Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. What does your extractItem() method look like? Or did you use ItemStackHandler.
  2. I gave you the code for the TE, diesieben provided the correct type of slot to use, and the block and gui code was not even posted.
  3. Because you'll end up iterating multiple times up a column of blocks if you have 2 blocks with the same (X,Z) in the list of affected blocks. Waste of CPU cycles. Ok? but why is it a waste if he/she really wants all the blocks to become falling sand entities. Or did I miss the part where he/she said they want some. And if that is the case would it not be better to not use a method that creates a new Object with all of this data, and instead just go through it and gather and use the information you want.
  4. Those Javadocs are found inside the file of IItemHandler itself.
  5. If you don't understand this then....you could use ItemStackHandler. Javadocs /** * Inserts an ItemStack into the given slot and return the remainder. * The ItemStack should not be modified in this function! * Note: This behaviour is subtly different from IFluidHandlers.fill() * * @param slot Slot to insert into. * @param stack ItemStack to insert. * @param simulate If true, the insertion is only simulated * @return The remaining ItemStack that was not inserted (if the entire stack is accepted, then return null). * May be the same as the input ItemStack if unchanged, otherwise a new ItemStack. **/ ItemStack insertItem(int slot, ItemStack stack, boolean simulate); /** * Extracts an ItemStack from the given slot. The returned value must be null * if nothing is extracted, otherwise it's stack size must not be greater than amount or the * itemstacks getMaxStackSize(). * * @param slot Slot to extract from. * @param amount Amount to extract (may be greater than the current stacks max limit) * @param simulate If true, the extraction is only simulated * @return ItemStack extracted from the slot, must be null, if nothing can be extracted **/ ItemStack extractItem(int slot, int amount, boolean simulate);
  6. Read the docs.
  7. Hence using a Set<Pair> - just store one instance of each (X,Z) pair. But you're right - you'd need to store a Y-value as well; so perhaps a Map<Pair<Integer,Integer>, Integer> would be better, where the key is (X,Z) and the value is Y. As for which Y-value, that's up to the mod developer; the smallest Y would be a reasonable choice. Why not just create a list of BlockPos? It already stores x, y, z and it is given to you in that form? Or heck you could do a Map of <BlockPos, IBlockState> and then iterate through them and spawn them with that information.
  8. That wont work because theny position is not identifable. Explain please? Seems totally workable to me. Two things multiple blocks on the same x and z coord, and second how would I even find the correct y coord. Would it be at the highest possible y position there is a block or would it be at the first block with air above them.
  9. Yep. Hence why I suggested a Set<Pair<Integer,Integer>> as the appropriate data structure here; a unique set of (x,z) positions from which columns can be traced vertically upwards. OP needs to be paying attention That wont work because theny position is not identifable.
  10. You have not followed any of desht's advice, and you should be using the sub event of ExplosionEvent.Start
  11. Post your code.
  12. ItemStackHandler itemHandler = new ItemstackHandler(size); @Override public boolean hasCapability(Capability capability, EnumFacing facing) { return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY ? true : super.hasCapability(capability, facing); } @Override public Capability getCapability(Capability capability, EnumFacing facing) { return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY : itemHandler ? super.getCapability(capability, facing); }
  13. Pretty much. You might need to create a custom implementation of IItemHandlerModifiable instead of using the default one provided (ItemStackHandler).
  14. In your TE override getCapability(Capability, EnumFacing) and hasCapability(Capability, EnumFacing). return an instance of IItemHandlerModifiable. IE if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY /* Something with EnumFacing here if you want */) return itemHander;
  15. Post your TE code.
  16. Make it happen when attack target is set or create a boolean value that changes when it is null and is not null.
  17. Along the lines of this (taken from EntityZombie.class) this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1));
  18. When your mob has a target ie getAttackTarget() !=null set the speed.
  19. Under the Support & Bugs thread (or similar). And it would be under .minecraft/crash-reports
  20. First off there is no crash report there and second this is wrong part of the forum.
  21. You may be able to do this with Block#eventReceived(...) otherwise the answer is you can only determine what type of piston interaction it has.
  22. Yes, but that gets quite long and gets harder to find certain blocks. And then you have to specifically register them one by one instead of in mass, by I digress. We are "arguing" opinions not much of a reason to do that.
  23. I can definately agree with what you are saying, but having an Interface such as I"Modid"Block that has custom methods such as createCustomStateMapper. Or even just include them in the base block class.
  24. For being able to reference your stuff later, using an array isn't a good idea. The only time you'd want it is if you were doing something with the whole collection. Which a number of folks have done for their item registration, but you'd still have the public static properties. Yes, agreed you could also use a Reflection way to register IE loop through all of your fields and all instances of Block you register as a Block and all instances of Item you register as an Item.
  25. All of that looks good, now you just need to implement it into your TE. I give you luck on your endeavor of limiting your two input slots as it can be quite the process. And if you need any source of how to do the smelting I definitely recommend looking at the vanilla furnace as it should give you some insight.
×
×
  • Create New...

Important Information

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