• Posts

    • nothing. i just erased so it looks like: server-ip=  
    • What did you put in the IP settings now?
    • Why on earth?   Only open container GUIs on the server.   Your inventory has 1 slot, but you told a Slot in your container to use the 2nd slot of that inventory.
    • Here is also the code to the tile entity: package com.log_cabin_blocks.objects.blocks.utility_blocks.cooking_utilities.cabin_furnace; import javax.annotation.Nonnull; import javax.annotation.Nullable; import com.log_cabin_blocks.objects.blocks.BlockList; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.container.Container; import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.INBTSerializable; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; public class CabinFurnaceTileEntity extends TileEntity implements INamedContainerProvider { private LazyOptional<IItemHandler> handler = LazyOptional.of(this::createHandler); @SuppressWarnings("unchecked") @Override public void read(CompoundNBT tag) { CompoundNBT invTag = tag.getCompound("inv"); handler.ifPresent(h -> ((INBTSerializable<CompoundNBT>)h).deserializeNBT(invTag)); super.read(tag); } @SuppressWarnings("unchecked") @Override public CompoundNBT write(CompoundNBT tag) { handler.ifPresent(h -> { CompoundNBT compound = ((INBTSerializable<CompoundNBT>)h).serializeNBT(); tag.put("inv", compound); }); return super.write(tag); } public CabinFurnaceTileEntity() { super(BlockList.cabin_furnace_tile_entity); } private IItemHandler createHandler () { return new ItemStackHandler(1) { @Override protected void onContentsChanged(int slot) { markDirty(); } @Override public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) { return stack; } }; } @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { return handler.cast(); } return super.getCapability(cap, side); } @Nullable @Override public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) { return new CabinFurnaceContainer(p_createMenu_1_, world, pos, p_createMenu_2_, p_createMenu_3_); } @Override public ITextComponent getDisplayName() { return new StringTextComponent("cabinfurnace"); } } which I based off the code here:   https://github.com/McJty/YouTubeModding14/blob/master/src/main/java/com/mcjty/mytutorial/blocks/FirstBlockTile.java
  • Topics

  • Who's Online (See full list)