Jump to content

[1.7.2] Did the system time change, or is the server overloaded?


loawkise

Recommended Posts

I keep getting these errors but can't figure out why. They don't happen when a specific event takes place, well not that I know of, so I can't figure out the cause.

 

[19:08:29] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 14900ms behind, skipping 298 tick(s)

[19:08:41] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2154ms behind, skipping 43 tick(s)

[19:08:59] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2479ms behind, skipping 49 tick(s)

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I am using packets yes. I am not sure what could be causing it because I am not too familiar with packets as I am newish to modding. These are all the packet classes, which work, but I am not familiar with how they work so I can't seem to figure out why they are causing this error, if they are.

 

 

 

package com.blocklings.network;

 

import java.io.IOException;

 

import net.minecraft.entity.player.EntityPlayerMP;

import net.minecraft.network.NetHandlerPlayServer;

 

import com.blocklings.main.Blocklings;

 

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;

 

public class ServerPacketHandler {

 

protected String channelName;

protected EntityPlayerMP thePlayer;

 

@SubscribeEvent

public void onServerPacket(ServerCustomPacketEvent event) throws IOException {

 

channelName = event.packet.channel();

 

NetHandlerPlayServer theNetHandlerPlayServer = (NetHandlerPlayServer) event.handler;

thePlayer = theNetHandlerPlayServer.playerEntity;

 

if (channelName.equals(Blocklings.networkChannelName)) {

 

ProcessPacketServerSide.processPacketOnServer(event.packet.payload(),event.packet.getTarget(), thePlayer);

 

}

}

}

 

 

 

 

 

 

package com.blocklings.network;

 

import io.netty.buffer.ByteBuf;

import io.netty.buffer.ByteBufInputStream;

 

import java.io.IOException;

 

import net.minecraft.entity.player.EntityPlayerMP;

 

import com.blocklings.main.Blocklings;

 

import cpw.mods.fml.relauncher.Side;

 

public class ProcessPacketServerSide {

 

public ProcessPacketServerSide() {

 

}

 

public static void processPacketOnServer(ByteBuf parBB, Side parSide, EntityPlayerMP parPlayer) throws IOException {

 

if (parSide == Side.SERVER)

{

 

System.out.println("Received Packet on Server Side from Player = " + parPlayer.getEntityId());

 

ByteBufInputStream bbis = new ByteBufInputStream(parBB);

 

int packetTypeID = bbis.readInt();

 

System.out.println("Packet type ID = " + packetTypeID);

 

switch (packetTypeID) {

 

case Blocklings.PACKET_TYPE_C2S_TEST: {

 

int testVal = bbis.readInt();

 

break;

}

 

}

 

bbis.close();

 

}

}

}

 

 

 

 

 

package com.blocklings.network;

 

import java.io.IOException;

 

import com.blocklings.main.Blocklings;

 

import cpw.mods.fml.common.eventhandler.SubscribeEvent;

import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;

 

public class ClientPacketHandler extends ServerPacketHandler {

 

@SubscribeEvent

public void onClientPacket(ClientCustomPacketEvent event) throws IOException {

 

channelName = event.packet.channel();

 

if (channelName.equals(Blocklings.networkChannelName)) {

 

ProcessPacketClientSide.processPacketOnClient(event.packet.payload(), event.packet.getTarget());

 

}

}

}

 

 

 

 

 

package com.blocklings.network;

 

import io.netty.buffer.ByteBuf;

import io.netty.buffer.ByteBufInputStream;

 

import java.io.IOException;

 

import net.minecraft.client.Minecraft;

import net.minecraft.entity.Entity;

import net.minecraft.world.World;

 

import com.blocklings.entity.EntityBlockling;

import com.blocklings.main.Blocklings;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class ProcessPacketClientSide {

 

public ProcessPacketClientSide() {

 

}

 

@SideOnly(Side.CLIENT)

public static void processPacketOnClient(ByteBuf parBB, Side parSide) throws IOException {

 

if (parSide == Side.CLIENT) {

 

World theWorld = Minecraft.getMinecraft().theWorld;

ByteBufInputStream bbis = new ByteBufInputStream(parBB);

 

int packetTypeID = bbis.readInt();

 

switch (packetTypeID) {

case Blocklings.PACKET_TYPE_ENTITY_SYNC:

{

 

int entityID = bbis.readInt();

 

Entity foundEntity = getEntityByID(entityID, theWorld);

 

if (foundEntity != null) {

 

} else {

 

 

 

}

 

if (foundEntity instanceof EntityBlockling) {

 

EntityBlockling blockling = (EntityBlockling) foundEntity;

 

blockling.setLevel(bbis.readInt());

 

blockling.setCurrentUpgradeTier(bbis.readInt());

 

blockling.setAttackTimer(bbis.readFloat());

 

}

 

break;

 

}

 

}

 

bbis.close();

 

}

}

 

 

public static Entity getEntityByID(int entityID, World world) {

 

for (Object o : world.getLoadedEntityList()) {

 

if (((Entity) o).getEntityId() == entityID) {

 

return ((Entity) o);

 

}

}

 

return null;

 

}

}

 

 

 

 

 

package com.blocklings.network;

 

import io.netty.buffer.ByteBufOutputStream;

import io.netty.buffer.Unpooled;

 

import java.io.IOException;

 

import net.minecraft.entity.Entity;

 

import com.blocklings.entity.EntityBlockling;

import com.blocklings.main.Blocklings;

 

import cpw.mods.fml.common.network.internal.FMLProxyPacket;

 

public class CreatePacketServerSide {

 

public CreatePacketServerSide() {

 

}

 

public static FMLProxyPacket createEntityPacket(Entity parEntity) throws IOException {

 

ByteBufOutputStream bbos = new ByteBufOutputStream(Unpooled.buffer());

 

bbos.writeInt(Blocklings.PACKET_TYPE_ENTITY_SYNC);

 

bbos.writeInt(parEntity.getEntityId());

 

if (parEntity instanceof EntityBlockling) {

 

EntityBlockling blockling = (EntityBlockling) parEntity;

 

bbos.writeInt(blockling.getLevel());

 

bbos.writeInt(blockling.getCurrentUpgradeTier());

 

bbos.writeFloat(blockling.getAttackTimer());

 

}

 

FMLProxyPacket thePacket = new FMLProxyPacket(bbos.buffer(), Blocklings.networkChannelName);

 

bbos.close();

 

return thePacket;

}

 

public static void sendToAll(FMLProxyPacket parPacket) {

 

Blocklings.channel.sendToAll(parPacket);

 

}

 

public static void sendS2CEntitySync(Entity parEntity) {

 

try {

 

sendToAll(createEntityPacket(parEntity));

 

} catch (IOException e) {

 

e.printStackTrace();

 

}

}

}

 

 

Link to comment
Share on other sites

Here is what comes up when the lag spikes occur:

 

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai.newAi' took aprox 2297.20861 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai' took aprox 2297.396424 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick' took aprox 2297.491871 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular' took aprox 2308.833617 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities' took aprox 2308.994747 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick' took aprox 2312.519436 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels.New World' took aprox 2312.805776 ms

[09:50:25] [server thread/WARN]: Something's taking too long! 'root.levels' took aprox 2313.091774 ms

 

