Jump to content

[1.12.2] GuiContainer not opening onBlockActivated


GenElectrovise

Recommended Posts

Spoiler
Spoiler

Registering my GuiHandler



public static void initRegistries() {
	NetworkRegistry.INSTANCE.registerGuiHandler(Main.instance, new GuiHandler());
    }

 

AltarBase (Altar Block)


package com.magiksmostevile.blocks;

import java.util.Random;

import com.magiksmostevile.EvileLog;
import com.magiksmostevile.Main;
import com.magiksmostevile.EvileLog.EnumLogLevel;
import com.magiksmostevile.guis.GuiAltar;
import com.magiksmostevile.init.EvileBlocks;
import com.magiksmostevile.tileentity.TileEntityAltar;

import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityEnchantmentTable;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class AltarBase extends BlockBase implements ITileEntityProvider {
	public static AxisAlignedBB ALTAR_AABB = new AxisAlignedBB(0D, 0D, 0D, 1D, 1D, 1D);

	private World world;

	public AltarBase(String name, Material material) {
		super(name, material);
		EvileLog.logText(true, EnumLogLevel.INFO, "Constructing ALTAR");
		setHardness(5);
		setSoundType(SoundType.CLOTH);
	}

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

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

	@Override
	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
		return ALTAR_AABB;
	}

	// ======================================================================================================================
	// TILE ENTITY

	@Override
	public TileEntity createNewTileEntity(World worldIn, int meta) {
		EvileLog.logText(true, EnumLogLevel.INFO, "creating tile entity for ALTAR");
		return new TileEntityAltar();
	}

	@Override
	public boolean hasTileEntity(IBlockState state) {
		return true;
	}

	@Override
	public Item getItemDropped(IBlockState state, Random rand, int fortune) {
		return Item.getItemFromBlock(EvileBlocks.ALTAR);
	}

	@Override
	public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) {
		return new ItemStack(EvileBlocks.ALTAR);
	}

	@Override
	public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
		try {
			playerIn.sendMessage(new TextComponentString("Altar activated! +++++++++++++++++++++++++++"));
			if (!worldIn.isRemote) {
				playerIn.openGui(Main.instance, Main.GUI_ALTAR, worldIn, pos.getX(), pos.getY(), pos.getZ());
			}
		} catch (Exception e) {
			EvileLog.logText(true, EnumLogLevel.ERROR, "An error has occurred opening the GUI for Altar at : " + pos + " : This is not an intended feature! :/");
			e.printStackTrace();
		}

		return true;
	}

	private void openAltarGui(World worldIn, BlockPos pos, EntityPlayer playerIn) {
		playerIn.sendMessage(new TextComponentString("Opening altar gui, ID: " + Main.GUI_ALTAR));
		playerIn.openGui(Main.instance, Main.GUI_ALTAR, worldIn, pos.getX(), pos.getY(), pos.getZ());
	}

	@Override
	public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
		EvileLog.logText(true, EnumLogLevel.WARN, "Altar placed! Evile-ness incoming!");
	}

	public static void setState() {
		// TODO Check whether method needs population
	}

	@Override
	public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
		return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand);
	}

	@Override
	public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
		super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
	}

	@Override
	public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
		TileEntityAltar tileentity = (TileEntityAltar) worldIn.getTileEntity(pos);
		InventoryHelper.dropInventoryItems(worldIn, pos, tileentity);
		super.breakBlock(worldIn, pos, state);
	}

	@Override
	public EnumBlockRenderType getRenderType(IBlockState state) {
		return EnumBlockRenderType.MODEL;
	}

	@Override
	public IBlockState withRotation(IBlockState state, Rotation rot) {
		return super.withRotation(state, rot);
	}

	@Override
	public IBlockState withMirror(IBlockState state, Mirror mirrorIn) {
		return super.withMirror(state, mirrorIn);
	}

	@Override
	protected BlockStateContainer createBlockState() {
		return super.createBlockState();
	}

	@Override
	public IBlockState getStateFromMeta(int meta) {
		return super.getStateFromMeta(meta);
	}

	@Override
	public int getMetaFromState(IBlockState state) {
		return super.getMetaFromState(state);
	}

	// https://www.youtube.com/watch?v=JMdDf0PCxIE&list=PLiDUvCGH5WEUEV9nc0Ll2pzUFmSFc21uR&index=19&t=451s
}

 

Spoiler

TileEntityAltar


package com.magiksmostevile.tileentity;

import java.util.Iterator;

import com.google.common.collect.ImmutableMap;
import com.magiksmostevile.EvileLog;
import com.magiksmostevile.EvileLog.EnumLogLevel;
import com.magiksmostevile.Main;
import com.magiksmostevile.init.EvileItems;
import com.magiksmostevile.tileentity.container.ContainerAltar;

