Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.13.2] Tile Entity not opening
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
MyRedAlien43

[1.13.2] Tile Entity not opening

By MyRedAlien43, May 13 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 13 (edited)

I got another tile entity, with yet another problem.. When I right click it, it does nothing, but when I click the barrel(the other tile entity I had problems with) it opens.

Gui Handler:

public class GuiHandler {
	public static GuiScreen openGui(FMLPlayMessages.OpenContainer openContainer) {
		BlockPos pos = openContainer.getAdditionalData().readBlockPos();
		EntityPlayerSP player = Minecraft.getInstance().player;
		
		//Barrel
		if(openContainer.getId().equals(new ResourceLocation(Main.modid, "barrel"))) {
			return new GuiBarrel(player.inventory, (TileEntityBarrel)Minecraft.getInstance().world.getTileEntity(pos), player);
		}
		if(openContainer.getId().equals(new ResourceLocation(Main.modid, "press"))) {
			return new GuiPress(player.inventory, (TileEntityPress)Minecraft.getInstance().world.getTileEntity(pos));
		}
		
		return null;
	}
	
	public static enum GUI {
		BARREL("moresimplestuff:barrel", new ResourceLocation(Main.modid, "textures/gui/barrel.png")),
		PRESS("moresimplestuff:press", new ResourceLocation(Main.modid, "textures/gui/press.png"));
    	
    	private ResourceLocation texture;
    	private String guiId;
    	
    	GUI(String guiId, ResourceLocation texture) {
    		this.guiId = guiId;
    		this.texture = texture;
    	}
    	
    	public String getGuiID() {
    		return guiId;
    	}
    	
    	public ResourceLocation getTexture() {
    		return texture;
    	}
	}
}

How I registered it (in my main class):

ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.GUIFACTORY, () -> GuiHandler::openGui);

And how I open it (block class): 

@Override
	public boolean onBlockActivated(IBlockState state, World worldIn, BlockPos pos, EntityPlayer player, EnumHand hand,
			EnumFacing side, float hitX, float hitY, float hitZ) {
		if (worldIn.isRemote) {
			return true;
		} else {
			TileEntityPress te = (TileEntityPress)worldIn.getTileEntity(pos);
			
			if(te != null) {
				if(player instanceof EntityPlayerMP && !(player instanceof FakePlayer)) {
					EntityPlayerMP playermp = (EntityPlayerMP)player;
					
					NetworkHooks.openGui(playermp, te, buf -> buf.writeBlockPos(pos));
				}
			}
			
			return true;
		}
	}

If you need to me to show other code, just tell me

Edited May 13 by MyRedAlien43
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

Show your tile entity and container class.

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14
4 hours ago, diesieben07 said:

Show your tile entity and container class.

Tile Entity:

package beta.mod.tileentity.press;

import beta.mod.init.ItemInit;
import beta.mod.tileentity.ModTET;
import beta.mod.util.GuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemStackHandler;

@SuppressWarnings("unused")
public class TileEntityPress extends TileEntity implements ITickable, IInteractionObject {
	public ItemStackHandler handler = new ItemStackHandler(3);
	private int burnTime, currentBurnTime, cookTime, totalCookTime;
	private ITextComponent customName;
	
	private TileEntityPress(TileEntityType<?> type) {
		super(type);
	}
	
	public TileEntityPress() {
		this(ModTET.PRESS);
	}
	
	@Override
	public ITextComponent getName() {
		return this.hasCustomName() ? this.customName : new TextComponentTranslation("container.press");
	}
	
	@Override
	public boolean hasCustomName() {
		return this.customName != null;
	}
	
	public void setCustomName(ITextComponent customName) {
		this.customName = customName;
	}
	
	@Override
	public void read(NBTTagCompound compound) {
		super.read(compound);
		this.handler.deserializeNBT(compound.getCompound("inventory"));
		this.burnTime = compound.getInt("BurnTime");
		this.cookTime = compound.getInt("CookTime");
		this.totalCookTime = compound.getInt("TotalCookTime");
		this.currentBurnTime = compound.getInt("CurrentBurnTime");
		
		if(compound.contains("CustomName", Constants.NBT.TAG_STRING)) {
			this.customName = ITextComponent.Serializer.fromJson(compound.getString("CustomName"));
		}
	}
	
