Jump to content

A little help with Capabilities


LuccaPossamai

Recommended Posts

I created a capability for player to write a custom inventory for each player. But I do not really understant how to get the data stored in the capability.
Heres some classes:

The IStorage

Spoiler

public class IStorageInstance implements Capability.IStorage<AltarCapabilty> {

    @Nullable
    @Override
    public INBT writeNBT(Capability<AltarCapabilty> capability, AltarCapabilty instance, Direction side) {
        ListNBT listnbt = new ListNBT();

        for(int i = 0; i < 9; ++i) {
            ItemStack itemstack = instance.getStackInSlot(i);
            if (!itemstack.isEmpty()) {
                CompoundNBT compoundnbt = new CompoundNBT();
                compoundnbt.putByte("SlotAltar", (byte)i);
                itemstack.save(compoundnbt);
                listnbt.add(compoundnbt);
            }
        }

        return listnbt;
    }

    @Override
    public void readNBT(Capability<AltarCapabilty> capability, AltarCapabilty instance, Direction side, INBT nbt) {
        if(nbt instanceof ListNBT) {
            ListNBT p_70486_1_ = (ListNBT) nbt;

            for(int i = 0; i < 9; ++i) {
                instance.insertItem(i, ItemStack.EMPTY, false);
            }

            for(int k = 0; k < p_70486_1_.size(); ++k) {
                CompoundNBT compoundnbt = p_70486_1_.getCompound(k);
                int j = compoundnbt.getByte("SlotAltar") & 255;
                if (j >= 0 && j < 9) {
                    instance.insertItem(j, ItemStack.of(compoundnbt), false);
                }
            }
        }
    }
}

 

The default capability:

Spoiler

public class DefaultAltarCapability implements AltarCapabilty{

    private NonNullList<ItemStack> items = NonNullList.withSize(9, ItemStack.EMPTY);

    @Override
    public int getSlots() {
        return items.size();
    }

    @Nonnull
    @Override
    public ItemStack getStackInSlot(int slot) {
        return items.get(slot);
    }

    @Nonnull
    @Override
    public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) {
        if(simulate){
            try{
                return items.set(slot, stack);
            } catch (Exception ex){
                System.out.println(ex);
                return stack;
            }
        }

        return items.set(slot, stack);
    }

    @Nonnull
    @Override
    public ItemStack extractItem(int slot, int amount, boolean simulate) {
        if(simulate){
            try{
                items.get(slot).setCount(items.get(slot).getCount() - amount);
                return items.get(slot);
            } catch (Exception ex){
                System.out.println(ex);
                return items.get(slot);
            }
        }

        items.get(slot).setCount(items.get(slot).getCount() - amount);
        return items.get(slot);
    }

    @Override
    public int getSlotLimit(int slot) {
        return items.get(slot).getMaxStackSize();
    }

    @Override
    public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
        return true;
    }

    public NonNullList<ItemStack> getItems() {
        return items;
    }

    public void setItems(NonNullList<ItemStack> items) {
        this.items = items;
    }
}

 

The CapabilitySerializable:

Spoiler

public class AltarProvider implements ICapabilitySerializable<CompoundNBT> {

    private final DefaultAltarCapability defaultAltarCapability = new DefaultAltarCapability();
    private final LazyOptional<AltarCapabilty> altarCapabilty = LazyOptional.of( ()-> defaultAltarCapability);

    @Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        return altarCapabilty.cast();
    }

    @Override
    public CompoundNBT serializeNBT() {
        if(CapabilityInstance.ALTAR_CAPABILITY == null){
            return new CompoundNBT();
        } else {
            return (CompoundNBT) CapabilityInstance.ALTAR_CAPABILITY.writeNBT(defaultAltarCapability, null);

        }
    }

    @Override
    public void deserializeNBT(CompoundNBT nbt) {
        if(CapabilityInstance.ALTAR_CAPABILITY != null){
            CapabilityInstance.ALTAR_CAPABILITY.readNBT(defaultAltarCapability, null, nbt);
        }
    }

}

 

The tile entity:

Spoiler

public class AltarTileEntity extends LockableTileEntity {


    public AltarTileEntity() {
        super(ModTileEntityTypes.ALTAR.get());

    }





    @Override
    protected ITextComponent getDefaultName() {
        TextComponent nome = new StringTextComponent("Altar");
        return nome;
    }

    @Override
    protected Container createMenu(int containerId,
                                   PlayerInventory playerInventory) {


        Inventory items = loadItems(playerInventory.player);
        return new ModAltarContainer(ModContainers.ALTAR_TYPE.get(),
                containerId,
                playerInventory,
                items);



    }

    @Override
    public int getContainerSize() {
        return 9;
    }

    @Override
    public boolean isEmpty() {
        return true;
    }

    @Override
    public ItemStack getItem(int i) {
        return this.getItems().get(i);
    }

    @Override
    public ItemStack removeItem(int i, int count) {
        ItemStack itemstack = ItemStackHelper.removeItem(this.getItems(), i, count);
        if (!itemstack.isEmpty()) {
            this.setChanged();
        }

        return itemstack;


    }

    @Override
    public ItemStack removeItemNoUpdate(int i) {
        return ItemStackHelper.takeItem(this.getItems(), i);
    }

    @Override
    public void setItem(int i, ItemStack item) {

        this.getItems().set(i, item);
        if (item.getCount() > this.getMaxStackSize()) {
            item.setCount(this.getMaxStackSize());
        }

        this.setChanged();


    }

    @Override
    public boolean stillValid(PlayerEntity playerEntity) {

        if (this.level.getBlockEntity(this.worldPosition) != this) {
            return false;
        } else {
            return !(playerEntity.distanceToSqr((double)this.worldPosition.getX() + 0.5D, (double)this.worldPosition.getY() + 0.5D, (double)this.worldPosition.getZ() + 0.5D) > 64.0D);
        }

    }

    @Override
    public void clearContent() {
        this.getItems().clear();
    }


    protected NonNullList<ItemStack> getItems() {
        return NonNullList.withSize(9, ItemStack.EMPTY);
    }




    private Inventory loadItems(PlayerEntity player){
        NonNullList<ItemStack> items = NonNullList.withSize(9, ItemStack.EMPTY);
        player.getCapability(CapabilityInstance.ALTAR_CAPABILITY).ifPresent(inv ->{
            for(int i = 0; i < 9 ; i++){
                items.set(i, inv.getStackInSlot(i));
            }
        });
        Inventory inventory = new Inventory(9);
        for(int i = 0; i < 9; i++){
            inventory.setItem(i, items.get(i));
        }
        return inventory;
    }



}

 

And the container's class:

Spoiler

@Mod.EventBusSubscriber
public class ModAltarContainer extends Container {

    private static Container containerInstance;
    private IInventory altar;
    private static ContainerType menuType;
    private NonNullList<Slot> altarSlots = NonNullList.withSize(45, new Slot(altar, 0, 0, 0));



