Jump to content

[1.10.2] TileEntitys Data synchronisation and updating Containers


Roxane

Recommended Posts

I'm trying to update my mod from 1.9 to 1.10.2 (forge version 12.16.1.1887 to 12.18.2.2098).

 

Most of my mods work just fine, but with my AccessControl I'm having a little bit of a problem. The access panels can have different colors and some other properties, but on loading a world they all have the default properties on the client side. It seems that on the server side they have correct properties because they are behaving as they should, although looking differently. As soon as they are activated once the clientside gets the correct data and now they are looking as they should.

 

This is my code of the BlockAccessPanel.java

 

package net.roxa.accessControl;

import java.util.List;
import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.scoreboard.Team;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockAccessPanel extends BlockContainer
{
//TileEntityAccessPanel tileEntity;

    public static final PropertyBool POWERED = PropertyBool.create("powered");
    public static final PropertyDirection FACING = PropertyDirection.create("facing");
    public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumColor.class);

public BlockAccessPanel() {
	super(Material.CIRCUITS);
	this.setDefaultState(this.blockState.getBaseState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(COLOR, EnumColor.WHITE).withProperty(FACING, EnumFacing.UP));
	this.setUnlocalizedName("accessPanel");
	this.setRegistryName("accessPanel");
	this.setCreativeTab(CreativeTabs.REDSTONE);
	this.setSoundType(SoundType.METAL);
	this.setHardness(0.5F);
	this.setResistance(1F);
	//this.useNeighborBrightness = true;

	//tileEntity = new TileEntityAccessPanel();
}

@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer()
{
	return BlockRenderLayer.CUTOUT_MIPPED;
}

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

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

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

/*
@Override
public void setBlockBoundsForItemRender()
    {
        float f = 0.1875F;
        float f1 = 0.125F;
        float f2 = 0.125F;
        this.setBlockBounds(0.5F - f, 0.5F - f1, 0.5F - f2, 0.5F + f, 0.5F + f1, 0.5F + f2);
    }
    */

@Override
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side)
    {
        return worldIn.isSideSolid(pos.offset(side.getOpposite()), side, true);
    }

@Override
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
    {
        EnumFacing[] aenumfacing = EnumFacing.values();
        int i = aenumfacing.length;

        for (int j = 0; j < i; ++j)
        {
            EnumFacing enumfacing = aenumfacing[j];

            if (worldIn.isSideSolid(pos.offset(enumfacing), enumfacing.getOpposite(), true))
            {
                return true;
            }
        }

        return false;
    }

@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
    {
        return worldIn.isSideSolid(pos.offset(facing.getOpposite()), facing, true) ? this.getDefaultState().withProperty(FACING, facing).withProperty(POWERED, Boolean.valueOf(false)) : this.getDefaultState().withProperty(FACING, EnumFacing.DOWN).withProperty(POWERED, Boolean.valueOf(false));
    }

@Override
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block neighborBlock)
    {
        if (this.checkForDrop(worldIn, pos, state))
        {
            EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);

            if (!worldIn.isSideSolid(pos.offset(enumfacing.getOpposite()), enumfacing, true))
            {
                this.dropBlockAsItem(worldIn, pos, state, 0);
                worldIn.setBlockToAir(pos);
            }
        }
    }

    private boolean checkForDrop(World worldIn, BlockPos pos, IBlockState state)
    {
        if (!this.canPlaceBlockAt(worldIn, pos))
        {
            this.dropBlockAsItem(worldIn, pos, state, 0);
            worldIn.setBlockToAir(pos);
            return false;
        }
        else
        {
            return true;
        }
    }
    
    @Override
    //public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
    public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        return this.updateBlockBounds(source.getBlockState(pos));
    }

    private AxisAlignedBB updateBlockBounds(IBlockState state)
    {
    	if (state.getBlock() instanceof BlockAccessPanel)
    	{
    	AxisAlignedBB axis;
        EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
        float f = 0.25F;
        float f1 = 0.375F;
        float f2 = 1 / 16.0F;
        float f3 = 0.1875F;
        float f4 = 1 - 0.1875F;

        switch (BlockAccessPanel.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()])
        {
            case 1:
            	axis = new AxisAlignedBB(0.0F, f3, f3, f2, f4, f4);
                break;
            case 2:
            	axis = new AxisAlignedBB(1.0F - f2, f3, f3, 1.0F, f4, f4);
                break;
            case 3:
            	axis = new AxisAlignedBB(f3, f3, 0.0F, f4, f4, f2);
                break;
            case 4:
            	axis = new AxisAlignedBB(f3, f3, 1.0F - f2, f4, f4, 1.0F);
                break;
            case 5:
            	axis = new AxisAlignedBB(f3, 0.0F, f3, f4, 0.0F + f2, f4);
                break;
            default:
            	axis = new AxisAlignedBB(f3, 1.0F - f2, f3, f4, 1.0F, f4);
        }
        return axis;
    	}
    	else return null;
    }
    
    /*
    @Override
    public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
    {
        return null;
    }
    */

