Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by TheAwesomeGem

  1. Change block drop if there was explosion. I know there is an event for each explosion but how do I tag which explosion is which? I am using Chunk capability to store a list of affected blocks from an explosion. However whenever the tick interval ends, I don't know which explosion caused the block affected. So sometimes i clear the affected blocks before it even gets to the HarvestBlock event where I customize the block drop.
  2. Sadly, that's the way I am doing it but it's not working well if there are multiple explosions on top of each other. I wish there was a unique identifier for explosion. Thanks btw!
  3. So there are events to check before an explosion starts and before explosion affects blocks. How to check when an explosion is done(including all the calls to the HarvestDropEvent)? I need this to check if the block harvested was from an explosion or not. Basically I need a way to hook into this event: /** * Called when this Block is destroyed by an Explosion */ public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) { }
  4. Your facing value from getStateFromMeta doesn't take account of the Y axis. Do this @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumFacing = EnumFacing.getFront(meta); if (enumFacing.getAxis() == EnumFacing.Axis.Y) { enumFacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumFacing); } Also you should set default blockstate when a block gets added onto the world. @Override public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { this.setDefaultFacing(worldIn, pos, state); }
  5. Also whenever you get ghost items, either you are not copying/cloning the itemstack properly, or you are using them only in clientside without syncing them.
  6. Are you changing it on clientside or serverside? Also use GLStateManager and not the raw GL calls. Edit: Look at RenderGiantZombie as an example.
  7. Scale using GL changes the position/origin as well. So you need to sort that out. You also need to update it's serverside bounding box. Use https://www.programcreek.com/java-api-examples/index.php?class=org.lwjgl.opengl.GL11&method=glTranslatef for changing position.
  8. Yep digging deeper, it seems like Minecraft have no love for GUI. Even mods like refined storage and AE2 seems to use absolute positioning and a lot of headache inducing positional calculation. I will most likely switch to commands instead.
  9. It's messy to look at the code. A lot of Configuration related stuff and stuff that makes no sense.
  10. Is that how the Configuration GUI was done? Because it looks rather nice and properly size/aligned and all of that.
  11. Thanks to you both. Looks like something that I would need. How do you place an element next to each other with offset? Like a label next to a textfield or a button next to another button. And do I need to keep a reference to each individual element?
  12. You need to use onPlayerTick along with some reflection. I did something similar for my mod https://minecraft.curseforge.com/projects/better-fishing
  13. The GUI I am trying to re-create: My questions are: How would I relatively position buttons and labels next to each other? (Right now, manually positioning each element with absolute value is painful and unintuitive) How would I add a listbox area that is scrollable? How to make sure that my GUI positioning is fine on different resolution? That's pretty much it.
  14. I might have overlooked it. Will try it out and see if it works.
  15. Aaah you mean detectAndSendChanges method? And that works without IInventory and the fields? Nice.
  16. What way do you suggest? How to sync TileEntity GUI with the TileEntity?
  17. Exactly. So I cannot use setFields. I though marking the block dirty after setting the cookTime would automatically update it due to the update packet function. But it does not.
  18. Can I implement IInventory whilst also using IItemHandler. The way the furnace updates GUI is using the IInventory fields.
  19. Yeah but Furnace Container uses IInventory and setField to update it.
  20. The value cookTime on the client TileEntity is always 0. What am I doing wrong? TileEntityOven GuiOven
  21. public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) How to make it so that the function that checks for shift clicking an item into a container checks for all the slot's validation? I don't want to retype the same code I do for each individual slot. Thanks!
  22. Ugghh. Now I will have to make a tileentity, a new block, GUI, etc. oh well...
  • Create New...

Important Information

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