Jump to content

Need help with readFrom/Write to NBT


Zeher_Monkey

Recommended Posts

Added that, doesnt seem to do much. Basically what is happening is that when i change a side, and exit the world, the side reverts to what is used to be. Say i changed it from 0 to 2, i left the world, came back and it was 0 again. With a block update (Place and destroy another block next to my block), it stays as 2. I want to know if theres a way i can make sure it gets updated so it doesnt revert or require a block update. If i leave it enough time writeToNBT gets called anyway, however i want to make sure it doesnt revert. I may not have been clear, sorry :/ 

Link to comment
Share on other sites

Just now, Jay Avery said:

Can you post all your latest code? It's hard to keep track with various updates in different posts.

Of course :)

BlockCapacitorBasic

Spoiler

package com.zeher.orecraft.core.block.capacitor;

import java.util.Random;

import javax.annotation.Nullable;

import com.zeher.orecraft.OreCraftCore;
import com.zeher.orecraft.client.tileentity.capacitor.TileEntityCapacitorAdvanced;
import com.zeher.orecraft.client.tileentity.capacitor.TileEntityCapacitorBasic;
import com.zeher.orecraft.client.tileentity.energypipe.TileEntityEnergyPipeBasic;
import com.zeher.orecraft.core.handlers.BlockHandlerOreCraft;
import com.zeher.orecraft.core.net.NetUtils;
import com.zeher.orecraft.core.net.packet.PacketCapacitorBasic;
import com.zeher.trzcore.api.TRZUtil;
import com.zeher.trzcore.api.energy.TRZPipeConnectBase;
import com.zeher.trzcore.core.block.TRZBlockCapacitor;
import com.zeher.trzcore.core.tileentity.TRZTileEntityEnergyPipe;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.stats.StatList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.IWorldNameable;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class BlockCapacitorBasic extends TRZBlockCapacitor{
    
    private final Random capacitor_random = new Random();
    private boolean keepCapacitorInventory;
    
    public static final PropertyInteger NORTH = PropertyInteger.create("north", 0, 2);
    public static final PropertyInteger EAST = PropertyInteger.create("east", 0, 2);
    public static final PropertyInteger SOUTH = PropertyInteger.create("south", 0, 2);
    public static final PropertyInteger WEST = PropertyInteger.create("west", 0, 2);
    public static final PropertyInteger UP = PropertyInteger.create("up", 0, 2);
    public static final PropertyInteger DOWN = PropertyInteger.create("down", 0, 2);
    
    public int upSide;
    public int downSide;
    public int eastSide;
    public int westSide;
    public int northSide;
    public int southSide;

    public BlockCapacitorBasic(Material material, String name) {
        super(material, name);
        this.setDefaultState(this.blockState.getBaseState().withProperty(NORTH, 0)
                .withProperty(EAST, 0)
                .withProperty(SOUTH, 0)
                .withProperty(WEST, 0)
                .withProperty(UP, 0)
                .withProperty(DOWN, 0));
        setHardness(8);
        setResistance(10);
        
    }
    
    
    @Override
    public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
        Item item = Item.getItemFromBlock(this);
        ItemStack stack = new ItemStack(this, 1, 1000);
        return stack.getItem();
    }

    @Override
    public boolean isOpaqueCube(IBlockState state){
        return false;
    }
    
    @Override
    public boolean isFullCube(IBlockState state){
        return false;
    }
    
    public EnumBlockRenderType getRenderType(IBlockState state)
    {
        return EnumBlockRenderType.MODEL;
    }
    
    public TileEntity createNewTileEntity(World world, int i){
        return new TileEntityCapacitorBasic();
    }
    
    public void onBlockClicked(World worldIn, BlockPos pos, EntityPlayer playerIn)
    {
        //updateBlock((TileEntityCapacitorBasic) worldIn.getTileEntity(pos), worldIn, pos);
        if(!(worldIn.isRemote) && !(playerIn.isSneaking()) && (TRZUtil.isHoldingHammer(playerIn))){
                FMLNetworkHandler.openGui(playerIn, OreCraftCore.instance, 0, worldIn, pos.getX(), pos.getY(), pos.getZ());
                //this.getActualState(worldIn.getBlockState(pos), worldIn, pos);
        }
    }
    
    public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
    {
        worldIn.setBlockState(pos, state);
        worldIn.notifyBlockUpdate(pos, state, state, 3);
        
        //updateBlock((TileEntityCapacitorBasic) worldIn.getTileEntity(pos), worldIn, pos);
        this.getActualState(state, worldIn, pos);
        if(!(worldIn.isRemote) && !(playerIn.isSneaking()) && !(TRZUtil.isHoldingHammer(playerIn))){
            FMLNetworkHandler.openGui(playerIn, OreCraftCore.instance, 1, worldIn, pos.getX(), pos.getY(), pos.getZ());
        }
        if((TRZUtil.isHoldingHammer(playerIn)) && (playerIn.isSneaking()) && !(worldIn.isRemote)){
            playerIn.swingArm(EnumHand.MAIN_HAND);
                
                TileEntityCapacitorBasic tile = (TileEntityCapacitorBasic)worldIn.getTileEntity(pos);
                int set_power = tile.getPower();
                
                Item item1 = ItemBlock.getItemFromBlock(this);
                ItemStack stack = new ItemStack(item1);
                item1.setDamage(stack, item1.getMaxDamage() - (set_power / 1000));
                
                spawnAsEntity(worldIn, pos, stack);
                
                worldIn.destroyBlock(pos, false);
        }
        TileEntityCapacitorBasic tile = (TileEntityCapacitorBasic) worldIn.getTileEntity(pos);
        if ((TRZUtil.isHoldingHammer(playerIn)) && (!playerIn.isSneaking())) {
            playerIn.swingArm(EnumHand.MAIN_HAND);
            if (side.equals(EnumFacing.UP)) {
                if(worldIn.isRemote){
                    tile.cycleSide("up");
                } else {
                    tile.cycleSide("up");
                }
            }
            if (side.equals(EnumFacing.DOWN)) {
                if(worldIn.isRemote){
                    tile.cycleSide("down");
                } else {
                    tile.cycleSide("down");
                }
            }
            if (side.equals(EnumFacing.NORTH)) {
                if(worldIn.isRemote){
                    tile.cycleSide("north");
                } else {
                    tile.cycleSide("north");
                }
            }
            if (side.equals(EnumFacing.SOUTH)) {
                if(worldIn.isRemote){
                    tile.cycleSide("south");
                } else {
                    tile.cycleSide("south");
                }
            }
            if (side.equals(EnumFacing.EAST)) {
                if(worldIn.isRemote){
                    tile.cycleSide("east");
                } else {
                    tile.cycleSide("east");
                }
            }
            if (side.equals(EnumFacing.WEST)) {
                if(worldIn.isRemote){
                    tile.cycleSide("west");
                } else {
                    tile.cycleSide("west");
                }
            }
        }
        
        //tile.getUpdatePacket();
        //tile.writeToNBT(new NBTTagCompound());
        return false;
    }
    
    protected BlockStateContainer createBlockState()
    {
        return new BlockStateContainer(this, new IProperty[] {NORTH, EAST, WEST, SOUTH, UP, DOWN});
    }
    
    public int getMetaFromState(IBlockState state)
    {
        return 0;
    }
    
    public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {    
        TileEntityCapacitorBasic tile = (TileEntityCapacitorBasic)worldIn.getTileEntity(pos);
        
        return state.withProperty(NORTH, tile.getSide("north"))
                .withProperty(EAST, tile.getSide("east"))
                .withProperty(SOUTH, tile.getSide("south"))
                .withProperty(WEST, tile.getSide("west"))
                .withProperty(UP, tile.getSide("up"))
                .withProperty(DOWN, tile.getSide("down"));
    }
    
    public boolean getSide(EnumFacing side, World world, BlockPos pos){
        TileEntity tile = world.getTileEntity(pos);
        int northInt = 0;
        int eastInt = 0;
        int southInt = 0;
        int westInt = 0;
        int downInt = 0;
        int upInt = 0;
        if(tile != null && tile instanceof TileEntityCapacitorBasic){
            northInt = ((TileEntityCapacitorBasic) tile).getSide("north");
            eastInt = ((TileEntityCapacitorBasic) tile).getSide("east");
            southInt = ((TileEntityCapacitorBasic) tile).getSide("south");
            westInt = ((TileEntityCapacitorBasic) tile).getSide("west");
            downInt = ((TileEntityCapacitorBasic) tile).getSide("down");
            upInt = ((TileEntityCapacitorBasic) tile).getSide("up");
        } else {
            
        }
        
        boolean upBool = false;
        boolean downBool = false;
        boolean northBool = false;
        boolean southBool = false;
        boolean eastBool = false;
        boolean westBool = false;
        if(side.equals(EnumFacing.UP)){
            if(upInt == 1){
                upBool = false;
            } else if(upInt == 2 || upInt == 0){
                upBool = true;
            }
            return upBool;
        }
        
        if(side.equals(EnumFacing.DOWN)){
            if(downInt == 1){
                downBool = false;
            } else if(downInt == 2 || downInt == 0){
                downBool = true;
            }
            return downBool;
        }
        if(side.equals(EnumFacing.NORTH)){
            if(northInt == 1){
                northBool = false;
            } else if(northInt == 2 || northInt == 0){
                northBool = true;
            }
            return northBool;
        }
        if(side.equals(EnumFacing.SOUTH)){
            if(southInt == 1){
                southBool = false;
            } else if(southInt == 2 || southInt == 0){
                southBool = true;
            }
            return southBool;
        }
        if(side.equals(EnumFacing.EAST)){
            if(eastInt == 1){
                eastBool = false;
            } else if(eastInt == 2 || eastInt == 0){
                eastBool = true;
            }
            return eastBool;
        }
        if(side.equals(EnumFacing.WEST)){
            if(westInt == 1){
                westBool = false;
            } else if(westInt == 2 || westInt == 0){
                westBool = true;
            }
            return westBool;
        }
        return false;
    }
    
    public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
    {
        if (!keepCapacitorInventory)
        {
          TileEntityCapacitorBasic tileentityenergystorage_1 = (TileEntityCapacitorBasic)worldIn.getTileEntity(pos);
          if (tileentityenergystorage_1 != null)
          {
            for (int j1 = 0; j1 < tileentityenergystorage_1.getSizeInventory(); j1++)
            {
              ItemStack itemstack = tileentityenergystorage_1.getStackInSlot(j1);
              if (itemstack != null)
              {
                float f = this.capacitor_random.nextFloat() * 0.8F + 0.1F;
                float f1 = this.capacitor_random.nextFloat() * 0.8F + 0.1F;
                float f2 = this.capacitor_random.nextFloat() * 0.8F + 0.1F;
                while (itemstack.getCount() > 0)
                {
                  int k1 = this.capacitor_random.nextInt(21) + 10;
                  if (k1 > itemstack.getCount()) {
                    k1 = itemstack.getCount();
                  }
                  itemstack.setCount(itemstack.getCount() - k1);
                  EntityItem entityitem = new EntityItem(worldIn, pos.getX() + f, pos.getY() + f1, pos.getZ() + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
                  if (itemstack.hasTagCompound()) {
                    entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
                  }
                  float f3 = 0.05F;
                  entityitem.posX = ((float)this.capacitor_random.nextGaussian() * f3);
                  entityitem.posY = ((float)this.capacitor_random.nextGaussian() * f3 + 0.2F);
                  entityitem.posZ = ((float)this.capacitor_random.nextGaussian() * f3);
                  worldIn.spawnEntity(entityitem);
                }
              }
            }
          }
        }
        super.breakBlock(worldIn, pos, state);
      }
    
    
    
}

 

