Jump to content

Recommended Posts

Posted

I want to overwrite the vanilla ender chest container that the enderchest uses the double chest container.

I looked in the enderchest class vanilla uses PlayerEntity#getInventoryEnderChest

to open the gui so my question how to creat my own enderchest gui with 54 slots?

 

I know that I have to create my own capability. do I have to create a completely new one or can I use IItemHandler in my TileEntity?

because in the forge doc to capabilities it says that I can use persisting capabilities.

if I can use an existing capability, is this capability unique for each player?

(this is the first time that i use capabilities so i have no experience with them).

Posted
2 hours ago, diesieben07 said:

So you need to make an interface that extends IItemHandler

do I have to overwrite any method?

 

2 hours ago, diesieben07 said:

So you have to use a capability that's attached to the player.

using the AttachCapabilitiesEvent?

Posted
34 minutes ago, diesieben07 said:

No, you just need a separate interface because you can't have two capabilities with the same interface.

Now i have my custom Interfacce and a class which extends ItemStackHandler and implements my interface

now i have to create a new capability like forge doc:

@CapabilityInject(MyInterface.class)
public static Capability<MyInterface> ITEM_HANDLER_CAPABILITY = null;

but should the class in which i created the capability extends / implements another class

Posted
1 minute ago, diesieben07 said:

I'm not sure I understand what you mean by this. Which class are you referring to?

I created the classes as described above.

how do I create or register the capability?

Posted
17 minutes ago, diesieben07 said:

This is described in the docs on capabilities.

i just read this, and i created this but i'm not sure if this is correct:

 

public class ModCapability {
	
	public ModCapability() {
		
		CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), null);
		
	}
	
	private static class Storage implements IStorage<IModItemHandler> {

		@Override
		public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) {
			
			return null;
			
		}

		@Override
		public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) {
			
			
		}
		
	}
	
}

 

Posted
20 minutes ago, diesieben07 said:

The last parameter for register must not be null.

do i need the factory?

and what's wrong with the factory?

	public ModCapability() {
		
		CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory());
		
	}
	
	private static class Storage implements IStorage<IModItemHandler> {

		@Override
		public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) {
			
			return null;
			
		}

		@Override
		public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) {
			
			
		}
		
	}
	
	private static class Factory implements Callable<IModItemHandler> {

		@Override
		public IModItemHandler call() throws Exception {
			// what is here wrong?
			return new IModItemHandler();
			
		}
		
	}

 

Posted
5 minutes ago, diesieben07 said:

The Storage and Factory will most likely go away in the future, it was a flawed concept.

You can just make them throw exceptions.

this is now my complet class is this corect:

	@CapabilityInject(IModItemHandler.class)
	public static Capability<IModItemHandler> ITEM_HANDLER_CAPABILITY = null;
	
	public ModCapability() {
		
		CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory());
		
	}
	
	private static class Storage implements IStorage<IModItemHandler> {

		@Override
		public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) {
			
			return null;
			
		}

		@Override
		public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) {
			
			
		}
		
	}
	
	private static class Factory implements Callable<IModItemHandler> {

		@Override
		public IModItemHandler call() throws Exception {
			
			return null;
			
		}
		
	}

 

Posted
5 minutes ago, diesieben07 said:

That's not what I meant by make it throw an exception, but I guess it'll work.

do I have to register the capability or will it be registered automatically when I add it to the player

Posted (edited)
17 hours ago, diesieben07 said:

You already register it...

Another question how to add the extendsEnderChestGui (Generic9x3 ChestContainer) to the Capability (with this two methode \/ )

do I have to synchronize the gui between the server and the client and if so how do I do it since I looked at a few mods on github that use SimpleChannel and an interface is there another way to do this?

 

		@Override
		public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) {
			
			CompoundNBT nbt = new CompoundNBT();
			return nbt;
			
		}

		@Override
		public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) {
			
			
			
		}

 

Edited by Luis_ST
Posted (edited)
1 hour ago, diesieben07 said:

Also, please keep this forum in English.

Sorry I forgot i translate it into english

 

1 hour ago, diesieben07 said:

No. Container already does this for you.

okay thanks, if I don't want to overwrite the block (ender chest).

