use of me.desht.pneumaticcraft.common.entity.living.EntityDrone in project pnc-repressurized by TeamPneumatic.
the class CoordTrackUpgradeHandler method getDronePath.
public static Path getDronePath(EntityPlayer player, BlockPos pos) {
World world = player.world;
EntityDrone drone = new EntityDrone(world);
drone.setPosition(player.posX, player.posY - 2, player.posZ);
return new EntityPathNavigateDrone(drone, world).getPathToPos(pos);
}
use of me.desht.pneumaticcraft.common.entity.living.EntityDrone in project pnc-repressurized by TeamPneumatic.
the class ModelDroneMinigun method render.
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
EntityDrone drone = (EntityDrone) entity;
renderMinigun(drone != null ? drone.getMinigun() : null, f5, 0, true);
}
use of me.desht.pneumaticcraft.common.entity.living.EntityDrone in project pnc-repressurized by TeamPneumatic.
the class ItemDrone method spawnDrone.
public void spawnDrone(EntityPlayer player, World world, BlockPos placePos, ItemStack iStack) {
EntityDrone drone = new EntityDrone(world, player);
drone.setPosition(placePos.getX() + 0.5, placePos.getY() + 0.5, placePos.getZ() + 0.5);
world.spawnEntity(drone);
NBTTagCompound stackTag = iStack.getTagCompound();
NBTTagCompound entityTag = new NBTTagCompound();
drone.writeEntityToNBT(entityTag);
if (stackTag != null) {
entityTag.setTag("widgets", stackTag.getTagList("widgets", 10).copy());
entityTag.setFloat("currentAir", stackTag.getFloat("currentAir"));
entityTag.setInteger("color", stackTag.getInteger("color"));
entityTag.setTag(ChargeableItemHandler.NBT_UPGRADE_TAG, stackTag.getCompoundTag(ChargeableItemHandler.NBT_UPGRADE_TAG));
}
drone.readEntityFromNBT(entityTag);
if (iStack.hasDisplayName())
drone.setCustomNameTag(iStack.getDisplayName());
drone.naturallySpawned = false;
// TODO 1.8 check if valid replacement drone.onSpawnWithEgg(null);
drone.onInitialSpawn(world.getDifficultyForLocation(placePos), null);
}
use of me.desht.pneumaticcraft.common.entity.living.EntityDrone in project pnc-repressurized by TeamPneumatic.
the class ItemLogisticsDrone method spawnDrone.
@Override
public void spawnDrone(EntityPlayer player, World world, BlockPos placePos, ItemStack iStack) {
EntityDrone drone = new EntityLogisticsDrone(world, player);
drone.setPosition(placePos.getX() + 0.5, placePos.getY() + 0.5, placePos.getZ() + 0.5);
world.spawnEntity(drone);
NBTTagCompound stackTag = iStack.getTagCompound();
NBTTagCompound entityTag = new NBTTagCompound();
drone.writeEntityToNBT(entityTag);
if (stackTag != null) {
entityTag.setFloat("currentAir", stackTag.getFloat("currentAir"));
entityTag.setInteger("color", stackTag.getInteger("color"));
entityTag.setTag(ChargeableItemHandler.NBT_UPGRADE_TAG, stackTag.getCompoundTag(ChargeableItemHandler.NBT_UPGRADE_TAG));
}
drone.readEntityFromNBT(entityTag);
addLogisticsProgram(placePos, drone.progWidgets);
if (iStack.hasDisplayName())
drone.setCustomNameTag(iStack.getDisplayName());
drone.naturallySpawned = false;
// TODO 1.8 check if valid replacement drone.onSpawnWithEgg(null);
drone.onInitialSpawn(world.getDifficultyForLocation(placePos), null);
}
use of me.desht.pneumaticcraft.common.entity.living.EntityDrone in project pnc-repressurized by TeamPneumatic.
the class ContainerAmadron method handleGUIButtonPress.
@Override
public void handleGUIButtonPress(int guiID, EntityPlayer player) {
super.handleGUIButtonPress(guiID, player);
if (guiID == 1) {
for (int i = 0; i < shoppingItems.length; i++) {
if (shoppingItems[i] >= 0) {
AmadronOffer offer = offers.get(shoppingItems[i]);
BlockPos itemPos = ItemAmadronTablet.getItemProvidingLocation(player.getHeldItemMainhand());
World itemWorld;
if (itemPos == null) {
itemPos = new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ);
itemWorld = player.world;
} else {
itemWorld = DimensionManager.getWorld(ItemAmadronTablet.getItemProvidingDimension(player.getHeldItemMainhand()));
}
BlockPos liquidPos = ItemAmadronTablet.getLiquidProvidingLocation(player.getHeldItemMainhand());
World liquidWorld = null;
if (liquidPos != null) {
liquidWorld = DimensionManager.getWorld(ItemAmadronTablet.getLiquidProvidingDimension(player.getHeldItemMainhand()));
}
EntityDrone drone = retrieveOrderItems(offer, shoppingAmounts[i], itemWorld, itemPos, liquidWorld, liquidPos);
if (drone != null)
drone.setHandlingOffer(offer, shoppingAmounts[i], player.getHeldItemMainhand(), player.getName());
}
}
Arrays.fill(shoppingAmounts, 0);
Arrays.fill(shoppingItems, -1);
} else if (guiID == 2) {
player.openGui(PneumaticCraftRepressurized.instance, CommonProxy.EnumGuiId.AMADRON_ADD_TRADE.ordinal(), player.world, 0, 0, 0);
}
}
Aggregations