mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-16 03:14:04 +00:00
Further work on items
This commit is contained in:
@@ -290,7 +290,7 @@ public class BaseBlock extends Block implements TileEntityBlock {
|
||||
return "";
|
||||
}
|
||||
Tag idTag = nbtData.getValue().get("id");
|
||||
if (idTag != null && idTag instanceof StringTag) {
|
||||
if (idTag instanceof StringTag) {
|
||||
return ((StringTag) idTag).getValue();
|
||||
} else {
|
||||
return "";
|
||||
@@ -413,7 +413,7 @@ public class BaseBlock extends Block implements TileEntityBlock {
|
||||
* @return true if equal
|
||||
*/
|
||||
public boolean equalsFuzzy(BaseBlock o) {
|
||||
return (getType() == o.getType()) && (getData() == o.getData() || getData() == -1 || o.getData() == -1);
|
||||
return (getType().equals(o.getType())) && (getData() == o.getData() || getData() == -1 || o.getData() == -1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,6 +26,10 @@ public class BlockType {
|
||||
private String id;
|
||||
|
||||
public BlockType(String id) {
|
||||
// If it has no namespace, assume minecraft.
|
||||
if (!id.contains(":")) {
|
||||
id = "minecraft:" + id;
|
||||
}
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
@@ -587,6 +587,10 @@ public class BlockTypes {
|
||||
|
||||
@Nullable
|
||||
public static BlockType getBlockType(String id) {
|
||||
// If it has no namespace, assume minecraft.
|
||||
if (id != null && !id.contains(":")) {
|
||||
id = "minecraft:" + id;
|
||||
}
|
||||
return blockMapping.get(id);
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,10 @@ public class ItemType {
|
||||
private String id;
|
||||
|
||||
public ItemType(String id) {
|
||||
// If it has no namespace, assume minecraft.
|
||||
if (!id.contains(":")) {
|
||||
id = "minecraft:" + id;
|
||||
}
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
@@ -766,6 +766,10 @@ public class ItemTypes {
|
||||
|
||||
@Nullable
|
||||
public static ItemType getItemType(String id) {
|
||||
// If it has no namespace, assume minecraft.
|
||||
if (id != null && !id.contains(":")) {
|
||||
id = "minecraft:" + id;
|
||||
}
|
||||
return itemMapping.get(id);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user