2019-07-29 22:20:48 +00:00
|
|
|
/*
|
2021-01-01 15:10:36 +00:00
|
|
|
* Copyright (c) 2019-2021 GeyserMC. http://geysermc.org
|
2019-07-29 22:20:48 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* @author GeyserMC
|
|
|
|
* @link https://github.com/GeyserMC/Geyser
|
|
|
|
*/
|
|
|
|
|
|
|
|
package org.geysermc.connector.network.translators.item;
|
|
|
|
|
2019-10-10 00:11:50 +00:00
|
|
|
import lombok.AllArgsConstructor;
|
2019-07-29 22:20:48 +00:00
|
|
|
import lombok.Getter;
|
2020-07-07 20:40:19 +00:00
|
|
|
import lombok.ToString;
|
2019-07-29 22:20:48 +00:00
|
|
|
|
|
|
|
@Getter
|
2019-10-10 00:11:50 +00:00
|
|
|
@AllArgsConstructor
|
2020-07-07 20:40:19 +00:00
|
|
|
@ToString
|
2019-10-10 00:11:50 +00:00
|
|
|
public class ItemEntry {
|
2019-07-29 22:20:48 +00:00
|
|
|
|
2021-01-04 23:47:48 +00:00
|
|
|
public static ItemEntry AIR = new ItemEntry("minecraft:air", "minecraft:air", 0, 0, 0, false, 64);
|
2019-08-09 21:09:47 +00:00
|
|
|
|
2020-03-21 21:37:55 +00:00
|
|
|
private final String javaIdentifier;
|
2020-11-18 06:10:49 +00:00
|
|
|
private final String bedrockIdentifier;
|
2020-03-21 21:37:55 +00:00
|
|
|
private final int javaId;
|
|
|
|
private final int bedrockId;
|
|
|
|
private final int bedrockData;
|
2020-03-21 20:14:09 +00:00
|
|
|
|
2020-04-23 06:01:33 +00:00
|
|
|
private final boolean block;
|
2021-01-04 23:47:48 +00:00
|
|
|
private final int stackSize;
|
2020-04-23 06:01:33 +00:00
|
|
|
|
2019-07-30 02:25:13 +00:00
|
|
|
@Override
|
|
|
|
public boolean equals(Object obj) {
|
2019-10-10 00:11:50 +00:00
|
|
|
return obj == this || (obj instanceof ItemEntry && ((ItemEntry) obj).getBedrockId() == this.getBedrockId() && ((ItemEntry) obj).getJavaIdentifier().equals(this.getJavaIdentifier()));
|
2019-07-30 02:25:13 +00:00
|
|
|
}
|
2019-07-29 22:20:48 +00:00
|
|
|
}
|