Jump to content

1.11 Right Clicking Custom Block with custom Crafting Crash


Heltrato

Recommended Posts

Hello im back again after fixing the glitch on armor ( lol it was about the getArmorModel )

anyways im having crash whenever i right click my hunter bench block. This does not happen from 1.7.10. Almost all code is the same no changes 

 

 

Here is the crash report

 

---- Minecraft Crash Report ----
// You're mean.
Time: 4/23/17 12:50 AM
Description: Unexpected error
java.lang.NullPointerException: The validated object is null
    at org.apache.commons.lang3.Validate.notNull(Validate.java:222)
    at org.apache.commons.lang3.Validate.notNull(Validate.java:203)
    at net.minecraft.util.NonNullList.set(NonNullList.java:48)
    at net.minecraft.inventory.InventoryCraftResult.setInventorySlotContents(InventoryCraftResult.java:88)
    at mhfc.net.client.container.ContainerHunterBench.onCraftMatrixChanged(ContainerHunterBench.java:106)
    at mhfc.net.client.container.ContainerHunterBench.<init>(ContainerHunterBench.java:101)
    at mhfc.net.client.gui.GuiHunterBench.<init>(GuiHunterBench.java:392)
    at mhfc.net.common.eventhandler.MHFCGuiHandler.getClientGuiElement(MHFCGuiHandler.java:39)
    at net.minecraftforge.fml.common.network.NetworkRegistry.getLocalGuiContainer(NetworkRegistry.java:273)
    at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:110)
    at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2725)
    at mhfc.net.common.block.container.BlockHunterBench.onBlockActivated(BlockHunterBench.java:48)
    at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:442)
    at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1612)
    at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2282)
    at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2059)
    at net.minecraft.client.Minecraft.runTick(Minecraft.java:1847)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1125)
    at net.minecraft.client.Minecraft.run(Minecraft.java:405)
    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:26)

 

 

The first crash heading to 

 

 

@Override
    public void onCraftMatrixChanged(IInventory par1IInventory) {
        this.craftResult.setInventorySlotContents(0,MHFCCraftingManager.getInstance()
                .findMatchingRecipe(this.craftMatrix, this.worldObj));
    }

 

 

2nd crash pointing

 this.onCraftMatrixChanged(this.craftMatrix);

      

 

 

3rd

public GuiHunterBench(
            InventoryPlayer par1InventoryPlayer,
            World par2World,
            TileHunterBench tileEntity,
            int x,
            int y,
            int z) {
        super(new ContainerHunterBench(par1InventoryPlayer, par2World, tileEntity, x, y, z));
        this.tileEntity = tileEntity;
        this.xSize = 374;
        this.ySize = 220;
        mc = Minecraft.getMinecraft();
        width = MHFCGuiUtil.minecraftWidth(mc);
        height = MHFCGuiUtil.minecraftHeight(mc);
        this.guiLeft = (width - this.xSize - tabWidth) / 2 + tabWidth;
        this.guiTop = (height - this.ySize) / 2;
        this.addTab(new CraftArmorTab(tileEntity), "Armor");
        this.addTab(new CraftWeaponTab(tileEntity), "Weapons");
        this.addTab(new CraftUpgradeTab(tileEntity), "Upgrade");
        this.addTab(new WeaponTreeTab(), "Weapon tree");
        startCrafting = new GuiButton(0, guiLeft + 228 + (xSize - 228 - 60) / 2, guiTop + 166, 40, 20, "Craft") {
            @Override
            public void mouseReleased(int p_146118_1_, int p_146118_2_) {
                GuiHunterBench.this.tileEntity.beginCrafting();
            }
        };
        selectTab();
    }

 

 

 

Lastly

 

 

              @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
        switch (ID) {
        case MHFCContainerRegistry.gui_hunterbench_id:
            TileEntity tE = world.getTileEntity(new BlockPos(x, y, z));
            if (tE instanceof TileHunterBench) {
                return new GuiHunterBench(player.inventory, world, (TileHunterBench) tE, x, y, z);
            } else {
                MHFCMain.logger().debug(
                        "Tried to open hunter bench gui for block at {} {} {} which does not have a hunter bench tile entity",
                        x,
                        y,
                        z);
            }
            break;
        case MHFCContainerRegistry.gui_questgiver_id:
            return GuiQuestGiver.getScreen(x, player);
        case MHFCContainerRegistry.gui_questboard_id:
            return GuiQuestBoard.getQuestBoard(player);
        case MHFCContainerRegistry.gui_queststatus_id:
            return new QuestStatusInventory(player);
        case MHFCContainerRegistry.gui_changearea_id:
            return getChangeAreaGui(world, x, y, z);
        }
        return null;
    }

 

Here is my block class

 

package mhfc.net.common.block.container;

import mhfc.net.MHFCMain;
import mhfc.net.common.core.registry.MHFCContainerRegistry;
import mhfc.net.common.index.ResourceInterface;
import mhfc.net.common.tile.TileHunterBench;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class BlockHunterBench extends BlockContainer {

	public BlockHunterBench() {
		super(Material.ROCK);
		setUnlocalizedName(ResourceInterface.block_hunterbench_name);
		setHardness(1.2F);
		setCreativeTab(MHFCMain.mhfctabs);
	}

	@Override
	public TileEntity createNewTileEntity(World world, int var1) {
		return new TileHunterBench();
	}

	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}

	@Override
	public boolean onBlockActivated(
			World worldIn,
			BlockPos pos,
			IBlockState state,
			EntityPlayer player,
			EnumHand hand,
			EnumFacing side,
			float hitX,
			float hitY,
			float hitZ) {
		if (!player.isSneaking()) {
			player.openGui(
					MHFCMain.instance(),
					MHFCContainerRegistry.gui_hunterbench_id,
					worldIn,
					pos.getX(),
					pos.getY(),
					pos.getZ());
			return true;
		}
		return false;
	}

}

 

