From 5cb4c6e24033cf337812390d99a6817d24d21eab Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Sun, 12 Feb 2017 20:43:03 +0300 Subject: Removed explosion radius limitations. Explosion calculation optimized (reduced memory usage). One more detonator and explosive pack recipe. GT6 recipes for both chemical reactors and cryogenic distiller. Max stack size of muffle furnace is limited to 32. A lot of old features are removed. --- ihl/items_blocks/FlexibleCableItem.java | 15 +- ihl/items_blocks/IHLBucketHandler.java | 20 ++ ihl/items_blocks/IHLItemBlock.java | 43 --- ihl/items_blocks/ItemSubstance.java | 514 +++++++++++++++----------------- ihl/items_blocks/MachineBaseBlock.java | 150 +--------- 5 files changed, 278 insertions(+), 464 deletions(-) create mode 100644 ihl/items_blocks/IHLBucketHandler.java (limited to 'ihl/items_blocks') diff --git a/ihl/items_blocks/FlexibleCableItem.java b/ihl/items_blocks/FlexibleCableItem.java index 7fd2583..9944f4c 100644 --- a/ihl/items_blocks/FlexibleCableItem.java +++ b/ihl/items_blocks/FlexibleCableItem.java @@ -28,7 +28,6 @@ import ihl.flexible_cable.AnchorTileEntity; import ihl.flexible_cable.NodeEntity; import ihl.flexible_cable.PowerCableNodeEntity; import ihl.interfaces.ICableHolder; -import ihl.interfaces.IDataCableHolder; import ihl.interfaces.IEnergyNetNode; import ihl.interfaces.IMultiPowerCableHolder; import ihl.interfaces.IWire; @@ -100,8 +99,7 @@ public class FlexibleCableItem extends Item implements IWire { world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, "step.stone", 1.0F, 0.8F); if (!world.isRemote && t != null && ((t instanceof IEnergyNetNode && !isDataCable) - || (t instanceof IMultiPowerCableHolder && !isDataCable) - || (t instanceof IDataCableHolder && isDataCable)) + || (t instanceof IMultiPowerCableHolder && !isDataCable)) && stack.stackTagCompound.getInteger("fullLength") >= 1) { double ppx, ppy, ppz; ICableHolder te; @@ -138,10 +136,15 @@ public class FlexibleCableItem extends Item implements IWire { stack.stackTagCompound.setBoolean("firstConnection", false); return false; } else { - if (t2 instanceof IMultiPowerCableHolder) { - te = ((IMultiPowerCableHolder) t2).getEnergyNetNode(facing); + if (t instanceof IMultiPowerCableHolder) { + facing = ((IMultiPowerCableHolder) t).getSide(player); + if (facing == -1) { + return false; + } else { + te = ((IMultiPowerCableHolder) t).getEnergyNetNode(facing); + } } else { - te = (ICableHolder) t2; + te = (ICableHolder) t; } te.setCableCheck(true); } diff --git a/ihl/items_blocks/IHLBucketHandler.java b/ihl/items_blocks/IHLBucketHandler.java new file mode 100644 index 0000000..c0a23b6 --- /dev/null +++ b/ihl/items_blocks/IHLBucketHandler.java @@ -0,0 +1,20 @@ +package ihl.items_blocks; + +import net.minecraft.block.Block; +import net.minecraftforge.event.entity.player.FillBucketEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class IHLBucketHandler +{ + public IHLBucketHandler() {} + @SubscribeEvent + public void onBucketFill(FillBucketEvent event) + { + Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ); + if (block instanceof IHLFluidBlock && event.isCancelable()) + { + event.setCanceled(true); + } + } + +} diff --git a/ihl/items_blocks/IHLItemBlock.java b/ihl/items_blocks/IHLItemBlock.java index 3bde475..c25450d 100644 --- a/ihl/items_blocks/IHLItemBlock.java +++ b/ihl/items_blocks/IHLItemBlock.java @@ -10,9 +10,6 @@ import ic2.api.tile.IWrenchable; import ic2.core.IC2; import ihl.IHLCreativeTab; import ihl.IHLModInfo; -import ihl.collector.ChargerEjectorTileEntity; -import ihl.processing.metallurgy.PassiveBlock; -import ihl.tunneling_shield.DriverTileEntity; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -101,25 +98,6 @@ public class IHLItemBlock extends ItemBlock{ this.field_150939_a.onBlockPlacedBy(world, x, y, z, player, par1ItemStack); this.field_150939_a.onPostBlockPlaced(world, x, y, z, var13); TileEntity tile=world.getTileEntity(x, y, z); - if(tile!=null && par1ItemStack.stackTagCompound!=null && par1ItemStack.stackTagCompound.hasKey("energy") && tile instanceof ChargerEjectorTileEntity && IC2.platform.isSimulating()) - { - ChargerEjectorTileEntity te=(ChargerEjectorTileEntity)tile; - double energy; - try - { - energy = par1ItemStack.stackTagCompound.getDouble("energy"); - } - catch (Exception var3) - { - energy = par1ItemStack.stackTagCompound.getInteger("energy"); - - if (energy > Integer.MAX_VALUE) - { - energy *= 10.0D; - } - } - te.setStored(energy); - } if(tile instanceof IWrenchable && IC2.platform.isSimulating()) { IWrenchable te=(IWrenchable)tile; @@ -234,27 +212,6 @@ public class IHLItemBlock extends ItemBlock{ } } - @Override - public boolean onItemUseFirst(ItemStack itemstack, EntityPlayer entityPlayer, World world, int x, int y, int z, int l, float hitX, float hitY, float hitZ) - { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity instanceof DriverTileEntity && IC2.platform.isSimulating()) - { - DriverTileEntity dte = (DriverTileEntity) tileEntity; - if(itemstack.getUnlocalizedName()==PassiveBlock.Type.IHLShieldAssemblyUnitBlock.unlocalizedName) - { - dte.installShield(); - itemstack.stackSize--; - } - else if(itemstack.getUnlocalizedName()==PassiveBlock.Type.AdvancedShieldAssemblyUnitBlock.unlocalizedName) - { - dte.installAdvancedShield(); - itemstack.stackSize--; - } - } - return false; - } - @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List info, boolean flag) diff --git a/ihl/items_blocks/ItemSubstance.java b/ihl/items_blocks/ItemSubstance.java index d934172..7404a54 100644 --- a/ihl/items_blocks/ItemSubstance.java +++ b/ihl/items_blocks/ItemSubstance.java @@ -34,304 +34,286 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemSubstance extends Item implements IItemHasMiniGUI{ - +public class ItemSubstance extends Item implements IItemHasMiniGUI { + private static Map iconMap = new HashMap(); private static Map nameMap = new HashMap(); private static Map descriptionMap = new HashMap(); public static ItemSubstance instance; - - public ItemSubstance() - { + + public ItemSubstance() { super(); this.setMaxDamage(0); this.setNoRepair(); this.setHasSubtypes(true); this.setCreativeTab(IHLCreativeTab.tab); this.setUnlocalizedName("ihlSimpleItem"); - instance=this; + instance = this; } - - public static void init() - { - Item breadWithLard = (new ItemFood(4, 0.1F, false)).setUnlocalizedName("breadWithLard").setTextureName(IHLModInfo.MODID+":breadWithLard").setCreativeTab(IHLCreativeTab.tab); - GameRegistry.registerItem(breadWithLard,"food"); - IHLUtils.registerLocally("breadWithLard", new ItemStack(breadWithLard,1,0)); + + public static void init() { + Item breadWithLard = (new ItemFood(4, 0.1F, false)).setUnlocalizedName("breadWithLard") + .setTextureName(IHLModInfo.MODID + ":breadWithLard").setCreativeTab(IHLCreativeTab.tab); + GameRegistry.registerItem(breadWithLard, "food"); + IHLUtils.registerLocally("breadWithLard", new ItemStack(breadWithLard, 1, 0)); ItemSubstance item = new ItemSubstance(); - GameRegistry.registerItem(item,item.getUnlocalizedName()); + GameRegistry.registerItem(item, item.getUnlocalizedName()); Type[] var1 = Type.values(); - for(int i=0;i teclass; boolean isNormalBlock=true; boolean hasSpecialBlockRenderer=false; @@ -845,24 +715,6 @@ public class MachineBaseBlock extends Block implements ITileEntityProvider{ { case BronzeTub: return this.bronzeTubSide; - case GlassBox: - switch(flag) - { - case 0: - return this.glassBoxInnerSide; - case 1: - return this.glassBoxInnerBottom; - } - case RedstoneSignalConverter: - switch(flag) - { - case 0: - return this.redstoneSignalConverterEmptySide; - case 1: - return this.redstoneSignalConverterEmitterSide; - case 2: - return this.redstoneSignalConverterSensorSide; - } default: return this.blockIcon; } -- cgit v1.2.3