Jump to content

Recommended Posts

Posted

Hey all,

 

I'm having a rather serious problem with spawning my entity. I've gotten it to work perfectly in SP but in MP the thing simply will not spawn.

 

Here is the relevant code:

 

package mod_DefenseGunPack;

//Credits:
//big help from: Zorn_Taov
//
//
//
//
//
//

import mod_DefenseGunPack.handlers.CraftingHandler;
import mod_DefenseGunPack.handlers.DG3x3_SpawnPacketHandler;
import mod_DefenseGunPack.client.ClientProxy;
import mod_DefenseGunPack.handlers.DG3x3_PacketHandler;
import mod_DefenseGunPack.items.DG3x3_Item;
import mod_DefenseGunPack.turrets.DG3x3_EntityLiving;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.block.material.Material;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemReed;
import net.minecraft.item.ItemStack;
import net.minecraft.src.ModLoader;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.ICraftingHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.IConnectionHandler;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = "mod_DefenseGunPack", name = "mod_DefenseGunPack", version = "0.0.1")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Mod_Turrets
{
//public static final Block test = (new BlockDefenseGun3x3v1(250, mod_DefenseGunPack.EntityDefenseGun3x3v1.class))
//	.setHardness(0.5F) .setResistance(1F) .setBlockName("DefenseTurret3x3v1");

//	public static IPacketHandler packetHandler;
//
//    public static IPacketHandler packetSpawnHandler;

    public static Item DG3x3_Item;

    public void craftingRecipes()
    {
        GameRegistry.addRecipe(new ItemStack(DG3x3_Item, 1, 0), new Object[] { "##", "##", '#', Block.dirt});
    }

    @Instance("Mod_Turrets")
    public static Mod_Turrets instance;

    @SidedProxy(clientSide = "mod_DefenseGunPack.client.ClientProxy", serverSide = "mod_DefenseGunPack.CommonProxy")
    public static CommonProxy proxy;

    @PreInit
    public void preInt(FMLPreInitializationEvent event)
    {
        // stub Method
    }

    @Init
    public void load(FMLInitializationEvent event)
    {
//        packetHandler = new DG3x3_PacketHandler();
//        packetSpawnHandler = new DG3x3_SpawnPacketHandler();
//        
//        NetworkRegistry.instance().registerPacketHandler();
        
        DG3x3_Item = (new DG3x3_Item(5000-256)).setItemName("DefenseGun3x3v1")
                .setCreativeTab(CreativeTabs.tabRedstone).setIconCoord(12, 10); 
        
        craftingRecipes();
        
//        NetworkRegistry.instance().registerChannel(packetHandler, "DG3x3");
//        NetworkRegistry.instance().registerChannel(packetSpawnHandler, "DG3x3Spawn");
        
        int DG3x3id = EntityRegistry.findGlobalUniqueEntityId();
        EntityRegistry.registerGlobalEntityID(DG3x3_EntityLiving.class, "DefenseGun3x3v1", DG3x3id);
        EntityRegistry.registerModEntity(DG3x3_EntityLiving.class, "DefenseGun3x3v1",DG3x3id, this, 250, 5, false);
        
        GameRegistry.registerItem(DG3x3_Item, "DefenseGun3x3v1");
        LanguageRegistry.addName(DG3x3_Item, "DefenseGun3x3v1");
        
        ClientProxy.registerRenderInformation();
    }

    @PostInit
    public void postInit(FMLPostInitializationEvent event)
    {
        // stub Method
    }
}

 

package mod_DefenseGunPack;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.world.World;
import cpw.mods.fml.common.INetworkHandler;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkMod.NULL;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.common.registry.GameRegistry;
import mod_DefenseGunPack.handlers.DG3x3_PacketHandler;

public class CommonProxy 
{
    public static void registerRenderInformation()
    {
        //No rendering for servers
    }    
}

 

package mod_DefenseGunPack.client;

import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.client.model.ModelBase;
import net.minecraft.src.ModLoader;
import net.minecraftforge.client.MinecraftForgeClient;
import mod_DefenseGunPack.CommonProxy;
import mod_DefenseGunPack.turrets.DG3x3_EntityLiving;
import mod_DefenseGunPack.turrets.renderers.DG3x3_Renderer;
import mod_DefenseGunPack.turrets.models.DG3x3_Model;

public class ClientProxy extends CommonProxy
{
    public static void registerRenderInformation()
    {
        MinecraftForgeClient.preloadTexture("/mod_DefenseGunPack/DefenseGun3x3v1.png");
        RenderingRegistry.registerEntityRenderingHandler(mod_DefenseGunPack.turrets.DG3x3_EntityLiving.class, new mod_DefenseGunPack.turrets.renderers.DG3x3_Renderer());
    }
}

 

package mod_DefenseGunPack.items;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;