I am not entirely sure though what the source of this would be, but I am assuming my packets perhaps.

Link to comment
Share on other sites

I assume Blocklings use the new AI?

 

How many Blocklings are you loading, what is their detection/pathfinding range, and is there anything else about them that might cause the behaviour of the new AI to take up a large amount of resources?

Link to comment
Share on other sites

I am not too sure if there is anything wrong with it:

 

this.getNavigator().setAvoidsWater(false);

this.getNavigator().setCanSwim(true);

this.tasks.addTask(1, new EntityAISwimming(this));

this.tasks.addTask(2, this.aiSit);

this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));

this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 12.0F, 1.0F));

this.tasks.addTask(5, new EntityAIWander(this, 1.0D));

this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));

this.tasks.addTask(6, new EntityAILookIdle(this));

this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));

this.targetTasks.addTask(2, new EntityAIOwnerHurtByTarget(this));

this.targetTasks.addTask(3, new EntityAIOwnerHurtTarget(this));

this.setTamed(false);

 

Also some more errors started cropping up that you may find useful:

 

 

[10:49:39] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular' took aprox 1733.634726 ms

[10:49:39] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities' took aprox 1733.80612 ms

[10:49:39] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick' took aprox 1734.82764 ms

[10:49:39] [server thread/WARN]: Something's taking too long! 'root.levels.New World' took aprox 1735.154349 ms

[10:49:39] [server thread/WARN]: Something's taking too long! 'root.levels' took aprox 1735.311032 ms

[10:49:39] [server thread/WARN]: Something's taking too long! 'root' took aprox 1735.547425 ms

[10:49:43] [server thread/WARN]: Something's taking too long! 'root.connection.entityBaseTick' took aprox 2239.146521 ms

[10:49:43] [server thread/WARN]: Something's taking too long! 'root.connection' took aprox 2239.534466 ms

[10:49:43] [server thread/WARN]: Something's taking too long! 'root' took aprox 2247.847915 ms

[10:49:43] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2249ms behind, skipping 44 tick(s)

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai.newAi' took aprox 1787.395209 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai' took aprox 1802.375907 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick' took aprox 1802.500432 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular' took aprox 1831.465963 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities' took aprox 1831.63291 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick' took aprox 1834.835337 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels.New World' took aprox 1835.136046 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root.levels' took aprox 1835.307439 ms

[10:49:45] [server thread/WARN]: Something's taking too long! 'root' took aprox 1835.474728 ms

[10:49:49] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.tickBlocks' took aprox 2075.184351 ms

[10:49:49] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick' took aprox 2085.748496 ms

[10:49:49] [server thread/WARN]: Something's taking too long! 'root.levels.New World' took aprox 2086.254467 ms

[10:49:49] [server thread/WARN]: Something's taking too long! 'root.levels' took aprox 2086.439887 ms

[10:49:49] [server thread/WARN]: Something's taking too long! 'root' took aprox 2086.528491 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai.newAi.navigation' took aprox 1795.846184 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai.newAi' took aprox 1813.656757 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick.ai' took aprox 1813.704994 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick' took aprox 1813.794283 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular' took aprox 1834.972179 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities' took aprox 1835.252019 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick' took aprox 1838.506446 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels.New World' took aprox 1838.909786 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root.levels' took aprox 1839.1171 ms

[10:49:51] [server thread/WARN]: Something's taking too long! 'root' took aprox 1839.318257 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular.tick' took aprox 2127.64279 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities.regular' took aprox 2138.937667 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick.entities' took aprox 2139.105982 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root.levels.New World.tick' took aprox 2142.223568 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root.levels.New World' took aprox 2142.512987 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root.levels' took aprox 2142.67446 ms

[10:49:54] [server thread/WARN]: Something's taking too long! 'root' took aprox 2142.875959 ms

 

Link to comment
Share on other sites

I overwrite quite a lot of methods, plus the class is pretty big because they have a built in xp and levelling system.

 

 

 

package com.blocklings.entity;

 

import java.util.List;

import java.util.Random;

 

import net.minecraft.entity.Entity;

import net.minecraft.entity.EntityAgeable;

import net.minecraft.entity.EntityLivingBase;

import net.minecraft.entity.SharedMonsterAttributes;

import net.minecraft.entity.ai.EntityAIAttackOnCollide;

import net.minecraft.entity.ai.EntityAIBeg;

import net.minecraft.entity.ai.EntityAIFollowOwner;

import net.minecraft.entity.ai.EntityAIHurtByTarget;

import net.minecraft.entity.ai.EntityAILeapAtTarget;

import net.minecraft.entity.ai.EntityAILookIdle;

import net.minecraft.entity.ai.EntityAIMate;

import net.minecraft.entity.ai.EntityAINearestAttackableTarget;

import net.minecraft.entity.ai.EntityAIOwnerHurtByTarget;

import net.minecraft.entity.ai.EntityAIOwnerHurtTarget;

import net.minecraft.entity.ai.EntityAISwimming;

import net.minecraft.entity.ai.EntityAITarget;

import net.minecraft.entity.ai.EntityAITargetNonTamed;

import net.minecraft.entity.ai.EntityAIWander;

import net.minecraft.entity.ai.EntityAIWatchClosest;

import net.minecraft.entity.monster.EntityMob;

import net.minecraft.entity.passive.EntitySheep;

import net.minecraft.entity.passive.EntityTameable;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.init.Blocks;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.pathfinding.PathEntity;

import net.minecraft.util.AxisAlignedBB;

import net.minecraft.util.ChatComponentText;

import net.minecraft.util.DamageSource;

import net.minecraft.util.MathHelper;

import net.minecraft.world.World;

 

import com.blocklings.main.Blocklings;

import com.blocklings.network.CreatePacketServerSide;

 

import cpw.mods.fml.client.FMLClientHandler;

 

public class EntityBlockling extends EntityTameable {

 

public int xp;

public int level;

public int requiredXP;

public double maxHealth;

public double attackDamage;

 

public int currentUpgradeTier;

 

public float hitbox;

 

public float attackTimer;

 

public int i;

 

public EntityBlockling(World world) {

 

super(world);

 

this.xp = 0;

this.level = 1;

this.requiredXP = 250;

this.maxHealth = 4.0D;

this.attackDamage = 1.0D;

 

this.currentUpgradeTier = 1;

 

this.hitbox = 1.0F;

 

this.i = 0;

 

this.setSize(hitbox, hitbox);

this.getNavigator().setAvoidsWater(false);

this.getNavigator().setCanSwim(true);

this.tasks.addTask(1, new EntityAISwimming(this));

        this.tasks.addTask(2, this.aiSit);

        this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0D, false));

        this.tasks.addTask(4, new EntityAIFollowOwner(this, 1.0D, 12.0F, 1.0F));

        this.tasks.addTask(5, new EntityAIWander(this, 1.0D));

        this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));

        this.tasks.addTask(6, new EntityAILookIdle(this));

        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));

        this.targetTasks.addTask(2, new EntityAIOwnerHurtByTarget(this));

        this.targetTasks.addTask(3, new EntityAIOwnerHurtTarget(this));

        this.setTamed(false);

       

        setEntitySize();

       

}

 

