2019-07-29 22:20:48 +00:00
|
|
|
/*
|
2022-01-01 19:03:05 +00:00
|
|
|
* Copyright (c) 2019-2022 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
|
|
|
|
*/
|
|
|
|
|
2021-11-20 21:34:30 +00:00
|
|
|
package org.geysermc.geyser.registry.type;
|
2021-07-13 01:19:40 +00:00
|
|
|
|
|
|
|
import lombok.Builder;
|
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
|
import lombok.Value;
|
2022-03-20 02:55:29 +00:00
|
|
|
import org.geysermc.geyser.network.GameProtocol;
|
2021-11-20 21:34:30 +00:00
|
|
|
import org.geysermc.geyser.registry.BlockRegistries;
|
2021-07-13 01:19:40 +00:00
|
|
|
|
2021-11-15 01:15:25 +00:00
|
|
|
import java.util.Set;
|
|
|
|
|
2021-07-13 01:19:40 +00:00
|
|
|
@Value
|
|
|
|
@Builder
|
|
|
|
@EqualsAndHashCode
|
|
|
|
public class ItemMapping {
|
|
|
|
public static final ItemMapping AIR = new ItemMapping("minecraft:air", "minecraft:air", 0, 0, 0,
|
2022-03-20 02:55:29 +00:00
|
|
|
BlockRegistries.BLOCKS.forVersion(GameProtocol.DEFAULT_BEDROCK_CODEC.getProtocolVersion()).getBedrockAirId(),
|
2022-02-25 03:49:10 +00:00
|
|
|
64, null, null, null, 0, null, false);
|
2021-07-13 01:19:40 +00:00
|
|
|
|
|
|
|
String javaIdentifier;
|
|
|
|
String bedrockIdentifier;
|
|
|
|
int javaId;
|
|
|
|
int bedrockId;
|
|
|
|
int bedrockData;
|
|
|
|
|
2021-04-06 04:14:06 +00:00
|
|
|
/**
|
2021-04-08 23:32:06 +00:00
|
|
|
* The Bedrock block runtime ID to render this item with. The specific state *does* matter in how this item is rendered and used as a crafting ingredient.
|
2021-04-06 04:14:06 +00:00
|
|
|
* Required since 1.16.220.
|
|
|
|
*/
|
2021-07-13 01:19:40 +00:00
|
|
|
int bedrockBlockId;
|
|
|
|
int stackSize;
|
2020-04-23 06:01:33 +00:00
|
|
|
|
2021-07-13 01:19:40 +00:00
|
|
|
String toolType;
|
|
|
|
String toolTier;
|
|
|
|
|
|
|
|
String translationString;
|
|
|
|
|
2021-11-15 01:15:25 +00:00
|
|
|
int maxDamage;
|
|
|
|
|
|
|
|
Set<String> repairMaterials;
|
|
|
|
|
2022-02-25 03:49:10 +00:00
|
|
|
boolean hasSuspiciousStewEffect;
|
|
|
|
|
2021-07-13 01:19:40 +00:00
|
|
|
/**
|
|
|
|
* Gets if this item is a block.
|
|
|
|
*
|
|
|
|
* @return if this item is a block
|
|
|
|
*/
|
2021-04-06 04:14:06 +00:00
|
|
|
public boolean isBlock() {
|
2021-07-13 01:19:40 +00:00
|
|
|
return this.bedrockBlockId != -1;
|
2021-04-06 04:14:06 +00:00
|
|
|
}
|
|
|
|
|
2021-07-13 01:19:40 +00:00
|
|
|
/**
|
|
|
|
* Gets if this item has a translation string present.
|
|
|
|
*
|
|
|
|
* @return if this item has a translation string present
|
|
|
|
*/
|
|
|
|
public boolean hasTranslation() {
|
|
|
|
return this.translationString != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets if this item is a tool.
|
|
|
|
*
|
|
|
|
* @return if this item is a tool
|
|
|
|
*/
|
|
|
|
public boolean isTool() {
|
|
|
|
return this.toolType != null;
|
2019-07-30 02:25:13 +00:00
|
|
|
}
|
2021-07-13 01:19:40 +00:00
|
|
|
}
|