mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
anti piracy feature begone
This commit is contained in:
parent
d67bbe9c53
commit
3195cf650e
@ -4,8 +4,11 @@ import com.hbm.entity.logic.IChunkLoader;
|
|||||||
import com.hbm.inventory.FluidStack;
|
import com.hbm.inventory.FluidStack;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.tool.ItemDrone;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -29,6 +32,30 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
|
|||||||
super(world);
|
super(world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hitByEntity(Entity attacker) {
|
||||||
|
|
||||||
|
if(attacker instanceof EntityPlayer && !worldObj.isRemote) {
|
||||||
|
this.setDead();
|
||||||
|
for (ItemStack stack : slots) {
|
||||||
|
if(stack != null)
|
||||||
|
this.entityDropItem(stack, 1F);
|
||||||
|
}
|
||||||
|
int meta = 0;
|
||||||
|
|
||||||
|
//whether it is an express drone
|
||||||
|
if(this.dataWatcher.getWatchableObjectByte(11) == 1)
|
||||||
|
meta = 2;
|
||||||
|
|
||||||
|
if(chunkLoading)
|
||||||
|
meta += 1;
|
||||||
|
|
||||||
|
this.entityDropItem(new ItemStack(ModItems.drone, 1, meta), 1F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void entityInit() {
|
protected void entityInit() {
|
||||||
super.entityInit();
|
super.entityInit();
|
||||||
|
|||||||
@ -13,6 +13,8 @@ import com.hbm.tileentity.network.TileEntityDroneProvider;
|
|||||||
import com.hbm.tileentity.network.TileEntityDroneRequester;
|
import com.hbm.tileentity.network.TileEntityDroneRequester;
|
||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@ -38,7 +40,18 @@ public class EntityRequestDrone extends EntityDroneBase {
|
|||||||
this.targetZ = z;
|
this.targetZ = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hitByEntity(Entity attacker) {
|
||||||
|
|
||||||
|
if(attacker instanceof EntityPlayer && !worldObj.isRemote) {
|
||||||
|
this.setDead();
|
||||||
|
if(heldItem != null)
|
||||||
|
this.entityDropItem(heldItem, 1F);
|
||||||
|
this.entityDropItem(new ItemStack(ModItems.drone, 1, EnumDroneType.REQUEST.ordinal()), 1F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
public EntityRequestDrone(World world) {
|
public EntityRequestDrone(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user