import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.block.BlockPotato;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerEnchantment;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.RightClickBlock;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TileEntityAltar extends TileEntity implements ITickable, IInventory, IInteractionObject {

	private NonNullList<ItemStack> inventory = NonNullList.<ItemStack>withSize(4, ItemStack.EMPTY);
	private String customName;
	private World world;
	private int currentRitual;

	public TileEntityAltar() {
		super();
		EvileLog.logText(true, EnumLogLevel.INFO, "Constructing altar tile entity");
	}

	public int getCurrentRitual() {
		return this.currentRitual;
	}

	public void setAltarRitual(World worldIn, BlockPos pos, int ritualToSet) {
		TileEntityAltar tileentity = (TileEntityAltar) worldIn.getTileEntity(pos);
		tileentity.currentRitual = ritualToSet;
	}

	public String getName() {
		return this.hasCustomName() ? this.customName : "container.altar";
	}

	public boolean hasCustomName() {
		return this.customName != null && !this.customName.isEmpty();
	}

	private void setCustomName(String customNameIn) {
		this.customName = customNameIn;
	}

	public ITextComponent getDisplayName() {
		return this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName());
	}

	@Override
	public void readFromNBT(NBTTagCompound compound) {
		super.readFromNBT(compound);
		this.inventory = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
		ItemStackHelper.loadAllItems(compound, this.inventory);
		this.currentRitual = compound.getInteger("CurrentRitual");

		if (compound.hasKey("CustomName", 8))
			this.setCustomName(compound.getString("CustomName"));
	}

	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
		super.writeToNBT(compound);
		compound.setInteger("CurrentRitual", (short) this.currentRitual);

		if (this.hasCustomName())
			compound.setString("CustomName", this.customName);
		return compound;
	}

	@Override
	public void onLoad() { // HELPFUL POST FOR GETTING WORLD>>>
		// https://www.minecraftforge.net/forum/topic/41640-world-and-position-empty-in-tile-entity/
		this.world = this.getWorld();
	}

	@Override
	public void update() {

	}

	@Override
	public int getSizeInventory() {
		return this.inventory.size();
	}

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

	@Override
	public ItemStack getStackInSlot(int index) {
		return (ItemStack) this.inventory.get(index);
	}

	@Override
	public ItemStack decrStackSize(int index, int count) {
		return ItemStackHelper.getAndSplit(this.inventory, index, count);
	}

	@Override
	public ItemStack removeStackFromSlot(int index) {
		return ItemStackHelper.getAndRemove(this.inventory, index);
	}

	@Override
	public void setInventorySlotContents(int index, ItemStack stack) {
		ItemStack itemstack = (ItemStack) this.inventory.get(index);
		boolean flag = !stack.isEmpty() && stack.isItemEqual(itemstack) && ItemStack.areItemStackTagsEqual(stack, itemstack);
		this.inventory.set(index, stack);

		if (stack.getCount() > this.getInventoryStackLimit()) {
			stack.setCount(this.getInventoryStackLimit());
		}
		if (index == 0 && index + 1 == 1 && !flag) {
			ItemStack stack1 = (ItemStack) this.inventory.get(index + 1);
			this.markDirty();

		}
	}

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

	@Override
	public boolean isUsableByPlayer(EntityPlayer player) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void openInventory(EntityPlayer player) {
		EvileLog.logText(true, EnumLogLevel.INFO, "Opening ALTAR_GUI");
		System.out.println("TileEntityAltar Opening ALTAR_GUI");
		player.openGui(Main.instance, Main.GUI_ALTAR, world, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ());

	}

	@Override
	public void closeInventory(EntityPlayer player) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isItemValidForSlot(int index, ItemStack stack) { // TODO Decide on slot allocation!!!!!!!
		if (index == 1) {
			return false;
		} else if (index != 2) {
			return true;
		} else {
			return true;
		}
	}

	public String getGuiID() {
		return "magiksmostevile:gui_altar";
	}

	@Override
	public int getField(int id) { // https://www.youtube.com/watch?v=PcZ4JgTqCU8&list=PLiDUvCGH5WEUEV9nc0Ll2pzUFmSFc21uR&index=19
		// TODO Decide slot allocation + see link! 12:22
		return 0;
	}

	@Override
	public void setField(int id, int value) {
		// TODO Auto-generated method stub

	}

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

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

	@Override
	public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {
		System.out.println("creating container for Altar GUI");
        return new ContainerAltar(playerInventory, this);
	}
	
	public String getGuiId() {
		return "magiksmostevile:gui_altar";
	}

}

 

Spoiler

ContainerAltar


package com.magiksmostevile.tileentity.container;