import mod_DefenseGunPack.turrets.DG3x3_EntityLiving;
import net.minecraft.block.Block;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.item.EntityBoat;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.src.ModLoader;
import net.minecraft.stats.StatList;
import net.minecraft.util.ReportedException;
import net.minecraft.world.World;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.EntitySpawnPacket;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;



public class DG3x3_Item extends Item
{
    private int spawnID;

    public EntityPlayer PlacingPlayer;

    public DG3x3_Item(int par1)
    {
        super(par1);
    }
    
    public boolean FW_CheckPlacementLocation(World par3World, int par4, int par5, int par6, int par7)
    {
        if (!par3World.isAirBlock(par4, par5, par6))
        {
            int id = par3World.getBlockId(par4, par5, par6);

            if (id == 42 || id == 45 || id == 01 || id == 02 || id == 03)
            {
                return true;
            }
        }

        System.out.println("Placement False");
        return false;
    }

    /**
     * Callback for item usage. If the item does something special on right
     * clicking, he will have one of those. Return True if something happen and
     * false if it don't. This is for ITEMS, not BLOCKS
     */
    @Override
    public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
    {
        int var11 = par3World.getBlockId(par4, par5, par6);

        if (var11 == Block.snow.blockID)
        {
            par7 = 1;
        }
        else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID)
        {
            if (par7 == 0)
            {
                --par5;
            }

            if (par7 == 1)
            {
                ++par5;
            }

            if (par7 == 2)
            {
                --par6;
            }

            if (par7 == 3)
            {
                ++par6;
            }

            if (par7 == 4)
            {
                --par4;
            }

            if (par7 == 5)
            {
                ++par4;
            }
        }

        if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack))
        {
            return false;
        }
        else if (par1ItemStack.stackSize == 0)
        {
            return false;
        }
        else
        {
            if (
                    (FW_CheckPlacementLocation(par3World, par4 - 1, par5 - 1, par6 + 1, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4, par5 - 1, par6 + 1, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4 + 1, par5 - 1, par6 + 1, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4 - 1, par5 - 1, par6, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4, par5 - 1, par6, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4 + 1, par5 - 1, par6, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4 - 1, par5 - 1, par6 - 1, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4, par5 - 1, par6 - 1, par7) == true)
                    && (FW_CheckPlacementLocation(par3World, par4 + 1, par5 - 1, par6 - 1, par7) == true))
            {
                for (int i = 0; i < 3; i = i + 1)
                {
                    if (
                            (par3World.isAirBlock(par4 - 1, par5 + i, par6 + 1))
                            && (par3World.isAirBlock(par4, par5 + 1, par6 + 1))
                            && (par3World.isAirBlock(par4 + 1, par5 + i, par6 + 1))
                            && (par3World.isAirBlock(par4 - 1, par5 + i, par6))
                            && (par3World.isAirBlock(par4, par5 + 1, par6))
                            && (par3World.isAirBlock(par4 + 1, par5 + i, par6))
                            && (par3World.isAirBlock(par4 - 1, par5 + i, par6 - 1))
                            && (par3World.isAirBlock(par4, par5 + 1, par6 - 1))
                            && (par3World.isAirBlock(par4 + 1, par5 + i, par6 - 1))
                    )
                    {
                    }
                }
            }
            else
            {
                return false;
            }
        
            if(spawnTurret(par4, par5, par6, new DG3x3_EntityLiving(par3World), par3World, par2EntityPlayer))
            {
            	par1ItemStack.stackSize--;
            	return true;
            }
            par2EntityPlayer.swingItem();
            return false;
            
        }
    }

public static boolean spawnTurret(double x, double y, double z, Entity entity, World world, EntityPlayer player)
{
if(!world.isRemote)
{
	entity.setPosition(x, y, z);
	world.spawnEntityInWorld(entity);
	world.playAuxSFX(2001, (int)x, (int)y, (int)z, Block.stone.blockID);
	return true;
}
return false;
}

}

 

package mod_DefenseGunPack.turrets;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.List;
import java.util.Random;
import java.util.UUID;

