mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 04:10:07 +00:00
Fix crashes on the Debug map
This commit is contained in:
1 parent
93419395c3
commit
8654b9d054
2 files changed
+17
-11
No files matched your search
@@ -3,6 +3,7 @@ package binnie.core.machines;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.component.IRender;
|
||||
import binnie.core.util.TileUtil;
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
@@ -106,10 +107,11 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World var1, final int meta) {
|
||||
public TileEntity createNewTileEntity(final World world, final int meta) {
|
||||
MachinePackage machinePackage = this.group.getPackage(meta);
|
||||
if (machinePackage == null) {
|
||||
throw new IllegalArgumentException("Could not find package for meta value " + meta);
|
||||
machinePackage = this.group.getPackage(0);
|
||||
Preconditions.checkNotNull(machinePackage, "Machine has no packages %s", this);
|
||||
}
|
||||
return machinePackage.createTileEntity();
|
||||
}
|
||||
@@ -165,10 +167,12 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
IMachine machine = Machine.getMachine(world.getTileEntity(pos));
|
||||
if (machine != null) {
|
||||
for (IRender.RandomDisplayTick renders : machine.getInterfaces(IRender.RandomDisplayTick.class)) {
|
||||
renders.onRandomDisplayTick(world, pos, rand);
|
||||
if (world.isBlockLoaded(pos)) {
|
||||
IMachine machine = Machine.getMachine(world.getTileEntity(pos));
|
||||
if (machine != null) {
|
||||
for (IRender.RandomDisplayTick renders : machine.getInterfaces(IRender.RandomDisplayTick.class)) {
|
||||
renders.onRandomDisplayTick(world, pos, rand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,17 +5,19 @@ import binnie.core.machines.MachineGroup;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class ModuleKitchen implements IInitializable {
|
||||
|
||||
public Block blockKitchen;
|
||||
public Block blockKitchen = Blocks.AIR;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "kitchen", "kitchen", KitchenMachine.values());
|
||||
machineGroup.setCreativeTab(Tabs.tabArboriculture);
|
||||
machineGroup.customRenderer = false;
|
||||
blockKitchen = machineGroup.getBlock();
|
||||
// TODO implement kitchen
|
||||
// final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "kitchen", "kitchen", KitchenMachine.values());
|
||||
// machineGroup.setCreativeTab(Tabs.tabArboriculture);
|
||||
// machineGroup.customRenderer = false;
|
||||
// blockKitchen = machineGroup.getBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user