can I open the gui with the PlayerInteractEvent#RightClickBlock (using NetworkHooks)

the container and when closing save them in the capability?

 

do i have to creat a container with screen or an inventory because the ender chest use an inventory

Edited by Luis_ST
Posted
7 minutes ago, diesieben07 said:

The Container will already modify the capability (IItemHandler) directly.

so i just have to open the container / inventory and forge saves the gui from automatically?

 

22 minutes ago, Luis_ST said:

do i have to creat a container with screen or an inventory because the ender chest use an inventory

?

 

and where i have to put the container/inventory into the capability because when i use the AttachCapabilitiesEvent i got an NullPointerException:

event:

	@SubscribeEvent
	public static void AttachCapabilities(AttachCapabilitiesEvent<Entity> event) {
		
		if (event.getObject() instanceof PlayerEntity && !(event.getObject() instanceof FakePlayer)) {
			
			event.addCapability(new ResourceLocation("cave:extended_enderchest_gui"), new ModCapability.Provider());
			
		}
		
	}

 

and error log:

[10:38:50] [Server thread/ERROR] [ne.mi.ev.EventBus/EVENTBUS]: Exception caught during firing event: null
	Index: 1
	Listeners:
		0: NORMAL
		1: ASM: class net.luis.cave.events.capability.OnAttachCapabilitiesEvent AttachCapabilities(Lnet/minecraftforge/event/AttachCapabilitiesEvent;)V
java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:208)
	at net.luis.cave.init.ModCapability$Provider.<init>(ModCapability.java:59)
	at net.luis.cave.events.capability.OnAttachCapabilitiesEvent.AttachCapabilities(OnAttachCapabilitiesEvent.java:21)
	at net.minecraftforge.eventbus.ASMEventHandler_16_OnAttachCapabilitiesEvent_AttachCapabilities_AttachCapabilitiesEvent.invoke(.dynamic)
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)
	at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:579)
	at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:573)
	at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:48)
	at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:44)
	at net.minecraft.entity.Entity.<init>(Entity.java:221)
	at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:207)
	at net.minecraft.entity.player.PlayerEntity.<init>(PlayerEntity.java:160)
	at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:182)
	at net.minecraft.server.management.PlayerList.createPlayerForUser(PlayerList.java:419)
	at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:122)
	at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:66)
	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:244)
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:151)
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:898)
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:820)
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:84)
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:663)
	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233)
	at java.base/java.lang.Thread.run(Thread.java:832)

[10:38:50] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 3dbca5d1-2854-4053-a647-dfa6633d91c6
[10:38:50] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
net.minecraft.crash.ReportedException: Ticking memory connection
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:154) ~[forge:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:898) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:820) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:84) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:663) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at java.lang.Thread.run(Thread.java:832) [?:?] {}
Caused by: java.lang.NullPointerException
	at java.util.Objects.requireNonNull(Objects.java:208) ~[?:?] {}
	at net.luis.cave.init.ModCapability$Provider.<init>(ModCapability.java:59) ~[main/:?] {re:classloading}
	at net.luis.cave.events.capability.OnAttachCapabilitiesEvent.AttachCapabilities(OnAttachCapabilitiesEvent.java:21) ~[main/:?] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_16_OnAttachCapabilitiesEvent_AttachCapabilities_AttachCapabilitiesEvent.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
	at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:579) ~[forge:?] {re:classloading}
	at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:573) ~[forge:?] {re:classloading}
	at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:48) ~[forge:?] {re:classloading}
	at net.minecraftforge.common.capabilities.CapabilityProvider.gatherCapabilities(CapabilityProvider.java:44) ~[forge:?] {re:classloading}
	at net.minecraft.entity.Entity.<init>(Entity.java:221) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.LivingEntity.<init>(LivingEntity.java:207) ~[forge:?] {re:classloading}
	at net.minecraft.entity.player.PlayerEntity.<init>(PlayerEntity.java:160) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:182) ~[forge:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.server.management.PlayerList.createPlayerForUser(PlayerList.java:419) ~[forge:?] {re:classloading}
	at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:122) ~[forge:?] {re:classloading}
	at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:66) ~[forge:?] {re:classloading}
	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:244) ~[forge:?] {re:classloading}
	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:151) ~[forge:?] {re:classloading}
	... 6 more

 