Link to comment
Share on other sites

You're calling IInventory#setInventorySlotContents with a null value (returned by MHFCCraftingManager#findMatchingRecipe), which is invalid.

 

ItemStacks can no longer be null in 1.11.x, the default value is now the empty ItemStack (i.e. any ItemStack that returns true from ItemStack#isEmpty). The ItemStack.EMPTY field contains an ItemStack that's always empty.

Edited by Choonster
  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

17 minutes ago, Heltrato said:

Wait im confused. Which parrt is where the ItemStack is empty? Am i called it right?

 

MHFCCraftingManager#findMatchingRecipe is returning null (presumably because there's no matching recipe), which is no longer a valid value for an ItemStack. Instead of returning null, return ItemStack.EMPTY.

  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Okay so this is what i did.

As you can see i replace return null in ItemStack.EMPTY.

package mhfc.net.common.crafting;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import mhfc.net.common.crafting.recipes.MHFCShapedRecipes;
import mhfc.net.common.crafting.recipes.MHFCShapelessRecipe;
import net.minecraft.block.Block;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;

public class MHFCCraftingManager {
	private static final MHFCCraftingManager instance = new MHFCCraftingManager();

	private Set<IRecipe> recipes;

	public static final MHFCCraftingManager getInstance() {
		return instance;
	}

	public MHFCCraftingManager() {
		recipes = new LinkedHashSet<>();
	}

	// TODO: beautify this, is an akward method to add recipes
	// TODO rework this, pls, separation of concerns
	public ItemStack findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World) {
		int var3 = 0;
		ItemStack var4 = null;
		ItemStack var5 = null;
		int var6;

		for (var6 = 0; var6 < par1InventoryCrafting.getSizeInventory(); ++var6) {
			ItemStack var7 = par1InventoryCrafting.getStackInSlot(var6);

			if (var7 != null) {
				if (var3 == 0) {
					var4 = var7;
				}

				if (var3 == 1) {
					var5 = var7;
				}

				++var3;
			}
		}

		if (var3 == 2 && var4.getItem() == var5.getItem() && var4.getCount() == 1 && var5.getCount() == 1
				&& var5.getItem().isRepairable()) {
			Item var11 = var5.getItem();
			int var13 = var11.getMaxDamage() - var4.getItemDamage();
			int var8 = var11.getMaxDamage() - var5.getItemDamage();
			int var9 = var13 + var8 + var11.getMaxDamage() * 5 / 100;
			int var10 = var11.getMaxDamage() - var9;

			if (var10 < 0) {
				var10 = 0;
			}

			return new ItemStack(var4.getItem(), 1, var10);
		}

		for (IRecipe var12 : this.recipes) {
			if (var12.matches(par1InventoryCrafting, par2World)) {
				return var12.getCraftingResult(par1InventoryCrafting);
			}
		}

		return ItemStack.EMPTY;
	}

	public Set<IRecipe> getRecipeList() {
		return this.recipes;
	}

	public MHFCShapedRecipes addShapedRecipe(ItemStack par1ItemStack, Object... par2ArrayOfObj) {

		// TODO this should be moved into an constructor of shaped recipe
		String var3 = "";
		int var4 = 0;
		int var5 = 0;
		int var6 = 0;

		if (par2ArrayOfObj[var4] instanceof String[]) {
			String[] var7 = ((String[]) par2ArrayOfObj[var4++]);

			for (String var9 : var7) {
				++var6;
				var5 = var9.length();
				var3 = var3 + var9;
			}
		} else {
			while (par2ArrayOfObj[var4] instanceof String) {
				String var11 = (String) par2ArrayOfObj[var4++];
				++var6;
				var5 = var11.length();
				var3 = var3 + var11;
			}
		}

		HashMap<Character, ItemStack> var12 = new HashMap<>();

		for (; var4 < par2ArrayOfObj.length; var4 += 2) {
			Character var13 = (Character) par2ArrayOfObj[var4];
			ItemStack var14 = null;

			if (par2ArrayOfObj[var4 + 1] instanceof Item) {
				var14 = new ItemStack((Item) par2ArrayOfObj[var4 + 1]);
			} else if (par2ArrayOfObj[var4 + 1] instanceof Block) {
				var14 = new ItemStack((Block) par2ArrayOfObj[var4 + 1], 1, -1);
			} else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack) {
				var14 = (ItemStack) par2ArrayOfObj[var4 + 1];
			}

			var12.put(var13, var14);
		}

		ItemStack[] var15 = new ItemStack[var5 * var6];

		for (int var16 = 0; var16 < var5 * var6; ++var16) {
			char var10 = var3.charAt(var16);

			if (var12.containsKey(Character.valueOf(var10))) {
				var15[var16] = var12.get(Character.valueOf(var10)).copy();
			} else {
				var15[var16] = null;
			}
		}

		MHFCShapedRecipes var17 = new MHFCShapedRecipes(var5, var6, var15, par1ItemStack);
		this.recipes.add(var17);
		return var17;
	}

	public void addShapelessRecipe(ItemStack par1ItemStack, ItemStack... recipeStacks) {
		List<ItemStack> var3 = new ArrayList<>();
		var3.addAll(Arrays.asList(recipeStacks));
		this.recipes.add(new MHFCShapelessRecipe(par1ItemStack, var3));
	}

}

 

 