	@Override
	public NBTTagCompound write(NBTTagCompound compound) {
		super.write(compound);
		compound.setTag("inventory", this.handler.serializeNBT());
		compound.setInt("BurnTime", this.burnTime);
		compound.setInt("CookTime", this.cookTime);
		compound.setInt("TotalCookTime", this.totalCookTime);
		compound.setInt("CurrentBurnTime", this.currentBurnTime);
		if(this.hasCustomName()) {
			compound.setString("CustomName", ITextComponent.Serializer.toJson(customName));
		}
		
		return compound;
	}
	
	public boolean isPressing() {
		return this.burnTime > 0;
	}
	
	@Override
	public void tick() {
		boolean flag = this.isPressing(), flag1 = false;
		
		if(this.isPressing()) {
			this.burnTime--;
		}
		
		if(!this.world.isRemote) {
			ItemStack stack = this.handler.getStackInSlot(1);
			
			if(this.isPressing() || !stack.isEmpty() && !this.handler.getStackInSlot(0).isEmpty()) {
				if(!this.isPressing() && this.canSmelt()) {
					this.burnTime = getBurnTime(stack);
					this.currentBurnTime = this.burnTime;
					
					if(this.isPressing()) {
						flag1 = true;
						
						if(!stack.isEmpty()) {
							Item item = stack.getItem();
							stack.shrink(1);
							
							if(stack.isEmpty()) {
								ItemStack item1 = item.getContainerItem(stack);
								this.handler.setStackInSlot(1, item1);
							}
						}
					}
				}
				
				if(this.isPressing() && this.canSmelt()) {
					this.cookTime++;
					
					if(this.cookTime == this.totalCookTime) {
						this.cookTime = 0;
						this.totalCookTime = this.getCookTime(this.handler.getStackInSlot(0));
						this.smeltItem();
						flag1 = true;
					}
				} else {
					this.cookTime = 0;
				}
			} else if(!this.isPressing() && this.cookTime > 0) {
				this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.totalCookTime);
			}
			
			if(flag != this.isPressing()) {
				flag1 = true;
				BlockPress.setState(this.isPressing(), this.world, this.pos);
			}
		}
	}

	public void dropInventoryItems(World worldIn, BlockPos pos) {
		for(int i = 0; i < this.handler.getSlots(); i++) {
			ItemStack stack = this.handler.getStackInSlot(i);
			
			if(!stack.isEmpty()) {
				InventoryHelper.spawnItemStack(worldIn, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), stack);
			}
		}
	}
	
	public int getCookTime(ItemStack stack) {
		return 200;
	}
	
	private boolean canSmelt() {
		if(this.handler.getStackInSlot(0).isEmpty()) {
			return false;
		} else {
			ItemStack stack = PressRecipes.instance().getCookingResult(this.handler.getStackInSlot(0));
			
			if(stack.isEmpty()) {
				return false;
			} else {
				ItemStack stack1 = this.handler.getStackInSlot(2);
				
				if(stack1.isEmpty()) {
					return true;
				} else if(!stack1.isItemEqual(stack)) {
					return false;
				} else if(stack1.getCount() + stack.getCount() <= 64 && stack1.getCount() + stack.getCount() <= stack1.getMaxStackSize()) {
					return true;
				} else {
					return stack1.getCount() + stack.getCount() <= stack.getMaxStackSize();
				}
			}
		}
	}
	
	public void smeltItem() {
		if(this.canSmelt()) {
			ItemStack stack = this.handler.getStackInSlot(0), stack1 = PressRecipes.instance().getCookingResult(stack), stack2 = this.handler.getStackInSlot(2);
			
			if(stack2.isEmpty()) {
				this.handler.setStackInSlot(2, stack1.copy());
			} else if(stack2.getItem() == stack1.getItem()) {
				stack2.grow(stack1.getCount());
			}
			
			if(stack.getItem() == Blocks.WET_SPONGE.asItem() && !this.handler.getStackInSlot(1).isEmpty() && this.handler.getStackInSlot(1).getItem() == Items.BUCKET) {
				this.handler.setStackInSlot(1, new ItemStack(Items.WATER_BUCKET));
			}
			
			stack.shrink(1);
		}
	}
	
	@SuppressWarnings("unlikely-arg-type")
	public static int getBurnTime(ItemStack stack) {
		if(stack.isEmpty()) {
			return 0;
		} else {
			int burnTime = net.minecraft.tileentity.TileEntityFurnace.getBurnTimes().get(stack);
			if(burnTime >= 0) return burnTime;
			Item item = stack.getItem();
			
			if(item == ItemInit.GRAPE) {
				return 20;
			}
		}
		
		return 200;
	}
	
	public static boolean isItemFuel(ItemStack stack) {
		return getBurnTime(stack) > 0;
	}
	
	@Override
	public String getGuiID() {
		return GuiHandler.GUI.PRESS.getGuiID();
	}
	
	@Override
	public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) {
		return new ContainerPress(playerInventory, this);
	}
	
	public int getField(int id) {
		switch(id) {
		case 0:
			return this.burnTime;
		case 1:
			return this.currentBurnTime;
		case 2:
			return this.cookTime;
		case 3:
			return this.totalCookTime;
		default:
			return 0;
		}
	}
	
	public void setField(int id, int value) {
		switch(id) {
		case 0:
			this.burnTime = value;
			break;
		case 1:
			this.currentBurnTime = value;
			break;
		case 2:
			this.cookTime = value;
			break;
		case 3:
			this.totalCookTime = value;
			break;
		}
	}
	
	public int getFieldCount() {
		return 4;
	}
	
	public void clear() {
		for(int i = 0; i < this.handler.getSlots(); i++) {
			this.handler.setStackInSlot(i, ItemStack.EMPTY);
		}
	}
	
	public ItemStackHandler getInventory() {
		return this.handler;
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public <T> LazyOptional<T> getCapability(Capability<T> cap) {
		if(!this.removed && cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
			return LazyOptional.of(() -> (T)handler);
		} else {
			return LazyOptional.empty();
		}
	}

	@Override
	public ITextComponent getCustomName() {
		return this.hasCustomName() ? this.customName : new TextComponentTranslation("Press");
	}
}