Posted
3 minutes ago, diesieben07 said:

The container is completely unrelated to the capability. The inventory (i.e. IItemHandler) is the capability implementation.

so i have to use IItemHandler to get and open the gui inside there:

NetworkHooks.openGui(serverPlayer, /*here*/, pos);

 

and:

public class ModCapability {
	
	@CapabilityInject(IModItemHandler.class)
	public static Capability<IModItemHandler> CAPABILITY = null;
	
	public ModCapability() {
		
		CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory());
		
	}
	
	public static class Storage implements IStorage<IModItemHandler> {
		@Override
		public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) {
			return null;
		}

		@Override
		public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) {
		}
	}
	
	public static class Factory implements Callable<IModItemHandler> {
		@Override
		public IModItemHandler call() throws Exception {
			return null;
		}
	}
	
	public static class Provider implements ICapabilityProvider {

		private final LazyOptional<IModItemHandler> lazyOptional = LazyOptional.of(CAPABILITY::getDefaultInstance);
		
		@Override
		public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
			
			return cap == CAPABILITY ? lazyOptional.cast() : LazyOptional.empty();
			
		}
		
	}
	
}

 

Posted
9 minutes ago, diesieben07 said:

No, you need to implement INamedContainerProvider.

do i only have to implement Named ContainerProvider because i currently extends Chest Container / Container and i think thats wrong

 

34 minutes ago, diesieben07 said:

Obviously you can't do this if your default factory returns null. Use a normal constructor.

so like this:

	public static class Provider implements ICapabilityProvider {
		
		@Override
		public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
			
			return null;
			
		}
		
	}

 

Posted (edited)
3 hours ago, diesieben07 said:

You need both. You need a Container (and the corresponding ContainerType and ScreenFactory) and you need to implement INamedContainerProvider for openGui.

I already have that, but how do I open the container in my event?

what do I have to hand over to the method at "null"?

	@SubscribeEvent
	public static void PlayerInteract(PlayerInteractEvent.RightClickBlock event) {
		
		PlayerEntity player = event.getPlayer();
		BlockPos pos = event.getPos();
		World world = event.getWorld();
		BlockState state = world.getBlockState(pos);
		EnderChestInventory enderChestInventory = player.getInventoryEnderChest();
		
		if (state.getBlock() == Blocks.ENDER_CHEST) {
			
			if (!enderChestInventory.isEmpty()) {
				
				InventoryHelper.dropInventoryItems(world, pos, enderChestInventory);
				
			} else {
				
				if (player instanceof ServerPlayerEntity) {
					
					event.setCanceled(true);
					ServerPlayerEntity serverPlayer = (ServerPlayerEntity) player;
					NetworkHooks.openGui(serverPlayer, null, pos);
					
				}
				
			}
			
		}

	}

 

3 hours ago, diesieben07 said:

No... Not at all.

you say I should use a constructor, what must be in the constructor and what should the method "getCapability" return

Edited by Luis_ST
Posted
2 hours ago, diesieben07 said:

A new instance of your INamedContainerProvider implementation.

then like this:

					NetworkHooks.openGui(serverPlayer, new SimpleNamedContainerProvider((id, inventory, playerIn) -> {
						return new ModEnderChestContainer(id, inventory);
					}, ModEnderChestContainer.getContainerName()), pos);

 

2 hours ago, diesieben07 said:

Why do you do this?

This checks whether the player's Enderchest inventory is already in use, as the player may add the mod later. If this is the case,

the existing inventory will be dropped and the new one will be opened with the next click.

 

2 hours ago, diesieben07 said:

This is a class that extends ItemStackHandler, just add the same constructors that that class has and call the super constructors. Your IDE should do this for you automatically.

i dont get a constructor

so this is my complet class:

package net.luis.cave.init;

import java.util.concurrent.Callable;

import net.luis.cave.api.capability.IModItemHandler;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.INBT;
import net.minecraft.util.Direction;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.Capability.IStorage;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.common.util.NonNullSupplier;

public class ModCapability {
	
	@CapabilityInject(IModItemHandler.class)
	public static Capability<IModItemHandler> CAPABILITY = null;
	
