mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Code optimization
This commit is contained in:
parent
89b1da7db8
commit
cb5f146840
@ -749,24 +749,18 @@ public class SlimefunSetup {
|
||||
p.getWorld().playEffect(b.getLocation(), Effect.MOBSPAWNER_FLAMES, 1);
|
||||
Block raw_disp = b.getRelative(BlockFace.DOWN);
|
||||
Hopper resf = null;
|
||||
boolean isIgnitionChamberInstalled = false;
|
||||
|
||||
if(BlockStorage.check(raw_disp.getRelative(BlockFace.EAST).getState().getBlock(), "IGNITION_CHAMBER")) {
|
||||
resf = (Hopper) raw_disp.getRelative(BlockFace.EAST).getState();
|
||||
isIgnitionChamberInstalled = true;
|
||||
} else if (BlockStorage.check(raw_disp.getRelative(BlockFace.WEST).getState().getBlock(), "IGNITION_CHAMBER")) {
|
||||
resf = (Hopper) raw_disp.getRelative(BlockFace.WEST).getState();
|
||||
isIgnitionChamberInstalled = true;
|
||||
} else if (BlockStorage.check(raw_disp.getRelative(BlockFace.NORTH).getState().getBlock(), "IGNITION_CHAMBER")) {
|
||||
resf = (Hopper) raw_disp.getRelative(BlockFace.NORTH).getState();
|
||||
isIgnitionChamberInstalled = true;
|
||||
} else if (BlockStorage.check(raw_disp.getRelative(BlockFace.SOUTH).getState().getBlock(), "IGNITION_CHAMBER")){
|
||||
resf = (Hopper) raw_disp.getRelative(BlockFace.SOUTH).getState();
|
||||
isIgnitionChamberInstalled = true;
|
||||
}
|
||||
|
||||
if (SlimefunStartup.chance(100, (Integer) Slimefun.getItemValue("SMELTERY", "chance.fireBreak"))) {
|
||||
if(isIgnitionChamberInstalled) {
|
||||
if(resf != null) {
|
||||
if(resf.getInventory().contains(Material.FLINT_AND_STEEL)) {
|
||||
ItemStack item = resf.getInventory().getItem(resf.getInventory().first(Material.FLINT_AND_STEEL));
|
||||
item.setDurability((short) (item.getDurability() + 1));
|
||||
|
Loading…
Reference in New Issue
Block a user