protected void applyEntityAttributes() {

 

this.maxHealth = 4.0D;

this.attackDamage = 1.0D;

 

super.applyEntityAttributes();

 

this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxHealth); 

this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);

this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage);

this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(this.attackDamage);

 

}

 

public boolean getCanSpawnHere() {

 

int i = MathHelper.floor_double(this.posX);

        int j = MathHelper.floor_double(this.boundingBox.minY);

        int k = MathHelper.floor_double(this.posZ);

       

        int l = this.worldObj.getFullBlockLightValue(i, j, k);

        boolean s = this.worldObj.canBlockSeeTheSky(i, j, k);

        boolean b = this.worldObj.getBlock(i, j - 1, k) == Blocks.grass;

       

        List list = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(posX, posY, posZ, posX + 1, posY + 1, posZ + 1).expand(16D, 512D, 16D));

 

    return list.size() < 5 && l > 8 && b && s;

 

}

 

public boolean interact(EntityPlayer par1EntityPlayer)

    {

        ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();

       

        if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && par1EntityPlayer.isSneaking() && itemstack == null) {

       

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

        "XP: " + this.xp + "/" + this.requiredXP + " | " +

        "Level: " + this.level));

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

        "Health: " + (int)this.getHealth() + "/" + (int)this.maxHealth + " | " +

        "Attack Damage: " + (int)this.attackDamage));

       

        }

       

        if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemWoodenUpgrade && this.currentUpgradeTier == 1 && this.level >= 2 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

       

        this.currentUpgradeTier = 2;

       

        setMaxHealth();

        setAttackDamage();

        this.heal((float)maxHealth - this.getHealth());

       

        if (!par1EntityPlayer.capabilities.isCreativeMode) {

           

                --itemstack.stackSize;

 

            }

 

            if (itemstack.stackSize <= 0) {

           

                par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

 

                FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

            "Wooden Upgrade Applied"));

               

            }

           

            if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

       

        }

       

        if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemCobblestoneUpgrade && this.currentUpgradeTier == 2 && this.level >= 3 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

       

        this.currentUpgradeTier = 3;

       

        setMaxHealth();

        setAttackDamage();

        this.heal((float)maxHealth - this.getHealth());

       

        if (!par1EntityPlayer.capabilities.isCreativeMode) {

           

                --itemstack.stackSize;

 

            }

 

            if (itemstack.stackSize <= 0) {

           

                par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

               

                FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

            "Cobblestone Upgrade Applied"));

               

            }

           

            if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

       

        }

       

        if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemStoneUpgrade && this.currentUpgradeTier == 3 && this.level >= 4 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

       

        this.currentUpgradeTier = 4;

       

        setMaxHealth();

        setAttackDamage();

        this.heal((float)maxHealth - this.getHealth());

       

        if (!par1EntityPlayer.capabilities.isCreativeMode) {

           

                --itemstack.stackSize;

 

            }

 

            if (itemstack.stackSize <= 0) {

           

                par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

               

                FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

            "Stone Upgrade Applied"));

               

            }

           

            if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

       

        }

 

if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemIronUpgrade && this.currentUpgradeTier == 4 && this.level >= 5 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

 

this.currentUpgradeTier = 5;

 

setMaxHealth();

setAttackDamage();

this.heal((float)maxHealth - this.getHealth());

 

if (!par1EntityPlayer.capabilities.isCreativeMode) {

   

        --itemstack.stackSize;

 

    }

 

    if (itemstack.stackSize <= 0) {

   

        par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

       

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

    "Iron Upgrade Applied"));

       

    }

   

    if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

 

}

 

if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemLapisLazuliUpgrade && this.currentUpgradeTier == 5 && this.level >= 6 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

 

this.currentUpgradeTier = 6;

 

setMaxHealth();

setAttackDamage();

this.heal((float)maxHealth - this.getHealth());

 

if (!par1EntityPlayer.capabilities.isCreativeMode) {

   

        --itemstack.stackSize;

 

    }

 

    if (itemstack.stackSize <= 0) {

   

        par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

       

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

    "Lapis Lazuli Upgrade Applied"));

       

    }

   

    if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

 

}

 

if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemGoldUpgrade && this.currentUpgradeTier == 6 && this.level >= 7 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

 

this.currentUpgradeTier = 7;

 

setMaxHealth();

setAttackDamage();

this.heal((float)maxHealth - this.getHealth());

 

if (!par1EntityPlayer.capabilities.isCreativeMode) {

   

        --itemstack.stackSize;

 

    }

 

    if (itemstack.stackSize <= 0) {

   

        par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

       

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

    "Gold Upgrade Applied"));

       

    }

   

    if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

 

}

 

if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemDiamondUpgrade && this.currentUpgradeTier == 7 && this.level >= 8 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

 

this.currentUpgradeTier = 8;

 

setMaxHealth();

setAttackDamage();

this.heal((float)maxHealth - this.getHealth());

 

if (!par1EntityPlayer.capabilities.isCreativeMode) {

   

        --itemstack.stackSize;

 

    }

 

    if (itemstack.stackSize <= 0) {

   

        par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

       

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

    "Diamond Upgrade Applied"));

       

    }

   

    if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

 

}

 

if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemEmeraldUpgrade && this.currentUpgradeTier == 8 && this.level >= 9 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

 

this.currentUpgradeTier = 9;

 

setMaxHealth();

setAttackDamage();

this.heal((float)maxHealth - this.getHealth());

 

if (!par1EntityPlayer.capabilities.isCreativeMode) {

   

        --itemstack.stackSize;

 

    }

 

    if (itemstack.stackSize <= 0) {

   

        par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

       

        FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

    "Emerald Upgrade Applied"));

       

    }

   

    if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

 

}

 

if(par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && itemstack != null && itemstack.getItem() == Blocklings.itemObsidianUpgrade && this.currentUpgradeTier == 9 && this.level >= 10 && !this.worldObj.isRemote && par1EntityPlayer.isSneaking()) {

   

    this.currentUpgradeTier = 10;

   

    setMaxHealth();

    setAttackDamage();

    this.heal((float)maxHealth - this.getHealth());

   

    if (!par1EntityPlayer.capabilities.isCreativeMode) {

       

            --itemstack.stackSize;

 

        }

 

        if (itemstack.stackSize <= 0) {

       

            par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

           

            FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

        "Obsidian Upgrade Applied"));

           

        }

       

        if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

   

    }

 

if(!this.worldObj.isRemote && this.isTamed() && itemstack == null && par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !par1EntityPlayer.isSneaking()) {

 

this.aiSit.setSitting(!this.isSitting());

 

}

       

        if (itemstack != null && (itemstack.getItem() == Item.getItemFromBlock(Blocks.red_flower) || itemstack.getItem() == Item.getItemFromBlock(Blocks.yellow_flower))) {

       

            if (!par1EntityPlayer.capabilities.isCreativeMode && !this.isTamed()) {

           

                --itemstack.stackSize;

               

            }

 

            if (itemstack.stackSize <= 0 && !this.isTamed()) {

           

                par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);

               

            }

           

            if (!this.worldObj.isRemote && !this.isTamed()) {

           

                if (this.rand.nextInt(2) == 0) {

               

                    this.setTamed(true);

                    this.setPathToEntity((PathEntity)null);

                    this.setAttackTarget((EntityLivingBase)null);

                    this.setOwner(par1EntityPlayer.getCommandSenderName());

                    this.playTameEffect(true);

                    this.worldObj.setEntityState(this, (byte)7);

                   

                } else {

               

                    this.playTameEffect(false);

                    this.worldObj.setEntityState(this, (byte)6);

                   

                }

               

            }

 

            return true;

           

        }

 

        return super.interact(par1EntityPlayer);

       

    }

 