@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
    {
        if (((Boolean)state.getValue(POWERED)).booleanValue())
        {
            this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING));
        }

        super.breakBlock(worldIn, pos, state);
    }

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
    {
	boolean activated = false;
	boolean canAccess = false;
    	//ItemStack itemStackHold = playerIn.getHeldItem();
    	Item item;
    	if (heldItem != null) item = heldItem.getItem();
    	else item = null;
    	if (item == RoxaAccessControlMod.accessCard && !playerIn.isSneaking())
    	{
    		TileEntity tileEntity = worldIn.getTileEntity(pos);
    		TileEntityAccessPanel entityAccessPanel = null;
    		if (tileEntity instanceof TileEntityAccessPanel) entityAccessPanel = (TileEntityAccessPanel)tileEntity;
    		ItemAccessCard card = (ItemAccessCard) item;
    		
    		//Testing for the right color
            if (card.canAccess(heldItem, (entityAccessPanel.getColor())))
            {
            	//activated = activateBlock(worldIn, state, pos);
            	canAccess = true;
            	//System.out.println("Access because of color saved on Card");
            }
            //Testing for Panels on Card or Player on Panel
            else if (entityAccessPanel != null)
    		{
    			String[] playerNames = null;
    			playerNames = entityAccessPanel.getPlayerNames();
    			String playerName = playerIn.getDisplayNameString();
    			if (playerNames != null)
    			{
    				for (int i = 0; i < playerNames.length; i++)
                    {
        				if (playerNames[i].equals(playerName))
                    	{
                    		//activated = activateBlock(worldIn, state, pos);
        					canAccess = true;
                    		//System.out.println("Access because of player saved in Panel");
                    	}
        				if (playerNames[i].equals(""))
                    	{
                    		canAccess = true;
                    		//System.out.println("Access because everybody has Access");
                    	}
                    }
    			}
    			
    			if (!canAccess && card.getPanels(heldItem) != null)
    			{
    				String[] panels = card.getPanels(heldItem);
    				String panelName = entityAccessPanel.getPanelName();
    				for (int i = 0; i < panels.length; i++)
                    {
    					if (panels[i].equals(panelName))
    					{
    						canAccess = true;
    						//activated = activateBlock(worldIn, state, pos);
    						//System.out.println("Access because of panel name is on Card");
    					}
                    }
    			}
    			
    			if (!canAccess)
    			{
    				worldIn.playSound(null, pos, RoxaAccessControlMod.soundDenied, SoundCategory.BLOCKS, 0.6F, 1.0F);
    			}
    		}
    		
    		if (((Boolean)state.getValue(POWERED)).booleanValue())
            {
    			if(!entityAccessPanel.isToggle()) activated = true;
    			else if (canAccess)
    			{
    				deactivateBlock(worldIn, state, pos);
    				entityAccessPanel.incCounter();
        			activateOtherPanels(worldIn, pos, entityAccessPanel, false);
    				worldIn.playSound(null, pos, RoxaAccessControlMod.soundGranted, SoundCategory.BLOCKS, 0.4F, 1.0F);
    			}
            }
    		else if (canAccess)
    		{
			activateBlock(worldIn, state, pos, entityAccessPanel.isToggle());
    			entityAccessPanel.incCounter();
    			activateOtherPanels(worldIn, pos, entityAccessPanel, true);
    			worldIn.playSound(null, pos, RoxaAccessControlMod.soundGranted, SoundCategory.BLOCKS, 0.6F, 1.0F);
    		}
    	}
    	else
    	{
    		//Do nothing
    	}
    	return activated;
    }

private boolean activateBlock(World worldIn, IBlockState state, BlockPos pos, boolean toggle)
{
	worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3);
        worldIn.markBlockRangeForRenderUpdate(pos, pos);
        worldIn.playSound(null, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F);
        this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING));
        if(!toggle) worldIn.scheduleUpdate(pos, this, 40);
        return true;
}

public void deactivateBlock(World worldIn, IBlockState state, BlockPos pos)
{
	if (!worldIn.isRemote)
        {
            if (((Boolean)state.getValue(POWERED)).booleanValue())
            {
                worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)));
                this.notifyNeighbors(worldIn, pos, (EnumFacing)state.getValue(FACING));
                worldIn.playSound(null, pos, SoundEvents.BLOCK_STONE_BUTTON_CLICK_OFF, SoundCategory.BLOCKS, 0.3F, 0.5F);
                worldIn.markBlockRangeForRenderUpdate(pos, pos);
            }
        }
}