import com.magiksmostevile.tileentity.TileEntityAltar;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

public class ContainerAltar extends Container { // https://www.youtube.com/watch?v=rARVLYm9TBs&list=PLiDUvCGH5WEUEV9nc0Ll2pzUFmSFc21uR&index=22&t=366s

	private final TileEntityAltar tileentity;

	public ContainerAltar(InventoryPlayer player, TileEntityAltar tileentity) {
		this.tileentity = tileentity;

		System.out.println("Constructing ContainerAltar");

		this.addSlotToContainer(new Slot(tileentity, 0, 305, 185));
		this.addSlotToContainer(new Slot(tileentity, 1, 327, 185));
		this.addSlotToContainer(new Slot(tileentity, 2, 305, 208));
		this.addSlotToContainer(new Slot(tileentity, 3, 327, 208));

		for (int y = 0; y < 3; y++) {
			for (int x = 0; x < 9; x++) {
				this.addSlotToContainer(new Slot(player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
			}
		}

		for (int x = 0; x < 9; x++) {
			this.addSlotToContainer(new Slot(player, x, 8 + x * 18, 142));
		}
	}

	@Override
	public void addListener(IContainerListener listener) {
		super.addListener(listener);
		listener.sendAllWindowProperties(this, this.tileentity);
	}

	@Override
	public void detectAndSendChanges() {
		// TODO Auto-generated method stub
		super.detectAndSendChanges();
	}

	@Override
	public boolean canInteractWith(EntityPlayer playerIn) {
		return this.tileentity.isUsableByPlayer(playerIn);
	}

	@Override
	public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
		return super.transferStackInSlot(playerIn, index);
	}

}

 

Spoiler

GuiAltar


package com.magiksmostevile.guis;

import com.magiksmostevile.Main;
import com.magiksmostevile.tileentity.TileEntityAltar;
import com.magiksmostevile.tileentity.container.ContainerAltar;

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.util.ResourceLocation;

public class GuiAltar extends GuiContainer {

	private static final ResourceLocation TEXTURES = new ResourceLocation(Main.MODID, "textures/gui/altar/gui_altar.png");
	private final InventoryPlayer player;
	private final TileEntityAltar tileentity;

	public GuiAltar(InventoryPlayer player, TileEntityAltar tileentity) {
		super(new ContainerAltar(player, tileentity));
		this.player = player;
		this.tileentity = tileentity;
		System.out.println("path to textures" + TEXTURES.getResourcePath());
		System.out.println("path to textures" + TEXTURES.getResourceDomain());
	}

	@Override
	protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
		System.out.println("Drawing gui bg");
		GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
		this.mc.getTextureManager().bindTexture(TEXTURES);
		this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
	}

	@Override
	protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
		System.out.println("Drawing gui fg");
		String tileName = this.tileentity.getDisplayName().getUnformattedText();
		this.fontRenderer.drawString(tileName, (this.xSize / 2 - this.fontRenderer.getStringWidth(tileName) / 2) + 3, 115, 4210752);
		this.fontRenderer.drawString(this.player.getDisplayName().getUnformattedText(), 295, this.ySize - 96 + 2, 4210752);
	}

}

// https://www.minecraftforge.net/forum/topic/38014-19-solved-gui-doesnt-open-on-right-click/

 

Spoiler

GuiHandler


package com.magiksmostevile.handler;

import com.magiksmostevile.guis.GuiAltar;
import com.magiksmostevile.tileentity.TileEntityAltar;
import com.magiksmostevile.tileentity.container.ContainerAltar;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;

public class GuiHandler implements IGuiHandler {

	/*
	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if (ID == Main.GUI_ALTAR)
			return new ContainerAltar(player.inventory, (TileEntityAltar) world.getTileEntity(new BlockPos(x, y, z)));
		return null;
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
		if (ID == Main.GUI_ALTAR)
			return new GuiAltar(player.inventory, (TileEntityAltar) world.getTileEntity(new BlockPos(x, y, z)));
		return null;
	}
	*/

	@Override
	public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

		BlockPos xyz = new BlockPos(x, y, z);
		TileEntity tileEntity = world.getTileEntity(xyz);
		if(tileEntity instanceof TileEntityAltar) {
			TileEntityAltar tileEntityAltar = (TileEntityAltar)tileEntity;
			return new ContainerAltar(player.inventory, tileEntityAltar);
		}
		return null;
	}

	@Override
	public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

		BlockPos xyz = new BlockPos(x, y, z);
		TileEntity tileEntity = world.getTileEntity(xyz);
		if(tileEntity instanceof TileEntityAltar) {
			TileEntityAltar tileEntityAltar = (TileEntityAltar)tileEntity;
			return new GuiAltar(player.inventory, tileEntityAltar);
		}
		return null;
	}
	
}

 