TileEntityCapacitorBasic

Spoiler

package com.zeher.orecraft.client.tileentity.capacitor;

import javax.annotation.Nullable;

import com.zeher.orecraft.OreCraftCore;
import com.zeher.orecraft.core.block.capacitor.BlockCapacitorBasic;
import com.zeher.orecraft.core.net.NetUtils;
import com.zeher.orecraft.core.net.packet.PacketCapacitorBasic;
import com.zeher.trzcore.api.TRZBlockPosition;
import com.zeher.trzcore.api.energy.TRZICapacitor;
import com.zeher.trzcore.api.energy.TRZItemEnergyBase;
import com.zeher.trzcore.core.block.TRZBlockEnergyPipe;
import com.zeher.trzcore.core.item.TRZItemBattery;
import com.zeher.trzcore.core.tileentity.TRZTileEntityCapacitor;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;

public class TileEntityCapacitorBasic extends TRZTileEntityCapacitor
        implements ISidedInventory, IInventory, ITickable, TRZICapacitor {

    private String custom_name;
    private NonNullList<ItemStack> capacitorItemStacks = NonNullList.<ItemStack>withSize(8, ItemStack.EMPTY);
    private static final int[] slots_top = { 1 };
    private static final int[] slots_bottom = { 2, 1 };
    private static final int[] slots_sides = { 1 };
    public int _power;
    public int _max_power = 20000000;

    public int energy_recieve;
    public int energy_send;

    public int up;
    public int down;
    public int north;
    public int south;
    public int east;
    public int west;

    public byte[] side_cache = { 0, 0, 0, 0, 0, 0 };

    @Override
    public int getSizeInventory() {
        return this.capacitorItemStacks.size();
    }
    
    public void cycleSide(String side){
        if(side.equals("up")){
            int i = getSide("up");
            i = i+1;
            if(i > 2){
                i= 0;
            }
            up = i;
        }
        if(side.equals("down")){
            int i = getSide("down");
            i = i+1;
            if(i > 2){
                i= 0;
            }
            down = i;
        }
        if(side.equals("east")){
            int i = getSide("east");
            i = i+1;
            if(i > 2){
                i= 0;
            }
            east = i;
        }
        if(side.equals("west")){
            int i = getSide("west");
            i = i+1;
            if(i > 2){
                i= 0;
            }
            west = i;
        }
        if(side.equals("north")){
            int i = getSide("north");
            i = i+1;
            if(i > 2){
                i= 0;
            }
            north = i;
        }
        if(side.equals("south")){
            int i = getSide("south");
            i = i+1;
            if(i > 2){
                i= 0;
            }
            south = i;
        }
        Minecraft.getMinecraft().renderGlobal.markBlockRangeForRenderUpdate(pos.getX(), pos.getY(), pos.getZ(), pos.getX(), pos.getY(), pos.getZ());
        world.markBlockRangeForRenderUpdate(pos, pos);
        //world.markAndNotifyBlock(pos, null, world.getBlockState(pos), world.getBlockState(pos), 3);
        /*Block block =  world.getBlockState(pos).getBlock();
        if(block instanceof BlockCapacitorBasic && block != null){
            ((BlockCapacitorBasic)block).updateBlock((TileEntityCapacitorBasic) world.getTileEntity(pos), world, pos);
            block.getActualState(world.getBlockState(pos), world, pos);
        }*/
    }
    
    
    public void setSideNBT(String str, int value) {
        if (str == "up") {
            this.up = value;
        }
        if (str == "down") {
            this.down = value;
        }
        if (str == "north") {
            this.north = value;
        }
        if (str == "south") {
            this.south = value;
        }
        if (str == "east") {
            this.east = value;
        }
        if (str == "west") {
            this.west = value;
        }
        markDirty();
    }

    public int getSide(String str) {
        if (str == "up") {
            return this.up;
        }
        if (str == "down") {
            return this.down;
        }
        if (str == "north") {
            return this.north;
        }
        if (str == "south") {
            return this.south;
        }
        if (str == "east") {
            return this.east;
        }
        if (str == "west") {
            return this.west;
        }
        return 0;
    }

    @Override
    public void update() {
        //BlockCapacitorBasic blockToUpdate = (BlockCapacitorBasic) world.getBlockState(pos).getBlock();
        //blockToUpdate.updateBlock((TileEntityCapacitorBasic) world.getTileEntity(pos), world, pos);
        
        boolean flag = this._power > 0;
        boolean flag1 = false;
        ItemStack stackInput = capacitorItemStacks.get(1);
        ItemStack stackOutput = capacitorItemStacks.get(0);
        if (!this.world.isRemote) {
            if ((isItemPowerStorage(0)) && !(stackOutput.isEmpty()) && (this._power > 0)) {
                if (stackOutput.getItemDamage() > 0) {
                    stackOutput.setItemDamage(stackOutput.getItemDamage() - 1);
                    this._power -= TRZItemEnergyBase.getItemPower(stackOutput.getItem());
                }
            }
            if ((isItemPower(1))
                    && (this._power <= this._max_power - TRZItemEnergyBase.getItemPower(stackInput.getItem()))) {
                if (!stackInput.isItemStackDamageable()) {
                    this._power += TRZItemEnergyBase.getItemPower(stackInput.getItem());

                    flag1 = true;
                    if (!(stackInput.isEmpty())) {
                        stackInput.setCount(stackInput.getCount() - 1);
                        if (stackInput.isEmpty()) {
                            this.capacitorItemStacks.set(1, stackInput.getItem().getContainerItem(stackInput));
                        }
                    }
                } else if (stackInput.getItemDamage() < stackInput.getMaxDamage()) {
                    this._power += TRZItemEnergyBase.getItemPower(stackInput.getItem());
                    this.capacitorItemStacks.set(1,
                            new ItemStack(stackInput.getItem(), stackInput.getCount(), stackInput.getItemDamage() + 1));
                }
            }
            if (flag1) {
                this.update();
                this.markDirty();
            }
        }

        IBlockState state = world.getBlockState(this.pos);
        Block block = state.getBlock();
        if (block instanceof BlockCapacitorBasic) {
            boolean up = ((BlockCapacitorBasic) block).getSide(EnumFacing.UP, world, this.pos);
            boolean down = ((BlockCapacitorBasic) block).getSide(EnumFacing.DOWN, world, pos);
            boolean east = ((BlockCapacitorBasic) block).getSide(EnumFacing.EAST, world, this.pos);
            boolean west = ((BlockCapacitorBasic) block).getSide(EnumFacing.WEST, world, pos);
            boolean north = ((BlockCapacitorBasic) block).getSide(EnumFacing.NORTH, world, this.pos);
            boolean south = ((BlockCapacitorBasic) block).getSide(EnumFacing.SOUTH, world, pos);

            if (up) {
                TRZBlockPosition bp = new TRZBlockPosition(pos);
                bp.orientation = EnumFacing.UP;
                bp.moveForwards(1);
                Block blockUp = world.getBlockState(bp.pos).getBlock();

                if (this.up == 1) {
                    if (blockUp != null) {
                        capacitorItemStacks.set(2, new ItemStack(blockUp));
                    }
                }
                if (this.up == 1) {
                    capacitorItemStacks.set(2, ItemStack.EMPTY);
                }
                if (this.up == 2) {
                    capacitorItemStacks.set(2, new ItemStack(blockUp));
                }
            } else {
                capacitorItemStacks.set(2, ItemStack.EMPTY);
            }

            if (down) {
                TRZBlockPosition bp = new TRZBlockPosition(pos);
                bp.orientation = EnumFacing.DOWN;
                bp.moveForwards(1);
                Block blockDown = world.getBlockState(bp.pos).getBlock();

                if (this.down == 0) {
                    if (blockDown instanceof TRZBlockEnergyPipe) {
                        capacitorItemStacks.set(3, new ItemStack(blockDown));
                    } else {
                        capacitorItemStacks.set(3, ItemStack.EMPTY);
                    }
                }
                if (this.down == 1) {
                    capacitorItemStacks.set(3, ItemStack.EMPTY);
                }
                if (this.down == 2) {
                    capacitorItemStacks.set(3, new ItemStack(blockDown));
                }
            } else {
                capacitorItemStacks.set(3, ItemStack.EMPTY);
            }

            if (east) {
                TRZBlockPosition bp = new TRZBlockPosition(pos);
                bp.orientation = EnumFacing.EAST;
                bp.moveForwards(1);
                Block blockEast = world.getBlockState(bp.pos).getBlock();

                if (this.east == 0) {
                    if (blockEast instanceof TRZBlockEnergyPipe) {
                        capacitorItemStacks.set(4, new ItemStack(blockEast));
                    } else {
                        capacitorItemStacks.set(4, ItemStack.EMPTY);
                    }
                }
                if (this.east == 1) {
                    capacitorItemStacks.set(4, ItemStack.EMPTY);
                }
                if (this.east == 2) {
                    capacitorItemStacks.set(4, new ItemStack(blockEast));
                }
            } else {
                capacitorItemStacks.set(4, ItemStack.EMPTY);
            }

            if (west) {
                TRZBlockPosition bp = new TRZBlockPosition(pos);
                bp.orientation = EnumFacing.WEST;
                bp.moveForwards(1);
                Block blockWest = world.getBlockState(bp.pos).getBlock();

                if (this.west == 0) {
                    if (blockWest instanceof TRZBlockEnergyPipe) {
                        capacitorItemStacks.set(5, new ItemStack(blockWest));
                    } else {
                        capacitorItemStacks.set(5, ItemStack.EMPTY);
                    }
                }
                if (this.west == 1) {
                    capacitorItemStacks.set(5, ItemStack.EMPTY);
                }
                if (this.west == 2) {
                    capacitorItemStacks.set(5, new ItemStack(blockWest));
                } 
            } else {
                capacitorItemStacks.set(5, ItemStack.EMPTY);
            }

            if (north) {
                TRZBlockPosition bp = new TRZBlockPosition(pos);
                bp.orientation = EnumFacing.NORTH;
                bp.moveForwards(1);
                Block blockNorth = world.getBlockState(bp.pos).getBlock();

                if (this.north == 0) {
                    if (blockNorth instanceof TRZBlockEnergyPipe) {
                        capacitorItemStacks.set(6, new ItemStack(blockNorth));
                    } else {
                        capacitorItemStacks.set(6, ItemStack.EMPTY);
                    }
                }
                if (this.north == 1) {
                    capacitorItemStacks.set(6, ItemStack.EMPTY);
                }
                if (this.north == 2) {
                    capacitorItemStacks.set(6, new ItemStack(blockNorth));
                }
            } else {
                capacitorItemStacks.set(6, ItemStack.EMPTY);
            }

            if (south) {
                TRZBlockPosition bp = new TRZBlockPosition(pos);
                bp.orientation = EnumFacing.SOUTH;
                bp.moveForwards(1);
                Block blockSouth = world.getBlockState(bp.pos).getBlock();

                if (this.south == 0) {
                    if (blockSouth instanceof TRZBlockEnergyPipe) {
                        capacitorItemStacks.set(7, new ItemStack(blockSouth));
                    } else {
                        capacitorItemStacks.set(7, ItemStack.EMPTY);
                    }
                }
                if (this.south == 1) {
                    capacitorItemStacks.set(7, ItemStack.EMPTY);
                }
                if (this.south == 2) {
                    capacitorItemStacks.set(7, new ItemStack(blockSouth));
                } 
            } else {
                capacitorItemStacks.set(7, ItemStack.EMPTY);
            }
        }
    }

    private boolean isItemPowerStorage(int index) {
        if (!(this.capacitorItemStacks.get(index).isEmpty())) {
            return this.capacitorItemStacks.get(index).getItem() instanceof TRZItemBattery;
        }
        return false;
    }

    public int getPowerReaminingScaled(int par1) {
        return this._power * par1 / this._max_power;
    }

    public ItemStack getStackInSlot(int i) {
        return this.capacitorItemStacks.get(i);
    }

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

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

    public boolean isItemPower(int index) {
        return TRZItemEnergyBase.getItemPower(this.capacitorItemStacks.get(index).getItem()) > 0;
    }

    @Override
    public void setInventorySlotContents(int index, ItemStack stack) {
        ItemStack itemstack = (ItemStack) this.capacitorItemStacks.get(index);
        boolean flag = !stack.isEmpty() && stack.isItemEqual(itemstack)
                && ItemStack.areItemStackTagsEqual(stack, itemstack);
        this.capacitorItemStacks.set(index, stack);
        if (stack.getCount() > this.getInventoryStackLimit()) {
            stack.setCount(this.getInventoryStackLimit());
        }
    }

    public String getName() {
        return this.hasCustomName() ? this.custom_name : "Basic Capacitor";
    }

    public boolean hasCustomName() {
        return (this.custom_name != null) && (this.custom_name.length() > 0);
    }

    public void setGuiDisplayName(String par1Str) {
        this.custom_name = par1Str;
    }

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

    @Override
    public boolean isUsableByPlayer(EntityPlayer player) {
        return player.getDistanceSq(this.pos) <= 64.0D;
    }

    public void openInventory() {
    }

    public void closeInventory() {
    }

    @Override
    public boolean isItemValidForSlot(int i, ItemStack itemstack) {
        return true;
    }

    public void readFromNBT(NBTTagCompound compound) {
        this.capacitorItemStacks = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
        ItemStackHelper.loadAllItems(compound, this.capacitorItemStacks);
        this._power = compound.getInteger("power");
        
        System.out.println("READ (NBT) - " + compound.getInteger("DirUp") + " " + compound.getInteger("DirDown") + " " + compound.getInteger("DirNorth") + " " + compound.getInteger("DirSouth") + " " + compound.getInteger("DirEast") + " " + compound.getInteger("DirWest"));
        this.up = compound.getInteger("DirUp");
        this.down = compound.getInteger("DirDown");
        this.north = compound.getInteger("DirNorth");
        this.south = compound.getInteger("DirSouth");
        this.east = compound.getInteger("DirEast");
        this.west = compound.getInteger("DirWest");
        
        if (compound.hasKey("custom_name", 8)) {
            this.custom_name = compound.getString("custom_name");
        }
        super.readFromNBT(compound);
    }

    public NBTTagCompound writeToNBT(NBTTagCompound compound) {
        ItemStackHelper.saveAllItems(compound, this.capacitorItemStacks);
        compound.setInteger("power", this._power);
        
        System.out.println("WRITE (NBT)" + up + " " + down + " " + north + " " + south + " " + east + " " + west);
        compound.setInteger("DirUp", this.up);
        compound.setInteger("DirDown", this.down);
        compound.setInteger("DirNorth", this.north);
        compound.setInteger("DirSouth", this.south);
        compound.setInteger("DirEast", this.east);
        compound.setInteger("DirWest", this.west);
        
        if (this.hasCustomName()) {
            compound.setString("custom_name", this.custom_name);
        }
        return super.writeToNBT(compound);
    }
    
    @Nullable
    public SPacketUpdateTileEntity getUpdatePacket()
    {
        NBTTagCompound tag = new NBTTagCompound();
        tag.setInteger("DirUp", this.up);
        tag.setInteger("DirDown", this.down);
        tag.setInteger("DirNorth", this.north);
        tag.setInteger("DirSouth", this.south);
        tag.setInteger("DirEast", this.east);
        tag.setInteger("DirWest", this.west);
        
        System.out.println("Sending Packet - " + getSide("up") + " " + getSide("down") + " " + getSide("north") + " " + getSide("south") + " " + getSide("east") + " " + getSide("west"));
        writeToNBT(tag);
        return new SPacketUpdateTileEntity(pos, 0, tag);
    }

    public void onDataPacket(net.minecraft.network.NetworkManager net, net.minecraft.network.play.server.SPacketUpdateTileEntity pkt)
    {
        NBTTagCompound tag = pkt.getNbtCompound();
        int a = tag.getInteger("DirUp");
        int b = tag.getInteger("DirDown"); 
        int c = tag.getInteger("DirNorth");
        int d = tag.getInteger("DirSouth");
        int e = tag.getInteger("DirEast");
        int f = tag.getInteger("DirWest");
        System.out.println("Packet Received - " + a + " " + b + " " + c + " " + d + " " + e + " " + f);
        //handleUpdateTag(tag);
        this.up = a;
        this.down = b;
        this.north = c; 
        this.south = d;
        this.east = e;
        this.west = f;
    }
    
    public void handleUpdateTag(NBTTagCompound tag)
    {
        this.readFromNBT(tag);
    }
    
    public NBTTagCompound getUpdateTag()
    {
        return writeToNBT(new NBTTagCompound());
    }
    
    @Override
    public boolean isEmpty() {
        for (ItemStack itemstack : this.capacitorItemStacks) {
            if (!itemstack.isEmpty()) {
                return false;
            }
        }

        return true;
    }

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

    }

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

    }

    public int getField(int id) {
        switch (id) {
        case 0:
            return this._power;
        default:
            return 0;
        }
    }

    public void setField(int id, int value) {
        switch (id) {
        case 0:
            this._power = value;
            break;
        }
    }

    public int getFieldCount() {
        return 1;
    }

    @Override
    public void clear() {
        // TODO Auto-generated method stub

    }

    @Override
    public int[] getSlotsForFace(EnumFacing side) {
        // TODO Auto-generated method stub
        return side.UP != null ? slots_top : side.DOWN != null ? slots_bottom : slots_sides;
    }

    @Override
    public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean hasPower() {
        return this._power > 0;
    }

    @Override
    public int getPower() {
        return _power;
    }

    @Override
    public int getMaxSend() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public int getMaxReceive() {
        // TODO Auto-generated method stub
        return 0;
    }

}
 

 