    public ModAltarContainer(int i, PlayerInventory playerInventory) {
        this(ModContainers.ALTAR_TYPE.get(), i, playerInventory,
                new Inventory(9));
    }



    public ModAltarContainer(@Nullable ContainerType<?> containerType,
                             int containerId,
                             PlayerInventory invPlayer,
                             IInventory inventory) {

        super(containerType, containerId);
        containerInstance = this;
        altar = inventory;
        altarSlots.clear();
        menuType = this.getType();
        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                Slot slot = new Slot(altar, j + i * 3, 62 + j * 18, 17 + i * 18);
                altarSlots.set(j + i * 3, slot);
                this.addSlot(slot);
            }
        }


        for (int k = 0; k < 3; ++k) {
            for (int i1 = 0; i1 < 9; ++i1) {
                Slot slot = new Slot(invPlayer, i1 + k * 9 + 9, 8 + i1 * 18, 84 + k * 18);
                altarSlots.set(i1 + k * 9 + 9, slot);
                this.addSlot(slot);
            }
        }

        for (int l = 0; l < 9; ++l) {
            Slot slot = new Slot(invPlayer, l, 8 + l * 18, 142);
            altarSlots.set(36 + l, slot);
            this.addSlot(slot);
        }
    }



    @Override
    protected Slot addSlot(Slot slot) {
        return super.addSlot(slot);
    }




    @Override
    public boolean stillValid(PlayerEntity jogador) {
        return altar.stillValid(jogador);
    }


    @Override
    public ContainerType<?> getType() {
        return ModContainers.ALTAR_TYPE.get();

    }

    public void removed(PlayerEntity p_75134_1_) {
        super.removed(p_75134_1_);
        this.altar.stopOpen(p_75134_1_);
    }

    @SubscribeEvent
    public static void saveAltarItems(PlayerContainerEvent.Close event){
        PlayerEntity jogador = event.getPlayer();
        if(event.getContainer() instanceof ModAltarContainer){
            saveItems(event.getContainer(), jogador);
        }
        /*
        NonNullList<ItemStack> lista = NonNullList.withSize(9, ItemStack.EMPTY);
        if(event.getContainer().getType().equals(menuType)){
            Container cont = event.getContainer();
            ListNBT listnbt = new ListNBT();
            for(int i = 0; i < 9; i++){
                ItemStack itemstack = cont.getItems().get(i);
                lista.set(i, itemstack);
                CompoundNBT compoundnbt = new CompoundNBT();
                compoundnbt.putByte("SlotAltar", (byte)i);
                itemstack.save(compoundnbt);
                listnbt.add(compoundnbt);
            }

            new InventoryStorage().readNBT(AltarCapabilityDef.ALTAR_INVENTORY,
                    AltarCapabilityDef.ALTAR_INVENTORY.getDefaultInstance(),
                    null,
                    listnbt);


            PlayerEvolution.setStats(lista, jogador);


        }

         */

    }
    public static void saveItems(Container cont, PlayerEntity jogador){


    }



    @Override
    public ItemStack clicked(int p_184996_1_, int p_184996_2_, ClickType p_184996_3_, PlayerEntity p_184996_4_) {
        return super.clicked(p_184996_1_, p_184996_2_, p_184996_3_, p_184996_4_);
    }

    @Override
    public ItemStack quickMoveStack(PlayerEntity p_82846_1_, int p_82846_2_) {
        ItemStack itemstack = ItemStack.EMPTY;
        Slot slot = this.slots.get(p_82846_2_);
        if (slot != null && slot.hasItem()) {
            ItemStack itemstack1 = slot.getItem();
            itemstack = itemstack1.copy();
            if (p_82846_2_ < 9) {
                if (!this.moveItemStackTo(itemstack1, 9, this.slots.size(), true)) {
                    return ItemStack.EMPTY;
                }
            } else if (!this.moveItemStackTo(itemstack1, 0, 9, false)) {
                return ItemStack.EMPTY;
            }

            if (itemstack1.isEmpty()) {
                slot.set(ItemStack.EMPTY);
            } else {
                slot.setChanged();
            }
        }

        return itemstack;
    }

}

 

 

Edited by LuccaPossamai
Link to comment
Share on other sites

Why do you have a tile entity? isn't the capability for the player entity?

What's  the purpose of IStorageInstance? and what's the difference between AltarCapability and DefaultAltarCapability?

I think you're under some fundamental misconception over the capability system. Here's what you need:

1. A capability, and a capability is just a class which holds any arbitrary data you need. Since what you want is an "inventory", forge provides an implementation for that, the ItemStackHandler. If you don't require any custom logic on top of just a holder of ItemStacks, you don't even need to extend it, just use the ItemStackHandler capability.

2. A capability provider, which will manage the capabilities for your player. in it you'll handle serialization, and on the getCapability method, you'll check if the requested capability matches your capability, and if it does, return the lazy capability

3. you'll register the capabilities, and attach them on the proper event handler

4. if you want the inventory to be displayed, and interacted with by the player, you'll need the container and a container screen (not a tile entity, those are for blocks).

Link to comment
Share on other sites

6 hours ago, LuccaPossamai said:

The tile entity in this context just serves to open the container that allows the player to have acess to this inventory.

yeah, that's not what tile entities are for. Tile entities are for blocks.

what you need to open the container, is an INamedContainerProvider

6 hours ago, LuccaPossamai said:

I change for the ItemStackHandler and I works. But, when I enter the world the capability resets.

then you're not properly serializing your data, make sure you properly overrode the serializeNBT and deserializeNBT methods in your Capability Provider.

and post your new code if you're still with some issues

Link to comment
Share on other sites

I use this tile entity for a block, and this block the player use to open the inventory(like an ender chest). I changed the capability to an ItemStackHandler. But every time I enter in the game the inventory resets.

The class for ItemStackHandler cap: 

Spoiler

public class DefaultAltarCapability extends ItemStackHandler { public DefaultAltarCapability(){ super(9); } }


public class DefaultAltarCapability extends ItemStackHandler {

    public DefaultAltarCapability(){
        super(9);
    }
    
}

 

The Capability.IStorage:

Spoiler

public class IStorageInstance implements Capability.IStorage<DefaultAltarCapability> {

    @Nullable
    @Override
    public INBT writeNBT(Capability<DefaultAltarCapability> capability, DefaultAltarCapability instance, Direction side) {
        ListNBT listnbt = new ListNBT();

        for(int i = 0; i < instance.getSlots(); ++i) {
            ItemStack itemstack = instance.getStackInSlot(i);
            CompoundNBT compoundnbt = new CompoundNBT();
            compoundnbt.putInt("Slot", i);
            itemstack.save(compoundnbt);
            listnbt.add(compoundnbt);

        }
        CompoundNBT nbt = new CompoundNBT();
        nbt.put("Items",listnbt);
        nbt.putInt("Size",listnbt.size());

        return listnbt;
    }