import mod_DefenseGunPack.Mod_Turrets;
import mod_DefenseGunPack.packet.DG3x3_Packet;
import mod_DefenseGunPack.projectiles.EntityExplosiveArrow;
import mod_DefenseGunPack.targetfilters.FilterITurret;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.command.IEntitySelector;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.WatchableObject;
import net.minecraft.entity.ai.EntityAIArrowAttack;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagDouble;
import net.minecraft.nbt.NBTTagFloat;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.DamageSource;
import net.minecraft.util.ReportedException;
import net.minecraft.world.World;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.EntitySpawnPacket;
import cpw.mods.fml.common.network.FMLPacket;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class DG3x3_EntityLiving extends EntityLiving implements IInventory, IRangedAttackMob, IEntitySelector
{
    private float field_70926_e;
    private float field_70924_f;

    private EntityAIArrowAttack field_85037_d = new EntityAIArrowAttack(this, 0F, 1, 25F);
    private EntityAIAttackOnCollide field_85038_e = new EntityAIAttackOnCollide(this, EntityPlayer.class, 0.31F, false);

    private ItemStack[] DG3X3v1Contents = new ItemStack[64];
    private boolean field_70279_a;
    private double field_70276_b;
    @SideOnly(Side.CLIENT)
    private double velocityX;
    @SideOnly(Side.CLIENT)
    private double velocityY;
    @SideOnly(Side.CLIENT)
    private double velocityZ;
    private EntityPlayer entityplayer;

    private IEntitySelector ientityselector = new FilterITurret();

    public DG3x3_Packet DG3x3packet;
    public DataOutputStream outputStream;

    public DG3x3_EntityLiving(World par1World)
    {
        super(par1World);
        this.field_70279_a = true;
        this.field_70276_b = 0.07D;
        this.preventEntitySpawning = true;
        this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
        this.tasks.addTask(2, this.field_85037_d);
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 25F, 0, true, true, ientityselector));
        this.func_82164_bB();
        this.func_82162_bC();
        System.out.println("EntitySpawn 1");
    }

    public DG3x3_EntityLiving(World par1World, double par2, double par4, double par6, EntityPlayer player)
    {
        super(par1World);
        double xpos2 = par2 + 0.5;
        double zpos2 = par6 + 0.5;
        this.setPosition(xpos2, par4, zpos2);
        this.motionX = 0.0D;
        this.motionY = 0.0D;
        this.motionZ = 0.0D;
        this.prevPosX = xpos2;
        this.prevPosY = par4;
        this.prevPosZ = par6;
        this.height = 1.5F;
        this.boundingBox.setBounds(xpos2 - 1.5, par4 - 0, zpos2 - 1.5, xpos2 + 1.5, par4 + 3, zpos2 + 1.5);
        this.entityplayer = player;
        this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
        this.tasks.addTask(2, this.field_85037_d);
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 25F, 0, true, true, ientityselector));
        System.out.println("EntitySpawn 2");
    }

    @Override
    public void setAttackTarget(EntityLiving par1EntityLiving)
    {
        super.setAttackTarget(par1EntityLiving);
    }

    @SideOnly(Side.CLIENT)
    public float getInterestedAngle(float par1)
    {
        return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * par1) * 0.15F * (float)Math.PI;
    }

    /**
     * random number generator for instance. Used in random item stack selection.
     */
    private Random DG3X3v1Random = new Random();

    /**
     * the movespeed used for the new AI system
     */
    @Override
    public float getAIMoveSpeed()
    {
        return 0;
    }

    /**
     * Returns the number of slots in the inventory.
     */
    @Override
    public int getSizeInventory()
    {
        return 1;
    }

    public boolean isAIEnabled()
    {
        return true;
    }

    public boolean attackEntityAsMob(Entity par1Entity)
    {
        if (super.attackEntityAsMob(par1Entity))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    /**
     * Returns the amount of damage a mob should deal.
     */
    public int getAttackStrength(Entity par1Entity)
    {
        return 999;
    }

    protected boolean canTriggerWalking()
    {
        return false;
    }

    protected void entityInit()
    {
        super.entityInit();
        this.dataWatcher.addObject(13, new Byte((byte)0));
        this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
        this.dataWatcher.addObject(17, Integer.valueOf(0));
        this.dataWatcher.addObject(18, Integer.valueOf(0));
        this.dataWatcher.addObject(19, Integer.valueOf(0));
        this.dataWatcher.addObject(20, Byte.valueOf((byte)0));
    }

    /**
     * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be
     * pushable on contact, like boats or minecarts.
     */
    @Override
    public AxisAlignedBB getCollisionBox(Entity par1Entity)
    {
        return par1Entity.boundingBox;
    }

    /**
     * returns the bounding box for this entity
     */
    @Override
    public AxisAlignedBB getBoundingBox()
    {
        return this.boundingBox;
    }

    /**
     * Returns true if this entity should push and be pushed by other entities when colliding.
     */
    @Override
    public boolean canBePushed()
    {
        return false;
    }

    /**
     * Called when the entity is attacked.
     */
    public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
    {
        if (this.func_85032_ar())
        {
            return false;
        }
        else if (!this.worldObj.isRemote && !this.isDead)
        {
            this.setForwardDirection(-this.getForwardDirection());
            this.setTimeSinceHit(10);
            this.setDamageTaken(this.getDamageTaken() + par2 * 10);
            this.setBeenAttacked();

            if (par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode)
            {
                this.setDamageTaken(100);
            }

            if (this.getDamageTaken() > 40)
            {
                this.dropItemWithOffset(Mod_Turrets.DG3x3_Item.shiftedIndex, 1, 0.0F);
                this.setDead();
            }

            return true;
        }
        else
        {
            return true;
        }
    }

    @SideOnly(Side.CLIENT)

    /**
     * Setups the entity to do the hurt animation. Only used by packets in multiplayer.
     */
    public void performHurtAnimation()
    {
        this.setForwardDirection(-this.getForwardDirection());
        this.setTimeSinceHit(10);
        this.setDamageTaken(this.getDamageTaken() * 11);
    }

    /**
     * Returns true if other Entities should be prevented from moving through this Entity.
     */
    public boolean canBeCollidedWith()
    {
        return !this.isDead;
    }

    @SideOnly(Side.CLIENT)

    /**
     * Sets the velocity to the args. Args: x, y, z
     */
    public void setVelocity(double par1, double par3, double par5)
    {
        this.velocityX = this.motionX = par1;
        this.velocityY = this.motionY = par3;
        this.velocityZ = this.motionZ = par5;
    }

    protected void func_82164_bB()
    {
        super.func_82164_bB();
        this.setCurrentItemOrArmor(0, new ItemStack(Item.bow));
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    @Override
    public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    {
        super.writeEntityToNBT(par1NBTTagCompound);

        if (getSizeInventory() > 0)
        {
            NBTTagList var2 = new NBTTagList();

            for (int var3 = 0; var3 < this.getSizeInventory(); ++var3)
            {
                if (this.DG3X3v1Contents[var3] != null)
                {
                    NBTTagCompound var4 = new NBTTagCompound();
                    var4.setByte("Slot", (byte)var3);
                    this.DG3X3v1Contents[var3].writeToNBT(var4);
                    var2.appendTag(var4);
                }
            }

            par1NBTTagCompound.setTag("Items", var2);
        }
    }

    @Override
    public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
    {
        super.readEntityFromNBT(par1NBTTagCompound);

        if (getSizeInventory() > 0)
        {
            NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
            this.DG3X3v1Contents = new ItemStack[this.getSizeInventory()];

            for (int var3 = 0; var3 < var2.tagCount(); ++var3)
            {
                NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
                int var5 = var4.getByte("Slot") & 255;

                if (var5 >= 0 && var5 < this.DG3X3v1Contents.length)
                {
                    this.DG3X3v1Contents[var5] = ItemStack.loadItemStackFromNBT(var4);
                }
            }
        }
    }

    protected boolean canDespawn()
    {
        return false;
    }

    /**
     * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
     */
    public boolean interact(EntityPlayer par1EntityPlayer)
    {
        if (getSizeInventory() > 0)
        {
            if (!this.worldObj.isRemote)
            {
                par1EntityPlayer.displayGUIChest(this);
            }
        }

        return true;
    }

    /**
     * Sets the damage taken from the last hit.
     */
    public void setDamageTaken(int par1)
    {
        this.dataWatcher.updateObject(19, Integer.valueOf(par1));
    }

    @SideOnly(Side.CLIENT)
    public float getShadowSize()
    {
        return 0.0F;
    }

    /**
     * Gets the damage taken from the last hit.
     */
    public int getDamageTaken()
    {
        return this.dataWatcher.getWatchableObjectInt(19);
    }

    /**
     * Sets the time to count down from since the last time entity was hit.
     */
    public void setTimeSinceHit(int par1)
    {
        this.dataWatcher.updateObject(17, Integer.valueOf(par1));
    }

    /**
     * Gets the time since the last hit.
     */
    public int getTimeSinceHit()
    {
        return this.dataWatcher.getWatchableObjectInt(17);
    }

    /**
     * Sets the forward direction of the entity.
     */
    public void setForwardDirection(int par1)
    {
        this.dataWatcher.updateObject(18, Integer.valueOf(par1));
    }

    /**
     * Gets the forward direction of the entity.
     */
    public int getForwardDirection()
    {
        return this.dataWatcher.getWatchableObjectInt(18);
    }

    /**
     * Returns the stack in slot i
     */
    @Override
    public ItemStack getStackInSlot(int par1)
    {
        return this.DG3X3v1Contents[par1];
    }

    /**
     * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a
     * new stack.
     */
    @Override
    public ItemStack decrStackSize(int par1, int par2)
    {
        if (this.DG3X3v1Contents[par1] != null)
        {
            ItemStack var3;

            if (this.DG3X3v1Contents[par1].stackSize <= par2)
            {
                var3 = this.DG3X3v1Contents[par1];
                this.DG3X3v1Contents[par1] = null;
                this.onInventoryChanged();
                return var3;
            }
            else
            {
                var3 = this.DG3X3v1Contents[par1].splitStack(par2);

                if (this.DG3X3v1Contents[par1].stackSize == 0)
                {
                    this.DG3X3v1Contents[par1] = null;
                }

                this.onInventoryChanged();
                return var3;
            }
        }
        else
        {
            return null;
        }
    }

    /**
     * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem -
     * like when you close a workbench GUI.
     */
    @Override
    public ItemStack getStackInSlotOnClosing(int par1)
    {
        if (this.DG3X3v1Contents[par1] != null)
        {
            ItemStack var2 = this.DG3X3v1Contents[par1];
            this.DG3X3v1Contents[par1] = null;
            return var2;
        }
        else
        {
            return null;
        }
    }

    /**
     * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections).
     */
    @Override
    public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
    {
        this.DG3X3v1Contents[par1] = par2ItemStack;

        if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit())
        {
            par2ItemStack.stackSize = this.getInventoryStackLimit();
        }

        this.onInventoryChanged();
    }

    public int getRandomStackFromInventory()
    {
        int var1 = -1;
        int var2 = 1;

        for (int var3 = 0; var3 < this.DG3X3v1Contents.length; ++var3)
        {
            if (this.DG3X3v1Contents[var3] != null && this.DG3X3v1Random.nextInt(var2++) == 0)
            {
                var1 = var3;
            }
        }

        return var1;
    }

    public int func_70360_a(ItemStack par1ItemStack)
    {
        for (int var2 = 0; var2 < this.DG3X3v1Contents.length; ++var2)
        {
            if (this.DG3X3v1Contents[var2] == null || this.DG3X3v1Contents[var2].itemID == 0)
            {
                this.DG3X3v1Contents[var2] = par1ItemStack;
                return var2;
            }
        }

        return -1;
    }

    /**
     * Returns the name of the inventory.
     */
    @Override
    public String getInvName()
    {
        return "container.DefenseGun3x3v1"; //$NON-NLS-1$
    }

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

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

    /**
     * Do not make give this method the name canInteractWith because it clashes with Container
     */
    @Override
    public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)
    {
        return true;
    }

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

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

    @Override
    public int getMaxHealth()
    {
        return 30;
    }

    @Override
    public void onLivingUpdate()
    {
        this.posX = this.prevPosX;
        this.posY = this.prevPosY;
        this.posZ = this.prevPosZ;
        super.onLivingUpdate();
    }

    public void attackEntityWithRangedAttack(EntityLiving par1EntityLiving)
    {
        EntityExplosiveArrow var2 = new EntityExplosiveArrow(this.worldObj, this, par1EntityLiving, 1.6F, 12.0F);
        var2.setDamage(5);
        var2.setKnockbackStrength(3);
        this.func_85030_a("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
        this.worldObj.spawnEntityInWorld(var2);
    }

    public boolean FW_CheckPlacementLocation(World par3World, int par4, int par5, int par6, int par7)
    {
        if (!par3World.isAirBlock(par4, par5, par6))
        {
            int id = par3World.getBlockId(par4, par5, par6);

            if (id == 42 || id == 45 || id == 01 || id == 02 || id == 03)
            {
                return true;
            }
        }

        return false;
    }

    public void onUpdate()
    {
        super.onUpdate();
        this.posX = this.prevPosX;
        this.posY = this.prevPosY;
        this.posZ = this.prevPosZ;
        this.field_70924_f = this.field_70926_e;

        if (this.func_70922_bv())
        {
            this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F;
        }
        else
        {
            this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F;
        }

        for (int i = -1; i < 2; i = i + 1)
        {
            for (int j = -1; j < 2; j = j + 1)
            {
                if (!(FW_CheckPlacementLocation(this.worldObj, (int)this.posX + i, (int)posY - 1, (int)this.posZ + j, 0)))
                {
                    this.kill();
                }
            }
        }
    }

    public boolean func_70922_bv()
    {
        return this.dataWatcher.getWatchableObjectByte(20) == 1;
    }

    public void func_70918_i(boolean par1)
    {
        byte var2 = this.dataWatcher.getWatchableObjectByte(20);

        if (par1)
        {
            this.dataWatcher.updateObject(20, Byte.valueOf((byte)1));
        }
        else
        {
            this.dataWatcher.updateObject(20, Byte.valueOf((byte)0));
        }
    }

    public void onKillEntity(EntityLiving par1EntityLiving)
    {
        super.onKillEntity(par1EntityLiving);

        if (this.worldObj.difficultySetting >= 2 && par1EntityLiving instanceof EntityVillager)
        {
            if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
            {
                return;
            }

            this.dataWatcher.updateObject(20, Byte.valueOf((byte)0));
            this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
        }
    }

    @Override
    public boolean isEntityApplicable(Entity par1Entity)
    {
        if (par1Entity instanceof IMob)
        {
            return par1Entity instanceof IMob;
        }
        else if (par1Entity instanceof EntityLiving && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityVillager) && !(par1Entity instanceof EntityAnimal))
        {
            return par1Entity instanceof EntityLiving;
        }
        else if (par1Entity instanceof EntitySlime)
        {
            return par1Entity instanceof EntitySlime;
        }
        else
        {
            return false;
        }
    }
}

 