Spoiler

Main


package com.magiksmostevile;

import com.magiksmostevile.entity.EntityVampireBat;
import com.magiksmostevile.entity.render.RenderVampireBat;
import com.magiksmostevile.handler.RegistryHandler;
import com.magiksmostevile.init.EntityInit;
import com.magiksmostevile.proxy.CommonProxy;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.relauncher.Side;

@Mod(modid = Main.MODID, name = Main.NAME, version = Main.VERSION)

public class Main {
	public static final String MODID = "magiksmostevile";
	public static final String VERSION = "1.0";
	public static final String NAME = "MagiksMostEvile";
	public static final String ACCEPTED_VERSIONS = "{1.12.2}";
	public static final String CLIENT_PROXY_CLASS = "com.magiksmostevile.proxy.ClientProxy";
	public static final String COMMON_PROXY_CLASS = "com.magiksmostevile.proxy.CommonProxy";

	public static final int ENTITY_VAMPIRE_BAT = 6750;

	public static final int GUI_ALTAR = 1;

	public static Item amethyst;
	public static Block amethystOre;

	@Mod.Instance("main")
	public static Main instance;

	@SidedProxy(clientSide = CLIENT_PROXY_CLASS, serverSide = COMMON_PROXY_CLASS)
	public static CommonProxy proxy;

	@Mod.EventHandler
	public void preInit(FMLPreInitializationEvent event) {
		if (event.getSide() == Side.CLIENT) {
			System.out.println("preInit: Client");
			RenderingRegistry.registerEntityRenderingHandler(EntityVampireBat.class, RenderVampireBat::new);
			RegistryHandler.otherRegistries();
		}

	}

	@EventHandler
	public void init(FMLInitializationEvent event) {

	}

	@EventHandler
	public void load(FMLInitializationEvent event) {

	}

	@Mod.EventHandler
	public void postInit(FMLPostInitializationEvent event) {

	}

}

 

Hello all! I'm trying to open a gui when I right click on a block (Altar), but although my logging code says the opening code is running, the gui doesn't appear. I don't know what the problem is, but I think it's just not opening (rather than just not rendering) as the game doesn't make me press Esc before I can move again. 

The GUI textures are located in magiksmostevile:textures/gui/altar/altar_gui.png and the texture is attached. As in the image, it should have four basic slots in the four areas to the right, and when I can actually see the gui I will add a scrolling menu on the left.

I have used the following resources to help:

Primarily: https://www.youtube.com/playlist?list=PLiDUvCGH5WEUEV9nc0Ll2pzUFmSFc21uR -- specifically the 5/6 tutorials on the Sintering Furnace

Also: https://www.youtube.com/watch?v=MHgS0GTNqq0&t=229s just for another potential way to open a gui

And: http://jabelarminecraft.blogspot.com/p/minecraft-modding-containers.html

As well as the minecraft source for the Enchantment Table, Furnace, Anvil, Villagers, Chest and this forum post.

 

So after all that, I still don't know the problem. I know there's gotta be something I'm missing, so any help from anyone who knows how to open a gui would be much appreciated!

 

Ps Sorry for the data-dump of code, but I figured it would be better to provide people with hopefully everything they need, rather than having to add more later.

 

 

gui_altar.png

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

5 hours ago, GenElectrovise said:

implements ITileEntityProvider

Dont use this. 

5 hours ago, GenElectrovise said:

BlockBase

BlockBase serves no purpose. You probably have something like "registerModels" in here. You could easily switch this to Block and be capable of extending any Block class.

5 hours ago, GenElectrovise said:

createNewTileEntity

You're using the wrong create method. Use the one with an IBlockState parameter.

 

5 hours ago, GenElectrovise said:

openAltarGui

Remove this method it is useless.

5 hours ago, GenElectrovise said:

implements ITickable, IInventory

Do not implement IInventory. Instead use the IItemHandler Capability. It's way easier to use and is the compatible option to use with other mods. No mods expect your TE to use IInventory anymore and stuff like pipes/machines/etc. Do not support it.

5 hours ago, GenElectrovise said:

this.world = this.getWorld();

This is literally the same as

this.world = this.world;

It serves no purpose. The load method is called after the TileEntity has been added to the world and has had its world field initialized. You dont need this function unless you have important stuff to do when the TileEntity is first created and placed or when the chunk gets loaded.

5 hours ago, GenElectrovise said:

IInteractionObject

There is no point to this if you dont use it anywhere.

 

Fix all this and your code will be better and easier to understand. Your error should also go away.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Ok shall make those changes, @Animefan8888. Will post results once done! (will likely be in a few hours) Thanks for the response!

 

