Jump to content

[1.12.2][SOLVED] Passing NBT/Instance data to functions


RiNickolous

Recommended Posts

I have an entity with a custom NBT value "type". This is a String, and can be equal to "normal" or "shadow".

Several aspects of this entity rely on the NBT value "type", and I want them to be updated when the value is changed. 

I want to change the model of the entity (or rather, just the texture which is rendered on the entity's model).

The entity also has an inventory capability, allowing it to store items. The size of this inventory, along with the corresponding elements of the inventory GUI, should change with the NBT value.

 

My problem is that I don't know how to do this. When I set the "type" variable to static within the entity's class, all of this works as I want. However, all entities are affected, as expected with a static variable.

When I remove the static modifier from "type", none of the aforementioned things happen.

 

My full source code is available here(GitHub link).

 

The following are the relevant parts of the files to do with this issue:

My entity's class:

Spoiler

package neck.dontstarve.entity;

public class EntityChester extends EntityTameable
{
	private String type;
	private EntityPlayer owner;
    private int index;
	
	public EntityChester(World worldIn)
	{
		super(worldIn);
		this.setSize(0.9F, 0.9F);
		if (this.type == null)
		{
			this.setType("normal");
		}
	}

	private int getInventorySize()
	{
		return 12;
	}

    
	public boolean processInteract(EntityPlayer player, EnumHand hand)
	{
		ItemStack stack = player.getHeldItem(hand);
		
		if (!stack.isEmpty())
		{
			if (stack.getItem() instanceof ItemFood)
			{
				if (getHealth() < getMaxHealth())
				{
					heal(((ItemFood)stack.getItem()).getHealAmount(stack));
					stack.shrink(1);
					if (stack.getCount() == 0) stack = ItemStack.EMPTY;
					if(this.world.isRemote)
					{
						this.world.spawnParticle(EnumParticleTypes.HEART, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
					}
				}
				return true;
			}
		}
		else
		{
			player.openGui(Main.instance, Reference.GUI_CHESTER, world, this.getEntityId(), (int)player.posY, (int)player.posZ);
		
		return true;
		}
		
		return true;
	}
	
	@Override
    public void writeEntityToNBT(NBTTagCompound compound)
    {
        super.writeEntityToNBT(compound);
        compound.setString("Type", this.getType());
        if (this.getOwner() == null)
        {
            compound.setString("OwnerUUID", "");
        }
        else
        {
            compound.setString("OwnerUUID", this.getOwner().getUniqueID().toString());
        }
    }
    
    @Override
    public void readEntityFromNBT(NBTTagCompound compound)
    {
        super.readEntityFromNBT(compound);
        this.setType(compound.getString("Type"));
        String s;
        if (compound.hasKey("OwnerUUID", 8))
        {
            s = compound.getString("OwnerUUID");
        }
        else
        {
            String s1 = compound.getString("Owner");
            s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
        }

        if (!s.isEmpty())
        {
            try
            {
                this.setOwnerId(UUID.fromString(s));
                this.setTamed(true);
            }
            catch (Throwable var4)
            {
                this.setTamed(false);
            }
        }
    }
    
}

The entity's render class:

Spoiler

package neck.dontstarve.entity.render;

public class RenderChester extends RenderLiving<EntityChester>
{
	public static final ResourceLocation TEXTURES_NORMAL = new ResourceLocation(Reference.MOD_ID + ":textures/entity/chester.png");
	public static final ResourceLocation TEXTURES_SNOW = new ResourceLocation(Reference.MOD_ID + ":textures/entity/chester_snow.png");
	public static final ResourceLocation TEXTURES_SHADOW = new ResourceLocation(Reference.MOD_ID + ":textures/entity/chester_shadow.png");

	public RenderChester(RenderManager manager)
	{
		super(manager, new ModelChester(), 0.5F);
	}

	@Override
	protected ResourceLocation getEntityTexture(EntityChester entity)
	{
		ResourceLocation textures;
		switch(entity.getType())
		{
			case("normal") : textures =  TEXTURES_NORMAL; break;
			case("snow") :  textures =  TEXTURES_SNOW; break;
			case("shadow") : textures =  TEXTURES_SHADOW; break;
			default: textures = TEXTURES_NORMAL; break;
		}
		
		return textures;
	}
}

The capability provider class:

Spoiler

package neck.dontstarve.capability;

public class CapabilityProvider implements ICapabilityProvider
{
	final ChesterInventory chesterInv = new ChesterInventory();
	public static final ResourceLocation KEY = new ResourceLocation(Reference.MOD_ID, "chester_inventory");
	
	public CapabilityProvider(EntityChester chester)
	{
		this.chesterInv.setInstance(chester);
	}

	@Override
	public boolean hasCapability(Capability<?> capability, EnumFacing facing)
	{
		if (capability == ChesterInventoryCapability.CAPABILITY)
		{
			return true;
		}
		return false;
	}

	public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
	{
		if (capability == ChesterInventoryCapability.CAPABILITY)
		{
			return (T) this.chesterInv;
		}
		return null;
	}

 

Edited by RiNickolous
Link to comment
Share on other sites

Consider changing your field from a string to an enum and serialize/deserialize it by an ordinal. It will save on both the NBT data size and the network packet size(more on that later).

If you want some data of the entity to affect something on the client you need to create a new DataParameter, store your data in the entity's DataManager with that DataParameter as the key and retrieve the data by using that DataParameter as the key. See pretty much any minecraft entity for an example, an EntitySheep for example.

Additionally since it is your own entity you do not need a capability provider, the entity itself is one. Directly have the inventory stored in your entity as a field, override Entity#hasCapability and Entity#getCapability to check if the capability parameter is your capability and return your inventory if it is, otherwise default to a super implementation.

By the way if you are wondering the reason the static field worked was only because you were reaching across logical sides. It would not work if you would have launched a dedicated server and connected to it.

Link to comment
Share on other sites

1 hour ago, V0idWa1k3r said:

Consider changing your field from a string to an enum and serialize/deserialize it by an ordinal.

I'm not very experienced with Java, but I think I did this correctly.

EnumChesterType.class

Spoiler

package neck.dontstarve.entity;

import net.minecraft.util.IStringSerializable;

public enum EnumChesterType implements IStringSerializable
{
	NORMAL(0, "normal", 3, false),
	SNOW(1, "snowl", 3, true),
	SHADOW(3, "shadow", 3, false);
	
	private static final EnumChesterType[] META_LOOKUP = new EnumChesterType[values().length];
	private final int meta;
	private final String name;
	private final int invSize;
	private final boolean chillFood;
			
	
	private EnumChesterType(int metaIn, String nameIn, int invSizeIn, boolean chillFoodIn)
	{
		this.meta = metaIn;
		this.name = nameIn;
		this.invSize = invSizeIn;
		this.chillFood = chillFoodIn;
	}
	
	public int getMetadata()
	{
		return this.meta;
	}
	
	public String getName()
	{
		return this.name;
	}
	
	public int getInvSize()
	{
		return this.invSize;
	}
	
	public boolean getChillFood()
	{
		return this.chillFood;
	}
	
	public static EnumChesterType byMetadata(int meta)
	{
		if (meta < 0 || meta >= META_LOOKUP.length)
		{
			meta = 0;
		}
		
		return META_LOOKUP[meta];
	}
	
	static
	{
		for (EnumChesterType type : values())
			META_LOOKUP[type.getMetadata()] = type;
	}
}

 

 

1 hour ago, V0idWa1k3r said:

If you want some data of the entity to affect something on the client you need to create a new DataParameter, store your data in the entity's DataManager with that DataParameter as the key and retrieve the data by using that DataParameter as the key.

I think I did this as well? This is all very foreign to me.

 

In EntityChester:

Spoiler

private static final DataParameter<Byte> TYPE = EntityDataManager.<Byte>createKey(EntityChester.class, DataSerializers.BYTE);

 

 

1 hour ago, V0idWa1k3r said:

Additionally since it is your own entity you do not need a capability provider, the entity itself is one. Directly have the inventory stored in your entity as a field, override Entity#hasCapability and Entity#getCapability to check if the capability parameter is your capability and return your inventory if it is, otherwise default to a super implementation.

This is what confuses me. Could you elaborate on this part, please?

 

For reference:

My CapabilityProvider class:

Spoiler

package neck.dontstarve.capability;

import javax.annotation.Nullable;

import neck.dontstarve.entity.EntityChester;
import neck.dontstarve.util.Reference;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;

public class CapabilityProvider implements ICapabilityProvider
{
	final ChesterInventory chesterInv = new ChesterInventory();
	public static final ResourceLocation KEY = new ResourceLocation(Reference.MOD_ID, "chester_inventory");
	
	public CapabilityProvider(EntityChester chester)
	{
		this.chesterInv.setInstance(chester);
	}

	@Override
	public boolean hasCapability(Capability<?> capability, EnumFacing facing)
	{
		if (capability == ChesterInventoryCapability.CAPABILITY)
		{
			return true;
		}
		return false;
	}

	public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing)
	{
		if (capability == ChesterInventoryCapability.CAPABILITY)
		{
			return (T) this.chesterInv;
		}
		return null;
	}

 

My Capability class:

Spoiler

package neck.dontstarve.capability;

import java.util.concurrent.Callable;

import net.minecraft.nbt.NBTBase;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;

public class ChesterInventoryCapability
{
	@CapabilityInject(ChesterInventory.class)
	public static Capability<ChesterInventory> CAPABILITY;
	
	public void register()
	{
		CapabilityManager.INSTANCE.register(ChesterInventory.class, new StorageHelper(), new DefaultInstanceFactory());
	}
	
	public static class StorageHelper implements Capability.IStorage<ChesterInventory>
	{
		public NBTBase writeNBT(Capability<ChesterInventory> capability, ChesterInventory instance, EnumFacing side)
		{
			return instance.writeData();
		}
		
		public void readNBT(Capability<ChesterInventory> capability, ChesterInventory instance, EnumFacing side, NBTBase nbt)
		{
			instance.readData(nbt);
		}
	}
	
	public static class DefaultInstanceFactory implements Callable<ChesterInventory>
	{
		public ChesterInventory call() throws Exception
		{
			return new ChesterInventory();
		}
	}
}

 

and the Inventory itself:

Spoiler

package neck.dontstarve.capability;

import neck.dontstarve.entity.EntityChester;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.items.ItemStackHandler;

public class ChesterInventory
{
	private ChesterStackHandler inventory;
	private String customName = null;
	private String type = "default";
	private EntityChester instance;
	
	private float Health = 20.0F;
	
	public ChesterInventory()
	{
		int slotNum = 12;
		this.inventory = new ChesterStackHandler(slotNum);
	}
	
	public ItemStackHandler getInventoryHandler()
	{
		return this.inventory;
	}
	
	public void setStackInSlot(int index, ItemStack stack)
	{
		this.inventory.setStackInSlot(index, stack);
	}
	
	public NBTBase writeData()
	{
		NBTTagCompound compound = this.inventory.serializeNBT();
		
		if ((getName() != null) && (getName().length() > 0))
		{
			compound.setString("customName", getName());
		}
		compound.setString("type", getType());
		compound.setFloat("health", getHealth());
		
		return compound;
	}
	
	public void readData(NBTBase nbt)
	{
		NBTTagCompound compound = (NBTTagCompound)nbt;
		this.inventory.deserializeNBT((NBTTagCompound)nbt);
		if (compound.hasKey("customName"))
		{
			setName(compound.getString("customName"));
		}
		setType(compound.getString("type"));
		setHealth(compound.getFloat("health"));
	}
	
	public String getName()
	{
		return this.customName;
	}
	
	public void setName(String name)
	{
		this.customName = name;
	}
	
	public String getType()
	{
		return this.type;
	}
	
	public void setType(String type)
	{
		this.type = type;
	}
	
	public float getHealth()
	{
		return this.Health;
	}
	
	public void setHealth(float health)
	{
		this.Health = health;
	}
	
	public void setInstance(EntityChester chester)
	{
		this.instance = chester;
	}
	
	public EntityChester getInstnace()
	{
		return this.instance;
	}
}

 

 

Edited by RiNickolous
added code snippets
Link to comment
Share on other sites

Okay, as it turns out, I have no idea what I'm doing.

 

My most recent crashlog:

Spoiler

---- Minecraft Crash Report ----
// Uh... Did I do that?

Time: 9/19/18 10:13 PM
Description: Unexpected error

java.lang.NoClassDefFoundError: Could not initialize class neck.dontstarve.entity.EnumChesterType
	at neck.dontstarve.entity.EntityChester.getType(EntityChester.java:116)
	at neck.dontstarve.inventory.ContainerChester.<init>(ContainerChester.java:18)
	at neck.dontstarve.gui.GuiChester.<init>(GuiChester.java:26)
	at neck.dontstarve.util.handlers.GuiHandler.getClientGuiElement(GuiHandler.java:31)
	at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:276)
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:111)
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809)
	at neck.dontstarve.entity.EntityChester.processInteract(EntityChester.java:93)
	at net.minecraft.entity.EntityLiving.processInitialInteract(EntityLiving.java:1355)
	at net.minecraft.entity.player.EntityPlayer.interactOn(EntityPlayer.java:1299)
	at net.minecraft.client.multiplayer.PlayerControllerMP.interactWithEntity(PlayerControllerMP.java:587)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1680)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2379)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2145)
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1933)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1186)
	at net.minecraft.client.Minecraft.run(Minecraft.java:441)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at neck.dontstarve.entity.EntityChester.getType(EntityChester.java:116)
	at neck.dontstarve.inventory.ContainerChester.<init>(ContainerChester.java:18)
	at neck.dontstarve.gui.GuiChester.<init>(GuiChester.java:26)
	at neck.dontstarve.util.handlers.GuiHandler.getClientGuiElement(GuiHandler.java:31)
	at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:276)
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:111)
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2809)
	at neck.dontstarve.entity.EntityChester.processInteract(EntityChester.java:93)
	at net.minecraft.entity.EntityLiving.processInitialInteract(EntityLiving.java:1355)
	at net.minecraft.entity.player.EntityPlayer.interactOn(EntityPlayer.java:1299)
	at net.minecraft.client.multiplayer.PlayerControllerMP.interactWithEntity(PlayerControllerMP.java:587)
	at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1680)
	at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2379)
	at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2145)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player379'/160, l='MpServer', x=-170.97, y=69.00, z=230.58]]
	Chunk stats: MultiplayerChunkCache: 624, 624
	Level seed: 0
	Level generator: ID 00 - default, ver 1. Features enabled: false
	Level generator options: 
	Level spawn location: World: (-176,64,228), Chunk: (at 0,4,4 in -11,14; contains blocks -176,0,224 to -161,255,239), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
	Level time: 443864 game time, 1000 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 15 total; [EntityChester['Chester'/3456, l='MpServer', x=-172.50, y=68.00, z=230.50], EntitySquid['Squid'/100, l='MpServer', x=-147.43, y=61.62, z=257.93], EntitySquid['Squid'/101, l='MpServer', x=-147.58, y=59.12, z=250.89], EntityLatchedRenderer['unknown'/421, l='MpServer', x=-170.97, y=69.00, z=230.58], EntitySquid['Squid'/102, l='MpServer', x=-148.10, y=62.14, z=245.10], EntitySquid['Squid'/103, l='MpServer', x=-146.20, y=62.24, z=247.33], EntitySquid['Squid'/104, l='MpServer', x=-154.13, y=62.22, z=278.56], EntitySquid['Squid'/105, l='MpServer', x=-156.30, y=62.60, z=287.11], EntityPlayerSP['Player379'/160, l='MpServer', x=-170.97, y=69.00, z=230.58], EntityLatchedRenderer['unknown'/303, l='MpServer', x=8.50, y=65.00, z=8.50], EntityBat['Bat'/83, l='MpServer', x=-227.47, y=29.55, z=169.14], EntityBat['Bat'/115, l='MpServer', x=-111.25, y=24.04, z=304.50], EntityBat['Bat'/3483, l='MpServer', x=-206.87, y=38.00, z=212.73], EntityBat['Bat'/3485, l='MpServer', x=-203.32, y=38.05, z=204.91], EntityBat['Bat'/3486, l='MpServer', x=-206.33, y=38.03, z=213.36]]
	Retry entities: 1 total; [EntityLatchedRenderer['unknown'/303, l='MpServer', x=8.50, y=65.00, z=8.50]]
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2886)
	at net.minecraft.client.Minecraft.run(Minecraft.java:470)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_181, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 745265312 bytes (710 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
	FML: MCP 9.42 Powered by Forge 14.23.4.2705 9 mods loaded, 9 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 |
	|:--------- |:--------------- |:------------ |:-------------------------------- |:--------- |
	| UCHIJAAAA | minecraft       | 1.12.2       | minecraft.jar                    | None      |
	| UCHIJAAAA | mcp             | 9.42         | minecraft.jar                    | None      |
	| UCHIJAAAA | FML             | 8.0.99.99    | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | forge           | 14.23.4.2705 | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | dont_starve_mod | 1.0          | bin                              | None      |
	| UCHIJAAAA | ichunutil       | 7.1.4        | iChunUtil-1.12.2-7.1.4.jar       | None      |
	| UCHIJAAAA | jei             | 4.11.0.212   | jei_1.12.2-4.11.0.212.jar        | None      |
	| UCHIJAAAA | nbtedit         | $version     | NBTEdit-0.7.jar                  | None      |
	| UCHIJAAAA | tabula          | 7.0.0        | Tabula-1.12.2-7.0.0.jar          | None      |

	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 391.35' Renderer: 'GeForce GTX 1060 6GB/PCIe/SSE2'
	Launched Version: 1.12.2
	LWJGL: 2.9.4
	OpenGL: GeForce GTX 1060 6GB/PCIe/SSE2 GL version 4.6.0 NVIDIA 391.35, 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: 
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 4x Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz

 

 

Link to comment
Share on other sites

You do not need all this "metadata" nonsense, get the enum by it's ordinal(Enum.values()[ordinal], Enum#ordinal).

As for your capability question create a field of ChesterInventory in your entity class, (de)serialize it when needed(readFrom/writeToNBT), override Entity#hasCapability and Entity#getCapability. In those methods check if the capability is yours exactly the same way you are checking it in your provider. If it is return your ChesterInventory, otherwise return a super implementation(return cap == YOUR_CAP ? yourField : super.getCapability(cap, facing) and return cap == YOUR_CAP || super.hasCapability(cap, facing))

Edited by V0idWa1k3r
Link to comment
Share on other sites

55 minutes ago, V0idWa1k3r said:

You do not need all this "metadata" nonsense, get the enum by it's ordinal(Enum.values()[ordinal], Enum#ordinal).

I'm sorry, I still don't think I quite understand. I'm not at all familiar with Enums. Where does this go? How do I make use of this? Looking at the EntitySheep code has left me quite confused.

Link to comment
Share on other sites

(De)serialize the enum as the ordinal. Use the ordinal in your DataManager.

Pseudo-code:

Deserialization: setType(EnumChesterType.values()[tag.readByte("type")])

Serialization: tag.writeByte("type", this.getType().ordinal())

getType: EnumChesterType.values()[dataManager.get(TYPE)]

setType: dataManager.set(TYPE, type.ordinal())

Link to comment
Share on other sites

I don't know what is going on.

 

EnumChesterType:

Spoiler

package neck.dontstarve.entity;

public enum EnumChesterType
{
	NORMAL(0,"normal", 3, false),
	SNOW(1,"snowl", 3, true),
	SHADOW(2,"shadow", 3, false);
	
	private static final EnumChesterType[] META_LOOKUP = new EnumChesterType[values().length];
	private int id;
	private final String name;
	private final int invSize;
	private final boolean chillFood;
	
	private EnumChesterType(int id, String nameIn, int invSizeIn, boolean chillFoodIn)
	{
		this.name = nameIn;
		this.invSize = invSizeIn;
		this.chillFood = chillFoodIn;
	}
}

 

 

In EntityChester:

Spoiler

private static final DataParameter TYPE = EntityDataManager.createKey(EntityChester.class, DataSerializers.BYTE);

	public void entityInit()
	{
		super.entityInit();
		this.dataManager.register(TYPE, EnumChesterType.NORMAL);
	}

	public EnumChesterType getType()
	{
		return EnumChesterType.values()[(int) this.dataManager.get(TYPE)];
	}
	
	public void setType(EnumChesterType type)
	{
		this.dataManager.set(TYPE,(byte) type.ordinal());
	}
	
	@Override
    public void writeEntityToNBT(NBTTagCompound compound)
    {
        super.writeEntityToNBT(compound);
        compound.setByte("Type", (byte) this.getType().ordinal());
        if (this.getOwner() == null)
        {
            compound.setString("OwnerUUID", "");
        }
        else
        {
            compound.setString("OwnerUUID", this.getOwner().getUniqueID().toString());
        }
    }
    
    @Override
    public void readEntityFromNBT(NBTTagCompound compound)
    {
        super.readEntityFromNBT(compound);
        this.setType(EnumChesterType.values()[compound.getByte("Type")]);
        String s;
        if (compound.hasKey("OwnerUUID", 8))
        {
            s = compound.getString("OwnerUUID");
        }
        else
        {
            String s1 = compound.getString("Owner");
            s = PreYggdrasilConverter.convertMobOwnerIfNeeded(this.getServer(), s1);
        }

        if (!s.isEmpty())
        {
            try
            {
                this.setOwnerId(UUID.fromString(s));
                this.setTamed(true);
            }
            catch (Throwable var4)
            {
                this.setTamed(false);
            }
        }
    }

 

 

crash-log:

Spoiler

---- Minecraft Crash Report ----
// Don't be sad. I'll do better next time, I promise!

Time: 9/20/18 12:52 AM
Description: Exception in server tick loop

java.lang.ClassCastException: neck.dontstarve.entity.EnumChesterType cannot be cast to java.lang.Byte
	at net.minecraft.network.datasync.DataSerializers$1.copyValue(DataSerializers.java:22)
	at net.minecraft.network.datasync.EntityDataManager$DataEntry.copy(EntityDataManager.java:384)
	at net.minecraft.network.datasync.EntityDataManager.getDirty(EntityDataManager.java:212)
	at net.minecraft.network.play.server.SPacketEntityMetadata.<init>(SPacketEntityMetadata.java:32)
	at net.minecraft.entity.EntityTrackerEntry.sendMetadata(EntityTrackerEntry.java:333)
	at net.minecraft.entity.EntityTrackerEntry.updatePlayerList(EntityTrackerEntry.java:285)
	at net.minecraft.entity.EntityTracker.tick(EntityTracker.java:297)
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:854)
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743)
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:192)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592)
	at java.lang.Thread.run(Unknown Source)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_181, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 519041048 bytes (494 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
	FML: MCP 9.42 Powered by Forge 14.23.4.2705 9 mods loaded, 9 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 |
	|:--------- |:--------------- |:------------ |:-------------------------------- |:--------- |
	| UCHIJAAAA | minecraft       | 1.12.2       | minecraft.jar                    | None      |
	| UCHIJAAAA | mcp             | 9.42         | minecraft.jar                    | None      |
	| UCHIJAAAA | FML             | 8.0.99.99    | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | forge           | 14.23.4.2705 | forgeSrc-1.12.2-14.23.4.2705.jar | None      |
	| UCHIJAAAA | dont_starve_mod | 1.0          | bin                              | None      |
	| UCHIJAAAA | ichunutil       | 7.1.4        | iChunUtil-1.12.2-7.1.4.jar       | None      |
	| UCHIJAAAA | jei             | 4.11.0.212   | jei_1.12.2-4.11.0.212.jar        | None      |
	| UCHIJAAAA | nbtedit         | $version     | NBTEdit-0.7.jar                  | None      |
	| UCHIJAAAA | tabula          | 7.0.0        | Tabula-1.12.2-7.0.0.jar          | None      |

	Loaded coremods (and transformers): 
	GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread.
	Profiler Position: N/A (disabled)
	Player Count: 1 / 8; [EntityPlayerMP['Player72'/158, l='Testing', x=-171.24, y=69.00, z=229.40]]
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'fml,forge'

 

 

Edited by RiNickolous
Link to comment
Share on other sites

27 minutes ago, RiNickolous said:

this.dataManager.register(TYPE, EnumChesterType.NORMAL);

Well here you register the value for the TYPE as an EnumChesterType. But later you use this data manager key as if it was associated with a byte. Stay consistent. If only java had a way to automatically check these kind of errors for you... You know, if only you could put a constraint on the TYPE parameter instead of it being a generic Object accepting anything. Something like DataParameter<Byte> TYPE = ... 

  • Like 1
Link to comment
Share on other sites

26 minutes ago, V0idWa1k3r said:

Well here you register the value for the TYPE as an EnumChesterType. But later you use this data manager key as if it was associated with a byte. Stay consistent. If only java had a way to automatically check these kind of errors for you... You know, if only you could put a constraint on the TYPE parameter instead of it being a generic Object accepting anything. Something like DataParameter<Byte> TYPE = ... 

Wow, it all works! Thank you so much for being so patient with me. I really appreciate the help.

 

All NBT data is now stored correctly, and functions relevant to them now respond correctly.

Edited by RiNickolous
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

    • Hello, I'm trying to modify the effects of native enchantments for bows and arrows in Minecraft. After using a decompilation tool, I found that the specific implementations of native bow and arrow enchantments (including `ArrowDamageEnchantment`, `ArrowKnockbackEnchantment`, `ArrowFireEnchantment`, `ArrowInfiniteEnchantment`, `ArrowPiercingEnchantment`) do not contain any information about the enchantment effects (such as the `getDamageProtection` function for `ProtectionEnchantment`, `getDamageBonus` function for `DamageEnchantment`, etc.). Upon searching for the base class of arrows, `AbstractArrow`, I found a function named setEnchantmentEffectsFromEntity`, which seems to be used to retrieve the enchantment levels of the tool held by a `LivingEntity` and calculate the specific values of the enchantment effects. However, after testing with the following code, I found that this function is not being called:   @Mixin(AbstractArrow.class) public class ModifyArrowEnchantmentEffects {     private static final Logger LOGGER = LogUtils.getLogger();     @Inject(         method = "setEnchantmentEffectsFromEntity",         at = @At("HEAD")     )     private void logArrowEnchantmentEffectsFromEntity(CallbackInfo ci) {         LOGGER.info("Arrow enchantment effects from entity");     } }   Upon further investigation, I found that within the onHitEntity method, there are several lines of code:               if (!this.level().isClientSide &amp;&amp; entity1 instanceof LivingEntity) {                EnchantmentHelper.doPostHurtEffects(livingentity, entity1);                EnchantmentHelper.doPostDamageEffects((LivingEntity)entity1, livingentity);             }   These lines of code actually call the doPostHurt and doPostAttack methods of each enchantment in the enchantment list. However, this leads back to the issue because native bow and arrow enchantments do not implement these functions. Although their base class defines the functions, they are empty. At this point, I'm completely stumped and seeking assistance. Thank you.
    • I have been trying to make a server with forge but I keep running into an issue. I have jdk 22 installed as well as Java 8. here is the debug file  
    • it crashed again     What the console says : [00:02:03] [Server thread/INFO] [Easy NPC/]: [EntityManager] Server started! [00:02:03] [Server thread/INFO] [co.gi.al.ic.IceAndFire/]: {iceandfire:fire_dragon_roost=true, iceandfire:fire_lily=true, iceandfire:spawn_dragon_skeleton_fire=true, iceandfire:lightning_dragon_roost=true, iceandfire:spawn_dragon_skeleton_lightning=true, iceandfire:ice_dragon_roost=true, iceandfire:ice_dragon_cave=true, iceandfire:lightning_dragon_cave=true, iceandfire:cyclops_cave=true, iceandfire:spawn_wandering_cyclops=true, iceandfire:spawn_sea_serpent=true, iceandfire:frost_lily=true, iceandfire:hydra_cave=true, iceandfire:lightning_lily=true, iceandfireixie_village=true, iceandfire:myrmex_hive_jungle=true, iceandfire:myrmex_hive_desert=true, iceandfire:silver_ore=true, iceandfire:siren_island=true, iceandfire:spawn_dragon_skeleton_ice=true, iceandfire:spawn_stymphalian_bird=true, iceandfire:fire_dragon_cave=true, iceandfire:sapphire_ore=true, iceandfire:spawn_hippocampus=true, iceandfire:spawn_death_worm=true} [00:02:03] [Server thread/INFO] [co.gi.al.ic.IceAndFire/]: {TROLL_S=true, HIPPOGRYPH=true, AMPHITHERE=true, COCKATRICE=true, TROLL_M=true, DREAD_LICH=true, TROLL_F=true} [00:02:03] [Server thread/INFO] [ne.be.lo.WeaponRegistry/]: Encoded Weapon Attribute registry size (with package overhead): 41976 bytes (in 5 string chunks with the size of 10000) [00:02:03] [Server thread/INFO] [patchouli/]: Sending reload packet to clients [00:02:03] [Server thread/WARN] [voicechat/]: [voicechat] Running in offline mode - Voice chat encryption is not secure! [00:02:03] [VoiceChatServerThread/INFO] [voicechat/]: [voicechat] Using server-ip as bind address: 0.0.0.0 [00:02:03] [Server thread/WARN] [ModernFix/]: Dedicated server took 22.521 seconds to load [00:02:03] [VoiceChatServerThread/INFO] [voicechat/]: [voicechat] Voice chat server started at 0.0.0.0:25565 [00:02:03] [Server thread/WARN] [minecraft/SynchedEntityData]: defineId called for: class net.minecraft.world.entity.player.Player from class tschipp.carryon.common.carry.CarryOnDataManager [00:02:03] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@2941ffd5 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 0 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 1 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 2 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 3 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 4 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 5 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 6 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 7 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 8 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 9 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 10 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 11 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 12 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 13 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 14 [00:02:19] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@ebc7ef2 [00:02:19] [Server thread/INFO] [minecraft/PlayerList]: ZacAdos[/90.2.17.162:49242] logged in with entity id 1062 at (-1848.6727005281205, 221.0, -3054.2468255848935) [00:02:19] [Server thread/ERROR] [ModernFix/]: Skipping entity ID sync for com.talhanation.smallships.world.entity.ship.Ship: java.lang.NoClassDefFoundError: net/minecraft/client/CameraType [00:02:19] [Server thread/INFO] [minecraft/MinecraftServer]: - Gloop - ZacAdos joined the game [00:02:19] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Updating all forceload tickets for cc56befd-d376-3526-a760-340713c478bd [00:02:19] [Server thread/INFO] [se.mi.te.da.DataManager/]: Sending data to client: ZacAdos [00:02:19] [Server thread/INFO] [voicechat/]: [voicechat] Received secret request of - Gloop - ZacAdos (17) [00:02:19] [Server thread/INFO] [voicechat/]: [voicechat] Sent secret to - Gloop - ZacAdos [00:02:21] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Successfully authenticated player cc56befd-d376-3526-a760-340713c478bd [00:02:22] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Successfully validated connection of player cc56befd-d376-3526-a760-340713c478bd [00:02:22] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Player - Gloop - ZacAdos (cc56befd-d376-3526-a760-340713c478bd) successfully connected to voice chat stop [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping the server [00:02:34] [Server thread/INFO] [mo.pl.ar.ArmourersWorkshop/]: stop local service [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [00:02:34] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: ZacAdos lost connection: Server closed [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: - Gloop - ZacAdos left the game [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Updating all forceload tickets for cc56befd-d376-3526-a760-340713c478bd [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_end [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_nether [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (world): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage: All dimensions are saved [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Stopping IO worker... [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Stopped IO worker! [00:02:34] [Server thread/INFO] [Calio/]: Removing Dynamic Registries for: net.minecraft.server.dedicated.DedicatedServer@7dc879e1 [MineStrator Daemon]: Checking server disk space usage, this could take a few seconds... [MineStrator Daemon]: Updating process configuration files... [MineStrator Daemon]: Ensuring file permissions are set correctly, this could take a few seconds... [MineStrator Daemon]: Pulling Docker container image, this could take a few minutes to complete... [MineStrator Daemon]: Finished pulling Docker container image container@pterodactyl~ java -version openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7) OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing) container@pterodactyl~ java -Xms128M -Xmx6302M -Dterminal.jline=false -Dterminal.ansi=true -Djline.terminal=jline.UnsupportedTerminal -p libraries/cpw/mods/bootstraplauncher/1.1.2/bootstraplauncher-1.1.2.jar:libraries/cpw/mods/securejarhandler/2.1.4/securejarhandler-2.1.4.jar:libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:libraries/net/minecraftforge/JarJarFileSystems/0.3.16/JarJarFileSystems-0.3.16.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-opens java.base/java.lang.invoke=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming -Djava.net.preferIPv6Addresses=system -DignoreList=bootstraplauncher-1.1.2.jar,securejarhandler-2.1.4.jar,asm-commons-9.5.jar,asm-util-9.5.jar,asm-analysis-9.5.jar,asm-tree-9.5.jar,asm-9.5.jar,JarJarFileSystems-0.3.16.jar -DlibraryDirectory=libraries -DlegacyClassPath=libraries/cpw/mods/securejarhandler/2.1.4/securejarhandler-2.1.4.jar:libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:libraries/net/minecraftforge/accesstransformers/8.0.4/accesstransformers-8.0.4.jar:libraries/org/antlr/antlr4-runtime/4.9.1/antlr4-runtime-4.9.1.jar:libraries/net/minecraftforge/eventbus/6.0.3/eventbus-6.0.3.jar:libraries/net/minecraftforge/forgespi/6.0.0/forgespi-6.0.0.jar:libraries/net/minecraftforge/coremods/5.0.1/coremods-5.0.1.jar:libraries/cpw/mods/modlauncher/10.0.8/modlauncher-10.0.8.jar:libraries/net/minecraftforge/unsafe/0.2.0/unsafe-0.2.0.jar:libraries/com/electronwill/night-config/core/3.6.4/core-3.6.4.jar:libraries/com/electronwill/night-config/toml/3.6.4/toml-3.6.4.jar:libraries/org/apache/maven/maven-artifact/3.8.5/maven-artifact-3.8.5.jar:libraries/net/jodah/typetools/0.8.3/typetools-0.8.3.jar:libraries/net/minecrell/terminalconsoleappender/1.2.0/terminalconsoleappender-1.2.0.jar:libraries/org/jline/jline-reader/3.12.1/jline-reader-3.12.1.jar:libraries/org/jline/jline-terminal/3.12.1/jline-terminal-3.12.1.jar:libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar:libraries/org/openjdk/nashorn/nashorn-core/15.3/nashorn-core-15.3.jar:libraries/net/minecraftforge/JarJarSelector/0.3.16/JarJarSelector-0.3.16.jar:libraries/net/minecraftforge/JarJarMetadata/0.3.16/JarJarMetadata-0.3.16.jar:libraries/net/minecraftforge/fmlloader/1.19.2-43.3.0/fmlloader-1.19.2-43.3.0.jar:libraries/net/minecraft/server/1.19.2-20220805.130853/server-1.19.2-20220805.130853-extra.jar:libraries/com/github/oshi/oshi-core/5.8.5/oshi-core-5.8.5.jar:libraries/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar:libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:libraries/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar:libraries/com/mojang/authlib/3.11.49/authlib-3.11.49.jar:libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar:libraries/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar:libraries/com/mojang/javabridge/1.2.24/javabridge-1.2.24.jar:libraries/com/mojang/logging/1.0.0/logging-1.0.0.jar:libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:libraries/io/netty/netty-buffer/4.1.77.Final/netty-buffer-4.1.77.Final.jar:libraries/io/netty/netty-codec/4.1.77.Final/netty-codec-4.1.77.Final.jar:libraries/io/netty/netty-common/4.1.77.Final/netty-common-4.1.77.Final.jar:libraries/io/netty/netty-handler/4.1.77.Final/netty-handler-4.1.77.Final.jar:libraries/io/netty/netty-resolver/4.1.77.Final/netty-resolver-4.1.77.Final.jar:libraries/io/netty/netty-transport/4.1.77.Final/netty-transport-4.1.77.Final.jar:libraries/io/netty/netty-transport-classes-epoll/4.1.77.Final/netty-transport-classes-epoll-4.1.77.Final.jar:libraries/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final-linux-x86_64.jar:libraries/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final-linux-aarch_64.jar:libraries/io/netty/netty-transport-native-unix-common/4.1.77.Final/netty-transport-native-unix-common-4.1.77.Final.jar:libraries/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.jar:libraries/net/java/dev/jna/jna/5.10.0/jna-5.10.0.jar:libraries/net/java/dev/jna/jna-platform/5.10.0/jna-platform-5.10.0.jar:libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar:libraries/org/apache/logging/log4j/log4j-api/2.17.0/log4j-api-2.17.0.jar:libraries/org/apache/logging/log4j/log4j-core/2.17.0/log4j-core-2.17.0.jar:libraries/org/apache/logging/log4j/log4j-slf4j18-impl/2.17.0/log4j-slf4j18-impl-2.17.0.jar:libraries/org/slf4j/slf4j-api/1.8.0-beta4/slf4j-api-1.8.0-beta4.jar cpw.mods.bootstraplauncher.BootstrapLauncher --launchTarget forgeserver --fml.forgeVersion 43.3.0 --fml.mcVersion 1.19.2 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20220805.130853 [00:02:42] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 43.3.0, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [00:02:42] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.10 by Eclipse Adoptium; OS Linux arch amd64 version 6.1.0-12-amd64 [00:02:43] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/home/container/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2363!/ Service=ModLauncher Env=SERVER [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/fmlcore/1.19.2-43.3.0/fmlcore-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/javafmllanguage/1.19.2-43.3.0/javafmllanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/lowcodelanguage/1.19.2-43.3.0/lowcodelanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/mclanguage/1.19.2-43.3.0/mclanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:44] [main/WARN] [ne.mi.ja.se.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [00:02:44] [main/WARN] [ne.mi.ja.se.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: /home/container/mods/resourcefullib-forge-1.19.2-1.1.24.jar [00:02:44] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: Found 13 dependencies adding them to mods collection Latest log [29Mar2024 00:02:42.803] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 43.3.0, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [29Mar2024 00:02:42.805] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.10 by Eclipse Adoptium; OS Linux arch amd64 version 6.1.0-12-amd64 [29Mar2024 00:02:43.548] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/home/container/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2363!/ Service=ModLauncher Env=SERVER [29Mar2024 00:02:43.876] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/fmlcore/1.19.2-43.3.0/fmlcore-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.877] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/javafmllanguage/1.19.2-43.3.0/javafmllanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.877] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/lowcodelanguage/1.19.2-43.3.0/lowcodelanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.878] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/mclanguage/1.19.2-43.3.0/mclanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:44.033] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [29Mar2024 00:02:44.034] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: /home/container/mods/resourcefullib-forge-1.19.2-1.1.24.jar [29Mar2024 00:02:44.034] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 13 dependencies adding them to mods collection
    • I am unable to do that. Brigadier is a mojang library that parses commands.
  • Topics

×
×
  • Create New...

Important Information

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