public void activateOtherPanels(World worldIn, BlockPos pos, TileEntityAccessPanel entityAccessPanel, boolean activate)
{
	String panelName = entityAccessPanel.getPanelName();
	if (!panelName.isEmpty())
	{
		for(int i = -5; i <= 5; i++)
		{
			for(int j = -5; j <= 5; j++)
			{
				BlockPos posOther = pos.add(i, 0, j);
				Block blockOther = worldIn.getBlockState(posOther).getBlock();
				if(blockOther == RoxaAccessControlMod.accessPanel && (i != 0 | j != 0))
				{
					TileEntity tileEntityOther = worldIn.getTileEntity(posOther);
		    		TileEntityAccessPanel entityAccessPanelOther = null;
		    		if (tileEntityOther instanceof TileEntityAccessPanel) entityAccessPanelOther = (TileEntityAccessPanel)tileEntityOther;
		    		String panelNameOther = entityAccessPanelOther.getPanelName();
		    		if(panelName.equals(panelNameOther))
		    		{
		    			BlockAccessPanel blockPanel = (BlockAccessPanel) blockOther;
		    			if(activate)
		    			{
		    				blockPanel.activateBlock(worldIn, worldIn.getBlockState(posOther), posOther, entityAccessPanelOther.isToggle());
		    				//System.out.println("Activating Access Panel at " + i + " " + j + " with same name");
		    				//System.out.println("Counter is: " + entityAccessPanel.getCounter());
	    				}
		    			else 
		    			{
		    				blockPanel.deactivateBlock(worldIn, worldIn.getBlockState(posOther), posOther);
		    				//System.out.println("Deaktivating Access Panel at " + i + " " + j + " with same name");
		    				//System.out.println("Counter is: " + entityAccessPanel.getCounter());
		    			}
		    			if (entityAccessPanel.getCounter() != entityAccessPanelOther.getCounter())
		    			{
		    				entityAccessPanelOther.setCounter(entityAccessPanel.getCounter());
		    				activateOtherPanels(worldIn, posOther, entityAccessPanelOther, activate);
		    			}
		    		}
				}
			}
		}
		for(int x = -3; x <= 3; x++)
		{
			for(int y = -3; y <= 3; y++)
			{
				if (y!=0)
				{
					for(int z = -3; z <= 3; z++)
					{
						BlockPos posOther = pos.add(x, y, z);
						Block blockOther = worldIn.getBlockState(posOther).getBlock();
						if(blockOther == RoxaAccessControlMod.accessPanel)
						{
							TileEntity tileEntityOther = worldIn.getTileEntity(posOther);
				    		TileEntityAccessPanel entityAccessPanelOther = null;
				    		if (tileEntityOther instanceof TileEntityAccessPanel) entityAccessPanelOther = (TileEntityAccessPanel)tileEntityOther;
				    		String panelNameOther = entityAccessPanelOther.getPanelName();
				    		if(panelName.equals(panelNameOther))
				    		{
				    			BlockAccessPanel blockPanel = (BlockAccessPanel) blockOther;
				    			if(activate)
				    			{
				    				blockPanel.activateBlock(worldIn, worldIn.getBlockState(posOther), posOther, entityAccessPanelOther.isToggle());
				    				//System.out.println("Activating Access Panel at " + i + " " + j + " with same name");
				    				//System.out.println("Counter is: " + entityAccessPanel.getCounter());
			    				}
				    			else 
				    			{
				    				blockPanel.deactivateBlock(worldIn, worldIn.getBlockState(posOther), posOther);
				    				//System.out.println("Deaktivating Access Panel at " + i + " " + j + " with same name");
				    				//System.out.println("Counter is: " + entityAccessPanel.getCounter());
				    			}
				    			if (entityAccessPanel.getCounter() != entityAccessPanelOther.getCounter())
				    			{
				    				entityAccessPanelOther.setCounter(entityAccessPanel.getCounter());
				    				activateOtherPanels(worldIn, posOther, entityAccessPanelOther, activate);
				    			}
				    		}
						}
					}
				}
			}
		}
	}
}

@Override
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
    {
        this.deactivateBlock(worldIn, state, pos);
        TileEntityAccessPanel entityAccessPanel = (TileEntityAccessPanel) worldIn.getTileEntity(pos);
        entityAccessPanel.incCounter();
        activateOtherPanels(worldIn, pos, entityAccessPanel, false);
    }

public int isProvidingWeakPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side)
    {
        return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
    }

@Override
    public int getStrongPower(IBlockState state, IBlockAccess worldIn, BlockPos pos, EnumFacing side)
    {
	return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (state.getValue(FACING) == side ? 15 : 0);
    }