	public ModCapability() {
		
		CapabilityManager.INSTANCE.register(IModItemHandler.class, new Storage(), new Factory());
		
	}
	
	public static class Storage implements IStorage<IModItemHandler> {
		@Override
		public INBT writeNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side) {
			return null;
		}

		@Override
		public void readNBT(Capability<IModItemHandler> capability, IModItemHandler instance, Direction side, INBT nbt) {
		}
	}
	
	public static class Factory implements Callable<IModItemHandler> {
		@Override
		public IModItemHandler call() throws Exception {
			return null;
		}
	}
	
	public static class Provider implements ICapabilityProvider {
		
		@Override
		public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
			
			return cap == CAPABILITY ? LazyOptional.of(() -> null) : LazyOptional.empty();
			
		}
		
	}
	
}

 

2 hours ago, diesieben07 said:

you need to check if the queried capability is yours and if so return the LazyOptional containing your capability instance. Otherwise return the empty LazyOptional.

what do I have to replace null with

Posted
34 minutes ago, diesieben07 said:

Or... you could just make your inventory an extension of the ender chest inventory (just like how chests that are next to each other merge together). That way their existing inventory (if any) stays and if they uninstall the mod at least the "normal" part still stays.

Like I already suggested...

what do I have to change so that it works like a double chest inventory?

 

50 minutes ago, Luis_ST said:

This is a class that extends ItemStackHandler, just add the same constructors that that class has and call the super constructors. Your IDE should do this for you automatically.

36 minutes ago, diesieben07 said:

I have no idea what you mean by this.

which class did you mean?

 

39 minutes ago, diesieben07 said:

You have to replace it with the instance of your capability (i.e. your inventory).

like this? (this doesent work -> "Cannot make a static reference to the non-static method getInventory() from the type Container")

	public static class Provider implements ICapabilityProvider {
		
		@Override
		public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
			
			return cap == CAPABILITY ? LazyOptional.of(ModEnderChestContainer::getInventory) : LazyOptional.empty();
			
		}
		
	}

 

Posted
35 minutes ago, diesieben07 said:

Use CombinedInvHandler to combine the two into one.

where and when do I have to use this in the container class or when I interact with the block

 

31 minutes ago, diesieben07 said:

What on earth are you talking about?

i fixed it (it was a question about the error log)

 

32 minutes ago, diesieben07 said:

This makes zero sense. Why would the container store the inventory. Your ICapabiltyProvider needs to store and save the capability.

i don't understand what i have to set there, i tried a lot but every time i get an error

Posted
12 hours ago, diesieben07 said:

Your ICapabiltiyProvider needs a field that holds your capability instance (the inventory). It also needs a field that holds a LazyOptional to be returned from getCapability.

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();
			
		}
		
	}

 

Posted (edited)
3 minutes ago, diesieben07 said:

Yes, but do not make a new LazyOptional every time, like I already told you.

so I store save them in a field?

and there is no "CombinedInvHandler" do you mean "CombinedInvWrapper"

Edited by Luis_ST
Posted
12 minutes ago, diesieben07 said:

Yes and yes.

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?

Posted
1 hour ago, diesieben07 said:

PlayerEntity#getInventoryEnderChest

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();
			
		}
		
	}

 

Posted
47 minutes ago, diesieben07 said:

How would you get the ender chest without a player?

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();
			
		}
		
	}

 

Posted
1 hour ago, diesieben07 said:

Do you know what static means?

I know what was meant by static i forgot it to remove

 

1 hour ago, diesieben07 said:

/*Here is an Error*/

i got an error: "The constructor CombinedInvWrapper(IModItemHandler, EnderChestInventory) is undefined".

 

1 hour ago, diesieben07 said:

Also: You still completely ignore the CombinedInvWrapper that you create.

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

Posted
2 hours ago, diesieben07 said:

What?

2 hours ago, diesieben07 said:

You have to return it from getCapability... obviously. You want to use it in your container.

has dealt with the question

 

i try it thanks

 

Posted
16 hours ago, diesieben07 said:

Yes... I told you how to fix it right below. In a quote, because I already told you this previously.

i dont understand when i only use my capility it work when i add the ender chest inventory i got this error

 