    @Override
    public void readNBT(Capability<DefaultAltarCapability> capability, DefaultAltarCapability instance, Direction side, INBT nbt) {
        if(nbt instanceof  CompoundNBT) {
            System.out.println("É tag");
            CompoundNBT compoundNBT = (CompoundNBT) nbt;
            ListNBT tagList = compoundNBT.getList("Items", Constants.NBT.TAG_COMPOUND);

            for (int i = 0; i < tagList.size(); ++i) {
                instance.insertItem(i, ItemStack.of(tagList.getCompound(i)), false);
            }
        }
    }

}

 

The instance of the capability:

Spoiler

public class CapabilityInstance  {

    @CapabilityInject(DefaultAltarCapability.class)
    public static Capability<DefaultAltarCapability> ALTAR_CAPABILITY = null;

    public static void register(){
        CapabilityManager.INSTANCE.register(DefaultAltarCapability.class, new IStorageInstance(), DefaultAltarCapability::new );
    }


}

 

I'm using this to load the items, a add them to an inventory:

Spoiler

private Inventory loadItems(PlayerEntity player){
        Inventory inventory = new Inventory(9);
        player.getCapability(CapabilityInstance.ALTAR_CAPABILITY).ifPresent(inv ->{
            for(int i = 0; i < inv.getSlots(); i++){
                inventory.setItem(i, inv.getStackInSlot(i));
            }
        });

        return inventory;
    }

 

And using this, to save the items of the container in the cap:

Spoiler

@SubscribeEvent
    public static void saveAltarItems(PlayerContainerEvent.Close event){
        PlayerEntity jogador = event.getPlayer();
        if(event.getContainer() instanceof ModAltarContainer) {
            NonNullList<ItemStack> lista = NonNullList.withSize(9, ItemStack.EMPTY);
            Container cont = event.getContainer();
            jogador.getCapability(CapabilityInstance.ALTAR_CAPABILITY).ifPresent( inv ->{
                for(int i = 0 ; i < inv.getSlots() ; i++){
                    inv.setStackInSlot(i, cont.getItems().get(i));
                    inv.deserializeNBT(inv.serializeNBT());
                }
            });
            //PlayerEvolution.setStats(lista, jogador);
        }
    }

 

 

Link to comment
Share on other sites

38 minutes ago, LuccaPossamai said:

I use this tile entity for a block, and this block the player use to open the inventory(like an ender chest).

that doesn't mean you need a tile entity, the data is being stored in the player's capability, not the block

 

38 minutes ago, LuccaPossamai said:

The class for ItemStackHandler cap: 



public class DefaultAltarCapability extends ItemStackHandler {

    public DefaultAltarCapability(){
        super(9);
    }
    
}

 

There's no need to extends the ItemStackHandler, just instantiate it

 

38 minutes ago, LuccaPossamai said:

The Capability.IStorage:




public class IStorageInstance implements Capability.IStorage<DefaultAltarCapability> {

    @Nullable
    @Override
    public INBT writeNBT(Capability<DefaultAltarCapability> capability, DefaultAltarCapability instance, Direction side) {
        ListNBT listnbt = new ListNBT();

        for(int i = 0; i < instance.getSlots(); ++i) {
            ItemStack itemstack = instance.getStackInSlot(i);
            CompoundNBT compoundnbt = new CompoundNBT();
            compoundnbt.putInt("Slot", i);
            itemstack.save(compoundnbt);
            listnbt.add(compoundnbt);

        }
        CompoundNBT nbt = new CompoundNBT();
        nbt.put("Items",listnbt);
        nbt.putInt("Size",listnbt.size());

        return listnbt;
    }

    @Override
    public void readNBT(Capability<DefaultAltarCapability> capability, DefaultAltarCapability instance, Direction side, INBT nbt) {
        if(nbt instanceof  CompoundNBT) {
            System.out.println("É tag");
            CompoundNBT compoundNBT = (CompoundNBT) nbt;
            ListNBT tagList = compoundNBT.getList("Items", Constants.NBT.TAG_COMPOUND);

            for (int i = 0; i < tagList.size(); ++i) {
                instance.insertItem(i, ItemStack.of(tagList.getCompound(i)), false);
            }
        }
    }

}

 

You don't need to use IStorage, plus they're being removed in the next versions. just do the serialization in the provider

 

38 minutes ago, LuccaPossamai said:

The instance of the capability:




public class CapabilityInstance  {

    @CapabilityInject(DefaultAltarCapability.class)
    public static Capability<DefaultAltarCapability> ALTAR_CAPABILITY = null;

    public static void register(){
        CapabilityManager.INSTANCE.register(DefaultAltarCapability.class, new IStorageInstance(), DefaultAltarCapability::new );
    }


}

 

and when your CapabilityInstance.register called?

 

38 minutes ago, LuccaPossamai said:

I'm using this to load the items, a add them to an inventory:




private Inventory loadItems(PlayerEntity player){
        Inventory inventory = new Inventory(9);
        player.getCapability(CapabilityInstance.ALTAR_CAPABILITY).ifPresent(inv ->{
            for(int i = 0; i < inv.getSlots(); i++){
                inventory.setItem(i, inv.getStackInSlot(i));
            }
        });

        return inventory;
    }

And using this, to save the items of the container in the cap:




@SubscribeEvent
    public static void saveAltarItems(PlayerContainerEvent.Close event){
        PlayerEntity jogador = event.getPlayer();
        if(event.getContainer() instanceof ModAltarContainer) {
            NonNullList<ItemStack> lista = NonNullList.withSize(9, ItemStack.EMPTY);
            Container cont = event.getContainer();
            jogador.getCapability(CapabilityInstance.ALTAR_CAPABILITY).ifPresent( inv ->{
                for(int i = 0 ; i < inv.getSlots() ; i++){
                    inv.setStackInSlot(i, cont.getItems().get(i));
                    inv.deserializeNBT(inv.serializeNBT());
                }
            });
            //PlayerEvolution.setStats(lista, jogador);
        }
    }

 

What are these for? why are you converting the ItemStackHandler to an Inventory, to use the ItemStackHandler

 

And you didn't show the CapabilityProvider.

You're over complicating this, I've already explained what it is that you need:

On 5/26/2021 at 11:58 PM, kiou.23 said:

1. A capability, and a capability is just a class which holds any arbitrary data you need. Since what you want is an "inventory", forge provides an implementation for that, the ItemStackHandler. If you don't require any custom logic on top of just a holder of ItemStacks, you don't even need to extend it, just use the ItemStackHandler capability.

2. A capability provider, which will manage the capabilities for your player. in it you'll handle serialization, and on the getCapability method, you'll check if the requested capability matches your capability, and if it does, return the lazy capability

3. you'll register the capabilities, and attach them on the proper event handler