@Override
    public boolean canProvidePower(IBlockState state)
    {
	return true;
    }
    
    private void notifyNeighbors(World worldIn, BlockPos pos, EnumFacing facing)
    {
        worldIn.notifyNeighborsOfStateChange(pos, this);
        worldIn.notifyNeighborsOfStateChange(pos.offset(facing.getOpposite()), this);
    }
    
    public IBlockState getStateFromMeta(int meta)
    {
        EnumFacing enumfacing;

        switch (meta & 7)
        {
            case 0:
                enumfacing = EnumFacing.DOWN;
                break;
            case 1:
                enumfacing = EnumFacing.EAST;
                break;
            case 2:
                enumfacing = EnumFacing.WEST;
                break;
            case 3:
                enumfacing = EnumFacing.SOUTH;
                break;
            case 4:
                enumfacing = EnumFacing.NORTH;
                break;
            case 5:
            default:
                enumfacing = EnumFacing.UP;
        }
        return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(POWERED, Boolean.valueOf((meta &  > 0));
    }

    public int getMetaFromState(IBlockState state)
    {
        int i;

        switch (BlockAccessPanel.SwitchEnumFacing.FACING_LOOKUP[((EnumFacing)state.getValue(FACING)).ordinal()])
        {
            case 1:
                i = 1;
                break;
            case 2:
                i = 2;
                break;
            case 3:
                i = 3;
                break;
            case 4:
                i = 4;
                break;
            case 5:
            default:
                i = 5;
                break;
            case 6:
                i = 0;
        }

        if (((Boolean)state.getValue(POWERED)).booleanValue())
        {
            i |= 8;
        }

        return i;
    }
    
    @Override
    public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
    	TileEntityAccessPanel teap = (TileEntityAccessPanel) worldIn.getTileEntity(pos);
    	return worldIn.getBlockState(pos).withProperty(COLOR, this.getPanelColor(teap.getColor()));
    }
    
    @Override
    protected BlockStateContainer createBlockState()
    {
    	return new BlockStateContainer(this, new IProperty[] {POWERED, FACING, COLOR});
    }

@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
	return new TileEntityAccessPanel();
}

public EnumColor getPanelColor(int colorIn)
{
	EnumColor color = null;
	switch (colorIn) 
	{
	case 0:
		color = EnumColor.WHITE;
		break;
	case 1:
		color = EnumColor.YELLOW;
		break;
	case 2:
		color = EnumColor.ORANGE;
		break;
	case 3:
		color = EnumColor.RED;
		break;
	case 4:
		color = EnumColor.PURPLE;
		break;
	case 5:
		color = EnumColor.BLUE;
		break;
	case 6:
		color = EnumColor.GREEN;
		break;
	case 7:
		color = EnumColor.BLACK;
		break;
	case 8:
		color = EnumColor.GREY;
		break;
	case 9:
		color = EnumColor.LIGHT_GREY;
		break;
	case 10:
		color = EnumColor.PINK;
		break;
	case 11:
		color = EnumColor.MAGENTA;
		break;
	case 12:
		color = EnumColor.LIGHT_BLUE;
		break;
	case 13:
		color = EnumColor.CYAN;
		break;
	case 14:
		color = EnumColor.LIME;
		break;
	case 15:
		color = EnumColor.BROWN;
		break;
	}
	return color;
}

public void setPanelColor(World worldIn, BlockPos posIn, int colorIn)
{
	TileEntityAccessPanel teap = (TileEntityAccessPanel) worldIn.getTileEntity(posIn);
	teap.setColor(colorIn);
	IBlockState state = worldIn.getBlockState(posIn);
	switch (colorIn) 
	{
	case 0:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.WHITE));
		break;
	case 1:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.YELLOW));
		break;
	case 2:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.ORANGE));
		break;
	case 3:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.RED));
		break;
	case 4:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.PURPLE));
		break;
	case 5:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.BLUE));
		break;
	case 6:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.GREEN));
		break;
	case 7:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.BLACK));
		break;
	case 8:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.GREY));
		break;
	case 9:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.LIGHT_GREY));
		break;
	case 10:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.PINK));
		break;
	case 11:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.MAGENTA));
		break;
	case 12:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.LIGHT_BLUE));
		break;
	case 13:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.CYAN));
		break;
	case 14:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.LIME));
		break;
	case 15:
		worldIn.setBlockState(posIn, state.withProperty(COLOR, EnumColor.BROWN));
		break;
	}
	//System.out.println(worldIn.getBlockState(posIn));
	//TODO Mit Mehrspieler testen: Tut das hier das, was es soll?
	//worldIn.markBlockForUpdate(posIn);
	worldIn.markBlockRangeForRenderUpdate(posIn, posIn);
}

