mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2025-02-16 19:51:27 +01:00
Fixed items in chests from structures not setting properly
This commit is contained in:
parent
b3001dc18d
commit
b7d4ab5fd8
@ -288,8 +288,6 @@ public final class BlockUtil {
|
||||
banner.addPattern(new Pattern(DyeColor.valueOf(pattern[1].toUpperCase()),
|
||||
PatternType.valueOf(pattern[0].toUpperCase())));
|
||||
}
|
||||
|
||||
block.getState().update();
|
||||
} else if (blockTypeState == BlockStateType.BEACON) {
|
||||
Beacon beacon = (Beacon) block.getState();
|
||||
String[] potionEffect = blockData.getPotionEffect().split(":");
|
||||
@ -304,12 +302,10 @@ public final class BlockUtil {
|
||||
BrewingStand brewingStand = (BrewingStand) block.getState();
|
||||
brewingStand.setBrewingTime(blockData.getBrewingTime());
|
||||
brewingStand.setFuelLevel(blockData.getFuelLevel());
|
||||
brewingStand.update();
|
||||
} else if (blockTypeState == BlockStateType.COMMANDBLOCK) {
|
||||
CommandBlock commandBlock = (CommandBlock) block.getState();
|
||||
commandBlock.setCommand(blockData.getCommand());
|
||||
commandBlock.setName(blockData.getCommandBlockName());
|
||||
commandBlock.update();
|
||||
} else if (blockTypeState == BlockStateType.CHEST) {
|
||||
Chest chest = (Chest) block.getState();
|
||||
|
||||
@ -319,8 +315,6 @@ public final class BlockUtil {
|
||||
chest.getInventory().setItem(slotList, is);
|
||||
}
|
||||
}
|
||||
|
||||
chest.update();
|
||||
} else if (blockTypeState == BlockStateType.DISPENSER) {
|
||||
Dispenser dispenser = (Dispenser) block.getState();
|
||||
|
||||
@ -330,8 +324,6 @@ public final class BlockUtil {
|
||||
dispenser.getInventory().setItem(slotList, is);
|
||||
}
|
||||
}
|
||||
|
||||
dispenser.update();
|
||||
} else if (blockTypeState == BlockStateType.DROPPER) {
|
||||
Dropper dropper = (Dropper) block.getState();
|
||||
|
||||
@ -341,8 +333,6 @@ public final class BlockUtil {
|
||||
dropper.getInventory().setItem(slotList, is);
|
||||
}
|
||||
}
|
||||
|
||||
dropper.update();
|
||||
} else if (blockTypeState == BlockStateType.HOPPER) {
|
||||
Hopper hopper = (Hopper) block.getState();
|
||||
|
||||
@ -352,8 +342,6 @@ public final class BlockUtil {
|
||||
hopper.getInventory().setItem(slotList, is);
|
||||
}
|
||||
}
|
||||
|
||||
hopper.update();
|
||||
} else if (blockTypeState == BlockStateType.CREATURESPAWNER) {
|
||||
CreatureSpawner creatureSpawner = (CreatureSpawner) block.getState();
|
||||
|
||||
@ -362,7 +350,6 @@ public final class BlockUtil {
|
||||
}
|
||||
|
||||
creatureSpawner.setDelay(blockData.getDelay());
|
||||
creatureSpawner.update();
|
||||
} else if (blockTypeState == BlockStateType.FURNACE) {
|
||||
Furnace furnace = (Furnace) block.getState();
|
||||
furnace.setBurnTime(blockData.getBurnTime());
|
||||
@ -380,15 +367,12 @@ public final class BlockUtil {
|
||||
if (blockData.getPlaying() != null) {
|
||||
jukebox.setPlaying(Material.valueOf(blockData.getPlaying().toUpperCase()));
|
||||
}
|
||||
jukebox.update();
|
||||
} else if (blockTypeState == BlockStateType.SIGN) {
|
||||
Sign sign = (Sign) block.getState();
|
||||
|
||||
for (int i = 0; i < blockData.getSignLines().length; i++) {
|
||||
sign.setLine(i, ChatColor.translateAlternateColorCodes('&', blockData.getSignLines()[i]));
|
||||
}
|
||||
|
||||
sign.update();
|
||||
} else if (blockTypeState == BlockStateType.SKULL) {
|
||||
Skull skull = (Skull) block.getState();
|
||||
|
||||
@ -400,7 +384,6 @@ public final class BlockUtil {
|
||||
} else {
|
||||
skull.setOwner(blockData.getSkullOwner());
|
||||
}
|
||||
skull.update();
|
||||
} else {
|
||||
if (NMSVersion > 8) {
|
||||
if (blockTypeState == BlockStateType.ENDGATEWAY) {
|
||||
@ -416,7 +399,6 @@ public final class BlockUtil {
|
||||
|
||||
endGateway.setExitLocation(
|
||||
new Location(exitLocationWorld, exitLocationX, exitLocationY, exitLocationZ));
|
||||
endGateway.update();
|
||||
}
|
||||
|
||||
if (NMSVersion > 9) {
|
||||
@ -431,7 +413,6 @@ public final class BlockUtil {
|
||||
shulkerBox.getInventory().setItem(slotList, is);
|
||||
}
|
||||
}
|
||||
shulkerBox.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user