4. if you want the inventory to be displayed, and interacted with by the player, you'll need the container and a container screen (not a tile entity, those are for blocks).

your Capability Provider will provide an ItemStackHandler, in this case, handle serialization in the Provider's serialize and deserialize methods

and you don't need a TE, at least not for this. the TE is meant to store additional data for blocks, since the data you're storing isn't kept in a block, but in the player, you don't need a Tile entity. to open the container you just need an INamedContainerProvider, which passes any data that the Container needs, to the container. and you'll get this data from the Capability

Edited by kiou.23
Link to comment
Share on other sites

Ok, I changed some things. But the inventory still resets. I'm calling the registration of the capability in the setup, maybe this is causing the reset.
The attachEvent:

Spoiler

@Mod.EventBusSubscriber
public class AltarCapabilitySetup {

    @SubscribeEvent
    public static void attachEntityCapabilities(AttachCapabilitiesEvent<Entity> event) {
        if(event.getObject() instanceof  PlayerEntity) {
            event.addCapability(new ResourceLocation(ExampleMod.MOD_ID, "altar_inventory"), new CapabilityInstance());
        }
    }
    
}

 

And the Provider/Serializable:

Spoiler

public class CapabilityInstance implements ICapabilityProvider, ICapabilitySerializable {

    @CapabilityInject(ItemStackHandler.class)
    public static Capability<ItemStackHandler> ALTAR_CAPABILITY = null;

    private final ItemStackHandler ALTAR_HANDLER = new ItemStackHandler(9);

    private final LazyOptional<ItemStackHandler> ALTAR_LAZY = LazyOptional.of(()-> ALTAR_HANDLER);

    @Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        return ALTAR_LAZY.cast();
    }

    @Override
    public INBT serializeNBT() {
        if(ALTAR_CAPABILITY == null){
            return new CompoundNBT();
        } else {
            return ALTAR_CAPABILITY.writeNBT(ALTAR_HANDLER, null);
        }
    }

    @Override
    public void deserializeNBT(INBT nbt) {
        if(ALTAR_CAPABILITY != null) {
            ALTAR_CAPABILITY.readNBT(ALTAR_HANDLER, null, nbt);
        }
    }
    public static void register() {
        CapabilityManager.INSTANCE.register(CapabilityInstance.class, new Capability.IStorage<CapabilityInstance>() {
            @Nullable
            @Override
            public INBT writeNBT(Capability<CapabilityInstance> capability, CapabilityInstance instance, Direction side) {
                return instance.serializeNBT();
            }

            @Override
            public void readNBT(Capability<CapabilityInstance> capability, CapabilityInstance instance, Direction side, INBT nbt) {
                instance.serializeNBT();
            }
        }, CapabilityInstance::new);
    }


}

 

 

Link to comment
Share on other sites

1 hour ago, LuccaPossamai said:

Ok, I changed some things. But the inventory still resets. I'm calling the registration of the capability in the setup, maybe this is causing the reset.
The attachEvent:

  Reveal hidden contents






@Mod.EventBusSubscriber
public class AltarCapabilitySetup {

    @SubscribeEvent
    public static void attachEntityCapabilities(AttachCapabilitiesEvent<Entity> event) {
        if(event.getObject() instanceof  PlayerEntity) {
            event.addCapability(new ResourceLocation(ExampleMod.MOD_ID, "altar_inventory"), new CapabilityInstance());
        }
    }
    
}

 

And the Provider/Serializable:

  Reveal hidden contents






public class CapabilityInstance implements ICapabilityProvider, ICapabilitySerializable {

    @CapabilityInject(ItemStackHandler.class)
    public static Capability<ItemStackHandler> ALTAR_CAPABILITY = null;

    private final ItemStackHandler ALTAR_HANDLER = new ItemStackHandler(9);

    private final LazyOptional<ItemStackHandler> ALTAR_LAZY = LazyOptional.of(()-> ALTAR_HANDLER);

    @Nonnull
    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) {
        return ALTAR_LAZY.cast();
    }

    @Override
    public INBT serializeNBT() {
        if(ALTAR_CAPABILITY == null){
            return new CompoundNBT();
        } else {
            return ALTAR_CAPABILITY.writeNBT(ALTAR_HANDLER, null);
        }
    }

    @Override
    public void deserializeNBT(INBT nbt) {
        if(ALTAR_CAPABILITY != null) {
            ALTAR_CAPABILITY.readNBT(ALTAR_HANDLER, null, nbt);
        }
    }
    public static void register() {
        CapabilityManager.INSTANCE.register(CapabilityInstance.class, new Capability.IStorage<CapabilityInstance>() {
            @Nullable
            @Override
            public INBT writeNBT(Capability<CapabilityInstance> capability, CapabilityInstance instance, Direction side) {
                return instance.serializeNBT();
            }

            @Override
            public void readNBT(Capability<CapabilityInstance> capability, CapabilityInstance instance, Direction side, INBT nbt) {
                instance.serializeNBT();
            }
        }, CapabilityInstance::new);
    }


}

 

 

in the provider's serializeNBT you call the IStorage's writeNBT, but in the IStorage's writeNBT you call the provider's serializeNBT. You never actually serialize your data.

 

1. You don't need an IStorage, just do the serialization in the provider itself.

2. your lazy altar isn't actually lazy. google the concept up. don't initialize the the field on instantiation, instead wait until the capability is requested to initialize it, then cache it.

3. no need to implement ICapabilityProvider, only ICapabilitySerializable, also, you should define the generic parameter of the interface.

4. don't put your capability instance on the capability provider class. that's separation of concerns 101

5. on your getCapability, make sure that the capability being requested is the one you're providing!

Hold on, I have a mod with a private repo that uses capabilities. I'll make it public to share it here so you can see some examples

 

EDIT: here's some examples https://github.com/jvcmarcenes/skbackpacks

EDIT2: I had forgot, for serializing ItemStackHandlers you can use of CapabilityItemHandler.ITEM_HANDLER_CAPABILITY write/read method

Edited by kiou.23
Link to comment
Share on other sites

Ok, with an example the things just get so many clear now. Thanks btw. But, I'm confused. How do I register this Capability. I mean, I tried but, with the serialization, there is no IStorage. I looked in your code, and do not find a field that you register the cap. 

Link to comment
Share on other sites

7 hours ago, LuccaPossamai said:

Ok, with an example the things just get so many clear now. Thanks btw. But, I'm confused. How do I register this Capability. I mean, I tried but, with the serialization, there is no IStorage. I looked in your code, and do not find a field that you register the cap. 

since that's just using an ItemStackHandler, I used the ITEM_HANDLER capability that already exists in CapabilityItemHandler

Bur for registration you just create a field, in a class like ModCapabilities, of type Capability<Your Capability class>, and use @CapabilityInject()

and I didn't have to use an attach event because I'm using the capability in a custom Item. but for attaching it's the same thing, just listen to the proper event, and call event.addCapabicall, then give it the cap ID and an instance of the cap provider