Also, for @loordgek, any particular reason for

14 hours ago, loordgek said:

dont watch Harry Talks

 

I see that some of his choices aren't the best, but anything else specific?

Edited by GenElectrovise
Added clarification

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

6 hours ago, GenElectrovise said:

I see that some of his choices aren't the best, but anything else specific?

His code (and coding practice) is such garbage it needs to be taken out back, shot, set on fire, and buried, never to be seen again. As in, almost everything he does is wrong in some way. And sure "it works for him" but everyone who watches his crap shows up here with the same garbage code, we've enshrined several of the problems created by him in the Common Issues thread.

 

Problematic Code #4, #5, #14

Code Style #1, #2, #3, #4

Edited by Draco18s
  • Haha 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Question: How does the container (ContainerAltar) work when using IItemHandler ? Is it still necessary, because I'm getting a lot of errors from when I previously tried to add slots.

this.addSlotToContainer(new Slot(tileentity, 0, 305, 185));

Soooooo I'm guessing that's a IInventory thing. Does this have an equivalent with IItemHandler and Capabilities ? Do I even still need the container?

 

The Altar will have an inventory (of 4 slots), so therefore it needs to persist the data, right? So that means that TileEntityAltar should implement ICapabilitySerializable<T extends NBTBase> ? The 

 

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

2 hours ago, Draco18s said:

His code (and coding practice) is such garbage it needs to be taken out back, shot, set on fire, and buried, never to be seen again. As in, almost everything he does is wrong in some way. And sure "it works for him" but everyone who watches his crap shows up here with the same garbage code, we've enshrined several of the problems created by him in the Common Issues thread.

 

Problematic Code #4, #5, #14

Code Style #1, #2, #3, #4

Right. Ok. That's the explanation I needed.

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

4 minutes ago, GenElectrovise said:

Question: How does the container (ContainerAltar) work when using IItemHandler ? Is it still necessary, because I'm getting a lot of errors from when I previously tried to add slots.


this.addSlotToContainer(new Slot(tileentity, 0, 305, 185));

Soooooo I'm guessing that's a IInventory thing. Does this have an equivalent with IItemHandler and Capabilities ?

SlotItemHandler.

 

You can select a class name and either "search for all references" or "open type hierarchy" to get an idea of what alternatives exist or how something's used.

 

4 minutes ago, GenElectrovise said:

Do I even still need the container?

Yes

 

4 minutes ago, GenElectrovise said:

The Altar will have an inventory (of 4 slots), so therefore it needs to persist the data, right? So that means that TileEntityAltar should implement ICapabilitySerializable<T extends NBTBase> ? The 

No, TileEntity already implements that.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Spoiler