public void onLivingUpdate() {

 

super.onLivingUpdate();

 

if (this.attackTimer > 0) {

 

this.attackTimer -= 1;

 

if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

 

    }

 

}

 

if(i < 3) {

 

if (!worldObj.isRemote) {

 

      CreatePacketServerSide.sendS2CEntitySync(this);

      i++;

 

    }

 

}

 

}

 

public boolean attackEntityAsMob(Entity par1Entity) {

 

Random random = new Random();

 

if(this.attackTimer <= 2) {

 

this.attackTimer = 8;

 

}

 

if(this.isTamed()) {

 

addXP((int)this.attackDamage + random.nextInt((int)this.attackDamage + (int)this.attackDamage * 3));

setMaxHealth();

setAttackDamage();

 

}

 

        return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue());

       

}

 

public void writeEntityToNBT(NBTTagCompound compound) {

 

        super.writeEntityToNBT(compound);

        compound.setInteger("XP", this.xp);

        compound.setInteger("Level", this.level);

compound.setInteger("Required XP", this.requiredXP);

compound.setDouble("Max Health", this.maxHealth);

compound.setDouble("Attack Damage", this.attackDamage);

 

compound.setInteger("Current Upgrade Tier", this.currentUpgradeTier);

 

compound.setFloat("Hitbox", this.hitbox);

       

    }

 

    public void readEntityFromNBT(NBTTagCompound compound) {

 

        super.readEntityFromNBT(compound);

        this.xp = compound.getInteger("XP");

        this.level = compound.getInteger("Level");

this.requiredXP = compound.getInteger("Required XP");

this.maxHealth = compound.getInteger("Max Health");

this.attackDamage = compound.getInteger("Attack Damage");

 

this.currentUpgradeTier = compound.getInteger("Current Upgrade Tier");

 

this.hitbox = compound.getFloat("Hitbox");

       

    }

   

    public void addXP(int addedXP) {

   

this.xp = this.xp + addedXP;

onLevelUp();

 

}

 

public void onLevelUp() {

 

if(this.xp >= this.requiredXP) {

 

this.xp = 0;

this.level = level + 1;

calculateRequiredXP();

setMaxHealth();

setEntitySize();

this.heal((float)maxHealth - this.getHealth());

FMLClientHandler.instance().getClient().ingameGUI.getChatGUI().printChatMessage(new ChatComponentText(

    "Your Blockling Levelled Up! It is now level " + this.level));

 

}

 

}

 

public void calculateRequiredXP() {

 

this.requiredXP = this.level * this.level * 10 * 10;

 

}

 

public void setMaxHealth() {

 

if(this.level == 1) {

 

this.maxHealth = 4.0D;

 

} else if(this.level == 2 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 6.0D;

 

} else if(this.level == 3 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 9.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 12.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 15.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 19.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 23.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 28.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 33.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 1) {

 

this.maxHealth = 40.0D;

 

} else if(this.level == 2 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 7.0D;

 

} else if(this.level == 3 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 10.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 13.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 16.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 20.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 24.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 29.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 34.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 2) {

 

this.maxHealth = 41.0D;

 

} else if(this.level == 3 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 11.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 14.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 17.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 21.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 25.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 30.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 35.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 3) {

 

this.maxHealth = 42.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 15.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 18.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 22.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 26.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 31.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 36.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 4) {

 

this.maxHealth = 43.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 5) {

 

this.maxHealth = 19.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 5) {

 

this.maxHealth = 23.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 5) {

 

this.maxHealth = 27.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 5) {

 

this.maxHealth = 32.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 5) {

 

this.maxHealth = 37.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 5) {

 

this.maxHealth = 44.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 6) {

 

this.maxHealth = 24.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 6) {

 

this.maxHealth = 28.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 6) {

 

this.maxHealth = 33.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 6) {

 

this.maxHealth = 38.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 6) {

 

this.maxHealth = 45.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 7) {

 

this.maxHealth = 29.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 7) {

 

this.maxHealth = 34.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 7) {

 

this.maxHealth = 39.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 7) {

 

this.maxHealth = 46.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 8) {

 

this.maxHealth = 35.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 8) {

 

this.maxHealth = 40.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 8) {

 

this.maxHealth = 47.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 9) {

 

this.maxHealth = 41.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 9) {

 

this.maxHealth = 48.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 10) {

 

this.maxHealth = 50.0D;

 

}

 

this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxHealth); 

 

}

 

public void setAttackDamage() {

 

if(this.level == 1) {

 

this.attackDamage = 1.0D;

 

} else if(this.level == 2 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 2.0D;

 

} else if(this.level == 3 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 3.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 4.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 5.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 7.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 9.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 11.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 13.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 1) {

 

this.attackDamage = 15.0D;

 

} else if(this.level == 2 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 3.0D;

 

} else if(this.level == 3 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 4.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 5.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 6.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 8.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 10.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 12.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 14.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 2) {

 

this.attackDamage = 16.0D;

 

} else if(this.level == 3 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 5.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 6.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 7.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 9.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 11.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 13.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 15.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 3) {

 

this.attackDamage = 17.0D;

 

} else if(this.level == 4 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 7.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 8.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 10.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 12.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 14.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 16.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 4) {

 

this.attackDamage = 18.0D;

 

} else if(this.level == 5 && this.currentUpgradeTier == 5) {

 

this.attackDamage = 9.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 5) {

 

this.attackDamage = 11.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 5) {

 

this.attackDamage = 13.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 5) {

 

this.attackDamage = 15.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 5) {

 

this.attackDamage = 17.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 5) {

 

this.attackDamage = 19.0D;

 

} else if(this.level == 6 && this.currentUpgradeTier == 6) {

 

this.attackDamage = 12.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 6) {

 

this.attackDamage = 14.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 6) {

 

this.attackDamage = 16.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 6) {

 

this.attackDamage = 18.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 6) {

 

this.attackDamage = 20.0D;

 

} else if(this.level == 7 && this.currentUpgradeTier == 7) {

 

this.attackDamage = 15.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 7) {

 

this.attackDamage = 17.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 7) {

 

this.attackDamage = 19.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 7) {

 

this.attackDamage = 21.0D;

 

} else if(this.level == 8 && this.currentUpgradeTier == 8) {

 

this.attackDamage = 18.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 8) {

 

this.attackDamage = 20.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 8) {

 

this.attackDamage = 22.0D;

 

} else if(this.level == 9 && this.currentUpgradeTier == 9) {

 

this.attackDamage = 21.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 9) {

 

this.attackDamage = 23.0D;

 

} else if(this.level >= 10 && this.currentUpgradeTier == 10) {

 

this.attackDamage = 25.0D;

 

}

 

this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(this.attackDamage); 

 

}

 

