Everything posted by Luis_ST
-
[1.16.5] Help with Capability (Inventory)
where do you have the methods from?
-
[1.16.5] Help with Capability (Inventory)
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) { } }
-
[1.16.5] Help with Capability (Inventory)
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(); } }
-
Block light emission in 1.16
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)
-
[1.16.5] Help with Capability (Inventory)
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?
-
[1.16.5] Help with Capability (Inventory)
so like this: public Provider(PlayerEntity player) { EnderChestInventory enderChestInventory = player.getInventoryEnderChest(); IItemHandlerModifiable enderChestModifiable = (IItemHandlerModifiable) enderChestInventory; CombinedInvWrapper invWrapper = new CombinedInvWrapper(inventory, enderChestModifiable); }
-
[1.16.5] Help with Capability (Inventory)
"The constructor CombinedInvWrapper(IModItemHandler, EnderChestInventory) is undefined" i can't figure out whats wrong
-
[1.16.5] Help with Capability (Inventory)
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
-
[1.16.5] Block with transparent bottom
you need to add notSolid to the block properties
-
[1.16.4] Remove Experience from the Player and update the Expereince Bar
I think you should use that: player.addExperienceLevel(-5);
-
[1.16.5] Pet Interaction
I think you can use PlayerInteractEvent # EntityInteractSpecific. then check if the player is interacting with the entity you want
-
[1.15.2] Override vanilla block and/or properties
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
-
[1.16.4] Tags datapack JSON format
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).
-
[1.16] registerEntityRenderingHandler help
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);
-
[1.16.5] Help with Capability (Inventory)
has dealt with the question i try it thanks
-
[1.16.5] Help with Capability (Inventory)
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
-
[1.16.5] Help with Capability (Inventory)
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(); } }
-
[1.16.5] Help with Capability (Inventory)
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(); } }
-
[1.16.5] Help with Capability (Inventory)
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?
-
Projectile Entity Constructor Missing Access Level Modifier Preventing Direct Extension
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
-
[1.16.5] Help with Capability (Inventory)
so I store save them in a field? and there is no "CombinedInvHandler" do you mean "CombinedInvWrapper"
-
[1.15.2] Override vanilla block and/or properties
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.
-
[1.16.5] Help with Capability (Inventory)
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(); } }
-
[1.15.2] Override vanilla block and/or properties
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
-
[1.16.4] RenderRegistry#registerEntityRenderingHandler not working
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
IPS spam blocked by CleanTalk.