PacketCapacitorBasic

Spoiler

package com.zeher.orecraft.core.net.packet;

import com.zeher.orecraft.client.tileentity.capacitor.TileEntityCapacitorBasic;
import com.zeher.orecraft.core.block.capacitor.BlockCapacitorBasic;

import io.netty.buffer.ByteBuf;
import net.minecraft.util.IThreadListener;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

public class PacketCapacitorBasic implements IMessage {
    
    private static String side;
    private static BlockPos pos;
    private static boolean cycle;
    private static int value;
    
    public PacketCapacitorBasic(){
        
    }
    
    public PacketCapacitorBasic(String side, BlockPos pos){
        this.side = side;
        this.pos = pos;
        cycle = true;
    }
    
    public PacketCapacitorBasic(String side, BlockPos pos, boolean cycle, int value){
        this.side = side;
        this.pos = pos;
        this.cycle = cycle;
        this.value = value;
    }
    
    @Override
    public void fromBytes(ByteBuf buf) {
        side = ByteBufUtils.readUTF8String(buf);
    }

    @Override
    public void toBytes(ByteBuf buf) {
        ByteBufUtils.writeUTF8String(buf, side);
    }
    
    public static class Handler implements IMessageHandler<PacketCapacitorBasic, IMessage> {

        @SuppressWarnings("unused")
        @Override
        public IMessage onMessage(final PacketCapacitorBasic message, final MessageContext ctx) {
            TileEntityCapacitorBasic tileEntity = (TileEntityCapacitorBasic)ctx.getServerHandler().playerEntity.world.getTileEntity(pos);
            BlockCapacitorBasic block = (BlockCapacitorBasic)ctx.getServerHandler().playerEntity.world.getBlockState(pos).getBlock();
            System.out.println("Packet Received: " + tileEntity.getName() + " BlockPos: " + pos);
            if(tileEntity != null){
                System.out.println("TileEntity is not null: " + "Cycle side: " + side);
                if(cycle){
                    tileEntity.cycleSide(side);
                    //tileEntity.getUpdatePacket();
                    //ctx.getServerHandler().playerEntity.world.setBlockState(pos, ctx.getServerHandler().playerEntity.world.getBlockState(pos));
                } else {
                    tileEntity.setSideNBT(side, value);
                }
            } 
            ctx.getServerHandler().playerEntity.world.markBlockRangeForRenderUpdate(pos, pos);
            if(tileEntity == null){
            System.out.println("TileEntity is NULL!. Report to mod author!");
            }
            return null;
        }
    
    }

}
 

 If theres anything else you want to see please ask :P 