And ended up with this crash. It seems there is no mhfc package related.

 

---- Minecraft Crash Report ----
// You should try our sister game, Minceraft!

Time: 4/23/17 1:02 PM
Description: Rendering screen

java.lang.NullPointerException: Rendering screen
	at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:274)
	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:117)
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382)
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1164)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1146)
	at net.minecraft.client.Minecraft.run(Minecraft.java:405)
	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:26)


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

-- Head --
Thread: Client thread
Stacktrace:
	at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:274)
	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:117)
	at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382)

-- Screen render details --
Details:
	Screen name: mhfc.net.client.gui.GuiHunterBench
	Mouse location: Scaled: (213, 119). Absolute: (427, 240)
	Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player694'/0, l='MpServer', x=522.75, y=4.00, z=319.43]]
	Chunk stats: MultiplayerChunkCache: 81, 81
	Level seed: 0
	Level generator: ID 01 - flat, ver 0. Features enabled: false
	Level generator options: 
	Level spawn location: World: (529,4,332), Chunk: (at 1,0,12 in 33,20; contains blocks 528,0,320 to 543,255,335), Region: (1,0; contains chunks 32,0 to 63,31, blocks 512,0,0 to 1023,255,511)
	Level time: 3932 game time, 1 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: 1 total; [EntityPlayerSP['Player694'/0, l='MpServer', x=522.75, y=4.00, z=319.43]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:451)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2780)
	at net.minecraft.client.Minecraft.run(Minecraft.java:426)
	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:26)

-- System Details --
Details:
	Minecraft Version: 1.11
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_102, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 872090520 bytes (831 MB) / 1621098496 bytes (1546 MB) up to 3797417984 bytes (3621 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.35 Powered by Forge 13.19.1.2189 6 mods loaded, 6 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11-13.19.1.2189.jar) 
	UCHIJAAAA	forge{13.19.1.2189} [Minecraft Forge] (forgeSrc-1.11-13.19.1.2189.jar) 
	UCHIJAAAA	mcanm{2.6.0.125} [Minecraft Animated] (MCAnm-v2.6.0-deobf.jar) 
	UCHIJAAAA	worldedit{6.1.6} [WorldEdit] (worldedit-forge-mc1.11-6.1.6-dev.jar) 
	UCHIJAAAA	mhfc{${version}} [§6Monster Hunter Frontier Craft] (bin) 
	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 353.82' Renderer: 'GeForce 920M/PCIe/SSE2'
	Launched Version: 1.11
	LWJGL: 2.9.4
	OpenGL: GeForce 920M/PCIe/SSE2 GL version 4.5.0 NVIDIA 353.82, 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: PureBDcraft  64x MC19.zip
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 4x Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz

 

Link to comment
Share on other sites

8 minutes ago, Heltrato said:

java.lang.NullPointerException: Rendering screen
	at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:274)
	at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:117)

 

This exception is thrown when GuiContainer tries to render a Slot with a null ItemStack in it.

 

MHFCCraftingManager is still using null ItemStacks in several places, you need to fix this.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Update:gone to slothunter bench and replaced all null into ItemStack.Empty . but holly molyy now my minecraft hangs..

 

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

Time: 4/23/17 2:40 PM
Description: Ticking player

java.lang.NullPointerException: Ticking player
	at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:442)
	at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:89)
	at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:292)
	at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2134)
	at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:879)
	at net.minecraft.world.World.updateEntity(World.java:2101)
	at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:676)
	at net.minecraft.world.World.updateEntities(World.java:1890)
	at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:647)
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:794)
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698)
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547)
	at java.lang.Thread.run(Unknown Source)


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

-- Head --
Thread: Server thread
Stacktrace:
	at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:442)
	at net.minecraft.inventory.Container.detectAndSendChanges(Container.java:89)
	at net.minecraft.entity.player.EntityPlayerMP.onUpdate(EntityPlayerMP.java:292)
	at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2134)
	at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:879)
	at net.minecraft.world.World.updateEntity(World.java:2101)

-- Player being ticked --
Details:
	Entity Type: null (net.minecraft.entity.player.EntityPlayerMP)
	Entity ID: 0
	Entity Name: Player512
	Entity's Exact location: 634.70, 4.00, -736.15
	Entity's Block location: World: (634,4,-737), Chunk: (at 10,0,15 in 39,-47; contains blocks 624,0,-752 to 639,255,-737), Region: (1,-2; contains chunks 32,-64 to 63,-33, blocks 512,0,-1024 to 1023,255,-513)
	Entity's Momentum: 0.00, -0.08, 0.00
	Entity's Passengers: []
	Entity's Vehicle: ~~ERROR~~ NullPointerException: null
Stacktrace:
	at net.minecraft.world.WorldServer.tickPlayers(WorldServer.java:676)
	at net.minecraft.world.World.updateEntities(World.java:1890)
	at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:647)

-- Affected level --
Details:
	Level name: New World
	All players: 1 total; [EntityPlayerMP['Player512'/0, l='New World', x=634.70, y=4.00, z=-736.15]]
	Chunk stats: ServerChunkCache: 256 Drop: 0
	Level seed: 1928336456568822493
	Level generator: ID 01 - flat, ver 0. Features enabled: false
	Level generator options: 
	Level spawn location: World: (645,4,-733), Chunk: (at 5,0,3 in 40,-46; contains blocks 640,0,-736 to 655,255,-721), Region: (1,-2; contains chunks 32,-64 to 63,-33, blocks 512,0,-1024 to 1023,255,-513)
	Level time: 2825 game time, 0 day time
	Level dimension: 0
	Level storage version: 0x04ABD - Anvil
	Level weather: Rain time: 98798 (now: false), thunder time: 45343 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:794)
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698)
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547)
	at java.lang.Thread.run(Unknown Source)