public void setEntitySize() {

 

if(level == 1) {

 

this.hitbox = 0.4F;

 

} else if(level == 2) {

 

this.hitbox = 0.55F;

 

} else if(level == 3) {

 

this.hitbox = 0.7F;

 

} else if(level == 4) {

 

this.hitbox = 0.85F;

 

} else if(level == 5) {

 

this.hitbox = 1.0F;

 

} else if(level == 6) {

 

this.hitbox = 1.15F;

 

} else if(level == 7) {

 

this.hitbox = 1.3F;

 

} else if(level == 8) {

 

this.hitbox = 1.45F;

 

} else if(level == 9) {

 

this.hitbox = 1.6F;

 

} else if(level >= 10) {

 

this.hitbox = 1.75F;

 

}

 

this.setSize(this.hitbox, this.hitbox);

 

}

 

public int getLevel() {

 

        return this.level;

       

    }

 

public int getCurrentUpgradeTier() {

 

return this.currentUpgradeTier;

 

}

 

public float getAttackTimer() {

 

        return this.attackTimer;

       

    }

 

public void setLevel(int level) {

 

this.level = level;

 

}

 

public void setCurrentUpgradeTier(int currentUpgradeTier) {

 

this.currentUpgradeTier = currentUpgradeTier;

 

}

 

public void setAttackTimer(float attackTimer) {

 

this.attackTimer = attackTimer;

 

}

 

@Override

public EntityAgeable createChild(EntityAgeable var1) {

 

return null;

 

}

 

public boolean isAIEnabled() {

 

return true;

 

}

 

}

 

 

 

Link to comment
Share on other sites

Could you please paste the class to http://paste.minecraftforge.net/ (which is http://gist.github.com/) instead? It is very difficult to read your code with messed up indentation and without syntax highlighting and line numbers :)

 

I see a lot of identical calls in there that could (and should) have their result saved to a local variable instead.

 

Also, you may want to look into the keyword

switch

:)

 

The use of both could pretty effectively make your code more performant and concise, thereby making future modifications less difficult and error-prone.

Link to comment
Share on other sites

The indentation issues when pasting arise from using mixed tabs and spaces. You ought to set your editor to enforce one over the other - you will probably want to replace one with the other before pasting, as well, unless your editor allows automatic conversion.

 

Personally I use spaces - that way I am sure other people will have the intended indentation size when reading my code in their editor.

 

If you want, I can look over your code once we fix the overloaded-issue and give you some hints as to improvements for your code, both regarding readability and performance? Just a friendly offer :)

 

Oh, and if you could update the gist with fixed indentation before I delve into it to try and find the issue you're having, that would be wonderful :)

Link to comment
Share on other sites

https://gist.github.com/ElyonItari/bd874849632050cc627d

 

Enjoy :)

 

Homework: Read up on Don't Repeat Yourself (DRY).

 

I will have a look at your issue when I come back a bit later.

 

NOTE: I have not compiled nor reread the code, so it probably will not work right off the bat. However, it should provide a guideline for how to not repeat yourself.

 

If there is any issues with the code, or clarifications that need to be made, don't hesitate to PM me - let us keep this thread clean from general programming help - for posterity - though :)

 

 

Link to comment
Share on other sites

The only problem I am having now is that it I get a NullPointerException here, but I don't exactly know why. Any ideas?

 

itemstack.getItem() == Blocklings.itemWoodenUpgrade      && this.currentUpgradeTier == 1 && this.level >= 2 ||

Link to comment
Share on other sites

I added itemstack != null to the if statement, but it still gives me the error and crashes my game.

 

if (

itemstack != null &&

itemstack.getItem() == Blocklings.itemWoodenUpgrade      && this.currentUpgradeTier == 1 && this.level >= 2 ||

temstack.getItem() == Blocklings.itemCobblestoneUpgrade && this.currentUpgradeTier == 2 && this.level >= 3 ||

itemstack.getItem() == Blocklings.itemStoneUpgrade      && this.currentUpgradeTier == 3 && this.level >= 4 ||

itemstack.getItem() == Blocklings.itemIronUpgrade        && this.currentUpgradeTier == 4 && this.level >= 5 ||

itemstack.getItem() == Blocklings.itemLapisLazuliUpgrade && this.currentUpgradeTier == 5 && this.level >= 6 ||

itemstack.getItem() == Blocklings.itemGoldUpgrade        && this.currentUpgradeTier == 6 && this.level >= 7 ||

itemstack.getItem() == Blocklings.itemDiamondUpgrade    && this.currentUpgradeTier == 7 && this.level >= 8 ||

itemstack.getItem() == Blocklings.itemEmeraldUpgrade    && this.currentUpgradeTier == 8 && this.level >= 9 ||

itemstack.getItem() == Blocklings.itemObsidianUpgrade    && this.currentUpgradeTier == 9 && this.level >= 10

)

Link to comment
Share on other sites

You can use [ code ] tags for short code snippets.

 

also, why not save

itemstack.getItem()

to a local variable, provided

itemstack

is not null?

 

Item item = itemstack.getItem();

 

The current precedence of your boolean operators is as follows:

 

(

a && [code]b

) ||

c

||

d

||

e

...

 

You are probably better off wrapping the entire thing in an if-statement that checks whether

itemstack

is

null

. Alternatively, wrap the combined boolean or operations in parentheses.

Link to comment
Share on other sites

I did use:

 

Item item = itemstack.getItem();

 

But it gave me a "dead code" error underneath:

 