static final class SwitchEnumFacing
    {
        static final int[] FACING_LOOKUP = new int[EnumFacing.values().length];
        private static final String __OBFID = "CL_00002131";

        static
        {
            try
            {
                FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 1;
            }
            catch (NoSuchFieldError var6)
            {
                ;
            }

            try
            {
                FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 2;
            }
            catch (NoSuchFieldError var5)
            {
                ;
            }

            try
            {
                FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 3;
            }
            catch (NoSuchFieldError var4)
            {
                ;
            }

            try
            {
                FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 4;
            }
            catch (NoSuchFieldError var3)
            {
                ;
            }

            try
            {
                FACING_LOOKUP[EnumFacing.UP.ordinal()] = 5;
            }
            catch (NoSuchFieldError var2)
            {
                ;
            }

            try
            {
                FACING_LOOKUP[EnumFacing.DOWN.ordinal()] = 6;
            }
            catch (NoSuchFieldError var1)
            {
                ;
            }
        }
    }
}

and this is the TileEntityAccessPanel.java

 

package net.roxa.accessControl;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagByte;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class TileEntityAccessPanel extends TileEntity
{
String name = "";
boolean toggleMode;
String players[];
int color = 0;
private int counter = 0;

public TileEntityAccessPanel()
{

}

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

	name = tagCompound.getString("Name");
	if (name == null) name = "";

	toggleMode = tagCompound.getBoolean("Toggle");

	color = tagCompound.getInteger("Color");

	NBTTagCompound tag = tagCompound.getCompoundTag("Player");
  		
  		if (tag != null)
  		{
  			int playerAmount = 0;
  	  		for (int i = 0; tag.hasKey("Player" + i); i++)
  			{
  	  		playerAmount++;
  			}
  	  		
  	  		players = new String[playerAmount];
  	  		
  	  		for (int i = 0; i < players.length; i++)
  			{
  	  		players[i] = tag.getString("Player" + i);
  			}

  	  		if (playerAmount == 0) players = null;
  		}
  		else
  		{
  			players = null;
  		}
}

@Override
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound)
{
	super.writeToNBT(tagCompound);

	tagCompound.setString("Name", name);

	tagCompound.setBoolean("Toggle", toggleMode);

	tagCompound.setInteger("Color", color);

	NBTTagCompound tag = new NBTTagCompound();
    	
    	if (players != null)
    	{
    		NBTTagString string = new NBTTagString();
    		for (int i = 0; i < players.length; i++)
    		{
    			string = new NBTTagString(players[i]);
    			tag.setTag("Player" + i, string);
    		}
    		tagCompound.setTag("Player", tag);
    	}
    	else tagCompound.setTag("Player", tag);
	return tagCompound;

}

@Override
public SPacketUpdateTileEntity getUpdatePacket()
{
	NBTTagCompound syncData = new NBTTagCompound();
	this.writeToNBT(syncData);
	return new SPacketUpdateTileEntity(pos, 0, syncData);
}

@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
	this.readFromNBT(pkt.getNbtCompound());
	RoxaAccessControlMod.network.sendToServer(new MessageInt(MessageInt.requestTileEntityForPanel, pos));
}

public void addPlayer(String nameIn)
  	{
  		int newLength;
  		if (players == null)
  		{
  			//System.out.println("Read no Players from NBT. Creating new String[]");
  			newLength = 1;
  			players = new String[newLength];
  			players[0] = nameIn;
  		}
  		else 
  		{
  			//System.out.println("Read some Players from NBT");
  			newLength = players.length + 1;
  			String[] old = players;
  			players = new String[newLength];
  			for (int i = 0; i < old.length; i++)
  			{
  				players[i] = old[i];
  				//System.out.println("Player[" + i + "] is now: " + players[i]);
  			}
  			players[newLength - 1] = nameIn;
  		}
  	}

public boolean doesPlayerExist(String nameIn)
{
	boolean exists = false;
	for (int i = 0; players != null && i < players.length; i++)
	{
		if (nameIn.equals(players[i])) exists = true;
	}
	return exists;
}

public void deletePlayer(int index)
{
	String[] old = players;

	RoxaAccessControlMod.network.sendToServer(new MessageInt(MessageInt.deletePlayerFromPanel, index));

	if (players != null && players.length > 1)
  		{
		players = new String[old.length - 1];
  			for (int i = 0; i < index; i++)
  			{
  				players[i] = old[i];
  			}
  			for (int i = players.length - 1; i >= index; i--)
  			{
  				players[i] = old[i+1];
  			}
  		}
  		else
  		{
  			players = null;
  		}
}

public boolean isToggle()
{
	return toggleMode;
}

public void setToggle(boolean toggleMode)
{
	this.toggleMode = toggleMode;

}