(I made setField and getField, not from IInventory)

Container:

package beta.mod.tileentity.press;

import beta.mod.tileentity.press.slots.SlotPressFuel;
import beta.mod.tileentity.press.slots.SlotPressOutput;
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 ContainerPress extends Container {
	private final TileEntityPress te;
	private int cookTime, totalCookTime, burnTime, currentBurnTime;
	
	public ContainerPress(InventoryPlayer plrInv, TileEntityPress te) {
		this.te = te;
		this.addSlot(new SlotItemHandler(te.getInventory(), 0, 56, 53));
		this.addSlot(new SlotPressFuel(te.getInventory(), 1, 56, 17));
		this.addSlot(new SlotPressOutput(plrInv.player, te.getInventory(), 2, 116, 35));
		
		for(int i = 0; i < 3; i++)
		{
			for(int j = 0; j < 9; ++j)
			{
				this.addSlot(new Slot(plrInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
			}
		}
		
		for(int k = 0; k < 9; k++)
		{
			this.addSlot(new Slot(plrInv, k, 8 + k * 18, 142));
		}
	}
	
	@Override
	public void detectAndSendChanges() {
		super.detectAndSendChanges();
		
		for(int i = 0; i < this.listeners.size(); i++) {
			IContainerListener icontainerlistener = this.listeners.get(i);

	        if (this.cookTime != this.te.getField(2))
	        {
	            icontainerlistener.sendWindowProperty(this, 2, this.te.getField(2));
	        }

	        if (this.burnTime != this.te.getField(0))
	        {
	            icontainerlistener.sendWindowProperty(this, 0, this.te.getField(0));
	        }

	        if (this.currentBurnTime != this.te.getField(1))
	        {
	            icontainerlistener.sendWindowProperty(this, 1, this.te.getField(1));
	        }

	        if (this.totalCookTime != this.te.getField(3))
	        {
	            icontainerlistener.sendWindowProperty(this, 3, this.te.getField(3));
	        }
		}
	    this.cookTime = this.te.getField(2);
	    this.burnTime = this.te.getField(0);
	    this.currentBurnTime = this.te.getField(1);
	    this.totalCookTime = this.te.getField(3);
	}
	
	@Override
	public void updateProgressBar(int id, int data) {
		this.te.setField(id, data);
	}
	
	@Override
	public boolean canInteractWith(EntityPlayer playerIn) {
		return playerIn.getDistanceSq((double)te.getPos().getX() + 0.5d, (double)te.getPos().getY() + 0.5d, (double)te.getPos().getZ() + 0.5d) <= 64.0d;
	}
	
	@Override
	public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
		ItemStack itemstack = ItemStack.EMPTY;
        Slot slot = this.inventorySlots.get(index);

        if (slot != null && slot.getHasStack())
        {
            ItemStack itemstack1 = slot.getStack();
            itemstack = itemstack1.copy();

            if (index == 2)
            {
                if (!this.mergeItemStack(itemstack1, 3, 39, true))
                {
                    return ItemStack.EMPTY;
                }

                slot.onSlotChange(itemstack1, itemstack);
            }
            else if (index != 1 && index != 0)
            {
                if (!PressRecipes.instance().getCookingResult(itemstack1).isEmpty())
                {
                    if (!this.mergeItemStack(itemstack1, 0, 1, false))
                    {
                        return ItemStack.EMPTY;
                    }
                }
                else if (TileEntityPress.isItemFuel(itemstack1))
                {
                    if (!this.mergeItemStack(itemstack1, 1, 2, false))
                    {
                        return ItemStack.EMPTY;
                    }
                }
                else if (index >= 3 && index < 30)
                {
                    if (!this.mergeItemStack(itemstack1, 30, 39, false))
                    {
                        return ItemStack.EMPTY;
                    }
                }
                else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
                {
                    return ItemStack.EMPTY;
                }
            }
            else if (!this.mergeItemStack(itemstack1, 3, 39, false))
            {
                return ItemStack.EMPTY;
            }

            if (itemstack1.isEmpty())
            {
                slot.putStack(ItemStack.EMPTY);
            }
            else
            {
                slot.onSlotChanged();
            }

            if (itemstack1.getCount() == itemstack.getCount())
            {
                return ItemStack.EMPTY;
            }

            slot.onTake(playerIn, itemstack1);
        }

        return itemstack;
	}
}

 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

Can't see anything wrong at a glance. Have you used the debugger?

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14 (edited)
1 hour ago, diesieben07 said:

Can't see anything wrong at a glance. Have you used the debugger?

Sorry for being dumb but where/what is it?

Edited May 14 by MyRedAlien43
  • Quote

Share this post


Link to post
Share on other sites

loordgek    163

loordgek

loordgek    163

  • World Shaper
  • loordgek
  • Members
  • 163
  • 1606 posts
Posted May 14

for Eclipse

https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php

 

for idea

https://www.jetbrains.com/help/idea/using-breakpoints.html

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

Eclipse: https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php

IntelliJ: https://www.jetbrains.com/help/idea/debugging-your-first-java-application.html

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

LOL.

  • Haha 1
  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14

I got nothing in the debugger

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14
22 minutes ago, diesieben07 said:

LOL.

Also, I know what a debugger is, I just didn't know which one

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14
1 minute ago, MyRedAlien43 said:

I got nothing in the debugger

Define "got nothing". What did you do? What happend?

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14
1 minute ago, diesieben07 said:

Define "got nothing". What did you do? What happend?

Nothing popped up / got written in the debugger

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

Where did you put breakpoints? Did they get hit?

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14 (edited)
1 minute ago, diesieben07 said:

Where did you put breakpoints? Did they get hit?

They didn't get hit.. I tried putting it in the block and the tile entity

Edited May 14 by MyRedAlien43
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

Dude. Can you stop being so vague?
Where exactly did you put breakpoints?

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14
3 minutes ago, diesieben07 said:

Dude. Can you stop being so vague?
Where exactly did you put breakpoints?

NetworkHooks.openGui(playermp, te, buf -> buf.writeBlockPos(pos));
return new ContainerPress(playerInventory, this);
return GuiHandler.GUI.PRESS.getGuiID();

 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

Okay. If the first line is not triggered, obviously the other two can't trigger as well.

Now, try to use some logical reasoning. You have various if statements in onBlockActivated, so if it's not getting to openGui some condition before that is not true. Use the debugger to find out what is not true any why.

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14
4 minutes ago, diesieben07 said:

Okay. If the first line is not triggered, obviously the other two can't trigger as well.

Now, try to use some logical reasoning. You have various if statements in onBlockActivated, so if it's not getting to openGui some condition before that is not true. Use the debugger to find out what is not true any why.

I put a break point on the line:

if(worldIn.isRemote) {
	return true; //This line
}

And it triggered, and not the other one I put on the line:

TileEntityPress te = (TileEntityPress)worldIn.getTileEntity(pos);

that is on the else side of the if above

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 14

If that is really the case, something is very wrong.

Please post a Git repository of your mod.

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14
2 minutes ago, diesieben07 said:

If that is really the case, something is very wrong.

Please post a Git repository of your mod.

https://github.com/aradgal/moresimplestuff1.13.2/

  • Quote

Share this post


Link to post
Share on other sites

loordgek    163

loordgek

loordgek    163

  • World Shaper
  • loordgek
  • Members
  • 163
  • 1606 posts
Posted May 14 (edited)

you override hasTileEntity but not createTileEntity

Edited May 14 by loordgek
  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 20 posts
Posted May 14 (edited)
10 minutes ago, loordgek said:

you override hasTileEntity but not createTileEntity

Omfg im so dumb... if i knew i didnt override it... thanks it works now i really want to bang my head onto a wall

Also thanks for the help @diesieben07 i appreciate it

Edited May 14 by MyRedAlien43
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6671

diesieben07

diesieben07    6671

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6671
  • 45620 posts
Posted May 15

This is why I told you to use the debugger. If you had done that, you could have noticed that getTileEntity gave you null and went on from there. This is what the debugger is for.

  • Quote

Share this post


Link to post
Share on other sites

desht    73

desht

desht    73

  • Creeper Killer
  • desht
  • Members
  • 73
  • 205 posts
Posted May 15

I propose adding a "3. LEARN TO USE YOUR IDE's DEBUGGER!" entry under General Issues in your Common Issues / Recommendations post.

@MyRedAlien43seriously, the debugger is a lifesaver.  Modding without it is like trying to run with your shoelaces tied together.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • BitNet_
      [1.12.2] Exception loading model

      By BitNet_ · Posted 4 minutes ago

      That hasn't worked for me, I still get the model registering error even when adding the code to my build.gradle
    • JMAS
      Recompile mod with newer version of Java?

      By JMAS · Posted 7 minutes ago

      Thank you for your quick and direct response.   After making the changes directed, I now receive the following error: Execution failed for task ':runClient'. > Process 'command 'C:\Program Files\Java\jdk1.8.0_231\bin\java.exe'' finished with non-zero exit value 1    No new debug.log was generated in run/logs. 😕
    • Lea9ue
      .setRepairItem not work

      By Lea9ue · Posted 21 minutes ago

      In your item class you should have something like...   @Override public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { if (toRepair.getItem().equals("YOUR ITEM") && repair.getItem().equals("WHAT REPAIRS IT")) { return true; } else { return false; } }  
    • Electrodynamite12
      .setRepairItem not work

      By Electrodynamite12 · Posted 28 minutes ago

      I made the ToolMaterial, and i add the .setRepairItem method, announced the ItemStack, where indicated the target item. Maybe i made something wrong? public static Item.ToolMaterial HLOMINITE = EnumHelper.addToolMaterial("another_test:hlominite", 5, 1000, 50.0F, 16.0F, 76).setRepairItem(new ItemStack(ItemsRegister.HLOMINGOT));
    • diesieben07
      [1.12.2] Exception loading model

      By diesieben07 · Posted 1 hour ago

  • Topics

    • BitNet_
      2
      [1.12.2] Exception loading model

      By BitNet_
      Started 8 hours ago

    • JMAS
      6
      Recompile mod with newer version of Java?

      By JMAS
      Started 10 hours ago

    • Electrodynamite12
      1
      .setRepairItem not work

      By Electrodynamite12
      Started 28 minutes ago

    • Hemeroahz
      5
      1.12.2 Crashing Upon Running Forge

      By Hemeroahz
      Started November 27, 2017

    • zhubwat
      9
      Forge not creating version .jar files?

      By zhubwat
      Started January 25, 2016

  • Who's Online (See full list)

    • saxon564
    • BitNet_
    • imacatlolol
    • AJGingy
    • Lordyammer
    • ItzGenes
    • Nuparu00
    • M1ntcraft3r
    • fcelon
    • KolonilGamer
    • Choonster
    • Lea9ue
    • ewew
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.13.2] Tile Entity not opening
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community