Link to comment
Share on other sites

3 minutes ago, LuccaPossamai said:

It worked, thanks. When the player dies, the capability should reset? If yes, how do I do to no reset?

yes, you have to copy all values from the old capability into the new one, do this in the PlayerEvent.Clone

Link to comment
Share on other sites

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

    • ---- Minecraft Crash Report ---- WARNING: coremods are present:   ForgelinPlugin (Forgelin-1.8.3.jar)   PatchingFixRtmCorePlugin (fixRtm-2.0.28.jar)   IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   FixRtmCorePlugin (fixRtm-2.0.28.jar)   JarInJarLoaderCoreMod (fixRtm-2.0.28.jar)   BetterFoliageLoader (BetterFoliage-MC1.12-2.3.2.jar)   SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.9.jar)   OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   MalisisCorePlugin (MalisisCore-1.12.2.jar)   ObfuscatePlugin (obfuscate-0.4.2-1.12.2.jar)   CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   HookingFixRtmCorePlugin (fixRtm-2.0.28.jar) Contact their authors BEFORE contacting forge // Hey, that tickles! Hehehe! Time: 4/19/24 4:05 PM Description: Updating screen events java.lang.RuntimeException: Failed to check session lock, aborting     at net.minecraft.world.storage.SaveHandler.func_75766_h(SaveHandler.java:76)     at net.minecraft.world.storage.SaveHandler.<init>(SaveHandler.java:54)     at net.minecraft.world.chunk.storage.AnvilSaveHandler.<init>(AnvilSaveHandler.java:18)     at net.minecraft.world.chunk.storage.AnvilSaveConverter.func_75804_a(SourceFile:84)     at net.minecraft.client.Minecraft.func_71371_a(Minecraft.java:2346)     at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:734)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186777_e(GuiListWorldSelectionEntry.java:249)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186774_a(GuiListWorldSelectionEntry.java:199)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_148278_a(GuiListWorldSelectionEntry.java:163)     at net.minecraft.client.gui.GuiListExtended.func_148179_a(SourceFile:41)     at net.minecraft.client.gui.GuiWorldSelection.func_73864_a(SourceFile:117)     at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533)     at net.minecraft.client.gui.GuiWorldSelection.func_146274_d(SourceFile:49)     at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501)     at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)     at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace:     at net.minecraft.world.storage.SaveHandler.func_75766_h(SaveHandler.java:76)     at net.minecraft.world.storage.SaveHandler.<init>(SaveHandler.java:54)     at net.minecraft.world.chunk.storage.AnvilSaveHandler.<init>(AnvilSaveHandler.java:18)     at net.minecraft.world.chunk.storage.AnvilSaveConverter.func_75804_a(SourceFile:84)     at net.minecraft.client.Minecraft.func_71371_a(Minecraft.java:2346)     at net.minecraftforge.fml.client.FMLClientHandler.tryLoadExistingWorld(FMLClientHandler.java:734)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186777_e(GuiListWorldSelectionEntry.java:249)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_186774_a(GuiListWorldSelectionEntry.java:199)     at net.minecraft.client.gui.GuiListWorldSelectionEntry.func_148278_a(GuiListWorldSelectionEntry.java:163)     at net.minecraft.client.gui.GuiListExtended.func_148179_a(SourceFile:41)     at net.minecraft.client.gui.GuiWorldSelection.func_73864_a(SourceFile:117)     at net.minecraft.client.gui.GuiScreen.func_146274_d(GuiScreen.java:533)     at net.minecraft.client.gui.GuiWorldSelection.func_146274_d(SourceFile:49)     at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501) -- Affected screen -- Details:     Screen name: net.minecraft.client.gui.GuiWorldSelection Stacktrace:     at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:1759)     at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1098)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:398)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 5013709368 bytes (4781 MB) / 11274289152 bytes (10752 MB) up to 12884901888 bytes (12288 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx12G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2859 Optifine OptiFine_1.12.2_HD_U_G5 99 mods loaded, 99 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State  | ID                          | Version               | Source                                            | Signature                                |     |:------ |:--------------------------- |:--------------------- |:------------------------------------------------- |:---------------------------------------- |     | LCHIJA | minecraft                   | 1.12.2                | minecraft.jar                                     | None                                     |     | LCHIJA | mcp                         | 9.42                  | minecraft.jar                                     | None                                     |     | LCHIJA | FML                         | 8.0.99.99             | forge-1.12.2-14.23.5.2859.jar                     | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LCHIJA | forge                       | 14.23.5.2859          | forge-1.12.2-14.23.5.2859.jar                     | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LCHIJA | openmodscore                | 0.12.2                | minecraft.jar                                     | None                                     |     | LCHIJA | obfuscate                   | 0.4.2                 | minecraft.jar                                     | None                                     |     | LCHIJA | securitycraft               | v1.9.9                | [1.12.2] SecurityCraft v1.9.9.jar                 | None                                     |     | LCHIJA | mts                         | 22.14.2               | Immersive Vehicles-1.12.2-22.14.2.jar             | None                                     |     | LCHIJA | mtsaircooled                | 1.0.1                 | Air-Cooled Pack [MTS] 1.10.2-14.0.0-1.0.1.jar     | None                                     |     | LCHIJA | codechickenlib              | 3.2.3.358             | CodeChickenLib-1.12.2-3.2.3.358-universal.jar     | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | ancientwarfare              | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | redstoneflux                | 2.1.1                 | RedstoneFlux-1.12-2.1.1.1-universal.jar           | None                                     |     | LCHIJA | ancientwarfareautomation    | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | ancientwarfarenpc           | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | ancientwarfarestructure     | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | ancientwarfarevehicle       | 1.12.2-2.7.0.1038     | ancientwarfare-1.12.2-2.7.0.1038.jar              | None                                     |     | LCHIJA | craftstudioapi              | 1.0.0                 | CraftStudio-1.0.0.93-mc1.12-alpha.jar             | None                                     |     | LCHIJA | animania                    | 2.0.3.28              | animania-1.12.2-base-2.0.3.28.jar                 | None                                     |     | LCHIJA | architecturecraft           | @VERSION@             | architecturecraft-1.12-3.108.jar                  | None                                     |     | LCHIJA | betteranimationscollection2 | 1.0.2                 | BetterAnimationsCollection2-v1.0.2-1.12.2.jar     | 12d137bcc36051a1c2c8ea7211cfc1da1c6e9dea |     | LCHIJA | forgelin                    | 1.8.3                 | Forgelin-1.8.3.jar                                | None                                     |     | LCHIJA | betterfoliage               | 2.3.1                 | BetterFoliage-MC1.12-2.3.2.jar                    | None                                     |     | LCHIJA | bibliocraft                 | 2.4.6                 | BiblioCraft[v2.4.6][MC1.12.2].jar                 | None                                     |     | LCHIJA | biomestaff                  | 1.0.0                 | BiomeStaff-1.12.2-1.0.0.jar                       | None                                     |     | LCHIJA | blockcraftery               | 1.12.2-1.3.1          | blockcraftery-1.12.2-1.3.1.jar                    | None                                     |     | LCHIJA | bookshelf                   | 2.3.590               | Bookshelf-1.12.2-2.3.590.jar                      | d476d1b22b218a10d845928d1665d45fce301b27 |     | LCHIJA | bookworm                    | 1.12.2-2.5.2.1        | Bookworm-Library-Mod-1.12.2.jar                   | None                                     |     | LCHIJA | brandonscore                | 2.4.20                | BrandonsCore-1.12.2-2.4.20.162-universal.jar      | None                                     |     | LCHIJA | bspkrscore                  | 8.0.0                 | BspkrsCore-1.12.2.jar                             | None                                     |     | LCHIJA | carpentersblocks            | 3.4.0-poc.6           | Carpenters-Blocks-v3.4.0-poc.6-MC-1.12.2.jar      | None                                     |     | LCHIJA | ctm                         | MC1.12.2-1.0.2.31     | CTM-MC1.12.2-1.0.2.31.jar                         | None                                     |     | LCHIJA | jei                         | 4.16.1.1012           | jei_1.12.2-4.16.1.1012.jar                        | None                                     |     | LCHIJA | chisel                      | MC1.12.2-1.0.2.45     | Chisel-Mod-1.12.2.jar                             | None                                     |     | LCHIJA | chiselsandbits              | 14.33                 | chiselsandbits-14.33.jar                          | None                                     |     | LCHIJA | customspawner               | 3.11.4                | CustomMobSpawner-3.11.5.jar                       | None                                     |     | LCHIJA | customsignposts             | 1.0                   | customsignposts-1.12.2-1.0.1.jar                  | None                                     |     | LCHIJA | ptrmodellib                 | 1.0.5                 | PTRLib-1.0.5.jar                                  | None                                     |     | LCHIJA | props                       | 2.6.3.7               | Decocraft-2.6.3.7_1.12.2.jar                      | None                                     |     | LCHIJA | mocreatures                 | 12.0.5                | DrZharks MoCreatures Mod-12.0.5.jar               | None                                     |     | LCHIJA | engineersdecor              | 1.1.5                 | engineersdecor-1.12.2-1.1.5.jar                   | ed58ed655893ced6280650866985abcae2bf7559 |     | LCHIJA | exoticbirds                 | 1.0                   | Exotic Birds 1.12.2-3.2.0.jar                     | None                                     |     | LCHIJA | unuparts                    | 6.5.0                 | UNU Parts Pack [MTS] 1.12.2-22.13.0-6.5.0.jar     | None                                     |     | LCHIJA | unuverse                    | 2.0.0                 | ExpandedUNUversePack[MTS]1.12.2-19.15.5-2.0.0.jar | None                                     |     | LCHIJA | fairylights                 | 2.1.10                | fairylights-2.2.0-1.12.2.jar                      | None                                     |     | LCHIJA | fcl                         | 1.12.82               | FCL-1.12.82c.jar                                  | None                                     |     | LCHIJA | net/fexcraft/lib/frl        | 1.2                   | FCL-1.12.82c.jar                                  | None                                     |     | LCHIJA | net/fexcraft/lib/tmt        | 1.15                  | FCL-1.12.82c.jar                                  | None                                     |     | LCHIJA | famm                        | 3.4.0                 | Fexs-Alphabet-and-More-Mod-Forge-1.12.2.jar       | None                                     |     | LCHIJA | forgemultipartcbe           | 2.6.2.83              | ForgeMultipart-1.12.2-2.6.2.83-universal.jar      | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | microblockcbe               | 2.6.2.83              | ForgeMultipart-1.12.2-2.6.2.83-universal.jar      | None                                     |     | LCHIJA | minecraftmultipartcbe       | 2.6.2.83              | ForgeMultipart-1.12.2-2.6.2.83-universal.jar      | None                                     |     | LCHIJA | funkylocomotion             | 1.0                   | funky-locomotion-1.12.2-1.1.2.jar                 | None                                     |     | LCHIJA | furenikusroads              | 1.2.5                 | Furenikus_Roads-1.2.5.jar                         | None                                     |     | LCHIJA | cfm                         | 6.3.0                 | furniture-6.3.2-1.12.2.jar                        | None                                     |     | LCHIJA | waila                       | 1.8.22                | Hwyla-1.8.22-B37_1.12.jar                         | None                                     |     | LCHIJA | trackapi                    | 1.2                   | TrackAPI-1.2.jar                                  | None                                     |     | LCHIJA | universalmodcore            | 1.2.1                 | UniversalModCore-1.12.2-forge-1.2.1.jar           | None                                     |     | LCHIJA | immersiverailroading        | 1.10.0                | ImmersiveRailroading-1.12.2-forge-1.10.0.jar      | None                                     |     | LCHIJA | journeymap                  | 1.12.2-5.7.1p2        | journeymap-1.12.2-5.7.1p2.jar                     | None                                     |     | LCHIJA | zawa                        | 1.12.2-2.1.3          | zawa-1.12.2-2.1.3.jar                             | 3ee471ded1bba54aa82f4f5ca5ca82dd67b8ef42 |     | LCHIJA | lilcritters                 | 1.12.2-1.1.0.0        | Lil-Critters-Mod-Forge-1.12.2.jar                 | None                                     |     | LCHIJA | malisiscore                 | 1.12.2-6.5.1-SNAPSHOT | MalisisCore-1.12.2.jar                            | None                                     |     | LCHIJA | malisisdoors                | 1.12.2-7.3.0          | MalisisDoors-Mod-1.12.2.jar                       | None                                     |     | LCHIJA | mcwbridges                  | 1.0.6                 | mcw-bridges-1.0.6b-mc1.12.2.jar                   | None                                     |     | LCHIJA | mcwfences                   | 1.0.0                 | mcw-fences-1.0.0-mc1.12.2.jar                     | None                                     |     | LCHIJA | mcwroofs                    | 1.0.2                 | mcw-roofs-1.0.2-mc1.12.2.jar                      | None                                     |     | LCHIJA | moon-core                   | 7.0                   | Moons-Core-Forge-1.12.2.jar                       | None                                     |     | LCHIJA | mrtjpcore                   | 2.1.4.43              | MrTJPCore-1.12.2-2.1.4.43-universal.jar           | None                                     |     | LCHIJA | railcraft                   | 12.0.0                | railcraft-12.0.0.jar                              | a0c255ac501b2749537d5824bb0f0588bf0320fa |     | LCHIJA | mtr                         | 3.0.0                 | MTR-1.12.2-alpha-test-0.0.1.jar                   | None                                     |     | LCHIJA | kadwinjpvehicles            | 2.0.0                 | MTS_Kadwin_JP_Vehicles_Pack_4.1.jar               | None                                     |     | LCHIJA | ngtlib                      | 2.4.21                | NGTLib2.4.21-38_forge-1.12.2-14.23.2.2611.jar     | None                                     |     | LCHIJA | projectintelligence         | 1.0.9                 | ProjectIntelligence-1.12.2-1.0.9.28-universal.jar | None                                     |     | LCHIJA | nei                         | 2.4.3                 | NotEnoughItems-1.12.2-2.4.3.245-universal.jar     | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | oe                          | 1.0.7                 | OceanicExpanse-1.0.7.jar                          | None                                     |     | LCHIJA | openmods                    | 0.12.2                | OpenModsLib-1.12.2-0.12.2.jar                     | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |     | LCHIJA | openblocks                  | 1.8.1                 | OpenBlocks-1.12.2-1.8.1.jar                       | d2a9a8e8440196e26a268d1f3ddc01b2e9c572a5 |     | LCHIJA | placeableitems              | 3.3                   | placeableitems-3.3.jar                            | None                                     |     | LCHIJA | projectred-core             | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-Base.jar              | None                                     |     | LCHIJA | projectred-integration      | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-integration.jar       | None                                     |     | LCHIJA | projectred-transmission     | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-integration.jar       | None                                     |     | LCHIJA | projectred-illumination     | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-lighting.jar          | None                                     |     | LCHIJA | projectred-expansion        | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-mechanical.jar        | None                                     |     | LCHIJA | projectred-relocation       | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-mechanical.jar        | None                                     |     | LCHIJA | projectred-transportation   | 4.9.4.120             | ProjectRed-1.12.2-4.9.4.120-mechanical.jar        | None                                     |     | LCHIJA | rtm                         | 2.4.24                | RTM2.4.24-43_forge-1.12.2-14.23.2.2611.jar        | None                                     |     | LCHIJA | trafficcontrol              | 1.1.1                 | trafficcontrol-1.1.1.jar                          | None                                     |     | LCHIJA | travelersbackpack           | 1.0.35                | TravelersBackpack-1.12.2-1.0.35.jar               | None                                     |     | LCHIJA | iv_tpp                      | 2.22.0                | Trin Parts Pack-1.12.2-2.23.1.jar                 | None                                     |     | LCHIJA | unucivil                    | 6.3.0                 | UNU Civilian Pack [MTS] 1.12.2-22.13.0-6.3.0.jar  | None                                     |     | LCHIJA | vehicle                     | 0.44.1                | vehicle-mod-0.44.1-1.12.2.jar                     | None                                     |     | LCHIJA | wawla                       | 2.6.275               | Wawla-1.12.2-2.6.275.jar                          | d476d1b22b218a10d845928d1665d45fce301b27 |     | LCHIJA | worldedit                   | 6.1.10                | worldedit-forge-mc1.12.2-6.1.10-dist.jar          | None                                     |     | LCHIJA | worldstatecheckpoints       | 1.12.2.1.2.1          | WorldStateCheckpoints-client-1.12.2.1.2.1.jar     | None                                     |     | LCHIJA | wrcbe                       | 2.3.2                 | WR-CBE-1.12.2-2.3.2.33-universal.jar              | f1850c39b2516232a2108a7bd84d1cb5df93b261 |     | LCHIJA | zoocraftdiscoveries         | 1.0                   | Zoocraft+Discoveries+1.12.2-1.3.0.jar             | None                                     |     | LCHIJA | immersiveengineering        | 0.12-98               | ImmersiveEngineering-0.12-98.jar                  | None                                     |     | LCHIJA | fix-rtm                     | 2.0.28                | fixRtm-2.0.28.jar                                 | None                                     |     | LCHIJA | mysticallib                 | 1.12.2-1.13.0         | mysticallib-1.12.2-1.13.0.jar                     | None                                     |     Loaded coremods (and transformers): ForgelinPlugin (Forgelin-1.8.3.jar)   PatchingFixRtmCorePlugin (fixRtm-2.0.28.jar)   com.anatawa12.fixRtm.asm.patching.PatchApplier IELoadingPlugin (ImmersiveEngineering-core-0.12-98.jar)   blusunrize.immersiveengineering.common.asm.IEClassTransformer FixRtmCorePlugin (fixRtm-2.0.28.jar)   JarInJarLoaderCoreMod (fixRtm-2.0.28.jar)   com.anatawa12.fixRtm.jarInJar.JarInJarPatcher BetterFoliageLoader (BetterFoliage-MC1.12-2.3.2.jar)   mods.betterfoliage.loader.BetterFoliageTransformer SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.9.jar)   OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   openmods.core.OpenModsClassTransformer MalisisCorePlugin (MalisisCore-1.12.2.jar)   ObfuscatePlugin (obfuscate-0.4.2-1.12.2.jar)   com.mrcrayfish.obfuscate.asm.ObfuscateTransformer CTMCorePlugin (CTM-MC1.12.2-1.0.2.31.jar)   team.chisel.ctm.client.asm.CTMTransformer HookingFixRtmCorePlugin (fixRtm-2.0.28.jar)   com.anatawa12.fixRtm.asm.hooking.HookingTransformer     GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 551.86' Renderer: 'NVIDIA GeForce RTX 3070/PCIe/SSE2'     OpenModsLib class transformers: [llama_null_fix:FINISHED],[horse_base_null_fix:FINISHED],[pre_world_render_hook:FINISHED],[player_render_hook:FINISHED],[horse_null_fix:FINISHED]     RTM Model Status: Initialized 1048 models, Using 0 models     I = Initialized, C = Constructed, SMP = SMP includeds     | model pack                                      | all | I | C   | SMP |     |:----------------------------------------------- |:--- |:- |:--- |:--- |     | mods\ModelPack_Nak_5_Structure_240313.zip       | 458 | 0 | 458 | 0   |     | mods\RTM2.4.24-43_forge-1.12.2-14.23.2.2611.jar | 281 | 0 | 281 | 0   |     | mods\rtm_Saracalias Pack v0.2.01.zip            | 309 | 0 | 309 | 0   |     Launched Version: 1.12.2-forge-14.23.5.2859     LWJGL: 2.9.4     OpenGL: NVIDIA GeForce RTX 3070/PCIe/SSE2 GL version 4.6.0 NVIDIA 551.86, NVIDIA Corporation     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs: NickMiner69V2.zip, MPT-4.zip, feldbahnpackv1-3.zip, G_P_Narrow_Gauge_Texel_Pack_V1.0.3.zip     Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 8x Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz     OptiFine Version: OptiFine_1.12.2_HD_U_G5     OptiFine Build: 20210124-142939     Render Distance Chunks: 12     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.6.0 NVIDIA 551.86     OpenGlRenderer: NVIDIA GeForce RTX 3070/PCIe/SSE2     OpenGlVendor: NVIDIA Corporation     CpuCount: 8
    • OLXTOTO: Menikmati Sensasi Bermain Togel dan Slot dengan Aman dan Mengasyikkan   Dunia perjudian daring terus berkembang dengan cepat, dan salah satu situs yang telah menonjol dalam pasar adalah OLXTOTO. Sebagai platform resmi untuk permainan togel dan slot, OLXTOTO telah memenangkan kepercayaan banyak pemain dengan menyediakan pengalaman bermain yang aman, adil, dan mengasyikkan.   Keamanan Sebagai Prioritas Utama   Salah satu aspek utama yang membuat OLXTOTO begitu menonjol adalah komitmennya terhadap keamanan pemain. Dengan menggunakan teknologi enkripsi terkini, situs ini memastikan bahwa semua informasi pribadi dan keuangan para pemain tetap aman dan terlindungi dari akses yang tidak sah.   Beragam Permainan yang Menarik   Di OLXTOTO, pemain dapat menemukan beragam permainan yang menarik untuk dinikmati. Mulai dari permainan klasik seperti togel hingga slot modern dengan fitur-fitur inovatif, ada sesuatu untuk setiap selera dan preferensi. Grafik yang memukau dan efek suara yang mengagumkan menambah keseruan setiap putaran. Peluang Menang yang Tinggi   Salah satu hal yang paling menarik bagi para pemain adalah peluang menang yang tinggi yang ditawarkan oleh OLXTOTO. Dengan pembayaran yang adil dan peluang yang setara bagi semua pemain, setiap taruhan memberikan kesempatan nyata untuk memenangkan hadiah besar.   Layanan Pelanggan yang Responsif   Tim layanan pelanggan OLXTOTO siap membantu para pemain dengan setiap pertanyaan atau masalah yang mereka hadapi. Dengan layanan yang ramah dan responsif, pemain dapat yakin bahwa mereka akan mendapatkan bantuan yang mereka butuhkan dengan cepat dan efisien.   Kesimpulan   OLXTOTO telah membuktikan dirinya sebagai salah satu situs terbaik untuk penggemar togel dan slot online. Dengan fokus pada keamanan, beragam permainan yang menarik, peluang menang yang tinggi, dan layanan pelanggan yang luar biasa, tidak mengherankan bahwa situs ini telah menjadi pilihan utama bagi banyak pemain.   Jadi, jika Anda mencari pengalaman bermain yang aman, adil, dan mengasyikkan, jangan ragu untuk bergabung dengan OLXTOTO hari ini dan rasakan sensasi kemenangan!      
    • i notice a change if i add the min and max ram in the line like this for example:    # Xmx and Xms set the maximum and minimum RAM usage, respectively. # They can take any number, followed by an M or a G. # M means Megabyte, G means Gigabyte. # For example, to set the maximum to 3GB: -Xmx3G # To set the minimum to 2.5GB: -Xms2500M # A good default for a modded server is 4GB. # Uncomment the next line to set it. -Xmx10240M -Xms8192M    i need to make more experiments but for now this apparently works.
    • Selamat datang di OLXTOTO, situs slot gacor terpanas yang sedang booming di industri perjudian online. Jika Anda mencari pengalaman bermain yang luar biasa, maka OLXTOTO adalah tempat yang tepat untuk Anda. Dapatkan sensasi tidak biasa dengan variasi slot online terlengkap dan peluang memenangkan jackpot slot maxwin yang sering. Di sini, Anda akan merasakan keseruan yang luar biasa dalam bermain judi slot. DAFTAR OLXTOTO DISINI LOGIN OLXTOTO DISINI AKUN PRO OLXTOTO DISINI   Slot Gacor untuk Sensasi Bermain Maksimal Olahraga cepat dan seru dengan slot gacor di OLXTOTO. Rasakan sensasi bermain maksimal dengan mesin slot yang memberikan kemenangan beruntun. Temukan keberuntungan Anda di antara berbagai pilihan slot gacor yang tersedia dan rasakan kegembiraan bermain judi slot yang tak terlupakan. Situs Slot Terpercaya dengan Pilihan Terlengkap OLXTOTO adalah situs slot terpercaya yang menawarkan pilihan terlengkap dalam perjudian online. Nikmati berbagai genre dan tema slot online yang menarik, dari slot klasik hingga slot video yang inovatif. Dipercaya oleh jutaan pemain, OLXTOTO memberikan pengalaman bermain yang aman dan terjamin.   Jackpot Slot Maxwin Sering Untuk Peluang Besar Di OLXTOTO, kami tidak hanya memberikan hadiah slot biasa, tapi juga memberikan kesempatan kepada pemain untuk memenangkan jackpot slot maxwin yang sering. Dengan demikian, Anda dapat meraih keberuntungan besar dan memenangkan ribuan rupiah sebagai hadiah jackpot slot maxwin kami. Jackpot slot maxwin merupakan peluang besar bagi para pemain judi slot untuk meraih keuntungan yang lebih besar. Dalam permainan kami, Anda tidak harus terpaku pada kemenangan biasa saja. Kami hadir dengan jackpot slot maxwin yang sering, sehingga Anda memiliki peluang yang lebih besar untuk meraih kemenangan besar dengan hadiah yang menggiurkan. Dalam permainan judi slot, pengalaman bermain bukan hanya tentang keseruan dan hiburan semata. Kami memahami bahwa para pemain juga menginginkan kesempatan untuk meraih keberuntungan besar. Oleh karena itu, OLXTOTO hadir dengan jackpot slot maxwin yang sering untuk memberikan peluang besar kepada para pemain kami. Peluang Besar Menang Jackpot Slot Maxwin Peluang menang jackpot slot maxwin di OLXTOTO sangatlah besar. Anda tidak perlu khawatir tentang batasan atau pembatasan dalam meraih jackpot tersebut. Kami ingin memberikan kesempatan kepada semua pemain kami untuk merasakan sensasi menang dalam jumlah yang luar biasa. Jackpot slot maxwin kami dibuka untuk semua pemain judi slot di OLXTOTO. Anda memiliki peluang yang sama dengan pemain lainnya untuk memenangkan hadiah jackpot yang besar. Kami percaya bahwa semua orang memiliki kesempatan untuk meraih keberuntungan besar, dan itulah mengapa kami menyediakan jackpot slot maxwin yang sering untuk memenuhi harapan dan keinginan Anda.  
    • LOGIN DAN DAFTAR DISINI SEKARANG !!!! Blacktogel adalah situs judi slot online yang menjadi pilihan banyak penggemar judi slot gacor di Indonesia. Dengan platform yang sangat user-friendly dan berbagai macam permainan slot yang tersedia, Blacktogel menjadi tempat yang tepat untuk penggemar judi slot online. Dalam artikel ini, kami akan membahas tentang Blacktogel dan keunggulan situs slot gacor online yang disediakan.  
  • Topics

×
×
  • Create New...

Important Information

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