public void setToggleOtherPanels(World worldIn, BlockPos pos, boolean toggle)
{
	if (!name.isEmpty())
	{
		for(int i = -5; i <= 5; i++)
		{
			for(int j = -5; j <= 5; j++)
			{
				BlockPos posOther = pos.add(i, 0, j);
				Block blockOther = worldIn.getBlockState(posOther).getBlock();
				if(blockOther == RoxaAccessControlMod.accessPanel && (i != 0 | j != 0))
				{
					TileEntity tileEntityOther = worldIn.getTileEntity(posOther);
		    		TileEntityAccessPanel entityAccessPanelOther = null;
		    		if (tileEntityOther instanceof TileEntityAccessPanel) entityAccessPanelOther = (TileEntityAccessPanel)tileEntityOther;
		    		String panelNameOther = entityAccessPanelOther.getPanelName();
		    		if(name.equals(panelNameOther))
		    		{
		    			//System.out.println("Setting Toggle Mode to " + toggle + " at " + i + " " + j);
		    			entityAccessPanelOther.setToggle(toggle);
		    			
		    			TileEntity tileEntity = worldIn.getTileEntity(pos);
			    		TileEntityAccessPanel entityAccessPanel = null;
			    		if (tileEntity instanceof TileEntityAccessPanel) entityAccessPanel = (TileEntityAccessPanel)tileEntity;
			    		//System.out.println("Counter is: " + entityAccessPanel.getCounter());
		    			if (entityAccessPanel.getCounter() != entityAccessPanelOther.getCounter())
		    			{
		    				entityAccessPanelOther.setCounter(entityAccessPanel.getCounter());
		    				setToggleOtherPanels(worldIn, posOther, toggle);
		    			}
		    		}
				}
			}
		}
		for(int x = -3; x <= 3; x++)
		{
			for(int y = -3; y <= 3; y++)
			{
				if (y!=0)
				{
					for(int z = -3; z <= 3; z++)
					{
						BlockPos posOther = pos.add(x, y, z);
						Block blockOther = worldIn.getBlockState(posOther).getBlock();
						if(blockOther == RoxaAccessControlMod.accessPanel)
						{
							TileEntity tileEntityOther = worldIn.getTileEntity(posOther);
				    		TileEntityAccessPanel entityAccessPanelOther = null;
				    		if (tileEntityOther instanceof TileEntityAccessPanel) entityAccessPanelOther = (TileEntityAccessPanel)tileEntityOther;
				    		String panelNameOther = entityAccessPanelOther.getPanelName();
				    		if(name.equals(panelNameOther))
				    		{
				    			System.out.println("Setting Toggle Mode to " + toggle + " at " + x + " " + y + " " + z);
				    			entityAccessPanelOther.setToggle(toggle);
				    			
				    			TileEntity tileEntity = worldIn.getTileEntity(pos);
					    		TileEntityAccessPanel entityAccessPanel = null;
					    		if (tileEntity instanceof TileEntityAccessPanel) entityAccessPanel = (TileEntityAccessPanel)tileEntity;
					    		System.out.println("Counter is: " + entityAccessPanel.getCounter());
				    			if (entityAccessPanel.getCounter() != entityAccessPanelOther.getCounter())
				    			{
				    				entityAccessPanelOther.setCounter(entityAccessPanel.getCounter());
				    				setToggleOtherPanels(worldIn, posOther, toggle);
				    			}
				    		}
						}
					}
				}
			}
		}
	}
}

public int getColor()
{
	return this.color;
}

public void setColor(int colorIn)
{
	color = colorIn;
}

public String[] getPlayerNames()
{
	return this.players;
}

public void setPlayers(String[] playerIn)
{
	players = playerIn;
}

public void setPanelName(String nameIn)
{
	name = nameIn;
}

public String getPanelName()
{
	return name;
}

public String getName()
{
	return "tileEntity.accessPanel";
}

public int getCounter()
{
	return counter;
}

public void setCounter(int counterIn)
{
	counter = counterIn;
}

public void incCounter()
{
	counter++;
}


@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
    {
        return (oldState.getBlock() != newSate.getBlock());
    }
}

 

 

and I can't seem to find a correct way to update this line

