mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Don't attempt to update empty or invalid flower pots.
This commit is contained in:
parent
4804fe64e3
commit
4b15439e03
@ -41,6 +41,9 @@ public class FlowerPotCompatibilityHandler implements NBTCompatibilityHandler {
|
|||||||
Tag item = values.get("Item");
|
Tag item = values.get("Item");
|
||||||
if (item instanceof StringTag) {
|
if (item instanceof StringTag) {
|
||||||
String id = ((StringTag) item).getValue();
|
String id = ((StringTag) item).getValue();
|
||||||
|
if (id.isEmpty()) {
|
||||||
|
return (B) BlockTypes.FLOWER_POT.getDefaultState();
|
||||||
|
}
|
||||||
int data = 0;
|
int data = 0;
|
||||||
Tag dataTag = values.get("Data");
|
Tag dataTag = values.get("Data");
|
||||||
if (dataTag instanceof IntTag) {
|
if (dataTag instanceof IntTag) {
|
||||||
@ -75,7 +78,7 @@ public class FlowerPotCompatibilityHandler implements NBTCompatibilityHandler {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String plantedName = null;
|
String plantedName = null;
|
||||||
if (newId == 0) {
|
if (newId == 0 && id.startsWith("minecraft:")) {
|
||||||
plantedName = id.substring(10);
|
plantedName = id.substring(10);
|
||||||
} else {
|
} else {
|
||||||
BlockState plantedWithData = LegacyMapper.getInstance().getBlockFromLegacy(newId, data);
|
BlockState plantedWithData = LegacyMapper.getInstance().getBlockFromLegacy(newId, data);
|
||||||
|
Loading…
Reference in New Issue
Block a user