-- System Details --
Details:
	Minecraft Version: 1.11
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_102, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 533167192 bytes (508 MB) / 1945108480 bytes (1855 MB) up to 3797417984 bytes (3621 MB)
	JVM Flags: 0 total; 
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.35 Powered by Forge 13.19.1.2189 6 mods loaded, 6 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
	UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.11-13.19.1.2189.jar) 
	UCHIJAAAA	forge{13.19.1.2189} [Minecraft Forge] (forgeSrc-1.11-13.19.1.2189.jar) 
	UCHIJAAAA	mcanm{2.6.0.125} [Minecraft Animated] (MCAnm-v2.6.0-deobf.jar) 
	UCHIJAAAA	worldedit{6.1.6} [WorldEdit] (worldedit-forge-mc1.11-6.1.6-dev.jar) 
	UCHIJAAAA	mhfc{${version}} 6Monster Hunter Frontier Craft] (bin) 
	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['Player512'/0, l='New World', x=634.70, y=4.00, z=-736.15]]
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'fml,forge'

 

 

[14:39:59] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@6eb98739[id=4296a45d-fd1d-3a8b-9f25-0f078d10cc6b,name=Player512,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
	at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[YggdrasilAuthenticationService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) [YggdrasilMinecraftSessionService.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) [YggdrasilMinecraftSessionService$1.class:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) [YggdrasilMinecraftSessionService$1.class:?]
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
	at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) [YggdrasilMinecraftSessionService.class:?]
	at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3062) [Minecraft.class:?]
	at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:138) [SkinManager$3.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_102]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_102]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_102]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
[14:40:07] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException: The validated object is null
	at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]
	at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]
	at net.minecraft.util.Util.runTask(Util.java:27) [Util.class:?]
	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:753) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) [MinecraftServer.class:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
Caused by: java.lang.NullPointerException: The validated object is null
	at org.apache.commons.lang3.Validate.notNull(Validate.java:222) ~[commons-lang3-3.3.2.jar:3.3.2]
	at org.apache.commons.lang3.Validate.notNull(Validate.java:203) ~[commons-lang3-3.3.2.jar:3.3.2]
	at net.minecraft.util.NonNullList.add(NonNullList.java:54) ~[NonNullList.class:?]
	at java.util.AbstractList.add(Unknown Source) ~[?:1.8.0_102]
	at net.minecraft.inventory.Container.getInventory(Container.java:64) ~[Container.class:?]
	at net.minecraft.inventory.Container.addListener(Container.java:53) ~[Container.class:?]
	at net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:100) ~[FMLNetworkHandler.class:?]
	at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2725) ~[EntityPlayer.class:?]
	at mhfc.net.common.block.container.BlockHunterBench.onBlockActivated(BlockHunterBench.java:41) ~[BlockHunterBench.class:?]
	at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:474) ~[PlayerInteractionManager.class:?]
	at net.minecraft.network.NetHandlerPlayServer.processTryUseItemOnBlock(NetHandlerPlayServer.java:701) ~[NetHandlerPlayServer.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?]
	at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?]
	at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]
	at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]
	at net.minecraft.util.Util.runTask(Util.java:26) ~[Util.class:?]
	... 5 more

 

Edited by Heltrato
not ocmplete
Link to comment
Share on other sites

You still have a null ItemStack somewhere in the inventory used by the Container. To narrow it down, set a breakpoint inside the for loop Container#getInventory with the condition inventorySlots.get(i).getStack() == null (i.e. the Slot's ItemStack is null). When the breakpoint is hit, look at the Slot's inventory (Slot#inventory or SlotItemHandler#itemHandler) and index (Slot#slotIndex) to see which inventory slot contains the null ItemStack.

 

Once you know where the null ItemStack is, you can figure out where that slot is set from and why it's being set to null.

 

To help avoid errors like this, annotate any ItemStack return value or parameter with @Nonnull. Your IDE will warn you when you return a nullable value from a @Nonnull method or pass a nullable value to a @Nonnull parameter.

 

If you copy the package-info.java file from a vanilla package into your own packages, the @MethodsReturnNonnullByDefault and @ParametersAreNonnullByDefault annotations will tell your IDE that the methods and parameters in that package are @Nonnull by default. Use @Nullable if a method can return or accept null values.

Edited by Choonster
  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Update i started debugging this line

 

 

  public NonNullList<ItemStack> getInventory()
    {
        NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>create();

        for (int i = 0; i < this.inventorySlots.size(); ++i)
        {
            nonnulllist.add(((Slot)this.inventorySlots.get(i)).getStack());  // <--- BREAKPOINT HERE.
        }

        return nonnulllist;
    }

 

But after i created a new world it begans to stop

havent opening the block yet.

Edited by Heltrato
Link to comment
Share on other sites

Quote

NonNullList<ItemStack> nonnulllist = NonNullList.<ItemStack>create();

Don't think that that is proper Java syntax there

Just call NonNullList.create().

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

57 minutes ago, Heltrato said:

Update i started debugging this line

 

But after i created a new world it begans to stop

havent opening the block yet.

 

Did you set a condition for the breakpoint like I said? If you did, it should only trigger when you right click on the block to open the GUI.

 

30 minutes ago, Heltrato said:

I able to bypass the world load by disabling the line and enabiling as soon as i right click the block. Now i see a NULL at defaultElement then i set it as ItemStack.EMPTY.

 