((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1);

in public void detectAndSendChanges() in the container...

ContainerAccessAdministrator.java:

 

package net.roxa.accessControl;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.inventory.IContainerListener;
//import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCraftResult;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class ContainerAccessAdministrator extends Container
{
public IInventory cardSlot;// = new InventoryCrafting(this, 1, 1); 
protected TileEntityAccessAdministrator tileEntity;

    private World worldObj;
    private BlockPos pos;
    private EntityPlayer player;

    public ContainerAccessAdministrator(EntityPlayer playerIn, InventoryPlayer playerInventory, World worldIn, BlockPos posIn, TileEntityAccessAdministrator te)
    {
        this.worldObj = worldIn;
        this.pos = posIn;
        this.player = playerIn;
        this.tileEntity = te;
        cardSlot = te;
        int i;
        int j;
        
        this.addSlotToContainer(new Slot(this.cardSlot, 0, 14, );//22, 25)); //Slot 0 of custom "Inventory"
        
        for (i = 0; i < 3; ++i)
        {
            for (j = 0; j < 9; ++j)
            {
                this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 48 + j * 18, 121 + i * 18)); //Slot (9 to 35) or (10 to 36)
            }
        }
        
        for (i = 0; i < 9; ++i)
        {
            this.addSlotToContainer(new Slot(playerInventory, i, 48 + i * 18, 179)); //Slot (0 to  or (1 to 9)
        }
        EntityPlayer player = playerInventory.player;
        if (!worldIn.isRemote)
        {
        	//System.out.println("Casting");
        	if (RoxaAccessControlMod.network != null) 
        	{
        		ItemStack stack = cardSlot.getStackInSlot(0);
        		if (stack != null && stack.getItem() == RoxaAccessControlMod.accessCard) 
        		{
        			ItemAccessCard card = (ItemAccessCard) stack.getItem();
        			String[] panels = card.getPanels(stack);
        			int length = 0;
        			if (panels != null) length = panels.length;
        			RoxaAccessControlMod.network.sendTo(new MessageInt(MessageInt.colorsToAdministratorGui, card.getColor(stack)), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
        			RoxaAccessControlMod.network.sendTo(new MessageStringArray(MessageStringArray.panelsToAdministratorGui, panels, length), (EntityPlayerMP) player);
        		}
            	else 
            	{
            		RoxaAccessControlMod.network.sendTo(new MessageInt(MessageInt.colorsToAdministratorGui, 0), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
            		RoxaAccessControlMod.network.sendTo(new MessageStringArray(MessageStringArray.panelsToAdministratorGui, null, 0), (EntityPlayerMP) player);
            	}
        	}
        }
    }
    
    @Override
    public boolean canInteractWith(EntityPlayer playerIn)
    {
        return playerIn.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D;
    }
    
    @Override
    public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
    {
    	ItemStack itemstack = null;
    	Slot slot = (Slot)this.inventorySlots.get(index);
    	if (slot != null && slot.getHasStack())
    	{
    		ItemStack itemstack1 = slot.getStack();
    		itemstack = itemstack1.copy();
    		// If itemstack is in Output stack
    		if (index == 0)
    		{
    			// try to place in player inventory / action bar; add 36+1 because mergeItemStack uses < index,
    			// so the last slot in the inventory won't get checked if you don't add 1
    			if (!this.mergeItemStack(itemstack1, 0+1, 0+36+1, true))
    			{
    				return null;
    			}
    			slot.onSlotChange(itemstack1, itemstack);
    		}
    		// itemstack is in player inventory, try to place in appropriate furnace slot
    		else if (index != 0)
    		{
    			//if it is an access Card, place it in the access card slot
    			if (itemstack1.getItem() == RoxaAccessControlMod.accessCard)
    			{
    				if (!this.mergeItemStack(itemstack1, 0, 0+1, false))
    				{
    					return null;
    				}
    			}
    			//item in player's inventory, but not in action bar
    			else if (index >= 0+1 && index < 0+28)
    			{
    				//place in action bar
    				if (!this.mergeItemStack(itemstack1, 0+28, 0+37, false))
    				{
    					return null;
    				}
    			}
    			//item in action bar - place in player inventory
    			else if (index >= 0+28 && index < 0+37 && !this.mergeItemStack(itemstack1, 0+1, 0+28, false))
    			{
    				return null;
    			}
    		}
    		//In one of the infuser slots; try to place in player inventory / action bar
    		else if (!this.mergeItemStack(itemstack1, 0+1, 0+37, false))
    		{
    			return null;
    		}
    		
    		if (itemstack1.stackSize == 0)
    		{
    			slot.putStack((ItemStack)null);
    		}
    		else
    		{
    			slot.onSlotChanged();
    		}
    		
    		if (itemstack1.stackSize == itemstack.stackSize)
    		{
    			return null;
    		}
    		
    		slot.onPickupFromSlot(playerIn, itemstack1);
    	}
    	return itemstack;
   	}
    
    @Override
    public void detectAndSendChanges()
    {
    	for (int i = 0; i < this.inventorySlots.size(); ++i)
        {
            ItemStack stack = ((Slot)this.inventorySlots.get(i)).getStack();
            ItemStack itemstack1 = (ItemStack)this.inventoryItemStacks.get(i);

            if (!ItemStack.areItemStacksEqual(itemstack1, stack))
            {
                itemstack1 = stack == null ? null : stack.copy();
                this.inventoryItemStacks.set(i, itemstack1);

                for (int j = 0; j < this.inventorySlots.size(); ++j)
                {
                	((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1);
                }
                if (!worldObj.isRemote && stack == cardSlot.getStackInSlot(0))
                {
                	//System.out.println("Casting");
                	if (stack != null && stack.getItem() == RoxaAccessControlMod.accessCard) 
                	{
                		ItemAccessCard card = (ItemAccessCard) stack.getItem();
            			String[] panels = card.getPanels(stack);
            			int length = 0;
            			if (panels != null) length = panels.length;
            			RoxaAccessControlMod.network.sendTo(new MessageInt(MessageInt.colorsToAdministratorGui, card.getColor(stack)), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
            			RoxaAccessControlMod.network.sendTo(new MessageStringArray(MessageStringArray.panelsToAdministratorGui, panels, length), (EntityPlayerMP) player);
                	}
                	else 
                	{
                		RoxaAccessControlMod.network.sendTo(new MessageInt(MessageInt.colorsToAdministratorGui, 0), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
                		RoxaAccessControlMod.network.sendTo(new MessageStringArray(MessageStringArray.panelsToAdministratorGui, null, 0), (EntityPlayerMP) player);
                	}
                }
            }
        }
    	if (cardSlot.getStackInSlot(0) == null || cardSlot.getStackInSlot(0).getItem() != RoxaAccessControlMod.accessCard) 
    	{
    		RoxaAccessControlMod.network.sendTo(new MessageInt(MessageInt.colorsToAdministratorGui, 0), (EntityPlayerMP) player);//worldIn.getPlayerEntityByUUID(playerInventory.player.getUniqueID()));
    		RoxaAccessControlMod.network.sendTo(new MessageStringArray(MessageStringArray.panelsToAdministratorGui, null, 0), (EntityPlayerMP) player);
    	}
    }
}

 

 

Edit: The solution was to update the line to:

this.listeners.get(0).sendSlotContents(this, i, itemstack1);

The whole code can be found here:

GitHub Repo

Link to comment
Share on other sites

1.9.4 changed

TileEntity

syncing a bit, the initial chunk data sent to the client now includes the update tag (

TileEntity#getUpdateTag

) of every

TileEntity

in the chunk; the update packet (

TileEntity#getUpdatePacket

) is only sent afterwards. This document by williewillus explains the changes in more detail.

 

ICrafting

was renamed to

IContainerListener

.

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

Link to comment
Share on other sites

1.9.4 changed

TileEntity

syncing a bit, the initial chunk data sent to the client now includes the update tag (

TileEntity#getUpdateTag

) of every

TileEntity

in the chunk; the update packet (

TileEntity#getUpdatePacket

) is only sent afterwards. This document by williewillus explains the changes in more detail.

Thanks a lot! This solved it. Good explanation too :)

 

ICrafting

was renamed to

IContainerListener

.

When I chage

((ICrafting)this.crafters.get(j)).sendSlotContents(this, i, itemstack1);

to

((IContainerListener)this.inventorySlots.get(j)).sendSlotContents(this, i, itemstack1);

(as this.craftes does not seem to exist any more) it does compile but crashes as soon as I open the Gui with a "Cannot be cast" Exception. Is there anythin else but crafters and inventorySlots that I can use there? I didn't find it...

Link to comment
Share on other sites

Container#listeners

contains the

Container

's

IContainerListener

s.

 

Since generics were added to the vanilla codebase in 1.8.9 (or more accurately no longer stripped by Mojang's obfuscation process), you don't need to cast values when retrieving them from collections; the returned values are already the appropriate type. Only cast values when it's required and you already know that the value is of the type you're casting to.

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

Link to comment
Share on other sites

I know about Generics, I just can't see what that got to do with my problem?

 

Maybe I should be asking differently:

How do I get the client side of the Gui to immediatly display a change made to an item in one of the containers slots on the server side?

Right now the item updates client side (shows the correct tool tip) as soon as I take it out of the slot. How can I update the item so I see the correct tool tip even if I only hover it?

Link to comment
Share on other sites

On that one I can't follow you...

 

Right at the moment I'm delaying the problem by simply commenting out the line, but I haven't found a proper solution yet.

 

The basic gist of what I was saying is don't cast unless you have a reason to and you know that the value you're casting is actually an instance of the type you're casting to.

 

Container#inventorySlots

is a

List<Slot>

.

Slot

is completely unrelated to

IContainerListener

, so don't try to cast a

Slot

to

IContainerListener

.

 

Container#listeners

is a

List<IContainerListener>

. You don't need to cast values from this to

IContainerListener

because they're already that type.

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • 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.
    • Hi, i appreciate the answer. I would love to do that, but we have active players with all their belongings in SSN. Also this mod is really handy and they would be mad if we removed it. Are you really certain that SSN is causing this? It would require lots of work to test it and SSN was not really an issue before we removed Fast Suite. Can it be related somehow? I will provide you with log before removing FS. PasteBin: https://pastebin.com/Y5EpLpNe (crash before removing Fast Suite, which I suspected to be a problem from some crash before)
    • Backup the world and make a test without storagenetwork
  • Topics

×
×
  • Create New...

Important Information

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