[20:06:25] [Server thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.AttachCapabilitiesEvent@5c44a1bf:
java.lang.StackOverflowError: null
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_201]
    at java.io.FilePermission.init(FilePermission.java:203) ~[?:1.8.0_201]
    at java.io.FilePermission.<init>(FilePermission.java:277) ~[?:1.8.0_201]
    at java.lang.SecurityManager.checkRead(SecurityManager.java:888) ~[?:1.8.0_201]
    at java.io.File.exists(File.java:814) ~[?:1.8.0_201]
    at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:434) ~[?:1.8.0_201]
    at java.io.File.getCanonicalPath(File.java:618) ~[?:1.8.0_201]
    at java.io.FilePermission$1.run(FilePermission.java:215) ~[?:1.8.0_201]
    at java.io.FilePermission$1.run(FilePermission.java:203) ~[?:1.8.0_201]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_201]
    at java.io.FilePermission.init(FilePermission.java:203) ~[?:1.8.0_201]
    at java.io.FilePermission.<init>(FilePermission.java:277) ~[?:1.8.0_201]
    at java.lang.SecurityManager.checkRead(SecurityManager.java:888) ~[?:1.8.0_201]
    at java.io.File.exists(File.java:814) ~[?:1.8.0_201]
    at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1334) ~[?:1.8.0_201]
    at sun.misc.URLClassPath.getResource(URLClassPath.java:249) ~[?:1.8.0_201]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[?:1.8.0_201]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363) ~[?:1.8.0_201]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_201]
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362) ~[?:1.8.0_201]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_201]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_201]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_201]
    at org.apache.logging.log4j.core.impl.MutableLogEvent.getThrownProxy(MutableLogEvent.java:338) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:61) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:38) ~[log4j-core-2.8.1.jar:2.8.1]
    at net.minecraftforge.server.terminalconsole.HighlightErrorConverter.format(HighlightErrorConverter.java:100) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
    at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:38) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.layout.PatternLayout$PatternSelectorSerializer.toSerializable(PatternLayout.java:455) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.layout.PatternLayout$PatternSelectorSerializer.toSerializable(PatternLayout.java:444) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:208) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:57) ~[log4j-core-2.8.1.jar:2.8.1]
    at net.minecraftforge.server.terminalconsole.TerminalConsoleAppender.append(TerminalConsoleAppender.java:320) ~[forgeSrc-1.12.2-14.23.5.2768.jar:?]
    at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:448) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:433) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:403) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146) ~[log4j-core-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2091) ~[log4j-api-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:2011) ~[log4j-api-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1884) ~[log4j-api-2.8.1.jar:2.8.1]
    at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:854) ~[log4j-api-2.8.1.jar:2.8.1]
    at net.minecraftforge.fml.common.eventhandler.EventBus.handleException(EventBus.java:203) ~[EventBus.class:?]
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:187) ~[EventBus.class:?]
    at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:668) ~[ForgeEventFactory.class:?]
    at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:632) ~[ForgeEventFactory.class:?]
    at net.minecraft.tileentity.TileEntity.<init>(TileEntity.java:508) ~[TileEntity.class:?]
    at com.magiksmostevile.tileentity.TileEntityAltar.<init>(TileEntityAltar.java:42) ~[TileEntityAltar.class:?]
    at com.magiksmostevile.handler.RegistryHandler.registerGuiRelations(RegistryHandler.java:41) ~[RegistryHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_RegistryHandler_registerGuiRelations_AttachCapabilitiesEvent.invoke(.dynamic) ~[?:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) ~[EventBus.class:?]
    at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:668) ~[ForgeEventFactory.class:?]
    at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:632) ~[ForgeEventFactory.class:?]
    at net.minecraft.tileentity.TileEntity.<init>(TileEntity.java:508) ~[TileEntity.class:?]
    at com.magiksmostevile.tileentity.TileEntityAltar.<init>(TileEntityAltar.java:42) ~[TileEntityAltar.class:?]
    at com.magiksmostevile.handler.RegistryHandler.registerGuiRelations(RegistryHandler.java:41) ~[RegistryHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_RegistryHandler_registerGuiRelations_AttachCapabilitiesEvent.invoke(.dynamic) ~[?:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) ~[EventBus.class:?]
    at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:668) ~[ForgeEventFactory.class:?]
    at net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(ForgeEventFactory.java:632) ~[ForgeEventFactory.class:?]
    at net.minecraft.tileentity.TileEntity.<init>(TileEntity.java:508) ~[TileEntity.class:?]
    at com.magiksmostevile.tileentity.TileEntityAltar.<init>(TileEntityAltar.java:42) ~[TileEntityAltar.class:?]
    at com.magiksmostevile.handler.RegistryHandler.registerGuiRelations(RegistryHandler.java:41) ~[RegistryHandler.class:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_8_RegistryHandler_registerGuiRelations_AttachCapabilitiesEvent.invoke(.dynamic) ~[?:?]
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Ok, so now I'm getting a loop when the game tries to register the tile entity and its capabilities, which is resulting in a StackOverFlowException. (The loop occurs between the area marked with + in the stacktrace). I think it's because when I try to register the capabilities, I do this:

@SubscribeEvent
	public static void registerGuiRelations(AttachCapabilitiesEvent<TileEntity> event) {
		event.addCapability(new ResourceLocation(Main.MODID + ":capabilites_altar"), new TileEntityAltar());
	}

I create a new TileEntityAltar which then calls its superconstructor which goes to line 508 in the TileEntity constructor:

private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities;
    public TileEntity()
    {
        capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this);
    }

Which causes forge to do.... something:

@Nullable
    public static CapabilityDispatcher gatherCapabilities(TileEntity tileEntity)
    {
        return gatherCapabilities(new AttachCapabilitiesEvent<TileEntity>(TileEntity.class, tileEntity), null);
    }

 

 

So how should I be registering the capabilities? -- it's pretty evident I'm doing this wrong!

 

 

Also, my updated code from @Animefan8888's post:

 

TileEntityAltar, ContainerAltar, registering capabilities, registering TileEntities

Spoiler

package com.magiksmostevile.tileentity;

import com.magiksmostevile.EvileLog;
import com.magiksmostevile.EvileLog.EnumLogLevel;

import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemStackHandler;

public class TileEntityAltar extends TileEntity implements ITickable, IItemHandler {

	public static Capability<IItemHandler> ITEM_HANDLER_CAPABILITY = CapabilityItemHandler.ITEM_HANDLER_CAPABILITY;

	private final IItemHandler inventory = new ItemStackHandler(4) {
		@Override
		protected void onContentsChanged(int slot) {
			super.onContentsChanged(slot);
			markDirty();
		}
	};

	private String customName;