Link to comment
Share on other sites

2 hours ago, Zeher_Monkey said:

Also setBlock()? What for...

I said you need to call something setBlock/setBlockStatee calls.

Okay, if you can't understand.. I meant World::notifyBlockUpdate.

Edited by Abastro

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

The nature of this issue as you describe it sounds like you aren't calling markDirty on the TileEntity when you need to. The purpose of that method is to tell the game that the TE needs to be saved to NBT, so it needs to be called anywhere that the TE's data gets changed. But it looks like you're not calling it in cycleSide, which changes the ints in the TE.

Link to comment
Share on other sites

4 minutes ago, Abastro said:

I said you need to call something setBlock/setBlockStatee calls.

Okay, if you can't understand.. I meant World::notifyBlockUpdate.

Yeah i figured that out after, dont worry :P 

 

3 minutes ago, Jay Avery said:

The nature of this issue as you describe it sounds like you aren't calling markDirty on the TileEntity when you need to. The purpose of that method is to tell the game that the TE needs to be saved to NBT, so it needs to be called anywhere that the TE's data gets changed. But it looks like you're not calling it in cycleSide, which changes the ints in the TE.

Ill try that thanks :) 

 

--Edit--

So simple. I don't know how i missed that :D. Thanks Jay. I think its sorted for now, until i mess up again :P Cheers everyone who helped out :) 

