Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/10/19 in all areas

  1. All vanilla TileEntities with inventories implement IInventory. Look at the method in question to figure out what it does. You'll notice it all leads back to one method InventoryHelper.dropItems Which takes in a NonNullList<ItemStack> which you can get from your IItemHandler.
    1 point
  2. This tells me that the capability provides some "feature" or "data" that you can interact with in the form of the Class type interface. What if you want this data to behave differently for different objects? You don't want to have to create another capability do you? Like case in point the IItemHandler capability. It needs to perform differently for a chest than it does to a furnace. The furnace will not allow the player to insert items into the output slot. This needs to be handled. Whereas all slots are accessible in a chest. It means to make is accessible. The term refers to the ICapabilityProvider object you attached in the AttachCapabilitiesEvent. You need to make the method getCapability return your data object stored in the ICapabilityProvider instance you have made. Attaching it means you have given it to the Entity/World/ItemStack/TileEntity/etc.
    1 point
  3. A capability is a way to attach data to an object that doesn't belong to you. IE the player. It's actually incredibly simple. You need a Capability instance with the @CapabilityInject annotation above it. You need to register your Capability using CapabilityManager.INSTANCE.register(Class<Some Base class where your capability data will be stored>, new IStorageInstance, new Callable) The IStorageInstance has two methods that save and load data for the capability. The new Callable needs to create an instance of your base class. Then you also need to use the AttachCapabilitiesEvent to attach it to the object you want to attach it to. You use AttachCapabilitiesEvent#addCapability(ID, new ICapabilityProvider) The ICapabilityProvider is the object that provides the way to get the Capability data from the object it is attached to.
    1 point
  4. Use a Capability or just the ItemStacks NBT tag. You can't just store a value in the @Mod class and use it for a timer that is player specific like right clicking. There is only one value on the server.
    1 point
  5. You've gotta interpolate the position of them. Using the partialTicks value in the event and the Entity#posX/Y/Z and Entity#lastPosX/Y/Z
    1 point
  6. Looks like you need to GLStateManager.translate in the post event to the player in question because it is translated back before the post event is fired.
    1 point
  7. First off this is client only you cant use this. Secondly I dont see this method in your code.
    1 point
×
×
  • Create New...

Important Information

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