diff --git a/changelog b/changelog index c785aee0c..405a72590 100644 --- a/changelog +++ b/changelog @@ -8,10 +8,17 @@ * This includes non-standard special effects like the .44 gap flash and the .35-800 ejector plume * Removed the old unused satelite deco blocks, freeing up 6 block IDs * Crucibles that smelt metal with no template set will no place the metal in the recipe stack instead of the waste stack, this should make it easier to get a recipe to work in the many, many cases where people add the template after smelting the material +* Battery sockets and the FENSU now support the copy tool +* Removed unused displaylist support from the model loader + * DLs have been long phased out in favor of VBOs anyway +* Rebranded canned horse slime + * Now with extra bone marrow # Fixed * Potentially fixed yet another issue regarding crates * Fixed battery socket `fillpercent` RoR function always assuming a max power of 1 * Fixed issue where multiblock ports would generate many OpenComputers component entries * Fixed RBMK automatic control rods having incorrect settings when using the copy tool -* Fixed battery sockets producing junk debug data in the logs \ No newline at end of file +* Fixed battery sockets producing junk debug data in the logs +* Fixed an issue where the charging station would crash when trying to charge certain items +* Fixed the DFC's core component not dropping its contents when mined \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/machine/CoreCore.java b/src/main/java/com/hbm/blocks/machine/CoreCore.java index 80ab50b9d..2dcd89c75 100644 --- a/src/main/java/com/hbm/blocks/machine/CoreCore.java +++ b/src/main/java/com/hbm/blocks/machine/CoreCore.java @@ -1,12 +1,18 @@ package com.hbm.blocks.machine; +import java.util.Random; + import com.hbm.main.MainRegistry; import com.hbm.tileentity.machine.TileEntityCore; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -50,5 +56,43 @@ public class CoreCore extends BlockContainer { return false; } } + + private Random rand = new Random(); + // shitty copy pasted crap for the 50th time because i hate this block + @Override + public void breakBlock(World world, int x, int y, int z, Block b, int m) { + TileEntityCore core = (TileEntityCore) world.getTileEntity(x, y, z); + + if(core != null) { + for(int i1 = 0; i1 < core.getSizeInventory(); ++i1) { + ItemStack itemstack = core.getStackInSlot(i1); + + if(itemstack != null) { + float f = this.rand.nextFloat() * 0.8F + 0.1F; + float f1 = this.rand.nextFloat() * 0.8F + 0.1F; + float f2 = this.rand.nextFloat() * 0.8F + 0.1F; + + while(itemstack.stackSize > 0) { + int j1 = this.rand.nextInt(21) + 10; + if(j1 > itemstack.stackSize) j1 = itemstack.stackSize; + + itemstack.stackSize -= j1; + EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); + if(itemstack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + + float f3 = 0.05F; + entityitem.motionX = (float) this.rand.nextGaussian() * f3; + entityitem.motionY = (float) this.rand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) this.rand.nextGaussian() * f3; + world.spawnEntityInWorld(entityitem); + } + } + } + + world.func_147453_f(x, y, z, b); + } + + super.breakBlock(world, x, y, z, b, m); + } } diff --git a/src/main/java/com/hbm/handler/BobmazonOfferFactory.java b/src/main/java/com/hbm/handler/BobmazonOfferFactory.java index e53b5f603..c27e3dabc 100644 --- a/src/main/java/com/hbm/handler/BobmazonOfferFactory.java +++ b/src/main/java/com/hbm/handler/BobmazonOfferFactory.java @@ -149,7 +149,7 @@ public class BobmazonOfferFactory { special.add(new Offer(ItemKitNBT.create( new ItemStack(ModItems.rod_of_discord).setStackDisplayName("Cock Joke"), - ModItems.canned_conserve.stackFromEnum(64, EnumFoodType.JIZZ).setStackDisplayName("Class A Horse Semen"), + ModItems.canned_conserve.stackFromEnum(64, EnumFoodType.SLIME).setStackDisplayName("Class A Horse Semen"), new ItemStack(ModItems.pipe_lead).setStackDisplayName("Get Nutted, Dumbass"), new ItemStack(ModItems.gem_alexandrite) ).setStackDisplayName("The Nut Bucket"), Requirement.HIDDEN, 64)); diff --git a/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java b/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java index 69a0fab4e..5b1a1ea44 100644 --- a/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/PedestalRecipes.java @@ -67,7 +67,7 @@ public class PedestalRecipes extends SerializableRecipe { new OreDictStack(STAR.ingot()), new OreDictStack(DURA.plateCast()), new OreDictStack(STAR.ingot()))); register(new PedestalRecipe(new ItemStack(ModItems.gun_flamer_daybreaker), - new OreDictStack(GOLD.plateCast()), new ComparableStack(ModItems.canned_conserve, 1, EnumFoodType.JIZZ), new OreDictStack(GOLD.plateCast()), + new OreDictStack(GOLD.plateCast()), new ComparableStack(ModItems.canned_conserve, 1, EnumFoodType.SLIME), new OreDictStack(GOLD.plateCast()), new OreDictStack(P_WHITE.ingot()), new ComparableStack(ModItems.gun_flamer), new OreDictStack(P_WHITE.ingot()), new OreDictStack(GOLD.plateCast()), new ComparableStack(ModItems.stick_dynamite), new OreDictStack(GOLD.plateCast())) .extra(PedestalExtraCondition.SUN)); diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 7fd1ba599..eb15c54cf 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -936,33 +936,6 @@ public class ModItems { public static Item cap_fritz; public static Item ring_pull; public static Item bdcl; - //public static Item canned_beef; - //public static Item canned_tuna; - //public static Item canned_mystery; - //public static Item canned_pashtet; - //public static Item canned_cheese; - //public static Item canned_jizz; - //public static Item canned_milk; - //public static Item canned_ass; - //public static Item canned_pizza; - //public static Item canned_tube; - //public static Item canned_tomato; - //public static Item canned_asbestos; - //public static Item canned_bhole; - //public static Item canned_hotdogs; - //public static Item canned_leftovers; - //public static Item canned_yogurt; - //public static Item canned_stew; - //public static Item canned_chinese; - //public static Item canned_oil; - //public static Item canned_fist; - //public static Item canned_spam; - //public static Item canned_fried; - //public static Item canned_napalm; - //public static Item canned_diesel; - //public static Item canned_kerosene; - //public static Item canned_recursion; - //public static Item canned_bark; public static ItemEnumMulti canned_conserve; public static Item can_key; diff --git a/src/main/java/com/hbm/items/food/ItemConserve.java b/src/main/java/com/hbm/items/food/ItemConserve.java index 353e848f1..f5d2a6b19 100644 --- a/src/main/java/com/hbm/items/food/ItemConserve.java +++ b/src/main/java/com/hbm/items/food/ItemConserve.java @@ -113,7 +113,7 @@ public class ItemConserve extends ItemEnumMulti { MYSTERY(6, 0.5F), PASHTET(4, 0.5F), CHEESE(3, 1F), - JIZZ(15, 5F), // :3 + SLIME(15, 5F), MILK(5, 0.25F), ASS(6, 0.75F), // :3 PIZZA(8, 075F), diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 885bb97b6..37e85aa15 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -28,7 +28,6 @@ import com.hbm.items.ItemEnums.EnumLegendaryType; import com.hbm.items.ItemEnums.EnumPages; import com.hbm.items.ItemEnums.EnumPlantType; import com.hbm.items.ItemGenericPart.EnumPartType; -import com.hbm.items.food.ItemConserve.EnumFoodType; import com.hbm.items.machine.ItemArcElectrode.EnumElectrodeType; import com.hbm.items.machine.ItemBattery; import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack; @@ -870,7 +869,6 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.machine_condenser), new Object[] { "SIS", "ICI", "SIS", 'S', STEEL.ingot(), 'I', IRON.plate(), 'C', CU.plateCast() }); - addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.TEST.ordinal()), new Object[] { Items.book, ModItems.canned_conserve.stackFromEnum(EnumFoodType.JIZZ) }); addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.RBMK.ordinal()), new Object[] { Items.book, Items.potato }); addShapelessAuto(new ItemStack(ModItems.book_guide, 1, BookType.STARTER.ordinal()), new Object[] { Items.book, Items.iron_ingot }); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index e2e189d01..446e8fbd9 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -36,7 +36,6 @@ import com.hbm.handler.threading.PacketThreading; import com.hbm.items.IEquipReceiver; import com.hbm.items.ModItems; import com.hbm.items.armor.*; -import com.hbm.items.food.ItemConserve.EnumFoodType; import com.hbm.items.tool.ItemGuideBook.BookType; import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.ItemGunBaseNT; @@ -1125,8 +1124,6 @@ public class ModEventHandler { @SubscribeEvent public void onItemPickup(PlayerEvent.ItemPickupEvent event) { - if(event.pickedUp.getEntityItem().getItem() == ModItems.canned_conserve && EnumUtil.grabEnumSafely(EnumFoodType.class, event.pickedUp.getEntityItem().getItemDamage()) == EnumFoodType.JIZZ) - event.player.triggerAchievement(MainRegistry.achC20_5); if(event.pickedUp.getEntityItem().getItem() == Items.slime_ball) event.player.triggerAchievement(MainRegistry.achSlimeball); } diff --git a/src/main/java/com/hbm/render/loader/HFRWavefrontObject.java b/src/main/java/com/hbm/render/loader/HFRWavefrontObject.java index a3e443e99..d8863bb2f 100644 --- a/src/main/java/com/hbm/render/loader/HFRWavefrontObject.java +++ b/src/main/java/com/hbm/render/loader/HFRWavefrontObject.java @@ -495,8 +495,4 @@ public class HFRWavefrontObject implements IModelCustomNamed { public WavefrontObjVBO asVBO() { return new WavefrontObjVBO(this); } - - public WavefrontObjDisplayList asDisplayList() { - return new WavefrontObjDisplayList(this); - } } diff --git a/src/main/java/com/hbm/render/loader/WavefrontObjDisplayList.java b/src/main/java/com/hbm/render/loader/WavefrontObjDisplayList.java deleted file mode 100644 index b797be151..000000000 --- a/src/main/java/com/hbm/render/loader/WavefrontObjDisplayList.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.hbm.render.loader; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.tuple.Pair; -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraftforge.client.model.obj.GroupObject; -import net.minecraftforge.client.model.obj.WavefrontObject; - -public class WavefrontObjDisplayList implements IModelCustomNamed { - - public List> nameToCallList = new ArrayList<>(); - - public WavefrontObjDisplayList(WavefrontObject obj) { - Tessellator tes = Tessellator.instance; - for(GroupObject g : obj.groupObjects){ - int list = GL11.glGenLists(1); - GL11.glNewList(list, GL11.GL_COMPILE); - tes.startDrawing(g.glDrawingMode); - g.render(tes); - tes.draw(); - GL11.glEndList(); - nameToCallList.add(Pair.of(g.name, list)); - } - - } - - public WavefrontObjDisplayList(HFRWavefrontObject obj) { - for(S_GroupObject g : obj.groupObjects){ - int list = GL11.glGenLists(1); - GL11.glNewList(list, GL11.GL_COMPILE); - g.render(); - GL11.glEndList(); - nameToCallList.add(Pair.of(g.name, list)); - } - } - - public int getListForName(String name){ - for(Pair p : nameToCallList){ - if(p.getLeft().equalsIgnoreCase(name)){ - return p.getRight(); - } - } - return 0; - } - - @Override - public String getType() { - return "obj_list"; - } - - @Override - public void renderAll() { - for(Pair p : nameToCallList) - GL11.glCallList(p.getRight()); - } - - @Override - public void renderOnly(String... groupNames) { - for(Pair p : nameToCallList){ - for(String name : groupNames){ - if(p.getLeft().equalsIgnoreCase(name)){ - GL11.glCallList(p.getRight()); - break; - } - } - } - } - - @Override - public void renderPart(String partName) { - for(Pair p : nameToCallList){ - if(p.getLeft().equalsIgnoreCase(partName)){ - GL11.glCallList(p.getRight()); - } - } - } - - @Override - public void renderAllExcept(String... excludedGroupNames) { - for(Pair p : nameToCallList){ - boolean skip = false; - for(String name : excludedGroupNames){ - if(p.getLeft().equalsIgnoreCase(name)){ - skip = true; - break; - } - } - if(!skip){ - GL11.glCallList(p.getRight()); - } - } - } - - @Override - public List getPartNames() { - List names = new ArrayList(); - for(Pair data : nameToCallList) { - names.add(data.getLeft()); - } - return names; - } -} \ No newline at end of file diff --git a/src/main/java/com/hbm/render/tileentity/RenderBobble.java b/src/main/java/com/hbm/render/tileentity/RenderBobble.java index fe3c9142f..37dc9f6f6 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderBobble.java +++ b/src/main/java/com/hbm/render/tileentity/RenderBobble.java @@ -446,20 +446,28 @@ public class RenderBobble extends TileEntitySpecialRenderer { break; case BOB: GL11.glShadeModel(GL11.GL_SMOOTH); - this.bindTexture(ResourceManager.mini_nuke_tex); - GL11.glScaled(0.5, 0.5, 0.5); GL11.glPushMatrix(); - GL11.glTranslated(0.75, 1, 0.9); - for(int i = 0; i < 3; i++) { - ResourceManager.projectiles.renderPart("MiniNuke"); - GL11.glTranslated(-0.75, 0, 0); + GL11.glTranslatef(0, 0.6875F, 0.625F); + GL11.glRotated(-90, 1, 0, 0); + GL11.glScaled(0.125, 0.125, 0.125); + Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.fatman_mininuke_tex); + GL11.glTranslatef(-6, 0, 0); + for(int i = -1; i <= 1; i++) { + GL11.glTranslatef(3, 0, 0); + ResourceManager.fatman.renderPart("MiniNuke"); } GL11.glPopMatrix(); - this.bindTexture(ResourceManager.mini_mirv_tex); - GL11.glTranslated(0, 0.75, -0.9); + GL11.glPushMatrix(); + GL11.glTranslatef(0.25F, 0.3125F, -0.5F); + GL11.glRotated(-90, 1, 0, 0); GL11.glRotated(90, 0, 1, 0); - GL11.glRotated(90, 1, 0, 0); - ResourceManager.projectiles.renderPart("MiniMIRV"); + GL11.glScaled(0.1, 0.1, 0.1); + Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.double_barrel_sacred_dragon_tex); + ResourceManager.double_barrel.renderPart("Stock"); + ResourceManager.double_barrel.renderPart("BarrelShort"); + ResourceManager.double_barrel.renderPart("Buckle"); + ResourceManager.double_barrel.renderPart("Lever"); + GL11.glPopMatrix(); GL11.glShadeModel(GL11.GL_FLAT); break; case VAER: diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityCharger.java b/src/main/java/com/hbm/tileentity/machine/TileEntityCharger.java index 887b6643b..2441c6279 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityCharger.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityCharger.java @@ -129,7 +129,7 @@ public class TileEntityCharger extends TileEntityLoadedBase implements IEnergyRe if(stack != null && stack.getItem() instanceof IBatteryItem) { IBatteryItem battery = (IBatteryItem) stack.getItem(); - long toCharge = Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate(null)); + long toCharge = Math.min(battery.getMaxCharge(stack) - battery.getCharge(stack), battery.getChargeRate(stack)); toCharge = Math.min(toCharge, Math.max(power / 5, 1)); battery.chargeBattery(stack, toCharge); power -= toCharge; diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBatteryBase.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBatteryBase.java index ed8608c07..ae3efb6cd 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBatteryBase.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBatteryBase.java @@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.storage; import com.hbm.handler.CompatHandler; import com.hbm.interfaces.IControlReceiver; +import com.hbm.interfaces.ICopiable; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.uninos.UniNodespace; @@ -29,9 +30,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; +import net.minecraft.world.World; @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")}) -public abstract class TileEntityBatteryBase extends TileEntityMachineBase implements IEnergyConductorMK2, IEnergyProviderMK2, IEnergyReceiverMK2, IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent { +public abstract class TileEntityBatteryBase extends TileEntityMachineBase implements IEnergyConductorMK2, IEnergyProviderMK2, IEnergyReceiverMK2, IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent, ICopiable { public byte lastRedstone = 0; public long prevPowerState = 0; @@ -253,4 +255,20 @@ public abstract class TileEntityBatteryBase extends TileEntityMachineBase implem public Object[] getInfo(Context context, Arguments args) { return new Object[] {getPower(), getMaxPower(), redLow, redHigh, getPriority().ordinal()-1}; } + + @Override + public NBTTagCompound getSettings(World world, int x, int y, int z) { + NBTTagCompound data = new NBTTagCompound(); + data.setShort("redLow", redLow); + data.setShort("redHigh", redHigh); + data.setByte("priority", (byte) this.priority.ordinal()); + return data; + } + + @Override + public void pasteSettings(NBTTagCompound nbt, int index, World world, EntityPlayer player, int x, int y, int z) { + if(nbt.hasKey("redLow")) this.redLow = nbt.getShort("redLow"); + if(nbt.hasKey("redHigh")) this.redHigh = nbt.getShort("redHigh"); + if(nbt.hasKey("priority")) this.priority = EnumUtil.grabEnumSafely(ConnectionPriority.class, nbt.getByte("priority")); + } } diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 3fcba2731..8ca3ff8bd 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -1572,7 +1572,7 @@ item.canned_diesel.name=Konservendose (Diesel) item.canned_fist.name=Konservendose (Faust) item.canned_fried.name=Konservendose (Fried Chicken) item.canned_hotdogs.name=Konservendose (Hotdogs) -item.canned_jizz.name=Konservendose (FlimFlam Industries Hengstmilchâ„¢) +item.canned_slime.name=Konservendose (Kondensierter Pferdeschleim) item.canned_kerosene.name=Konservendose (Kerosin) item.canned_leftovers.name=Konservendose (Reste) item.canned_milk.name=Konservendose (Kondensmilch) diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 8ae095078..762967714 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -2360,8 +2360,8 @@ item.canned_fried.name=Canned Fried Chicken item.canned_fried.desc=Even the can is deep fried! item.canned_hotdogs.name=Canned Hotdogs item.canned_hotdogs.desc=Not to be confused with cool cats. -item.canned_jizz.name=FlimFlam Industries Canned Stallion Milkâ„¢ -item.canned_jizz.desc=Wait wh- +item.canned_slime.name=Condensed Horse Slime +item.canned_slime.desc=Now with extra bone marrow. item.canned_kerosene.name=Canned Kerosene item.canned_kerosene.desc=Just imagine a witty line here. item.canned_leftovers.name=Leftover Conserve