16 hours ago, diesieben07 said:

You have to return it from getCapability... obviously. You want to use it in your container.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • It i have Create Stuff and Additions, i get an error that Create is at the wrong version (0.5.1j instead of 0.6.3) and if i remove it, i just end up getting an error for 11 different mods that are unable to load properly. What should i do? Without Create Stuff and Additions: https://ibb.co/fz6Mbw8x With Create Stuff and Additions: https://ibb.co/RTkvnCXN  And no, i can't update Create since i have other mods that don't support 0.6.0 yet.
    • I can usually figure out solutions to these, but I'm stumped. New modpack, made today. I have tried removing pehkui, but origins++ needs it, I have also tried removing amendments, supplementaries, and moonlight Attempted removing origins++ and pehkui and the server started, is there any way to add them to the server without crashing?   Crash log https://pastebin.com/xEm9rDLQ   Latest debug log https://pastebin.com/ChCRGegF    
    • Unlock Massive Savings with  Temu Coupon Codes: Save Big with $100 OFF and More!  Temu is a revolutionary online marketplace that offers a huge collection of trending items at unbeatable prices. Whether you're looking for gadgets, home décor, fashion, or beauty products,  Temu has something for everyone. By using the  Temu coupon code $100 OFF → [acu639380] for existing customers, you can unlock incredible discounts, save up to 90%, and even enjoy free shipping to over 67 countries. In this blog, we will explore the latest  Temu coupon code offerings, including $100 off for new and existing users, a special 40% discount on select items, and the incredible  Temu coupon bundle. Read on to discover how you can make the most of these discounts and enjoy amazing deals with  Temu this June! What is  Temu and Why Should You Shop There?  Temu is a one-stop online shopping destination that offers a vast selection of products at prices that are hard to beat. Whether you're purchasing for yourself or looking for gifts,  Temu delivers a wide variety of high-quality products across different categories. From clothing to electronics, home essentials, beauty products, and much more,  Temu has something for everyone. With its fast delivery, free shipping in over 67 countries, and discounts of up to 90% off, it’s no wonder why shoppers worldwide love this platform. Not only does  Temu offer competitive prices, but their frequent promotions and coupon codes make shopping even more affordable. In this blog, we’ll focus on how you can save even more with  Temu coupon codes, including the highly sought-after $100 OFF and 40% OFF codes. The Power of  Temu Coupon Code $100 OFF → [acu639380] for Existing Customers If you're a  Temu existing customer, you can unlock a fantastic $100 OFF by using the code [acu639380]. This coupon code provides a generous discount, allowing you to save big on your next purchase, whether it’s electronics, fashion, or home décor. Here’s why you should take advantage of this offer: Flat $100 off: This code gives you a flat $100 discount on your order. Available for Existing Users: If you've shopped with  Temu before, this coupon code is for you! Unbeatable Deals: Use this coupon in combination with other ongoing sales for even bigger savings. Huge Selection: Apply the code across  Temu’s massive inventory, from tech gadgets to everyday essentials.  Temu Coupon Code $100 OFF → [acu639380] for New Users Are you new to  Temu? You’re in luck!  Temu has a special $100 off coupon code just for you. By using [acu639380], new users can enjoy a $100 discount on their first purchase. This is an excellent way to try out the platform without breaking the bank. Here’s how to make the most of your  Temu coupon code as a new user: $100 Off Your First Order: If you’ve never shopped with  Temu before, the [acu639380] code gets you $100 off your first purchase. Great for First-Time Shoppers: Explore  Temu's range of trending items while saving money right from the start. Free Gifts: As a new user, you June also receive a special gift with your order as part of the ongoing promotions.  Temu Coupon Code 40% Off → [acu639380] for Extra Savings Looking for even more savings? The 40% off coupon is an amazing deal that’s available for a limited time. By using the code [acu639380], you can enjoy an extra 40% off on selected items. Whether you're shopping for electronics, home goods, or fashion, this coupon code allows you to grab even better deals on top of existing discounts. 40% Extra Off: This discount can be applied to select categories and items, giving you incredible savings. Stack with Other Offers: Combine it with other promotions for unbeatable prices. Popular Items: Use the 40% off code to save on some of  Temu’s hottest items of the season.  Temu Coupon Bundle: Unlock Even More Savings When you use the  Temu coupon bundle, you get even more benefits.  Temu offers a $100 coupon bundle, which allows both new and existing users to save even more on a variety of products. Whether you're shopping for yourself or buying gifts for others, this bundle can help you save big. $100 Coupon Bundle: The  Temu coupon bundle lets you apply multiple discounts at once, ensuring maximum savings. Available to All Users: Whether you’re a first-time shopper or a returning customer, the bundle is available for you to enjoy. Stacked Savings: When combined with other codes like the 40% off or the $100 off, you can save up to 90%.  Temu Coupon Code June 2025: New Offers and Promotions If you're shopping in June 2025, you're in for a treat!  Temu is offering a range of new offers and discount codes for the month. Whether you're shopping for electronics, clothing, or home décor, you’ll find discounts that will help you save a ton. Don’t miss out on the  Temu promo code and  Temu discount code that are available only for a limited time this month.  Temu New User Coupon: New users can save up to $100 off their first order with the [acu639380] code.  Temu Existing User Coupon: Existing users can unlock $100 off using the [acu639380] code.  Temu Coupon Code for June 2025: Get discounts on select items with up to 40% off this June.  Temu Coupon Code for Different Countries No matter where you live,  Temu has something special for you! You can use  Temu coupon codes tailored to your country to unlock great savings. Here’s a breakdown of how you can apply the [acu639380] coupon code in different regions:  Temu Coupon Code $100 Off for USA: Use the [acu639380] code in the USA to save $100 off your order.  Temu Coupon Code $100 Off for Canada: Canadians can enjoy $100 off using the [acu639380] code.  Temu Coupon Code $100 Off for UK: British shoppers can save $100 with the [acu639380] code.  Temu Coupon Code $100 Off for Japan: If you’re in Japan, apply the [acu639380] code to get $100 off.  Temu Coupon Code 40% Off for Mexico: Mexican shoppers can get 40% off with the [acu639380] code.  Temu Coupon Code 40% Off for Brazil: Brazil residents can save 40% by using the [acu639380] code. Why Shop with  Temu?  Temu isn’t just about the discounts; it’s about providing you with an exceptional shopping experience. Here’s why you should choose  Temu for your next shopping spree: Huge Selection of Trending Items: From the latest tech gadgets to fashion and home essentials,  Temu offers everything you need at amazing prices. Unbeatable Prices: With  Temu, you can shop for quality items at prices that are hard to match elsewhere. Fast Delivery: Enjoy fast and reliable delivery on all your orders. Free Shipping in Over 67 Countries: No matter where you are,  Temu ensures you get your products without any extra shipping fees. Up to 90% Off: Take advantage of massive discounts on selected products, so you can get more for less. Conclusion: Maximize Your Savings with  Temu Coupon Codes If you're looking for incredible deals, there’s no better time to shop at  Temu. With  Temu coupon code $100 OFF for existing and new users, an extra 40% off, and amazing coupon bundles, there are plenty of ways to save big. Don’t forget to check out the  Temu promo code for June 2025 and other exciting offers throughout the month. By using [acu639380], you can make the most of your shopping experience and enjoy unbeatable prices on all your favorite products. So, what are you waiting for? Start shopping with  Temu today, and enjoy massive savings with the $100 off and 40% off coupon codes. Happy shopping!  Temu Coupon Code Summary:  Temu Coupon Code $100 Off → [acu639380]: Save $100 on your purchase.  Temu Coupon Code $100 Off for New Users → [acu639380]: New users can get $100 off.  Temu Coupon Code $100 Off for Existing Users → [acu639380]: Existing users can save $100.  Temu Coupon Code 40% Off → [acu639380]: Enjoy 40% off select items.  Temu Coupon Bundle: Access a $100 coupon bundle for even more savings.  Temu Promo Code for June 2025: Latest deals for June 2025.  
    • it didnt make any different his game still crashes (https://www.mediafire.com/file/qmuanorha0d87b5/LOGSBURAK.zip/file) the crash log after without shield expansion mod
    • I am using Linux, I did Java --version and it shows I have Java 8 installed
  • Topics

×
×
  • Create New...

Important Information

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