	public TileEntityAltar() {
		super();
		System.out.println("Capability ITEM_HANDLER for Altar : " + this.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null));
		EvileLog.logText(true, EnumLogLevel.INFO, "Constructing altar tile entity");
	}

	@Override
	public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
		System.out.println("Checking ITEM_HANDLER_CAPABILIITY");
		if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return true;
		}
		System.out.println("Does not have ITEM_HANDLER_CAPABILIITY");
		return super.hasCapability(capability, facing);
	}

	@Override
	public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
		System.out.println("Getting ITEM_HANDLER_CAPABILIITY");
		if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return (T) inventory;
		}
		System.out.println("Cannot get ITEM_HANDLER_CAPABILIITY");
		return super.getCapability(capability, facing);
	}

	public String getName() {
		return this.hasCustomName() ? this.customName : "container.altar";
	}

	public boolean hasCustomName() {
		return this.customName != null && !this.customName.isEmpty();
	}

	private void setCustomName(String customNameIn) {
		this.customName = customNameIn;
	}

	public ITextComponent getDisplayName() {
		return this.hasCustomName() ? new TextComponentString(this.getName()) : new TextComponentTranslation(this.getName());
	}

	@Override
	public void readFromNBT(NBTTagCompound compound) {

	}

	@Override
	public NBTTagCompound writeToNBT(NBTTagCompound compound) {
		return compound;
	}

	@Override
	public void onLoad() {

	}

	@Override
	public void update() {

	}

	@Override
	public ItemStack getStackInSlot(int slot) {
		return (ItemStack) this.inventory.getStackInSlot(slot);
	}

	public String getGuiID() {
		return "magiksmostevile:gui_altar";
	}

	@Override
	public int getSlots() {
		return 4;
	}

	@Override
	public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
		return null;
	}

	@Override
	public ItemStack extractItem(int slot, int amount, boolean simulate) {
		return null;
	}

	@Override
	public int getSlotLimit(int slot) {
		return 64;
	}

}

 

Spoiler

package com.magiksmostevile.tileentity.container;

import com.magiksmostevile.tileentity.TileEntityAltar;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.SlotItemHandler;

public class ContainerAltar extends Container { // https://www.youtube.com/watch?v=rARVLYm9TBs&list=PLiDUvCGH5WEUEV9nc0Ll2pzUFmSFc21uR&index=22&t=366s

	private final TileEntityAltar tileentity;

	public ContainerAltar(InventoryPlayer player, TileEntityAltar tileentity) {

		this.tileentity = tileentity;

		System.out.println("Constructing ContainerAltar");

		this.addSlotToContainer(new SlotItemHandler(tileentity, 0, 305, 185));
		this.addSlotToContainer(new SlotItemHandler(tileentity, 1, 327, 185));
		this.addSlotToContainer(new SlotItemHandler(tileentity, 2, 305, 208));
		this.addSlotToContainer(new SlotItemHandler(tileentity, 3, 327, 208));

		for (int y = 0; y < 3; y++) {
			for (int x = 0; x < 9; x++) {
				this.addSlotToContainer(new Slot(player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
			}
		}

		for (int x = 0; x < 9; x++) {
			this.addSlotToContainer(new Slot(player, x, 8 + x * 18, 142));
		}
	}

	@Override
	public void detectAndSendChanges() {
		super.detectAndSendChanges();
	}

	@Override
	public boolean canInteractWith(EntityPlayer playerIn) {
		return this.tileentity.getDistanceSq(playerIn.getPosition().getX(), playerIn.getPosition().getY(), playerIn.getPosition().getZ()) < 3;
	}

	@Override
	public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
		return super.transferStackInSlot(playerIn, index);
	}

}

 

Spoiler



	@SubscribeEvent
	public static void registerGuiRelations(AttachCapabilitiesEvent<TileEntity> event) {
		event.addCapability(new ResourceLocation(Main.MODID + ":capabilites_altar"), new TileEntityAltar());
	}

 

Spoiler