{

 

                    chat.printChatMessage(new ChatComponentText("XP: " + this.xp + "/" + this.requiredXP + " | " + "Level: " + this.level));

                    chat.printChatMessage(new ChatComponentText("Health: " + (int) this.getHealth() + "/" + (int) this.maxHealth + " | " + "Attack Damage: " + (int) this.attackDamage));

 

                }

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

    • ironically it is a create based modpack so i need help understanding whats contradicting it 
    • An unexpected issue occurred and the game has crashed. (Exit Code 1) Heres the crash report (there are mods btw) [16:25:39] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [16:25:39] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [16:25:39] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [16:25:39] [main/INFO]: Forge Mod Loader version 14.23.5.2859 for Minecraft 1.12.2 loading [16:25:39] [main/INFO]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_51, running on Windows 10:amd64:10.0, installed at C:\Users\bruiser\curseforge\minecraft\Install\runtime\jre-legacy\windows-x64\jre-legacy [16:25:40] [main/INFO]: Searching C:\Users\bruiser\curseforge\minecraft\Instances\Fnaf 6\mods for mods [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from 3dSkinLayers-forge-mc1.12.2-1.2.0.jar [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from [1.12.2] SecurityCraft v1.9.9.jar [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from [___MixinCompat-1.1-1.12.2___].jar [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from _supermartijn642corelib-1.1.17-forge-mc1.12.jar [16:25:40] [main/INFO]: Loading tweaker guichaguri.betterfps.tweaker.BetterFpsTweaker from BetterFps-1.4.8.jar [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from controllable-0.11.2-1.12.2.jar [16:25:40] [main/WARN]: Found FMLCorePluginContainsFMLMod marker in CreativeCore_v1.10.71_mc1.12.2.jar. This is not recommended, @Mods should be in a separate jar from the coremod. [16:25:40] [main/WARN]: The coremod com.creativemd.creativecore.core.CreativePatchingLoader does not have a MCVersion annotation, it may cause issues with this version of Minecraft [16:25:40] [main/WARN]: The coremod CreativePatchingLoader (com.creativemd.creativecore.core.CreativePatchingLoader) is not signed! [16:25:40] [main/WARN]: Found FMLCorePluginContainsFMLMod marker in CTM-MC1.12.2-1.0.2.31.jar. This is not recommended, @Mods should be in a separate jar from the coremod. [16:25:40] [main/WARN]: The coremod team.chisel.ctm.client.asm.CTMCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [16:25:40] [main/WARN]: The coremod CTMCorePlugin (team.chisel.ctm.client.asm.CTMCorePlugin) is not signed! [16:25:40] [main/WARN]: Found FMLCorePluginContainsFMLMod marker in ears-forge-1.12-1.4.6.jar. This is not recommended, @Mods should be in a separate jar from the coremod. [16:25:40] [main/WARN]: The coremod com.unascribed.ears.common.agent.NewForgeCoremod does not have a MCVersion annotation, it may cause issues with this version of Minecraft [16:25:40] [main/WARN]: The coremod Ears (com.unascribed.ears.common.agent.NewForgeCoremod) is not signed! [16:25:40] [main/INFO]: Loading tweaker gg.essential.loader.stage0.EssentialSetupTweaker from essential_1-3-2-2_forge_1-12-2.jar [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from malisiscore-1.12.2-6.5.1.jar [16:25:40] [main/INFO]: Loading tweaker org.spongepowered.asm.launch.MixinTweaker from movingelevators-1.4.7-forge-mc1.12.jar [16:25:40] [main/INFO]: Loading tweaker optifine.OptiFineForgeTweaker from OptiFine_1.12.2_HD_U_G5.jar [16:25:40] [main/WARN]: The coremod shetiphian.asm.TweakPlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [16:25:40] [main/WARN]: The coremod ShetiPhian-ASM (shetiphian.asm.TweakPlugin) is not signed! [16:25:40] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:25:40] [main/INFO]: Loading tweak class name org.spongepowered.asm.launch.MixinTweaker [16:25:40] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/C:/Users/bruiser/curseforge/minecraft/Instances/Fnaf%206/mods/3dSkinLayers-forge-mc1.12.2-1.2.0.jar Service=LaunchWrapper Env=CLIENT [16:25:41] [main/DEBUG]: Instantiating coremod class SecurityCraftLoadingPlugin [16:25:41] [main/DEBUG]: The coremod net.geforcemods.securitycraft.SecurityCraftLoadingPlugin requested minecraft version 1.12.2 and minecraft is 1.12.2. It will be loaded. [16:25:41] [main/WARN]: The coremod SecurityCraftLoadingPlugin (net.geforcemods.securitycraft.SecurityCraftLoadingPlugin) is not signed! [16:25:41] [main/INFO]: Compatibility level set to JAVA_8 [16:25:41] [main/DEBUG]: Enqueued coremod SecurityCraftLoadingPlugin [16:25:41] [main/DEBUG]: Instantiating coremod class CoreModPlugin [16:25:41] [main/TRACE]: coremod named SuperMartijn642's Core Lib Plugin is loading [16:25:41] [main/DEBUG]: The coremod com.supermartijn642.core.coremod.CoreModPlugin requested minecraft version 1.12.2 and minecraft is 1.12.2. It will be loaded. [16:25:41] [main/WARN]: The coremod SuperMartijn642's Core Lib Plugin (com.supermartijn642.core.coremod.CoreModPlugin) is not signed! [16:25:41] [main/DEBUG]: Added access transformer class com/supermartijn642/core/coremod/CoreLibAccessTransformer to enqueued access transformers [16:25:41] [main/DEBUG]: Enqueued coremod SuperMartijn642's Core Lib Plugin [16:25:41] [main/DEBUG]: Instantiating coremod class ControllablePlugin [16:25:41] [main/TRACE]: coremod named Controllable is loading [16:25:41] [main/DEBUG]: The coremod com.mrcrayfish.controllable.asm.ControllablePlugin requested minecraft version 1.12.2 and minecraft is 1.12.2. It will be loaded. [16:25:41] [main/DEBUG]: Found signing certificates for coremod Controllable (com.mrcrayfish.controllable.asm.ControllablePlugin) [16:25:41] [main/DEBUG]: Found certificate 4d54165f7f65cf475bf13341569655b980a5b430 [16:25:41] [main/DEBUG]: Added access transformer class com.mrcrayfish.controllable.asm.ControllableAccessTransformer to enqueued access transformers [16:25:41] [main/DEBUG]: Enqueued coremod Controllable [16:25:41] [main/DEBUG]: Instantiating coremod class MalisisCorePlugin [16:25:41] [main/WARN]: The coremod net.malisis.core.asm.MalisisCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [16:25:41] [main/WARN]: The coremod MalisisCorePlugin (net.malisis.core.asm.MalisisCorePlugin) is not signed! [16:25:41] [main/DEBUG]: Enqueued coremod MalisisCorePlugin [16:25:41] [main/DEBUG]: Instantiating coremod class CoreMod [16:25:41] [main/TRACE]: coremod named Moving Elevators Plugin is loading [16:25:41] [main/DEBUG]: The coremod com.supermartijn642.movingelevators.core.CoreMod requested minecraft version 1.12.2 and minecraft is 1.12.2. It will be loaded. [16:25:41] [main/WARN]: The coremod Moving Elevators Plugin (com.supermartijn642.movingelevators.core.CoreMod) is not signed! [16:25:41] [main/DEBUG]: Enqueued coremod Moving Elevators Plugin [16:25:41] [main/WARN]: Tweak class name org.spongepowered.asm.launch.MixinTweaker has already been visited -- skipping [16:25:41] [main/WARN]: Tweak class name org.spongepowered.asm.launch.MixinTweaker has already been visited -- skipping [16:25:41] [main/WARN]: Tweak class name org.spongepowered.asm.launch.MixinTweaker has already been visited -- skipping [16:25:41] [main/INFO]: Loading tweak class name guichaguri.betterfps.tweaker.BetterFpsTweaker [16:25:41] [main/WARN]: Tweak class name org.spongepowered.asm.launch.MixinTweaker has already been visited -- skipping [16:25:41] [main/INFO]: Loading tweak class name gg.essential.loader.stage0.EssentialSetupTweaker [16:25:42] [main/INFO]: Starting Essential Loader (stage2) version 1.6.0 (b0b46ed40e44f9aaf7086a0d8c46a674) [stable] [16:25:45] [main/WARN]: Tweak class name org.spongepowered.asm.launch.MixinTweaker has already been visited -- skipping [16:25:45] [main/WARN]: Tweak class name org.spongepowered.asm.launch.MixinTweaker has already been visited -- skipping [16:25:45] [main/INFO]: Loading tweak class name optifine.OptiFineForgeTweaker [16:25:45] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [16:25:45] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:25:45] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [16:25:45] [main/INFO]: Calling tweak class optifine.OptiFineForgeTweaker [16:25:45] [main/INFO]: [optifine.OptiFineForgeTweaker:dbg:56]: OptiFineForgeTweaker: acceptOptions [16:25:45] [main/INFO]: [optifine.OptiFineForgeTweaker:dbg:56]: OptiFineForgeTweaker: injectIntoClassLoader [16:25:45] [main/INFO]: [optifine.OptiFineClassTransformer:dbg:242]: OptiFine ClassTransformer [16:25:45] [main/INFO]: [optifine.OptiFineClassTransformer:dbg:242]: OptiFine ZIP file: C:\Users\bruiser\curseforge\minecraft\Instances\Fnaf 6\mods\OptiFine_1.12.2_HD_U_G5.jar [16:25:45] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:25:45] [main/DEBUG]: Injecting coremod FMLCorePlugin \{net.minecraftforge.fml.relauncher.FMLCorePlugin\} class transformers [16:25:45] [main/TRACE]: Registering transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer [16:25:45] [main/TRACE]: Registering transformer net.minecraftforge.fml.common.asm.transformers.EventSubscriptionTransformer [16:25:45] [main/TRACE]: Registering transformer net.minecraftforge.fml.common.asm.transformers.EventSubscriberTransformer [16:25:45] [main/TRACE]: Registering transformer net.minecraftforge.fml.common.asm.transformers.SoundEngineFixTransformer [16:25:45] [main/DEBUG]: Injection complete [16:25:45] [main/DEBUG]: Running coremod plugin for FMLCorePlugin \{net.minecraftforge.fml.relauncher.FMLCorePlugin\} [16:25:45] [main/DEBUG]: Running coremod plugin FMLCorePlugin [16:25:49] [main/INFO]: Found valid fingerprint for Minecraft Forge. Certificate fingerprint e3c3d50c7c986df74c645c0ac54639741c90a557 [16:25:49] [main/INFO]: Found valid fingerprint for Minecraft. Certificate fingerprint cd99959656f753dc28d863b46769f7f8fbaefcfc [16:25:49] [main/DEBUG]: Coremod plugin class FMLCorePlugin run successfully [16:25:49] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:25:49] [main/DEBUG]: Injecting coremod FMLForgePlugin \{net.minecraftforge.classloading.FMLForgePlugin\} class transformers [16:25:49] [main/DEBUG]: Injection complete [16:25:49] [main/DEBUG]: Running coremod plugin for FMLForgePlugin \{net.minecraftforge.classloading.FMLForgePlugin\} [16:25:49] [main/DEBUG]: Running coremod plugin FMLForgePlugin [16:25:49] [main/DEBUG]: Coremod plugin class FMLForgePlugin run successfully [16:25:49] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:25:49] [main/DEBUG]: Injecting coremod CreativePatchingLoader \{com.creativemd.creativecore.core.CreativePatchingLoader\} class transformers [16:25:49] [main/DEBUG]: Injection complete [16:25:49] [main/DEBUG]: Running coremod plugin for CreativePatchingLoader \{com.creativemd.creativecore.core.CreativePatchingLoader\} [16:25:49] [main/DEBUG]: Running coremod plugin CreativePatchingLoader [16:25:50] [main/DEBUG]: Coremod plugin class CreativePatchingLoader run successfully [16:25:50] [main/INFO]: Calling tweak class org.spongepowered.asm.launch.MixinTweaker [16:25:50] [main/ERROR]: Mixin config 3dskinlayers.mixins.json does not specify "minVersion" property [16:25:50] [main/ERROR]: Mixin config mixins.mixincompat.json does not specify "minVersion" property [16:25:50] [main/INFO]: Initialised Mixin FML Remapper Adapter with net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper@3e0855b0 [16:25:50] [main/DEBUG]: Injecting coremod SecurityCraftLoadingPlugin \{net.geforcemods.securitycraft.SecurityCraftLoadingPlugin\} class transformers [16:25:50] [main/DEBUG]: Injection complete [16:25:50] [main/DEBUG]: Running coremod plugin for SecurityCraftLoadingPlugin \{net.geforcemods.securitycraft.SecurityCraftLoadingPlugin\} [16:25:50] [main/DEBUG]: Running coremod plugin SecurityCraftLoadingPlugin [16:25:50] [main/DEBUG]: Coremod plugin class SecurityCraftLoadingPlugin run successfully [16:25:50] [main/DEBUG]: Injecting coremod SuperMartijn642's Core Lib Plugin \{com.supermartijn642.core.coremod.CoreModPlugin\} class transformers [16:25:50] [main/DEBUG]: Injection complete [16:25:50] [main/DEBUG]: Running coremod plugin for SuperMartijn642's Core Lib Plugin \{com.supermartijn642.core.coremod.CoreModPlugin\} [16:25:50] [main/DEBUG]: Running coremod plugin SuperMartijn642's Core Lib Plugin [16:25:50] [main/DEBUG]: Coremod plugin class CoreModPlugin run successfully [16:25:50] [main/DEBUG]: Injecting coremod Controllable \{com.mrcrayfish.controllable.asm.ControllablePlugin\} class transformers [16:25:50] [main/DEBUG]: Injection complete [16:25:50] [main/DEBUG]: Running coremod plugin for Controllable \{com.mrcrayfish.controllable.asm.ControllablePlugin\} [16:25:50] [main/DEBUG]: Running coremod plugin Controllable [16:25:50] [main/DEBUG]: Coremod plugin class ControllablePlugin run successfully [16:25:50] [main/DEBUG]: Injecting coremod MalisisCorePlugin \{net.malisis.core.asm.MalisisCorePlugin\} class transformers [16:25:50] [main/DEBUG]: Injection complete [16:25:50] [main/DEBUG]: Running coremod plugin for MalisisCorePlugin \{net.malisis.core.asm.MalisisCorePlugin\} [16:25:50] [main/DEBUG]: Running coremod plugin MalisisCorePlugin [16:25:50] [main/DEBUG]: Coremod plugin class MalisisCorePlugin run successfully [16:25:50] [main/DEBUG]: Injecting coremod Moving Elevators Plugin \{com.supermartijn642.movingelevators.core.CoreMod\} class transformers [16:25:50] [main/DEBUG]: Injection complete [16:25:50] [main/DEBUG]: Running coremod plugin for Moving Elevators Plugin \{com.supermartijn642.movingelevators.core.CoreMod\} [16:25:50] [main/DEBUG]: Running coremod plugin Moving Elevators Plugin [16:25:50] [main/DEBUG]: Coremod plugin class CoreMod run successfully [16:25:50] [main/INFO]: Calling tweak class gg.essential.loader.stage0.EssentialSetupTweaker [16:25:50] [main/INFO]: Calling tweak class guichaguri.betterfps.tweaker.BetterFpsTweaker [16:25:50] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [16:25:50] [main/DEBUG]: Validating minecraft [16:25:52] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:25:52] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:25:52] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [16:25:52] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [16:25:52] [main/INFO]: Loading tweak class name org.spongepowered.asm.mixin.EnvironmentStateTweaker [16:25:52] [main/INFO]: Loading tweak class name gg.essential.asm.compat.betterfps.tweaker.BetterFpsWrappingTweaker [16:25:52] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [16:25:52] [main/INFO]: Calling tweak class org.spongepowered.asm.mixin.EnvironmentStateTweaker [16:25:52] [main/INFO]: Calling tweak class gg.essential.asm.compat.betterfps.tweaker.BetterFpsWrappingTweaker [16:25:52] [main/INFO]: [optifine.OptiFineForgeTweaker:dbg:56]: OptiFineForgeTweaker: getLaunchArguments [16:25:52] [main/WARN]: Reference map 'mixins.mixincompat.refmap.json' for mixins.mixincompat.json could not be read. If this is a development environment you can ignore this message [16:25:53] [main/INFO]: Starting Essential v1.3.2.3 (#6a2d13e09b) [stable] [16:25:54] [main/INFO]: Patching net.minecraft.client.renderer.EntityRenderer... (buq) [16:25:54] [main/INFO]: A re-entrant transformer 'guichaguri.betterfps.transformers.PatcherTransformer' was detected and will no longer process meta class data [16:25:55] [main/INFO]: Attempting: Injection of Run Particle Override into Entity.createRunningParticles [16:25:55] [main/INFO]: Searching for: Entity.createRunningParticles (func_174808_Z) [16:25:55] [main/INFO]: Found Method: Entity.createRunningParticles [16:25:55] [main/INFO]: Injecting: Run Particle Override [16:25:56] [main/INFO]: [team.chisel.ctm.client.asm.CTMTransformer:preTransform:230]: Transforming Class [net.minecraftforge.client.ForgeHooksClient], Method [getDamageModel] [16:25:56] [main/INFO]: [team.chisel.ctm.client.asm.CTMTransformer:finishTransform:242]: Transforming net.minecraftforge.client.ForgeHooksClient Finished. [16:25:56] [main/INFO]: [team.chisel.ctm.client.asm.CTMTransformer:preTransform:230]: Transforming Class [net.minecraft.client.renderer.texture.TextureMap], Method [registerSprite] [16:25:56] [main/INFO]: [team.chisel.ctm.client.asm.CTMTransformer:finishTransform:242]: Transforming net.minecraft.client.renderer.texture.TextureMap Finished. [16:25:57] [main/WARN]: Re-entrance detected during prepare phase, this will cause serious problems. org.spongepowered.asm.mixin.transformer.throwables.ReEntrantTransformerError: Re-entrance error.     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:283) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) [launchwrapper-1.12.jar:?]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [?:1.8.0_51]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [?:1.8.0_51]     at java.lang.Class.forName0(Native Method) ~[?:1.8.0_51]     at java.lang.Class.forName(Class.java:348) [?:1.8.0_51]     at com.unascribed.ears.common.agent.mini.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1017) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.SymbolTable.addMergedType(SymbolTable.java:1202) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.Frame.merge(Frame.java:1299) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.Frame.merge(Frame.java:1197) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.MethodWriter.computeAllFrames(MethodWriter.java:1610) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.MethodWriter.visitMaxs(MethodWriter.java:1546) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.tree.MethodNode.accept(MethodNode.java:769) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.tree.MethodNode.accept(MethodNode.java:649) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.asm.tree.ClassNode.accept(ClassNode.java:452) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.mini.MiniTransformer.transform(MiniTransformer.java:203) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.EarsAgent.transform(EarsAgent.java:43) [ears-forge-1.12-1.4.6.jar:?]     at com.unascribed.ears.common.agent.TransformerAdapter.transform(TransformerAdapter.java:12) [ears-forge-1.12-1.4.6.jar:?]     at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256) [ASMTransformerWrapper$TransformerWrapper.class:?]     at org.spongepowered.asm.service.mojang.LegacyTransformerHandle.transformClassBytes(LegacyTransformerHandle.java:80) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper.applyTransformers(MixinServiceLaunchWrapper.java:548) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper.getClassBytes(MixinServiceLaunchWrapper.java:514) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper.getClassNode(MixinServiceLaunchWrapper.java:592) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.ClassInfo.forName(ClassInfo.java:2005) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinInfo.getTargetClass(MixinInfo.java:1017) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinInfo.readTargetClasses(MixinInfo.java:1007) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinInfo.parseTargets(MixinInfo.java:895) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinConfig.prepareMixins(MixinConfig.java:867) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinConfig.prepare(MixinConfig.java:775) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:539) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:462) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) [launchwrapper-1.12.jar:?]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [?:1.8.0_51]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [?:1.8.0_51]     at java.lang.Class.forName0(Native Method) ~[?:1.8.0_51]     at java.lang.Class.forName(Class.java:348) [?:1.8.0_51]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] [16:25:57] [main/WARN]: Error loading class: net/minecraft/client/renderer/entity/layers/LayerElytra (net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer com.unascribed.ears.asm.PlatformTransformerAdapter@7bd7c4cf from coremod Ears) [16:25:57] [main/WARN]: @Mixin target net.minecraft.client.renderer.entity.layers.LayerElytra was not found mixins.essential.json:client.renderer.entity.Mixin_DisableElytraRendering [16:25:59] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main} [16:25:59] [main/INFO]: Patching net.minecraft.client.Minecraft... (bib) [16:25:59] [main/WARN]: Re-entrance detected, this will cause serious problems. org.spongepowered.asm.mixin.transformer.throwables.ReEntrantTransformerError: Re-entrance error.     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:352) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72) [3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) [launchwrapper-1.12.jar:?]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [?:1.8.0_51]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [?:1.8.0_51]     at net.minecraft.client.main.Main.main(SourceFile:38) [Main.class:?]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] [16:25:59] [main/ERROR]: Unable to launch java.lang.reflect.InvocationTargetException: null     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft     at net.minecraft.client.main.Main.main(SourceFile:38) ~[Main.class:?]     ... 6 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.Minecraft     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_51]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_51]     at net.minecraft.client.main.Main.main(SourceFile:38) ~[Main.class:?]     ... 6 more Caused by: org.spongepowered.asm.mixin.transformer.throwables.ReEntrantTransformerError: Re-entrance error.     at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:352) ~[3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234) ~[3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202) ~[3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at org.spongepowered.asm.mixin.transformer.Proxy.transform(Proxy.java:72) ~[3dSkinLayers-forge-mc1.12.2-1.2.0.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_51]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_51]     at net.minecraft.client.main.Main.main(SourceFile:38) ~[Main.class:?]     ... 6 more [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: net.minecraftforge.fml.relauncher.FMLSecurityManager$ExitTrappedException [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:49) [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.lang.SecurityManager.checkExit(SecurityManager.java:761) [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.lang.Runtime.exit(Runtime.java:107) [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at java.lang.System.exit(System.java:971) [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraft.launchwrapper.Launch.launch(Launch.java:138) [16:25:59] [main/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]:     at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    • I downloaded Better MC BMC4, it didnt starts and say: "Error: java.lang.IllegalStateException: Config property is not linked yet" Exit-Code: -1   https://paste.ee/p/g7qO2
    • I am wanting to export my mod to a .zip file in IntelliJ version 2024.1 but cannot.   I am not sure what to do, the only options available to me are "Files or selection to HTML" and "Project to eclipse." A possible theory I have is that IntelliJ believes that my mod is a HTML file, though I am not sure whether I could change that or not. There is nothing I have found online about the missing zip option for exporting a file, so I am confused. I export a backup of my mod every time I add/edit something important, though I don't think I can do this currently. (I have tried to export as HTML though I did not think it would work).
  • Topics

×
×
  • Create New...

Important Information

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