That's not the field I told you to look at. It's normal for that field to be null.

 

16 minutes ago, Matryoshika said:

Don't think that that is proper Java syntax there

Just call NonNullList.create().

 

It is valid, though not normally needed. That snippet of code is from vanilla, not the OP's mod.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

3 hours ago, Choonster said:

 

Did you set a condition for the breakpoint like I said? If you did, it should only trigger when you right click on the block to open the GUI.

 

 

That's not the field I told you to look at. It's normal for that field to be null.

 

 

It is valid, though not normally needed. That snippet of code is from vanilla, not the OP's mod.

Sorry Late reply i just took a nap anyways here is the progress.

 

 I added the conditions

 

and as far as my searching for nulls this is what i found 

Inside inventorySlots>elementData>[0..99]>[0](which is the Hunter Bench>inventory>stackresults etc.

 

 

 

Link to comment
Share on other sites

Somehow the InventoryCraftResult#stackResult NonNullList has an instance of Arrays.ArrayList as its delegate list but null as its default element. This shouldn't be possible unless the protected NonNullList(List<E>, E) constructor was called directly rather than being called through NonNullList#create or NonNullList#withSize.

 

Does ContainerHunterBench use the vanilla InventoryCraftResult class? Post the ContainerHunterBench, TileEntityHunterBench and InventoryCraftResult (if it's your own) classes.

  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

42 minutes ago, Choonster said:

Somehow the InventoryCraftResult#stackResult NonNullList has an instance of Arrays.ArrayList as its delegate list but null as its default element. This shouldn't be possible unless the protected NonNullList(List<E>, E) constructor was called directly rather than being called through NonNullList#create or NonNullList#withSize.

 

Does ContainerHunterBench use the vanilla InventoryCraftResult class? Post the ContainerHunterBench, TileEntityHunterBench and InventoryCraftResult (if it's your own) classes.

Yes it does wait up 

 

Container Hunter Bench

package mhfc.net.client.container;

import mhfc.net.client.gui.slot.SlotHunterBench;
import mhfc.net.common.core.registry.MHFCBlockRegistry;
import mhfc.net.common.crafting.MHFCCraftingManager;
import mhfc.net.common.tile.TileHunterBench;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class ContainerHunterBench extends Container {
	public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 5);
	public IInventory craftResult = new InventoryCraftResult();
	private World worldObj;
	private int posX;
	private int posY;
	private int posZ;

	public ContainerHunterBench(InventoryPlayer par1InventoryPlayer, World par2World, TileHunterBench tileEntity, int x,int y,int z) {
		this.worldObj = par2World;
		this.posX = x;
		this.posY = y;
		this.posZ = z;
		this.addSlotToContainer(
				new SlotHunterBench(
						par1InventoryPlayer.player,
						this.craftMatrix,
						this.craftResult,
						0,
						124 + 8,
						35 + 1));
		int var6;
		int var7;

		for (var6 = 0; var6 < 5; ++var6) {
			for (var7 = 0; var7 < 3; ++var7) {
				this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, var6 * 18 + 15));
			}
		}

		for (var6 = 0; var6 < 3; ++var6) {
			for (var7 = 0; var7 < 9; ++var7) {
				this.addSlotToContainer(
						new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 158 + var7 * 18, var6 * 18 + 15));
			}
		}

		for (var6 = 0; var6 < 9; ++var6) {
			this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 158 + var6 * 18, 84));
		}

		for (var6 = 0; var6 < 7; ++var6) {
			Slot s = new Slot(tileEntity, var6 + 3, var6 * 18 + 229, 28) {
				@Override
				public boolean isItemValid(ItemStack stack) {
					return false;
				}

				@Override
				public boolean canTakeStack(EntityPlayer p) {
					return false;
				}
			};
			this.addSlotToContainer(s);
		}

		for (var6 = 0; var6 < 7; ++var6) {
			this.addSlotToContainer(new Slot(tileEntity, var6 + 10, var6 * 18 + 229, 191) {
			});
		}

		this.addSlotToContainer(new Slot(tileEntity, TileHunterBench.resultSlot, 280, 146) {
			@Override
			public boolean isItemValid(ItemStack stack) {
				return false;
			}
		});

		this.addSlotToContainer(new Slot(tileEntity, TileHunterBench.fuelSlot, 354, 168));
		this.addSlotToContainer(new Slot(tileEntity, TileHunterBench.outputSlot, 335, 146));

		for (var6 = 0; var6 < 4; ++var6) {
			for (var7 = 0; var7 < 9; ++var7) {
				this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9, 7 + var6 * 18, var7 * 18 + 28));
			}
		}
		this.onCraftMatrixChanged(this.craftMatrix);
	}

	@Override
	public void onCraftMatrixChanged(IInventory par1IInventory) {
		this.craftResult.setInventorySlotContents(0,MHFCCraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj));
	}

	@Override
	public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
		return this.worldObj.getBlockState(new BlockPos(this.posX, this.posY, this.posZ))
				.getBlock() != MHFCBlockRegistry.getRegistry().mhfcblockhunterbench
						? false
						: par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64.0D;
	}

	@Override
	public void onContainerClosed(EntityPlayer par1EntityPlayer) {
		super.onContainerClosed(par1EntityPlayer);

		if (!this.worldObj.isRemote) {
			for (int i = 0; i < 15; ++i) {
				ItemStack itemstack = this.craftMatrix.getStackInSlot(i);

				if (itemstack != null) {
					par1EntityPlayer.dropItem(itemstack, false);
				}
			}
		}
	}

	@Override
	public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) {
		ItemStack var3 = null;
		Slot var4 = this.inventorySlots.get(par2);

		if (var4 != null && var4.getHasStack()) {
			ItemStack var5 = var4.getStack();
			var3 = var5.copy();

			if (par2 == 0) {
				if (!this.mergeItemStack(var5, 10, 46, true)) {
					return null;
				}

				var4.onSlotChange(var5, var3);
			} else if (par2 >= 10 && par2 < 37) {
				if (!this.mergeItemStack(var5, 37, 46, false)) {
					return null;
				}
			} else if (par2 >= 37 && par2 < 46) {
				if (!this.mergeItemStack(var5, 10, 37, false)) {
					return null;
				}
			} else if (!this.mergeItemStack(var5, 10, 46, false)) {
				return null;
			}

			if (var5.getCount() == 0) {
				var4.putStack((ItemStack) null);
			} else {
				var4.onSlotChanged();
			}

			if (var5.getCount() == var3.getCount()) {
				return null;
			}

			var4.onTake(par1EntityPlayer, var5);
		}

		return var3;
	}

	@Override
	public boolean canMergeSlot(ItemStack par1ItemStack, Slot par2Slot) {
		return par2Slot.inventory != this.craftResult && super.canMergeSlot(par1ItemStack, par2Slot);
	}
}

 

 