Edited by Zeher_Monkey
Link to comment
Share on other sites

Join the conversation

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

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, I'm trying to modify the effects of native enchantments for bows and arrows in Minecraft. After using a decompilation tool, I found that the specific implementations of native bow and arrow enchantments (including `ArrowDamageEnchantment`, `ArrowKnockbackEnchantment`, `ArrowFireEnchantment`, `ArrowInfiniteEnchantment`, `ArrowPiercingEnchantment`) do not contain any information about the enchantment effects (such as the `getDamageProtection` function for `ProtectionEnchantment`, `getDamageBonus` function for `DamageEnchantment`, etc.). Upon searching for the base class of arrows, `AbstractArrow`, I found a function named setEnchantmentEffectsFromEntity`, which seems to be used to retrieve the enchantment levels of the tool held by a `LivingEntity` and calculate the specific values of the enchantment effects. However, after testing with the following code, I found that this function is not being called:   @Mixin(AbstractArrow.class) public class ModifyArrowEnchantmentEffects {     private static final Logger LOGGER = LogUtils.getLogger();     @Inject(         method = "setEnchantmentEffectsFromEntity",         at = @At("HEAD")     )     private void logArrowEnchantmentEffectsFromEntity(CallbackInfo ci) {         LOGGER.info("Arrow enchantment effects from entity");     } }   Upon further investigation, I found that within the onHitEntity method, there are several lines of code:               if (!this.level().isClientSide &amp;&amp; entity1 instanceof LivingEntity) {                EnchantmentHelper.doPostHurtEffects(livingentity, entity1);                EnchantmentHelper.doPostDamageEffects((LivingEntity)entity1, livingentity);             }   These lines of code actually call the doPostHurt and doPostAttack methods of each enchantment in the enchantment list. However, this leads back to the issue because native bow and arrow enchantments do not implement these functions. Although their base class defines the functions, they are empty. At this point, I'm completely stumped and seeking assistance. Thank you.
    • I have been trying to make a server with forge but I keep running into an issue. I have jdk 22 installed as well as Java 8. here is the debug file  
    • it crashed again     What the console says : [00:02:03] [Server thread/INFO] [Easy NPC/]: [EntityManager] Server started! [00:02:03] [Server thread/INFO] [co.gi.al.ic.IceAndFire/]: {iceandfire:fire_dragon_roost=true, iceandfire:fire_lily=true, iceandfire:spawn_dragon_skeleton_fire=true, iceandfire:lightning_dragon_roost=true, iceandfire:spawn_dragon_skeleton_lightning=true, iceandfire:ice_dragon_roost=true, iceandfire:ice_dragon_cave=true, iceandfire:lightning_dragon_cave=true, iceandfire:cyclops_cave=true, iceandfire:spawn_wandering_cyclops=true, iceandfire:spawn_sea_serpent=true, iceandfire:frost_lily=true, iceandfire:hydra_cave=true, iceandfire:lightning_lily=true, iceandfireixie_village=true, iceandfire:myrmex_hive_jungle=true, iceandfire:myrmex_hive_desert=true, iceandfire:silver_ore=true, iceandfire:siren_island=true, iceandfire:spawn_dragon_skeleton_ice=true, iceandfire:spawn_stymphalian_bird=true, iceandfire:fire_dragon_cave=true, iceandfire:sapphire_ore=true, iceandfire:spawn_hippocampus=true, iceandfire:spawn_death_worm=true} [00:02:03] [Server thread/INFO] [co.gi.al.ic.IceAndFire/]: {TROLL_S=true, HIPPOGRYPH=true, AMPHITHERE=true, COCKATRICE=true, TROLL_M=true, DREAD_LICH=true, TROLL_F=true} [00:02:03] [Server thread/INFO] [ne.be.lo.WeaponRegistry/]: Encoded Weapon Attribute registry size (with package overhead): 41976 bytes (in 5 string chunks with the size of 10000) [00:02:03] [Server thread/INFO] [patchouli/]: Sending reload packet to clients [00:02:03] [Server thread/WARN] [voicechat/]: [voicechat] Running in offline mode - Voice chat encryption is not secure! [00:02:03] [VoiceChatServerThread/INFO] [voicechat/]: [voicechat] Using server-ip as bind address: 0.0.0.0 [00:02:03] [Server thread/WARN] [ModernFix/]: Dedicated server took 22.521 seconds to load [00:02:03] [VoiceChatServerThread/INFO] [voicechat/]: [voicechat] Voice chat server started at 0.0.0.0:25565 [00:02:03] [Server thread/WARN] [minecraft/SynchedEntityData]: defineId called for: class net.minecraft.world.entity.player.Player from class tschipp.carryon.common.carry.CarryOnDataManager [00:02:03] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@2941ffd5 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 0 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 1 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 2 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 3 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 4 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 5 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 6 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 7 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 8 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 9 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 10 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 11 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 12 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 13 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 14 [00:02:19] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@ebc7ef2 [00:02:19] [Server thread/INFO] [minecraft/PlayerList]: ZacAdos[/90.2.17.162:49242] logged in with entity id 1062 at (-1848.6727005281205, 221.0, -3054.2468255848935) [00:02:19] [Server thread/ERROR] [ModernFix/]: Skipping entity ID sync for com.talhanation.smallships.world.entity.ship.Ship: java.lang.NoClassDefFoundError: net/minecraft/client/CameraType [00:02:19] [Server thread/INFO] [minecraft/MinecraftServer]: - Gloop - ZacAdos joined the game [00:02:19] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Updating all forceload tickets for cc56befd-d376-3526-a760-340713c478bd [00:02:19] [Server thread/INFO] [se.mi.te.da.DataManager/]: Sending data to client: ZacAdos [00:02:19] [Server thread/INFO] [voicechat/]: [voicechat] Received secret request of - Gloop - ZacAdos (17) [00:02:19] [Server thread/INFO] [voicechat/]: [voicechat] Sent secret to - Gloop - ZacAdos [00:02:21] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Successfully authenticated player cc56befd-d376-3526-a760-340713c478bd [00:02:22] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Successfully validated connection of player cc56befd-d376-3526-a760-340713c478bd [00:02:22] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Player - Gloop - ZacAdos (cc56befd-d376-3526-a760-340713c478bd) successfully connected to voice chat stop [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping the server [00:02:34] [Server thread/INFO] [mo.pl.ar.ArmourersWorkshop/]: stop local service [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [00:02:34] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: ZacAdos lost connection: Server closed [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: - Gloop - ZacAdos left the game [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Updating all forceload tickets for cc56befd-d376-3526-a760-340713c478bd [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_end [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_nether [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (world): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage: All dimensions are saved [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Stopping IO worker... [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Stopped IO worker! [00:02:34] [Server thread/INFO] [Calio/]: Removing Dynamic Registries for: net.minecraft.server.dedicated.DedicatedServer@7dc879e1 [MineStrator Daemon]: Checking server disk space usage, this could take a few seconds... [MineStrator Daemon]: Updating process configuration files... [MineStrator Daemon]: Ensuring file permissions are set correctly, this could take a few seconds... [MineStrator Daemon]: Pulling Docker container image, this could take a few minutes to complete... [MineStrator Daemon]: Finished pulling Docker container image container@pterodactyl~ java -version openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7) OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing) container@pterodactyl~ java -Xms128M -Xmx6302M -Dterminal.jline=false -Dterminal.ansi=true -Djline.terminal=jline.UnsupportedTerminal -p libraries/cpw/mods/bootstraplauncher/1.1.2/bootstraplauncher-1.1.2.jar:libraries/cpw/mods/securejarhandler/2.1.4/securejarhandler-2.1.4.jar:libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:libraries/net/minecraftforge/JarJarFileSystems/0.3.16/JarJarFileSystems-0.3.16.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-opens java.base/java.lang.invoke=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming -Djava.net.preferIPv6Addresses=system -DignoreList=bootstraplauncher-1.1.2.jar,securejarhandler-2.1.4.jar,asm-commons-9.5.jar,asm-util-9.5.jar,asm-analysis-9.5.jar,asm-tree-9.5.jar,asm-9.5.jar,JarJarFileSystems-0.3.16.jar -DlibraryDirectory=libraries -DlegacyClassPath=libraries/cpw/mods/securejarhandler/2.1.4/securejarhandler-2.1.4.jar:libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:libraries/net/minecraftforge/accesstransformers/8.0.4/accesstransformers-8.0.4.jar:libraries/org/antlr/antlr4-runtime/4.9.1/antlr4-runtime-4.9.1.jar:libraries/net/minecraftforge/eventbus/6.0.3/eventbus-6.0.3.jar:libraries/net/minecraftforge/forgespi/6.0.0/forgespi-6.0.0.jar:libraries/net/minecraftforge/coremods/5.0.1/coremods-5.0.1.jar:libraries/cpw/mods/modlauncher/10.0.8/modlauncher-10.0.8.jar:libraries/net/minecraftforge/unsafe/0.2.0/unsafe-0.2.0.jar:libraries/com/electronwill/night-config/core/3.6.4/core-3.6.4.jar:libraries/com/electronwill/night-config/toml/3.6.4/toml-3.6.4.jar:libraries/org/apache/maven/maven-artifact/3.8.5/maven-artifact-3.8.5.jar:libraries/net/jodah/typetools/0.8.3/typetools-0.8.3.jar:libraries/net/minecrell/terminalconsoleappender/1.2.0/terminalconsoleappender-1.2.0.jar:libraries/org/jline/jline-reader/3.12.1/jline-reader-3.12.1.jar:libraries/org/jline/jline-terminal/3.12.1/jline-terminal-3.12.1.jar:libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar:libraries/org/openjdk/nashorn/nashorn-core/15.3/nashorn-core-15.3.jar:libraries/net/minecraftforge/JarJarSelector/0.3.16/JarJarSelector-0.3.16.jar:libraries/net/minecraftforge/JarJarMetadata/0.3.16/JarJarMetadata-0.3.16.jar:libraries/net/minecraftforge/fmlloader/1.19.2-43.3.0/fmlloader-1.19.2-43.3.0.jar:libraries/net/minecraft/server/1.19.2-20220805.130853/server-1.19.2-20220805.130853-extra.jar:libraries/com/github/oshi/oshi-core/5.8.5/oshi-core-5.8.5.jar:libraries/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar:libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:libraries/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar:libraries/com/mojang/authlib/3.11.49/authlib-3.11.49.jar:libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar:libraries/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar:libraries/com/mojang/javabridge/1.2.24/javabridge-1.2.24.jar:libraries/com/mojang/logging/1.0.0/logging-1.0.0.jar:libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:libraries/io/netty/netty-buffer/4.1.77.Final/netty-buffer-4.1.77.Final.jar:libraries/io/netty/netty-codec/4.1.77.Final/netty-codec-4.1.77.Final.jar:libraries/io/netty/netty-common/4.1.77.Final/netty-common-4.1.77.Final.jar:libraries/io/netty/netty-handler/4.1.77.Final/netty-handler-4.1.77.Final.jar:libraries/io/netty/netty-resolver/4.1.77.Final/netty-resolver-4.1.77.Final.jar:libraries/io/netty/netty-transport/4.1.77.Final/netty-transport-4.1.77.Final.jar:libraries/io/netty/netty-transport-classes-epoll/4.1.77.Final/netty-transport-classes-epoll-4.1.77.Final.jar:libraries/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final-linux-x86_64.jar:libraries/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final-linux-aarch_64.jar:libraries/io/netty/netty-transport-native-unix-common/4.1.77.Final/netty-transport-native-unix-common-4.1.77.Final.jar:libraries/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.jar:libraries/net/java/dev/jna/jna/5.10.0/jna-5.10.0.jar:libraries/net/java/dev/jna/jna-platform/5.10.0/jna-platform-5.10.0.jar:libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar:libraries/org/apache/logging/log4j/log4j-api/2.17.0/log4j-api-2.17.0.jar:libraries/org/apache/logging/log4j/log4j-core/2.17.0/log4j-core-2.17.0.jar:libraries/org/apache/logging/log4j/log4j-slf4j18-impl/2.17.0/log4j-slf4j18-impl-2.17.0.jar:libraries/org/slf4j/slf4j-api/1.8.0-beta4/slf4j-api-1.8.0-beta4.jar cpw.mods.bootstraplauncher.BootstrapLauncher --launchTarget forgeserver --fml.forgeVersion 43.3.0 --fml.mcVersion 1.19.2 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20220805.130853 [00:02:42] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 43.3.0, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [00:02:42] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.10 by Eclipse Adoptium; OS Linux arch amd64 version 6.1.0-12-amd64 [00:02:43] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/home/container/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2363!/ Service=ModLauncher Env=SERVER [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/fmlcore/1.19.2-43.3.0/fmlcore-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/javafmllanguage/1.19.2-43.3.0/javafmllanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/lowcodelanguage/1.19.2-43.3.0/lowcodelanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/mclanguage/1.19.2-43.3.0/mclanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:44] [main/WARN] [ne.mi.ja.se.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [00:02:44] [main/WARN] [ne.mi.ja.se.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: /home/container/mods/resourcefullib-forge-1.19.2-1.1.24.jar [00:02:44] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: Found 13 dependencies adding them to mods collection Latest log [29Mar2024 00:02:42.803] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 43.3.0, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [29Mar2024 00:02:42.805] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.10 by Eclipse Adoptium; OS Linux arch amd64 version 6.1.0-12-amd64 [29Mar2024 00:02:43.548] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/home/container/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2363!/ Service=ModLauncher Env=SERVER [29Mar2024 00:02:43.876] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/fmlcore/1.19.2-43.3.0/fmlcore-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.877] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/javafmllanguage/1.19.2-43.3.0/javafmllanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.877] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/lowcodelanguage/1.19.2-43.3.0/lowcodelanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.878] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/mclanguage/1.19.2-43.3.0/mclanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:44.033] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [29Mar2024 00:02:44.034] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: /home/container/mods/resourcefullib-forge-1.19.2-1.1.24.jar [29Mar2024 00:02:44.034] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 13 dependencies adding them to mods collection
    • I am unable to do that. Brigadier is a mojang library that parses commands.
  • Topics

×
×
  • Create New...

Important Information

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