Can anyone help me figure out why this is not working in MP?

 

Thanks!

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

    • Looking to save big while shopping online? Our Temu coupon code 100€ off is here to make your shopping experience across Europe even better. If you're from Germany, France, Italy, or Switzerland, using the "acw696499" Temu coupon code guarantees you maximum benefits on all your purchases. This powerful code works seamlessly on both the Temu app and official website. With Temu coupon 100€ off and Temu 100 off coupon code, you're not only securing major savings but also unlocking exclusive offers across thousands of categories. Don't miss this golden opportunity to shop smart in 2025! What Is The Coupon Code For Temu 100€ Off? Great news for all shoppers—whether you're a new user or a long-time customer, you can enjoy exciting discounts with our Temu coupon 100€ off. With this 100€ off Temu coupon, shopping across Europe has never been more rewarding. acw696499: Use this code to get a flat 100€ discount instantly. acw696499: Unlock a 100€ coupon pack usable multiple times. acw696499: New customers get a 100€ flat discount as a welcome gift. acw696499: Existing customers receive an additional 100€ promo offer. acw696499: Designed specifically for users in Germany, France, Italy, Switzerland, and more. Temu Coupon Code 100€ Off For New Users In 2025 As a new user, you're in luck! The Temu coupon 100€ off makes your first experience unforgettable with savings that are hard to ignore. Our Temu coupon code 100€ off guarantees the best deals for new users on their first purchases across Europe. acw696499: Flat 100€ discount for all first-time buyers. acw696499: Receive a 100€ coupon bundle immediately after signing up. acw696499: Enjoy up to 100€ coupon value usable multiple times. acw696499: Benefit from free shipping to Germany, France, Italy, Switzerland, etc. acw696499: Get an extra 30% off on your first purchase. How To Redeem The Temu coupon 100€ off For New Customers? To use the Temu 100€ coupon, start by downloading the Temu app or visiting the official website. Then follow this step-by-step guide to apply the Temu 100€ off coupon code for new users: Create an account or sign up on the Temu platform. Browse through categories and add items to your cart. Proceed to checkout and enter the code "acw696499". Apply the code and see the discount reflected instantly. Complete your purchase and enjoy your savings! Temu Coupon 100€ Off For Existing Customers Existing users can also enjoy big rewards! Our Temu 100€ coupon codes for existing users offer various benefits when shopping with the Temu app or site. You can unlock exclusive Temu coupon 100€ off for existing customers free shipping deals using our code "acw696499" today. acw696499: Get a 100€ discount as a returning Temu shopper. acw696499: Claim a 100€ coupon bundle valid across multiple purchases. acw696499: Receive a free gift with fast delivery across Europe. acw696499: Stack up to 70% off on top of your 100€ coupon. acw696499: Enjoy free shipping in Germany, France, Italy, Spain, Switzerland, and more. How To Use The Temu Coupon Code 100€ Off For Existing Customers? To apply the Temu coupon code 100€ off, visit the Temu website or open the app and log into your existing account. Here's how to redeem the Temu coupon 100€ off code: Select the items you wish to purchase. Add them to your cart and proceed to checkout. Enter the code "acw696499" in the promo section. Enjoy the instant 100€ discount applied to your total. Complete the payment to finalize your purchase. Latest Temu Coupon 100€ Off First Order Don't miss the chance to get the biggest deal on your very first purchase with our Temu coupon code 100€ off first order. Whether you're from France, Italy, Germany, or Switzerland, this Temu coupon code first order is your gateway to mega savings. Use this Temu coupon code 100€ off first time user to unlock the following: acw696499: Flat 100€ discount on your very first Temu order. acw696499: Enjoy a 100€ coupon pack tailored for your first-time use. acw696499: Up to 100€ in coupons spread over multiple uses. acw696499: Free shipping to countries like Germany, France, Italy, Switzerland, and Spain. acw696499: Additional 30% off on your first order. How To Find The Temu Coupon Code 100€ Off? You can easily find the Temu coupon 100€ off by subscribing to the Temu newsletter, where verified codes are shared regularly. Users searching for Temu coupon 100€ off Reddit can also explore discussions for active and tested codes. To ensure the best deals, follow Temu on social media platforms for real-time updates. Trusted coupon websites also offer the latest, verified Temu promo codes. Is Temu 100€ Off Coupon Legit? Yes, the Temu 100€ Off Coupon Legit claim is absolutely true. Our code "acw696499" has been tested multiple times to ensure legitimacy. You can confidently use our code knowing it's not only genuine but also safe for first and repeat orders. This Temu 100 off coupon legit code is valid across Europe and has no expiry date. How Does Temu 100€ Off Coupon Work? To put it simply, once you apply our Temu coupon code 100€ off first-time user, the discount is automatically subtracted from your total at checkout. The process is instant and works on both the app and website. The Temu coupon codes 100 off activate exclusive discounts depending on your user status (new or existing). Once validated, the code applies a flat 100€ reduction or bundles, which can include gifts, free shipping, and more discounts. How To Earn Temu 100€ Coupons As A New Customer? You can earn the Temu coupon code 100€ off simply by signing up as a new user. Additionally, inviting friends or completing tasks on the Temu app can get you extra coupons. Our 100 off Temu coupon code is available to every first-time user without any hidden conditions. Be active on the platform and check for pop-up deals that often contain surprise coupon drops. What Are The Advantages Of Using Temu Coupon 100€ Off? Here are the top reasons why you should apply our Temu coupon code 100 off and Temu coupon code 100€ off: 100€ discount on your very first order. 100€ coupon bundle valid for multiple uses. Up to 70% off on popular items. Extra 30% off for European existing customers. Up to 90% off on selected products. Free gift for new users across Europe. Free delivery in countries like Germany, France, Italy, Switzerland, and more. Temu 100€ Discount Code And Free Gift For New And Existing Customers Using the Temu 100€ off coupon code and 100€ off Temu coupon code gives you access to premium perks. acw696499: Flat 100€ off on your very first Temu purchase. acw696499: Additional 30% discount on any item. acw696499: Free welcome gift for new users. acw696499: Up to 70% off on top-rated items. acw696499: Free gift with fast shipping across Germany, France, Italy, Switzerland. Pros And Cons Of Using Temu Coupon Code 100€ Off This Month Here are some Temu coupon 100€ off code and Temu 100 off coupon benefits and limitations: Pros: Saves you up to 100€ instantly. No minimum purchase requirement. Works on both app and website. Valid in multiple European countries. Bonus gifts and free delivery available. Cons: Some items may not be eligible. One-time use per account per offer type. Terms And Conditions Of Using The Temu Coupon 100€ Off In 2025 Here are the Temu coupon code 100€ off free shipping and latest Temu coupon code 100€ off rules you should know: No expiration date on the code "acw696499." Valid for both new and existing users. Usable in Germany, France, Italy, Switzerland, Spain, and more. No minimum order requirement. Can be used on all product categories. Stackable with certain site promotions. Final Note: Use The Latest Temu Coupon Code 100€ Off Start saving instantly with our Temu coupon code 100€ off and elevate your online shopping journey today. There has never been a better time to use Temu for your fashion, tech, home, or beauty needs. With our verified Temu coupon 100€ off, you can enjoy discounts, free shipping, and bonus gifts across Europe. Happy shopping! FAQs Of Temu 100€ Off Coupon What is the latest working Temu coupon code 100€ off? The latest working Temu coupon code is "acw696499" which provides 100€ off for new and existing users across Europe. Is there any expiry date for this coupon code? No, our coupon code "acw696499" does not have an expiration date and is valid all year round. Can existing customers also use the Temu 100€ coupon? Yes, existing users can redeem the 100€ coupon using "acw696499" and enjoy exclusive benefits. Is the Temu 100€ off coupon legit? Absolutely! Our coupon code "acw696499" is tested and verified regularly for legitimacy. How many times can I use the Temu coupon code 100€ off? You can use it once per user type (new or existing), and it may apply for multiple uses depending on promotions.
    • Looking to grab the Temu coupon code $100 off this month? You're in the right place for the biggest savings on your favorite products. Use the exclusive "acw696499" Temu coupon code for maximum benefits across the USA, Canada, and European nations. Whether you're a new customer or a long-time user, this code unlocks massive discounts and perks. With the Temu coupon $100 off and Temu 100 off coupon code, you’re not just saving money—you’re upgrading your shopping experience. What Is The Coupon Code For Temu $100 Off? Both new and existing customers can enjoy unbeatable savings with our exclusive coupon code. Use this Temu coupon $100 off and get a $100 off Temu coupon for your next order. acw696499 – Flat $100 off your order at checkout. acw696499 – $100 coupon pack you can use on multiple products. acw696499 – $100 flat discount exclusively for new customers. acw696499 – Extra $100 promo code for loyal, existing customers. acw696499 – $100 coupon available for shoppers in the USA and Canada. Temu Coupon Code $100 Off For New Users In 2025 If you're new to Temu, you're in for a treat. Use our code for the Temu coupon $100 off and enjoy unmatched discounts. acw696499 – Flat $100 discount for first-time buyers. acw696499 – Unlock a $100 coupon bundle specially for new customers. acw696499 – Redeem up to $100 coupon value across multiple purchases. acw696499 – Get free shipping to over 68 countries. acw696499 – Enjoy an extra 30% off any purchase as a new user. How To Redeem The Temu Coupon $100 Off For New Customers? To use the Temu $100 coupon and claim your Temu $100 off coupon code for new users, follow these steps: Download the Temu app or visit the official website. Register for a new account using your email or phone number. Add your favorite products to the cart. Enter the coupon code acw696499 at checkout. Enjoy instant savings and free shipping benefits. Temu Coupon $100 Off For Existing Customers Returning customers can still enjoy exceptional deals by applying our exclusive code. Use the Temu $100 coupon codes for existing users and unlock Temu coupon $100 off for existing customers free shipping perks. acw696499 – Receive an additional $100 discount as a returning user. acw696499 – Use the $100 coupon bundle for multiple purchases. acw696499 – Get a free gift with express shipping across the USA and Canada. acw696499 – Enjoy an extra 30% off on top of your current discounts. acw696499 – Free shipping available to 68 countries worldwide. How To Use The Temu Coupon Code $100 Off For Existing Customers? To activate the Temu coupon code $100 off and enjoy your savings as a returning buyer, follow these simple steps: Log into your existing Temu account. Add your chosen items to the shopping cart. Head to the checkout page. Apply the code acw696499 in the promo code box. Watch your total drop instantly with the Temu coupon $100 off code. Latest Temu Coupon $100 Off First Order Enjoy your first shopping experience on Temu with massive savings! Apply the Temu coupon code $100 off first order, Temu coupon code first order, or Temu coupon code $100 off first time user to save more. acw696499 – Flat $100 discount for your first order. acw696499 – Special $100 Temu coupon code for first orders. acw696499 – Enjoy up to $100 coupon bundle across different purchases. acw696499 – Free shipping to more than 68 countries. acw696499 – Extra 30% off on your initial order. How To Find The Temu Coupon Code $100 Off? Searching for the best Temu coupon $100 off deals? Check out Temu coupon $100 off Reddit threads for user-shared experiences and updated codes. You can also sign up for Temu’s newsletter for personalized offers. Visit their official social media pages or rely on trusted coupon-sharing websites to grab the most recent working promo codes. Is Temu $100 Off Coupon Legit? Yes, the Temu $100 Off Coupon Legit claim is absolutely true. We guarantee our Temu 100 off coupon legit code "acw696499" is tested and verified for accuracy. Anyone can safely use this code to receive $100 off their first or repeat orders. It’s valid internationally and doesn’t expire, so use it anytime for instant savings. How Does Temu $100 Off Coupon Work? The Temu coupon code $100 off first-time user and Temu coupon codes 100 off give users a direct discount during checkout. When you enter the coupon code during payment, the system automatically deducts $100 from your total bill. Whether you're a first-time buyer or a loyal customer, our code ensures unbeatable savings. How To Earn Temu $100 Coupons As A New Customer? To earn the Temu coupon code $100 off and get access to the 100 off Temu coupon code, sign up as a new customer on the Temu platform. Once registered, apply the promo code "acw696499" during checkout. You’ll instantly receive a $100 coupon bundle, free shipping, and extra discounts exclusive to new users. What Are The Advantages Of Using The Temu Coupon $100 Off? Using the Temu coupon code 100 off and Temu coupon code $100 off unlocks the following perks: $100 discount on your first order. $100 coupon bundle for multiple uses. 70% discount on popular items. Extra 30% off for returning customers. Up to 90% off on selected products. Free gift for new users. Free shipping to over 68 countries. Temu $100 Discount Code And Free Gift For New And Existing Customers Want more than discounts? The Temu $100 off coupon code and $100 off Temu coupon code offer added bonuses for everyone. acw696499 – $100 discount for your first order. acw696499 – Extra 30% off on any product. acw696499 – Free gift for first-time buyers. acw696499 – Up to 70% discount sitewide. acw696499 – Free shipping and gift in 68 countries including USA & UK. Pros And Cons Of Using The Temu Coupon Code $100 Off This Month Using the Temu coupon $100 off code and Temu 100 off coupon offers major pros and a couple of cons: Pros: Huge $100 discount on first and repeat orders. Free shipping globally. Free gift for new users. Up to 90% off on exclusive deals. Extra 30% discount for all users. Cons: Cannot be combined with certain flash sale items. Limited-time availability for some regional users. Terms And Conditions Of Using The Temu Coupon $100 Off In 2025 Before using the Temu coupon code $100 off free shipping and latest Temu coupon code $100 off, keep these in mind: Valid for both new and returning users. Code "acw696499" works across 68 countries worldwide. No minimum purchase required. No expiration date—use it anytime. Free shipping and gifts depend on regional availability. Final Note: Use The Latest Temu Coupon Code $100 Off Save big on every order with our Temu coupon code $100 off—it’s the smartest way to shop. Apply your Temu coupon $100 off today and make your online shopping budget-friendly and exciting.
    • Update your drivers: https://www.amd.com/en/support/downloads/previous-drivers.html/processors/ryzen/ryzen-3000-series/amd-ryzen-7-3700u.html
    • mclo only shows 25000 lines - add the rest with another link
    • Make a test without Create Big Cannons More Shells
  • Topics

×
×
  • Create New...

Important Information

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