Tile Entity

 

package mhfc.net.common.tile;

import mhfc.net.common.core.registry.MHFCEquipementRecipeRegistry;
import mhfc.net.common.crafting.recipes.equipment.EquipmentRecipe;
import mhfc.net.common.crafting.recipes.equipment.EquipmentRecipe.RecipeType;
import mhfc.net.common.index.ResourceInterface;
import mhfc.net.common.network.PacketPipeline;
import mhfc.net.common.network.message.bench.MessageBeginCrafting;
import mhfc.net.common.network.message.bench.MessageBenchRefreshRequest;
import mhfc.net.common.network.message.bench.MessageCancelRecipe;
import mhfc.net.common.network.message.bench.MessageCraftingUpdate;
import mhfc.net.common.network.message.bench.MessageSetRecipe;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.ITickable;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TileHunterBench extends TileEntity implements ITickable, IInventory, TileMHFCUpdateStream {

	public static final int outputSlot = 2;
	public static final int fuelSlot = 0;
	public static final int resultSlot = 1;

	private ItemStack fuelStack;
	private ItemStack resultStack;
	private ItemStack[] recipeStacks;
	private ItemStack[] inputStacks;
	private ItemStack outputStack;

	/**
	 * How hot the furnace currently is
	 */
	volatile private int heatStrength;
	/**
	 * How hot the fire produced by the currently burning item is
	 */
	volatile private int heatFromItem;
	/**
	 * How long the furnace stays hot
	 */
	volatile private int heatLength;
	/**
	 * How long the furnace stayed hot initially with the burning item
	 */
	private int heatLengthInit;
	/**
	 * How long the current item has been smelting
	 */
	volatile private int itemSmeltDuration;
	/**
	 * The selected recipe
	 */
	private EquipmentRecipe recipe;
	/**
	 * If the recipe is currently worked on
	 */
	volatile private boolean workingMHFCBench;

	public TileHunterBench() {
		recipeStacks = new ItemStack[7];
		inputStacks = new ItemStack[recipeStacks.length];
		workingMHFCBench = false;
		heatLengthInit = 1;
	}

	@Override
	public int getSizeInventory() {
		return recipeStacks.length + inputStacks.length + 3;
	}

	@Override
	public void update() {
		if (heatLength > 0) {
			--heatLength;
			heatStrength = getNewHeat(heatStrength, heatFromItem);
			if (TileHunterBench.this.workingMHFCBench && recipe != null && heatStrength >= recipe.getRequiredHeat()) {
				++itemSmeltDuration;
			}
		} else {
			if (fuelStack != null && TileHunterBench.this.workingMHFCBench) {
				heatLength = TileEntityFurnace.getItemBurnTime(fuelStack);
				heatLengthInit = heatLength;
				heatFromItem = getItemHeat(fuelStack);
				decrStackSize(fuelSlot, 1);
				if (!world.isRemote) {
					sendUpdateCraft();
				}
			} else {
				heatStrength = getNewHeat(heatStrength, 0);
			}
		}
		if (recipe != null && itemSmeltDuration >= recipe.getDuration()) {
			finishRecipe();
		}
	}

	private void finishRecipe() {
		if (world.isRemote) {
			return;
		}
		inputStacks = new ItemStack[inputStacks.length];
		outputStack = resultStack.copy();
		workingMHFCBench = false;
		itemSmeltDuration = 0;
		sendUpdateCraft();
	}

	/**
	 * Forces the client to end the crafting and put the stack into the output slot. Unused
	 *
	 * @param stack
	 */
	@SideOnly(Side.CLIENT)
	public void forceEndCrafting(ItemStack stack) {
		outputStack = stack;
		inputStacks = new ItemStack[inputStacks.length];
		TileHunterBench.this.workingMHFCBench = false;
		itemSmeltDuration = 0;
	}

	public boolean isWorking() {
		return TileHunterBench.this.workingMHFCBench;
	}

	public void changeRecipe(EquipmentRecipe recipe) {
		if (world.isRemote) {
			sendSetRecipe(recipe);
		}
		if (recipe != this.recipe) {
			cancelRecipe();
			setRecipe(recipe);
		}
	}

	protected void setRecipe(EquipmentRecipe recipe) {
		if (recipe == null) {
			recipeStacks = new ItemStack[7];
			this.recipe = null;
			resultStack = null;
		} else {
			resultStack = recipe.getRecipeOutput();
			this.recipe = recipe;
			setIngredients(recipe);
		}
	}

	public void setIngredients(EquipmentRecipe recipe) {
		this.recipeStacks = recipe.getRequirements(7);
	}

	public static int getItemHeat(ItemStack itemStack) {
		if (itemStack == null) {
			return 0;
		}
		if (itemStack.getItem() == Item.getItemById(327)) {
			return 1000;
		}
		return 200;
	}

	private int getNewHeat(int heatOld, int heatAim) {
		int diff = heatAim - heatOld;
		// Some math to confuse the hell out of everyone reading this
		double change = Math.ceil(Math.log(Math.abs(diff) + 1.0));
		return heatOld + (int) (Math.ceil(change / 3.0) * Math.signum(diff));
	}

	@Override
	public ItemStack decrStackSize(int slot, int count) {
		markDirty();
		if (count <= 0) {
			return null;
		}
		// FIXME: can do that better...
		if (slot > recipeStacks.length + 2) {
			ItemStack stack = inputStacks[slot - recipeStacks.length - 3];
			if (stack == null) {
				return null;
			}
			cancelRecipe();
			if (count > stack.getCount()) {
				count = stack.getCount();
			}
			if (count == stack.getCount()) {
				inputStacks[slot - recipeStacks.length - 3] = null;
				return stack;
			}
			return stack.splitStack(count);
		}
		if (slot > 2) {
			return null; // You cant get anything from the recipe slots
		} else if (slot == outputSlot) {
			if (outputStack == null) {
				return null;
			}
			if (count > outputStack.getCount()) {
				count = outputStack.getCount();
			}
			if (count == outputStack.getCount()) {
				ItemStack fuel = outputStack;
				outputStack = null;
				return fuel;
			}
			return outputStack.splitStack(count);
		} else if (slot == resultSlot) {
			return null;
		} else {
			if (fuelStack == null) {
				return null;
			}
			if (count > fuelStack.getCount()) {
				count = fuelStack.getCount();
			}
			if (count == fuelStack.getCount()) {
				ItemStack fuel = fuelStack;
				fuelStack = null;
				return fuel;
			}
			return fuelStack.splitStack(count);
		}
	}

	/**
	 * Resets all working progress but leaves the recipe set
	 */
	public void cancelRecipe() {
		if (world.isRemote) {
			sendCancelRecipe();
		}
		TileHunterBench.this.workingMHFCBench = false;
		itemSmeltDuration = 0;
	}

	@Override
	public ItemStack removeStackFromSlot(int index) {
		ItemStack stack = getStackInSlot(index);
		setInventorySlotContents(index, null);
		return stack;
	}

	@Override
	public ItemStack getStackInSlot(int i) {
		if (i < 0 || i >= getSizeInventory()) {
			return null;
		} else if (i >= recipeStacks.length + 3) {
			return inputStacks[i - 3 - recipeStacks.length];
		} else if (i >= 3) {
			return recipeStacks[i - 3];
		} else if (i == outputSlot) {
			return outputStack;
		} else if (i == resultSlot) {
			return resultStack;
		} else {
			return fuelStack;
		}
	}

	@Override
	public void setInventorySlotContents(int i, ItemStack itemstack) {
		if (i < 0 || i >= getSizeInventory()) {
			return;
		}
		if (i >= recipeStacks.length + 3) {
			inputStacks[i - recipeStacks.length - 3] = itemstack;
		} else if (i >= 3) {
			recipeStacks[i - 3] = itemstack;
		} else if (i == outputSlot) {
			outputStack = itemstack;
		} else if (i == resultSlot) {
			resultStack = itemstack;
		} else if (i == fuelSlot) {
			fuelStack = itemstack;
		}
		markDirty();
	}

	public boolean isInvNameLocalized() {
		return false;
	}

	@Override
	public boolean isEmpty() {
		for (ItemStack stack : inputStacks) {
			if (!stack.isEmpty()) {
				return false;
			}
		}
		return true;
	}

	@Override
	public int getInventoryStackLimit() {
		return 64;
	}

	@Override
	public boolean isUsableByPlayer(EntityPlayer entityplayer) {
		return getDistanceSq(entityplayer.posX, entityplayer.posY, entityplayer.posZ) <= 64.0f;
	}

	@Override
	public boolean isItemValidForSlot(int i, ItemStack itemstack) {
		return (i == fuelSlot && TileEntityFurnace.isItemFuel(itemstack))
				|| (i > recipeStacks.length + 2 && i < recipeStacks.length * 2 + 3);
	}

	@Override
	public ITextComponent getDisplayName() {
		return new TextComponentTranslation(getName());
	}

	public boolean beginCrafting() {
		if (world.isRemote) {
			sendBeginCraft();
		}
		if (canBeginCrafting()) {
			TileHunterBench.this.workingMHFCBench = true;
		}
		return TileHunterBench.this.workingMHFCBench;
	}

	@SideOnly(Side.CLIENT)
	private void sendBeginCraft() {
		PacketPipeline.networkPipe.sendToServer(new MessageBeginCrafting(this));
	}

	@SideOnly(Side.CLIENT)
	private void sendSetRecipe(EquipmentRecipe recipeToSend) {
		PacketPipeline.networkPipe.sendToServer(new MessageSetRecipe(this, recipeToSend));
	}

	@SideOnly(Side.CLIENT)
	private void sendCancelRecipe() {
		PacketPipeline.networkPipe.sendToServer(new MessageCancelRecipe(this));
	}

	@Override
	public void refreshState() {
		if (world.isRemote) {
			PacketPipeline.networkPipe.sendToServer(new MessageBenchRefreshRequest(this));
		}
	}

	private void sendUpdateCraft() {
		PacketPipeline.networkPipe.sendToAll(new MessageCraftingUpdate(this));
	}

	public boolean canBeginCrafting() {
		return (recipe != null) && matchesInputOutput() && (outputStack == null);
	}

	protected boolean matchesInputOutput() {
		for (int i = 0; i < inputStacks.length; i++) {
			if (!ItemStack.areItemStacksEqual(inputStacks[i], recipeStacks[i])) {
				return false;
			}
		}
		return true;
	}

	public int getHeatStrength() {
		return heatStrength;
	}

	public int getBurningItemHeat() {
		return heatFromItem;
	}

	public int getHeatLength() {
		return heatLength;
	}

	public int getHeatLengthOriginal() {
		return heatLengthInit;
	}

	public int getItemSmeltDuration() {
		return itemSmeltDuration;
	}

	@Override
	public void readFromNBT(NBTTagCompound nbtTag) {
		super.readFromNBT(nbtTag);
		readCustomUpdate(nbtTag);

		NBTTagList items = nbtTag.getTagList("Items", 10);
		for (int a = 0; a < items.tagCount(); a++) {
			NBTTagCompound stack = items.getCompoundTagAt(a);
			byte id = stack.getByte("Slot");
			if (id >= 0 && id < getSizeInventory()) {
				setInventorySlotContents(id, new ItemStack(stack));
			}
		}
	}

	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound nbtTag) {
		nbtTag = super.writeToNBT(nbtTag);
		storeCustomUpdate(nbtTag);

		NBTTagList itemsStored = new NBTTagList();
		for (int a = 0; a < getSizeInventory(); a++) {
			ItemStack s = getStackInSlot(a);
			if (s != null) {
				NBTTagCompound tag = new NBTTagCompound();
				tag.setByte("Slot", (byte) a);
				s.writeToNBT(tag);
				itemsStored.appendTag(tag);
			}
		}
		nbtTag.setTag("Items", itemsStored);
		return nbtTag;
	}

	public EquipmentRecipe getRecipe() {
		return recipe;
	}

	private static final String heatStrID = "heatStrength";
	private static final String heatFromItemID = "heatFromItem";
	private static final String heatLengthID = "heatLength";
	private static final String heatLengthInitID = "heatLengthInit";
	private static final String itemSmeltDurationID = "itemSmeltDuration";
	private static final String workingID = "workingID";
	private static final String recipeTypeID = "recipeType";
	private static final String recipeIDID = "recipeID";

	@Override
	public void storeCustomUpdate(NBTTagCompound nbtTag) {
		nbtTag.setInteger(heatStrID, heatStrength);
		nbtTag.setInteger(heatFromItemID, heatFromItem);
		nbtTag.setInteger(heatLengthID, heatLength);
		nbtTag.setInteger(heatLengthInitID, heatLengthInit);
		nbtTag.setInteger(itemSmeltDurationID, itemSmeltDuration);
		nbtTag.setBoolean(workingID, TileHunterBench.this.workingMHFCBench);
		RecipeType type = recipe != null ? recipe.getRecipeType() : RecipeType.MHFC;
		int recipeID = MHFCEquipementRecipeRegistry.getIDFor(recipe);
		nbtTag.setInteger(recipeTypeID, type.ordinal());
		nbtTag.setInteger(recipeIDID, recipeID);
	}

	@Override
	public void readCustomUpdate(NBTTagCompound nbtTag) {
		heatStrength = nbtTag.getInteger(heatStrID);
		heatFromItem = nbtTag.getInteger(heatFromItemID);
		heatLength = nbtTag.getInteger(heatLengthID);
		heatLengthInit = nbtTag.getInteger(heatLengthInitID);
		itemSmeltDuration = nbtTag.getInteger(itemSmeltDurationID);
		TileHunterBench.this.workingMHFCBench = nbtTag.getBoolean(workingID);
		int irecType = nbtTag.getInteger(recipeTypeID);
		int recId = nbtTag.getInteger(recipeIDID);
		RecipeType recType = RecipeType.values()[irecType];
		setRecipe(MHFCEquipementRecipeRegistry.getRecipeFor(recId, recType));
	}

	@Override
	public String getName() {
		return "container" + ResourceInterface.block_hunterbench_name;
	}

	@Override
	public boolean hasCustomName() {
		return false;
	}

	@Override
	public void openInventory(EntityPlayer player) {}

	@Override
	public void closeInventory(EntityPlayer player) {}

	@Override
	public void clear() {
		for (int i = 0; i < getSizeInventory(); ++i) {
			removeStackFromSlot(i);
		}
	}

	@Override
	public int getField(int id) {
		throw new IllegalArgumentException("No such field: " + id);
	}

	@Override
	public void setField(int id, int value) {
		throw new IllegalArgumentException("No such field: " + id);
	}

	@Override
	public int getFieldCount() {
		return 0;
	}

}

 

 

I dont have my own inventory crafting i uses vanilla.

Link to comment
Share on other sites

You shouldn't be using or implementing IInventory or storing ItemStacks in arrays, create an IItemHandler field for each of the TileEntity's inventories and expose them using the Capability system. If you just need a temporary collection of ItemStacks without a formal inventory, use a NonNullList (created by calling NonNullList#withSize with ItemStack.EMPTY as the second argument) instead of an array.

 

This will help to eliminate any potential null ItemStacks.

Edited by Choonster
Fixed typo
  • Like 1

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.