		GameRegistry.registerTileEntity(TileEntityAltar.class, new ResourceLocation(Main.MODID, "tile_entity_altar"));

 

Those are the main changes, but I haven't included minor ones like removing my own useless methods.

Thanks!

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

16 minutes ago, GenElectrovise said:

registerGuiRelations(AttachCapabilitiesEvent<TileEntity>

You dont need to use this when it's your TileEntity. Also you wouldn't use new TileEntityAltar here there is a field in the event parameter.

17 minutes ago, GenElectrovise said:

net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this)

You dont ever have to do this unless you are adding a new object type that has Capabilities.

18 minutes ago, GenElectrovise said:

implements ITickable, IItemHandler

Get rid of IItemHandler here you only need the field in your class.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Hi again! Sorry for the belated response! I have done the things mentioned above, however, I also noticed that I was only opening the GUI on the server ( !world.isRemote )

Spoiler

@Override
	public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
		try {
			playerIn.sendMessage(new TextComponentString("Altar activated! +++++++++++++++++++++++++++"));
			if (worldIn.isRemote) {
				playerIn.sendMessage(new TextComponentString("World is not remote"));
				playerIn.openGui(Main.instance, Main.GUI_ALTAR, worldIn, pos.getX(), pos.getY(), pos.getZ());
			}
		} catch (Exception e) {
			EvileLog.logText(true, EnumLogLevel.ERROR, "An error has occurred opening the GUI for Altar at : " + pos + " : This is not an intended feature! :/");
			EvileLog.logText(true, EnumLogLevel.ERROR, e.getMessage() == null ? "No message to print!" : e.getMessage());
			e.printStackTrace();
		}

		return true;
	}

 

and as GUIs don't exist as a GUI on the server -- only the GuiContainer I changed that to openGui if world.isRemote (therefore on the client) and now I get a helpful stacktrace!

Spoiler


[17:55:22] [main/INFO] [minecraft/GuiNewChat]: [CHAT] Altar activated! +++++++++++++++++++++++++++
[17:55:22] [main/INFO] [minecraft/GuiNewChat]: [CHAT] World is not remote


[17:55:22] [main/INFO] [STDOUT]: [com.magiksmostevile.EvileLog:logText:23]: EVILE EXCEPTION! THAT'S AN ERROR! : An error has occurred opening the GUI for Altar at : BlockPos{x=238, y=64, z=250} : This is not an intended feature! :/
[17:55:22] [main/INFO] [STDOUT]: [com.magiksmostevile.EvileLog:logText:23]: EVILE EXCEPTION! THAT'S AN ERROR! : No message to print!


[17:55:22] [main/INFO] [STDERR]: [com.magiksmostevile.blocks.AltarBase:onBlockActivated:109]: java.lang.NullPointerException
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 com.magiksmostevile.blocks.AltarBase.onBlockActivated(AltarBase.java:104)
at net.minecraft.client.multiplayer.PlayerControllerMP.processRightClickBlock(PlayerControllerMP.java:455)
at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1693)
at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:2380)
at net.minecraft.client.Minecraft.runTickKeyboard(Minecraft.java:2146)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1934)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:25)


[17:55:22] [main/INFO] [minecraft/GuiNewChat]: [CHAT] Altar activated! +++++++++++++++++++++++++++

Even if it should still be !world.isRemote which might seem logical as the client should be getting its prompts from the server, this should still be useful (right?) as it's exposed an error which was unknown and failing silently before.

 

======

 

Oh also

On 10/27/2019 at 8:49 PM, Animefan8888 said:

net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(this)

wasn't me calling it specifically, it was being called from TileEntity.java when I construct my TileEntityAltar and called its super constructor.

 

Again sorry for taking so long and thanks for all the assistance so far!

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

Also for easier reviewing for future I'm going to make a github repo for this. Also means I'll have a backup! 

How to ask a good coding question: https://stackoverflow.com/help/how-to-ask

Give logs, code, desired effects, and actual effects. Be thorough or we can't help you. Don't post code without putting it in a code block (the <> button on the post - select "C-type Language"): syntax highlighting makes everything easier, and it keeps the post tidy.

 

My own mod, Magiks Most Evile: GitHub (https://github.com/GenElectrovise/MagiksMostEvile) Wiki (https://magiksmostevile.fandom.com/wiki/Magiks_Most_Evile_Wiki)

Edit your own signature at https://www.minecraftforge.net/forum/settings/signature/

Link to comment
Share on other sites

55 minutes ago, GenElectrovise said:

however, I also noticed that I was only opening the GUI on the server ( !world.isRemote )

This is the correct way to do this. You tell the server hey open this gui from this mod. The server says ok it creates the server side Container and then sends a packet to the Player(client) and then the client opens the gui and container on that side.

 

55 minutes ago, GenElectrovise said:

wasn't me calling it specifically, it was being called from TileEntity.java when I construct my TileEntityAltar and called its super constructor.

My bad, but you've solved this by getting rid of the AttachCapabilityEvent right?

 

50 minutes ago, GenElectrovise said:

Also for easier reviewing for future I'm going to make a github repo for this. Also means I'll have a backup! 

Nice 

 

55 minutes ago, GenElectrovise said:

and failing silently before.

It might not have been also I failed to notice this on my first glance through your code, but...

 

On 10/26/2019 at 2:02 AM, GenElectrovise said:

@Mod.Instance("main") public static Main instance;

The string in the Instance annotation needs to be your modid.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.