Jump to content

Raizunne

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by Raizunne

  1. With the world object you can use getEntitiesWithinAABB
  2. So I have 7 heads and and 6 bodies, this means that I will have to make 42~ item variants of each head with each body?
  3. I've been out of modding and skipped 1.8, my 1.7.10 mod had textures that changed depending on the NBT of the item. Can someone point me to the right direction as to how to add this in 1.9? I had something like this: http://i.imgur.com/UrvlkJ4.png Thanks!
  4. Well that works, but now that I have my dependencies as dependencies = "after:ThermalExpansion;after:EnderIO" Thermal Expansion crashes with something that has nothing to do with my mod. http://pastebin.com/WiSGBW1u Is it because Im not using a deobf version of EnderIO? Removed Thermal Expansion and everything works great.
  5. ingotPhasedGold is a alloy from EnderIO, here's the class for the alloy. Here's the base class for the alloys. https://github.com/CrazyPants/EnderIO/blob/master/src/main/java/crazypants/enderio/material/Alloy.java On another class it adds the ore to the dictionary by using the oredictIngotName from that class. In this case the oredictIngotName is PhasedGold, so it ends up being ingotPhasedgold.
  6. Located in my RedstonicRecipes.java in my init function. Here's what's there: public staitic void init(){ if(Loader.isModLoaded("EnderIO")){ ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0); EIOHelper.addAlloySmelterRecipe("Vibrantium", 16000, ingotPhasedGold, ingotPhasedGold, ingotPhasedGold, Util.toStack(Items.potato)); } } Then I call the RedstonicRecipes.init() in my preInit.
  7. Yes it crashes in that line. Also if I use the "ingotPhasedGold" in a ShapedOreRecipe it works great. Just when I try getting the ores into an ItemStack
  8. Here's what I'm trying to do. ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0); //Arguments - name, energy, slot1, slot2, slot3, output EIOHelper.addAlloySmelterRecipe("Potatotato", 16000, ingotPhasedGold, ingotPhasedGold, ingotPhasedGold, Util.toStack(Items.potato));
  9. So I'm trying to get the Vibrant Alloy from EnderIO to an ItemStack to use it in the recipe for a machine. I've tryed getting it from the GameRegistry, no luck just fire. Now I'm trying to get it from the OreDictionary, still no luck. Here's my code: ItemStack ingotPhasedGold = OreDictionary.getOres("ingotPhasedGold").get(0); If I try that and add the ingotPhasedGold to a recipe or to the machine recipe, I crash. It says that there's no index with "0" but when I try outputing it to the console I get a "1xitem.itemAlloy@2" with I guess it means that the index DOES exist. So I just get a crash when using the OreDictionary with a recipe or when adding it to a machine recipe. What am I doing wrong?
  10. I'mt trying to remove an enchantment from an item, is there a way that I can do this? I've tried using: itemstack.stackTagCompound.getIntArray("ench", null) itemstack.stackTagCompound.getTag("ench", null) But all of these gave me a crash with the item disappering... is there a function to remove the enchantment?
  11. Yup, I did miss the default constructor, I must've deleted it when cleaning code Thank you!
  12. Hi! Im trying to send information (Clicking a button to change the value of a integer in the tileEntity) from the GUI to the TileEntity. I know I have to do some packets, and there's where the problem is. I have a IMessage and an IMessageHandler, but when I try pressing the button I get "A fatal error has occured, this connection is terminated". Here's the code for the IMessage and the IMessageHandler. public class PacketDrill implements IMessage{ private int x; private int y; private int z; private int mode; public PacketDrill(TileEntityDrillModifier te){ x = te.xCoord; y = te.yCoord; z = te.zCoord; mode = te.getMode(); } @Override public void fromBytes(ByteBuf buf) { x = buf.readInt(); y = buf.readInt(); z = buf.readInt(); mode = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(x); buf.writeInt(y); buf.writeInt(z); buf.writeInt(mode); } public static class Handler implements IMessageHandler<PacketDrill, IMessage>{ @Override public IMessage onMessage(PacketDrill message, MessageContext ctx) { TileEntity tile = ctx.getServerHandler().playerEntity.worldObj.getTileEntity(message.x, message.y, message.z); if(tile instanceof TileEntityDrillModifier){ TileEntityDrillModifier modifier = (TileEntityDrillModifier)tile; modifier.setMode(message.mode); ctx.getServerHandler().playerEntity.worldObj.markBlockForUpdate(message.x, message.y, message.z); } return null; } } } After that I register it in the preInit: Miscellany.network.registerMessage(PacketDrill.Handler.class, PacketDrill.class, 0, Side.SERVER); And finally here's the code of me using it in the GUI: @Override protected void actionPerformed(GuiButton button) { super.actionPerformed(button); switch(button.id){ case 0: if(tile.getMode()==0){ tile.setMode(1); }else{ tile.setMode(0); } Miscellany.network.sendToServer(new PacketDrill(this.tile)); } } What am I doing wrong? First time trying to do packets in GUI so this may be a small error, thanks!
  13. I will take that into account when making other machines! Thats a very ingenious way to do it Thanks for the advice! Also, did what ContainerFurance does, but the progress bar is not updating real time, do I have to call the updateProgressBar somewhere?.
  14. I am trying to display a energy bar that shows the total energy I have. I have a tile entity with a IEnergyHandler implementation and I have a single EnergyStorage variable. I am trying to access it from my GUI to make the energy bar, but everytime I access it I get that the energy stored is 0, and when I check the value of the energy stored inside of the TileEntity I get that it is fully charged. So in summary: Energy that I get in the TileEntity - 25,600 Energy that I get in the GUI - 0 Tile Entity - https://github.com/Raizunne/Miscellany/blob/master/main/java/com/raizunne/miscellany/tileentities/TileEntityFoodPackager.java GUI - https://github.com/Raizunne/Miscellany/blob/master/main/java/com/raizunne/miscellany/gui/GuiFoodPackager.java Exta - Here's what my machine does! - http://www.gfycat.com/GlumBreakableIbisbill
  15. Is there a way to open a GUI from a GUI? I want my machine to have a manual so that when I click on a button it opens another GUI I made. Is this a posibility?
  16. Yup that did it! I used a tutorial from here: https://countrygamer.wordpress.com/minecraft-tutorials/tileentityspecialrender-using-the-te-to-update-rendering/ It was a little outdated, and it caused me GL11 problems, but moving the stuff that the tutorial tells you to put in the TESR in the block's updateTick will do. Thanks for the help!
  17. Here's a gfy representation of the problem I'm having: So basically I have a TileEntitySpecialRenderer, and I have it so that the item that is in a specific slot of the TileEntity is rendered on the block model. The problem is that when I enter the world the items are not rendered until I click the block and open the GUI, then the items appear. What am I missing so that when I load the world the items load without having to click the block. I'm guessing there's something to do with the TileEntity? Here's the code for the TileEntitySpecialRenderer: https://github.com/Raizunne/Miscellany/blob/master/main/java/com/raizunne/miscellany/client/render/RenderAdvReactBrewer.java EDIT: Tile Entity code: https://github.com/Raizunne/Miscellany/blob/master/main/java/com/raizunne/miscellany/tileentities/TileEntityAdvReactBrewer.java Thanks in advance for the help!
  18. In your Container class you have //ActionBar for(int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(invPlayer, 8, 8 + i * 18, 142)); } In the addSlotToContainer you are giving the slot a value of 8, when it should be "i". So like this: //ActionBar for(int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142)); } Hopefully this works!
  19. I've tried using onItemRightClick, and its still growing the crops but it looks like only on the client side. It still leaves ghost blocks of the plants growing when they're not, just as the gfy that I posted ontop shows. I've tried checking world.isRemote but it's no use since its not being called, dont know why. Also I want my item to update the blocks in a 3x3 radius of the player when right click is being held .
  20. Having only the updateTick still causes ghost blocks, dont know why. Also looking at the updateTick it looks like it needs to have an update scheduled (?). Still no luck Here's complete code again: @Override public void onUsingTick(ItemStack itemstack, EntityPlayer player, int count) { super.onUsingTick(itemstack, player, count); Block block1 = player.worldObj.getBlock(x, y-1, z); Block block2 = player.worldObj.getBlock(x+1, y-1, z); Block block3 = player.worldObj.getBlock(x, y-1, z+1); Block block4 = player.worldObj.getBlock(x+1, y-1, z+1); Block block5 = player.worldObj.getBlock(x+1, y-1, z-1); Block block6 = player.worldObj.getBlock(x-1, y-1, z+1); Block block7 = player.worldObj.getBlock(x-1, y-1, z-1); Block block8 = player.worldObj.getBlock(x-1, y-1, z); Block block9 = player.worldObj.getBlock(x, y-1, z-1); switch(itemstack.stackTagCompound.getInteger("mode")){ case 0: //USED FOR GROWING CROPS updateThisBlock(block1, player.worldObj, x, y, z); updateThisBlock(block2, player.worldObj, x+1, y, z); updateThisBlock(block3, player.worldObj, x, y, z+1); updateThisBlock(block4, player.worldObj, x+1, y, z+1); updateThisBlock(block5, player.worldObj, x+1, y, z-1); updateThisBlock(block6, player.worldObj, x-1, y, z-1); updateThisBlock(block7, player.worldObj, x-1, y, z+1); updateThisBlock(block8, player.worldObj, x-1, y, z); updateThisBlock(block9, player.worldObj, x, y, z-1); break; case 1: //USED FOR DESTROYING CROPS breakThisBlock(block1, player.worldObj, x, y, z); breakThisBlock(block2, player.worldObj, x+1, y, z); breakThisBlock(block3, player.worldObj, x, y, z+1); breakThisBlock(block4, player.worldObj, x+1, y, z+1); breakThisBlock(block5, player.worldObj, x+1, y, z-1); breakThisBlock(block6, player.worldObj, x-1, y, z-1); breakThisBlock(block7, player.worldObj, x-1, y, z+1); breakThisBlock(block8, player.worldObj, x-1, y, z); breakThisBlock(block9, player.worldObj, x, y, z-1); break; } } //GROWING CROPS public void updateThisBlock(Block block, World world, int x, int y, int z){ int r = world.rand.nextInt(4); if(block instanceof IPlantable && r == 3){ System.out.println("Updated"); world.scheduleBlockUpdate(x, y, z, block, 1); block.updateTick(world, x, y-1, z, world.rand); } } //BREAKING CROPS public void breakThisBlock(Block block, World world, int x, int y, int z){ Random random = new Random(); int r = random.nextInt(1); List<ItemStack> items = new ArrayList(); if(block instanceof IPlantable && r==0){ items.addAll(block.getDrops(world, x, y-1, z, world.getBlockMetadata(x, y-1, z), 1)); world.func_147480_a(x, y-1, z, true); for(ItemStack stackerino : items){ world.spawnEntityInWorld(new EntityItem(world, x, y, z, stackerino)); } } } Thanks for the help!
  21. Well removing the check of the world remote simply creates ghost blocks and ghost items:
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.