Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Luis_ST

Members
  • Joined

  • Last visited

Everything posted by Luis_ST

  1. where do you have the methods from?
  2. so like this: do I have to create a new nbt and save my inventory in it? if yes how to do that? public static class Provider implements ICapabilitySerializable<INBT> { private IModItemHandler inventory = new ModItemStackHandler(); private CombinedInvWrapper invWrapper; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> invWrapper); public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY ? (LazyOptional<T>) optional : LazyOptional.empty(); } @Override public INBT serializeNBT() { CompoundNBT nbt = new CompoundNBT(); return nbt; } @Override public void deserializeNBT(INBT nbt) { } }
  3. so that should work: public static class Provider implements ICapabilityProvider { private IModItemHandler inventory = new ModItemStackHandler(); private CombinedInvWrapper invWrapper; private LazyOptional<CombinedInvWrapper> optional = LazyOptional.of(() -> invWrapper); public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); } @Override @SuppressWarnings({ "unchecked" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY ? (LazyOptional<T>) optional : LazyOptional.empty(); } }
  4. use the methode: @Override public int getLightValue(BlockState state, IBlockReader world, BlockPos pos) { return super.getLightValue(state, world, pos); } and retun the light level you want (1-15)
  5. then like this: EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = new InvWrapper(enderChestInventory); CombinedInvWrapper invWrapper = new CombinedInvWrapper(enderChestModifiable, inventory); and now i have to creat a LazyOptional from the CombinedInvWrapper and retrun the LazyOptional in getCapability?
  6. so like this: public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = (IItemHandlerModifiable) enderChestInventory; CombinedInvWrapper invWrapper = new CombinedInvWrapper(inventory, enderChestModifiable); }
  7. "The constructor CombinedInvWrapper(IModItemHandler, EnderChestInventory) is undefined" i can't figure out whats wrong
  8. i dont understand when i only use my capility it work when i add the ender chest inventory i got this error then i have to creat a field? I have to do the following: 1. Combination of inventories 2. Creat a IItemHandlerModifiable from the combination 3. Retrun the IItemHandlerModifiable in getCapability
  9. you need to add notSolid to the block properties
  10. I think you should use that: player.addExperienceLevel(-5);
  11. I think you can use PlayerInteractEvent # EntityInteractSpecific. then check if the player is interacting with the entity you want
  12. I'm not sure, but I think that is also possible with the tag forge:dirt I am unfortunately not familiar with that. Sorry I can't help you any further if you need help with the world generation have a look in the forum or create a new topic
  13. i think not this is the doc for 1.16.x https://mcforge.readthedocs.io/en/1.16.x/utilities/tags/#declaring-your-own-groupings if you mean a code example just look in your ide in the forge-lib in extra-client there are all vanilla assets and data (tags,loot tables, recipes).
  14. Have you ever looked at registerEntityRenderingHandler? you don't need a class and your own factory, you need an EntityType and the minecraft factory. like this: RenderingRegistry.registerEntityRenderingHandler(ModEntityType.JADE_ARROW.get(), JadeArrowRender::new);
  15. has dealt with the question i try it thanks
  16. I know what was meant by static i forgot it to remove i got an error: "The constructor CombinedInvWrapper(IModItemHandler, EnderChestInventory) is undefined". 1. What do I have to do with it or how do I create IItemHandlerModifiable 2. I have to add the container that I have created to my IModItemHandler. because I have not yet passed anything to the IModItemHandler (it is empty) or I think that it is empty
  17. i add an constructor an remove the static of the LazyOptional so this is now my Provider: but i can't combined the Inventories in this way. public static class Provider implements ICapabilityProvider { private static IModItemHandler inventory = new ModItemStackHandler(); private LazyOptional<IModItemHandler> optional = LazyOptional.of(() -> inventory); public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); /*Here is an Error*/ CombinedInvWrapper invWrapper = new CombinedInvWrapper(inventory, enderChestInventory); IItemHandlerModifiable itemHandlerModifiable = invWrapper; } @Override @SuppressWarnings({ "unchecked", "unused" }) public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY ? (LazyOptional<T>) optional : LazyOptional.empty(); } }
  18. i know about this methode but what i mean how o get the InventoryEnderChest whitout a player or can i get beacuse i dont have a player inside the class: or is there a way to get the player? public static class Provider implements ICapabilityProvider { private static IModItemHandler inventory = new ModItemStackHandler(); private static LazyOptional<IModItemHandler> optional = LazyOptional.of(() -> inventory); @Override @SuppressWarnings("unchecked") public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { CombinedInvWrapper invWrapper = new CombinedInvWrapper(inventory); return cap == CAPABILITY ? (LazyOptional<T>) optional : LazyOptional.empty(); } }
  19. this is now my ICapabilityProvider: public static class Provider implements ICapabilityProvider { private static IModItemHandler inventory = new ModItemStackHandler(); private static LazyOptional<IModItemHandler> optional = LazyOptional.of(() -> inventory); @Override @SuppressWarnings("unchecked") public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY ? (LazyOptional<T>) optional : LazyOptional.empty(); } } and how do I add my extended enderchest inventory and that of the enderchest beacuse when i try this: CombinedInvWrapper invWrapper = new CombinedInvWrapper(inventory); 1. i got an error: "The constructor CombinedInvWrapper(IModItemHandler) is undefined" 2, how to get the ernderchest inventory?
  20. extends ProjectileEntity and set the constructor to public that you register you entity if you extends a class which has protect methods you can use them
  21. so I store save them in a field? and there is no "CombinedInvHandler" do you mean "CombinedInvWrapper"
  22. try minecraft:cave_air or minecraft:void Edit: what is also possible is you overwrite the vanilla dirt block (the blockitem) so that every time you place vanilla dirt. your dirt will be placed and every time you break down your dirt block it will drop vanilla dirt.
  23. like this? public static class Provider implements ICapabilityProvider { private static IModItemHandler inventory = new ModItemStackHandler(); @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { return cap == CAPABILITY ? (LazyOptional<T>) LazyOptional.of(() -> inventory) : LazyOptional.empty(); } }
  24. I think the problem is you want to replace the minecraft dirt with itself I think the best and the most uncomplicated would be you register the dirt with your mod id and then try to replace it again I'm not sure because I'm not very familiar with ore generating, but I think minecraft checks whether the block is dirt instance of DirtBlock, which is not the case with you
  25. the constructor of your Renderer contains two elemetnts a EntityRendererManager and a float the IRenderFactory needs only the EntityRendererManager In addition, the Factory cannot do anything with the float and gives you the error that's exactly what @diesieben07 meant by

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.