cleanup, priority settings for diodes

This commit is contained in:
Boblet 2022-10-24 16:59:39 +02:00
parent 10bc50d9a7
commit 9748a34ed0
51 changed files with 30 additions and 2280 deletions

View File

@ -1103,9 +1103,6 @@ public class ModBlocks {
public static Block anvil_murky;
public static final int guiID_anvil = 121;
public static Block turret_spitfire;
public static Block turret_cheapo;
public static Block turret_chekhov;
public static final int guiID_chekhov = 104;
public static Block turret_friendly;
@ -2124,9 +2121,6 @@ public class ModBlocks {
sat_dock = new MachineSatDock(Material.iron).setBlockName("sat_dock").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":sat_dock");
soyuz_capsule = new SoyuzCapsule(Material.iron).setBlockName("soyuz_capsule").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":soyuz_capsule");
turret_spitfire = new TurretSpitfire(Material.iron).setBlockName("turret_spitfire").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":code");
turret_cheapo = new TurretCheapo(Material.iron).setBlockName("turret_cheapo").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":turret_cheapo");
turret_chekhov = new TurretChekhov(Material.iron).setBlockName("turret_chekhov").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_friendly = new TurretFriendly(Material.iron).setBlockName("turret_friendly").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_jeremy = new TurretJeremy(Material.iron).setBlockName("turret_jeremy").setHardness(5.0F).setResistance(600.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -2890,8 +2884,6 @@ public class ModBlocks {
GameRegistry.registerBlock(c4, c4.getUnlocalizedName());
//Turrets
GameRegistry.registerBlock(turret_spitfire, turret_spitfire.getUnlocalizedName());
GameRegistry.registerBlock(turret_cheapo, turret_cheapo.getUnlocalizedName());
GameRegistry.registerBlock(turret_chekhov, turret_chekhov.getUnlocalizedName());
GameRegistry.registerBlock(turret_friendly, turret_friendly.getUnlocalizedName());
GameRegistry.registerBlock(turret_jeremy, turret_jeremy.getUnlocalizedName());

View File

@ -11,6 +11,7 @@ import com.hbm.util.I18nUtil;
import api.hbm.block.IToolable;
import api.hbm.energy.IEnergyUser;
import api.hbm.energy.IEnergyConnector.ConnectionPriority;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -89,6 +90,15 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
return true;
}
if(tool == ToolType.DEFUSER) {
int p = te.priority.ordinal() + 1;
if(p > 2) p = 0;
te.priority = ConnectionPriority.values()[p];
te.markDirty();
world.markBlockForUpdate(x, y, z);
return true;
}
return false;
}
@ -97,6 +107,7 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
list.add(EnumChatFormatting.GOLD + "Limits throughput and restricts flow direction");
list.add(EnumChatFormatting.YELLOW + "Use screwdriver to increase throughput");
list.add(EnumChatFormatting.YELLOW + "Use hand drill to decrease throughput");
list.add(EnumChatFormatting.YELLOW + "Use defuser to change network priority");
}
@Override
@ -111,6 +122,7 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
List<String> text = new ArrayList();
text.add("Max.: " + BobMathUtil.getShortNumber(diode.getMaxPower()) + "HE/t");
text.add("Priority: " + diode.priority.name());
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
}
@ -126,12 +138,14 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
level = nbt.getInteger("level");
priority = ConnectionPriority.values()[nbt.getByte("p")];
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("level", level);
nbt.setByte("p", (byte) this.priority.ordinal());
}
@Override
@ -171,6 +185,7 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
private long contingent = 0;
private long lastTransfer = 0;
private int pulses = 0;
public ConnectionPriority priority = ConnectionPriority.NORMAL;
@Override
public long transferPower(long power) {
@ -224,5 +239,10 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
public void setPower(long power) {
this.subBuffer = power;
}
@Override
public ConnectionPriority getPriority() {
return this.priority;
}
}
}

View File

@ -1,92 +0,0 @@
package com.hbm.blocks.turret;
import java.util.List;
import com.hbm.config.WeaponConfig;
import com.hbm.lib.ModDamageSource;
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretCIWS extends TurretBase {
public TurretCIWS(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretCIWS();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
TileEntityTurretCIWS te = (TileEntityTurretCIWS)world.getTileEntity(x, y, z);
if(i == 0 && te.spin < 10)
world.playSoundEffect(x, y, z, "hbm:weapon.ciwsSpinup", 1.0F, 1.0F);
if(te.spin < 35)
te.spin += 5;
if(te.spin > 25 && i % 2 == 0) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
world.playSoundEffect(x, y, z, "hbm:weapon.ciwsFiringLoop", 1.0F, 1.25F);
flag = true;
}
return flag;
}
private void rayShot(World world, Vec3 vec, double posX, double posY, double posZ, int range, float damage, int hitPercent) {
for(float i = 0; i < range; i += 0.25F) {
double pX = posX + vec.xCoord * i;
double pY = posY + vec.yCoord * i;
double pZ = posZ + vec.zCoord * i;
if(world.getBlock((int)pX, (int)pY, (int)pZ).getMaterial() != Material.air)
break;
List<Entity> hit = world.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(pX - 0.125, pY - 0.125, pZ - 0.125, pX + 0.125, pY + 0.125, pZ + 0.125));
for(int j = 0; j < hit.size(); j++) {
Entity ent = hit.get(j);
if(rand.nextInt(100) < hitPercent) {
ent.attackEntityFrom(ModDamageSource.shrapnel, 10.0F);
}
}
}
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
TileEntityTurretCIWS te = (TileEntityTurretCIWS)world.getTileEntity(x, y, z);
if(te.spin > 10)
world.playSoundEffect(x, y, z, "hbm:weapon.ciwsSpindown", 1.0F, 1.0F);
}
}

View File

@ -1,80 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretCheapo extends TurretBase {
public TurretCheapo(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretCheapo();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -30)
pitch = -30;
if(pitch > 15)
pitch = 15;
TileEntityTurretCheapo te = (TileEntityTurretCheapo)world.getTileEntity(x, y, z);
if(i == 0 && te.spin < 10)
world.playSoundEffect(x, y, z, "hbm:weapon.spinup", 1.0F, 1.0F);
if(te.spin < 35)
te.spin += 5;
if(te.spin > 25 && i % 2 == 0) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityBullet bullet = new EntityBullet(world);
bullet.posX = x + vector.xCoord * 1.5 + 0.5;
bullet.posY = y + vector.yCoord * 1.5 + 1.5;
bullet.posZ = z + vector.zCoord * 1.5 + 0.5;
bullet.motionX = vector.xCoord * 3;
bullet.motionY = vector.yCoord * 3;
bullet.motionZ = vector.zCoord * 3;
bullet.damage = rand.nextInt(11) + 5;
world.spawnEntityInWorld(bullet);
}
world.playSoundEffect(x, y, z, "hbm:weapon.sawShoot", 3.0F, 1.0F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
TileEntityTurretCheapo te = (TileEntityTurretCheapo)world.getTileEntity(x, y, z);
if(te.spin > 10)
world.playSoundEffect(x, y, z, "hbm:weapon.spindown", 1.0F, 1.0F);
}
}

View File

@ -1,69 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityFire;
import com.hbm.tileentity.turret.TileEntityTurretFlamer;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretFlamer extends TurretBase {
public TurretFlamer(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretFlamer();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
if(true) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityFire bullet = new EntityFire(world);
bullet.posX = x + vector.xCoord * 2 + 0.5;
bullet.posY = y + vector.yCoord * 2 + 1;
bullet.posZ = z + vector.zCoord * 2 + 0.5;
bullet.motionX = vector.xCoord * 3;
bullet.motionY = vector.yCoord * 3;
bullet.motionZ = vector.zCoord * 3;
bullet.setDamage(6 + rand.nextInt(5));
world.spawnEntityInWorld(bullet);
}
if(i == 0)
world.playSoundEffect(x, y, z, "hbm:weapon.flamethrowerIgnite", 1.0F, 1.0F);
else
world.playSoundEffect(x, y, z, "hbm:weapon.flamethrowerShoot", 1.0F, 1.0F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) { }
}

View File

@ -1,66 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.tileentity.turret.TileEntityTurretHeavy;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretHeavy extends TurretBase {
public TurretHeavy(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretHeavy();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
if(i != 0 && i % 20 == 0) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityBullet bullet = new EntityBullet(world);
bullet.posX = x + vector.xCoord * 1 + 0.5;
bullet.posY = y + vector.yCoord * 1 + 1;
bullet.posZ = z + vector.zCoord * 1 + 0.5;
bullet.motionX = vector.xCoord * 3;
bullet.motionY = vector.yCoord * 3;
bullet.motionZ = vector.zCoord * 3;
bullet.damage = rand.nextInt(26) + 15;
world.spawnEntityInWorld(bullet);
}
world.playSoundEffect(x, y, z, "hbm:weapon.defabShoot", 1.0F, 0.75F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) { }
}

View File

@ -1,66 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.tileentity.turret.TileEntityTurretLight;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretLight extends TurretBase {
public TurretLight(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretLight();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
if(i != 0 && i % 2 == 0) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityBullet bullet = new EntityBullet(world);
bullet.posX = x + vector.xCoord * 1.5 + 0.5;
bullet.posY = y + vector.yCoord * 1.5 + 1.1;
bullet.posZ = z + vector.zCoord * 1.5 + 0.5;
bullet.motionX = vector.xCoord * 3;
bullet.motionY = vector.yCoord * 3;
bullet.motionZ = vector.zCoord * 3;
bullet.damage = rand.nextInt(11) + 10;
world.spawnEntityInWorld(bullet);
}
world.playSoundEffect(x, y, z, "hbm:weapon.rifleShoot", 1.0F, 0.5F + rand.nextFloat() * 0.25F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) { }
}

View File

@ -1,64 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityRocket;
import com.hbm.tileentity.turret.TileEntityTurretRocket;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretRocket extends TurretBase {
public TurretRocket(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretRocket();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
if(i != 0 && (i % 100 == 60 || i % 100 == 70 || i % 100 == 80 || i % 100 == 90)) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityRocket bullet = new EntityRocket(world);
bullet.posX = x + vector.xCoord * 1 + 0.5;
bullet.posY = y + vector.yCoord * 1 + 1;
bullet.posZ = z + vector.zCoord * 1 + 0.5;
bullet.motionX = vector.xCoord * 3;
bullet.motionY = vector.yCoord * 3;
bullet.motionZ = vector.zCoord * 3;
world.spawnEntityInWorld(bullet);
}
world.playSoundEffect(x, y, z, "hbm:weapon.rpgShoot", 1.0F, 0.75F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) { }
}

View File

@ -1,65 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityAAShell;
import com.hbm.tileentity.turret.TileEntityTurretSpitfire;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretSpitfire extends TurretBase {
public TurretSpitfire(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretSpitfire();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
if(i != 0 && i % 35 == 0) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityAAShell bullet = new EntityAAShell(world);
bullet.posX = x + vector.xCoord * 2.75 + 0.5;
bullet.posY = y + vector.yCoord * 2.75 + 1.5;
bullet.posZ = z + vector.zCoord * 2.75 + 0.5;
bullet.motionX = vector.xCoord;
bullet.motionY = vector.yCoord;
bullet.motionZ = vector.zCoord;
bullet.speedOverride = 3;
world.spawnEntityInWorld(bullet);
}
world.playSoundEffect(x, y, z, "hbm:entity.oldExplosion", 1.0F, 0.5F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) { }
}

View File

@ -1,67 +0,0 @@
package com.hbm.blocks.turret;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.tileentity.turret.TileEntityTurretTau;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class TurretTau extends TurretBase {
public TurretTau(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileEntityTurretTau();
}
@Override
public boolean executeHoldAction(World world, int i, double yaw, double pitch, int x, int y, int z) {
boolean flag = false;
if(pitch < -60)
pitch = -60;
if(pitch > 30)
pitch = 30;
if(i != 0 && i % 4 == 0) {
Vec3 vector = Vec3.createVectorHelper(
-Math.sin(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI),
-Math.sin(pitch / 180.0F * (float) Math.PI),
Math.cos(yaw / 180.0F * (float) Math.PI) * Math.cos(pitch / 180.0F * (float) Math.PI));
vector.normalize();
if(!world.isRemote) {
EntityBullet bullet = new EntityBullet(world);
bullet.setIsCritical(true);
bullet.posX = x + vector.xCoord * 2 + 0.5;
bullet.posY = y + vector.yCoord * 2 + 1;
bullet.posZ = z + vector.zCoord * 2 + 0.5;
bullet.motionX = vector.xCoord * 3;
bullet.motionY = vector.yCoord * 3;
bullet.motionZ = vector.zCoord * 3;
bullet.setDamage(25 + rand.nextInt(65 - 25));
world.spawnEntityInWorld(bullet);
}
world.playSoundEffect(x, y, z, "hbm:weapon.tauShoot", 1.0F, 0.5F);
flag = true;
}
return flag;
}
@Override
public void executeReleaseAction(World world, int i, double yaw, double pitch, int x, int y, int z) { }
}

View File

@ -323,16 +323,6 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fireext_foam, 1), new Object[] { " N ", "NFN", " N ", 'N', KNO.dust(), 'F', ModItems.ammo_fireext });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fireext_sand, 1), new Object[] { "NNN", "NFN", "NNN", 'N', ModBlocks.sand_boron, 'F', ModItems.ammo_fireext });
//Turrets
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_light_ammo, 1), new Object[] { " L ", "IGI", "ICI", 'L', PB.plate(), 'I', IRON.plate(), 'C', CU.plate(), 'G', Items.gunpowder });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_heavy_ammo, 1), new Object[] { "LGC", "LGC", "LGC", 'L', PB.plate(), 'C', CU.plate(), 'G', Items.gunpowder });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_rocket_ammo, 1), new Object[] { "TS ", "SGS", " SR", 'T', Blocks.tnt, 'S', STEEL.plate(), 'G', Items.gunpowder, 'R', REDSTONE.dust() });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_flamer_ammo, 1), new Object[] { "FSF", "FPF", "FPF", 'F', ModItems.gun_immolator_ammo, 'S', ModItems.pipes_steel, 'P', CU.plate() });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_tau_ammo, 1), new Object[] { "AAA", "AUA", "AAA", 'A', ModItems.gun_xvl1456_ammo, 'U', U238.block() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_spitfire_ammo, 1), new Object[] { "CP ", "PTP", " PR", 'P', STEEL.plate(), 'C', ModItems.circuit_copper, 'T', Blocks.tnt, 'R', REDSTONE.dust() });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_cwis_ammo, 1), new Object[] { "LLL", "GGG", "IGI", 'L', PB.plate(), 'I', IRON.plate(), 'G', Items.gunpowder });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.turret_cheapo_ammo, 1), new Object[] { "ILI", "IGI", "ICI", 'L', PB.plate(), 'I', STEEL.plate(), 'C', CU.plate(), 'G', Items.gunpowder });
//Grenades
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_generic, 4), new Object[] { "RS ", "ITI", " I ", 'I', IRON.plate(), 'R', ModItems.wire_red_copper, 'S', STEEL.plate(), 'T', Item.getItemFromBlock(Blocks.tnt) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_strong, 2), new Object[] { " G ", "SGS", " S ", 'G', ModItems.grenade_generic, 'S', Items.gunpowder });

View File

@ -36,7 +36,6 @@ import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import com.hbm.util.ArmorUtil;
import api.hbm.energy.IEnergyUser;
@ -612,10 +611,6 @@ public class ExplosionNukeGeneric {
if(random.nextInt(5) <= 1)
world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
}
if (te != null && te instanceof TileEntityTurretBase) {
((TileEntityTurretBase)te).ammo = 0;
}
if((b == ModBlocks.fusion_conductor || b == ModBlocks.fwatz_conductor || b == ModBlocks.fusion_motor || b == ModBlocks.fusion_heater || b == ModBlocks.fwatz_computer) && random.nextInt(10) == 0)
world.setBlock(x, y, z, ModBlocks.block_electrical_scrap);
}

View File

@ -106,9 +106,6 @@ public class BobmazonOfferFactory {
weapons.add(new Offer(new ItemStack(ModItems.designator), Requirement.CHEMICS, 35 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.designator_range), Requirement.CHEMICS, 50 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.sat_chip), Requirement.CHEMICS, 35 * inflation));
weapons.add(new Offer(new ItemStack(ModBlocks.turret_cheapo), Requirement.CHEMICS, 70 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.turret_cheapo_ammo), Requirement.ASSEMBLY, 20 * inflation));
//weapons.add(new Offer(new ItemStack(ModItems.turret_control), Requirement.CHEMICS, 35 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.turret_chip), Requirement.CHEMICS, 80 * inflation));
weapons.add(new Offer(new ItemStack(ModBlocks.mine_ap, 4), Requirement.ASSEMBLY, 25 * inflation));
weapons.add(new Offer(new ItemStack(ModBlocks.emp_bomb), Requirement.CHEMICS, 90 * inflation));

View File

@ -1,64 +0,0 @@
package com.hbm.inventory.container;
import com.hbm.tileentity.bomb.TileEntityCelPrime;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerCelPrime extends Container {
private TileEntityCelPrime nukeSol;
public ContainerCelPrime(InventoryPlayer invPlayer, TileEntityCelPrime tedf) {
nukeSol = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 44, 158));
this.addSlotToContainer(new Slot(tedf, 1, 80, 158));
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 10) {
if (!this.mergeItemStack(var5, 11, this.inventorySlots.size(), true))
{
return null;
}
} else {
return null;
}
if (var5.stackSize == 0)
{
var4.putStack((ItemStack) null);
}
else
{
var4.onSlotChanged();
}
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return nukeSol.isUseableByPlayer(player);
}
}

View File

@ -1,46 +0,0 @@
package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerCelPrime;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.bomb.TileEntityCelPrime;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
public class GUICelPrime extends GuiContainer {
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/celprime_cmd_alt_thirdslot.png");
private TileEntityCelPrime testNuke;
public GUICelPrime(InventoryPlayer invPlayer, TileEntityCelPrime tedf) {
super(new ContainerCelPrime(invPlayer, tedf));
testNuke = tedf;
this.xSize = 176;
this.ySize = 222;
}
@Override
protected void drawGuiContainerForegroundLayer( int i, int j) {
String name = this.testNuke.hasCustomInventoryName() ? this.testNuke.getInventoryName() : I18n.format(this.testNuke.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2 + 56, 4210752);
GL11.glScalef(0.5F, 0.5F, 0.5F);
for(int k = 0; k < testNuke.cmd.length; k++)
this.fontRendererObj.drawString(testNuke.cmd[k], 36, 50 + (12 * k), 65280);
GL11.glScalef(2F, 2F, 2F);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
}

View File

@ -328,14 +328,6 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModBlocks.therm_exo, 1), new AStack[] {new OreDictStack(TI.plate(), 12), new OreDictStack(P_RED.dust(), 32), new ComparableStack(ModItems.circuit_gold, 1), new ComparableStack(ModItems.coil_gold, 4), },250);
makeRecipe(new ComparableStack(ModBlocks.launch_pad, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(ANY_PLASTIC.ingot(), 2), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.machine_battery, 1), new ComparableStack(ModItems.circuit_gold, 2), },250);
makeRecipe(new ComparableStack(ModItems.spawn_chopper, 1), new AStack[] {new ComparableStack(ModItems.chopper_blades, 5), new ComparableStack(ModItems.chopper_gun, 1), new ComparableStack(ModItems.chopper_head, 1), new ComparableStack(ModItems.chopper_tail, 1), new ComparableStack(ModItems.chopper_torso, 1), new ComparableStack(ModItems.chopper_wing, 2), },300);
//makeRecipe(new ComparableStack(ModBlocks.turret_light, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 6), new ComparableStack(ModItems.pipes_steel, 2), new OreDictStack(MINGRADE.ingot(), 2), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.circuit_targeting_tier2, 2), },200);
//makeRecipe(new ComparableStack(ModBlocks.turret_heavy, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(AL.ingot(), 4), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.hull_small_steel, 1), new OreDictStack(MINGRADE.ingot(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.circuit_targeting_tier2, 3), },250);
//makeRecipe(new ComparableStack(ModBlocks.turret_rocket, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(TI.ingot(), 4), new ComparableStack(ModItems.hull_small_steel, 8), new OreDictStack(MINGRADE.ingot(), 6), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.circuit_targeting_tier3, 2), },300);
//makeRecipe(new ComparableStack(ModBlocks.turret_flamer, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(W.ingot(), 2), new ComparableStack(ModItems.pipes_steel, 1), new ComparableStack(ModItems.tank_steel, 2), new OreDictStack(MINGRADE.ingot(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.circuit_targeting_tier3, 2), },250);
//makeRecipe(new ComparableStack(ModBlocks.turret_tau, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 16), new OreDictStack(TI.ingot(), 8), new OreDictStack(ALLOY.plate(), 4), new ComparableStack(ModItems.redcoil_capacitor, 3), new OreDictStack(MINGRADE.ingot(), 12), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 2), },350);
makeRecipe(new ComparableStack(ModBlocks.turret_spitfire, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 6), new OreDictStack(MINGRADE.ingot(), 6), new OreDictStack(STEEL.plate(), 16), new OreDictStack(IRON.plate(), 8), new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.motor, 3), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },350);
//makeRecipe(new ComparableStack(ModBlocks.turret_cwis, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 6), new OreDictStack(MINGRADE.ingot(), 8), new OreDictStack(STEEL.plate(), 10), new OreDictStack(TI.plate(), 4), new ComparableStack(ModItems.hull_small_aluminium, 2), new ComparableStack(ModItems.pipes_steel, 6), new ComparableStack(ModItems.motor, 4), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModItems.magnetron, 3), },400);
makeRecipe(new ComparableStack(ModBlocks.turret_cheapo, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(IRON.plate(), 4), new ComparableStack(ModItems.pipes_steel, 1), new ComparableStack(ModItems.motor, 3), new ComparableStack(ModItems.circuit_targeting_tier1, 4), },200);
makeRecipe(new ComparableStack(ModItems.missile_generic, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_small, 1), new ComparableStack(ModItems.fuel_tank_small, 1), new ComparableStack(ModItems.thruster_small, 1), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.circuit_targeting_tier1, 1), },200);
makeRecipe(new ComparableStack(ModItems.missile_incendiary, 1), new AStack[] {new ComparableStack(ModItems.warhead_incendiary_small, 1), new ComparableStack(ModItems.fuel_tank_small, 1), new ComparableStack(ModItems.thruster_small, 1), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.circuit_targeting_tier1, 1), },200);
makeRecipe(new ComparableStack(ModItems.missile_cluster, 1), new AStack[] {new ComparableStack(ModItems.warhead_cluster_small, 1), new ComparableStack(ModItems.fuel_tank_small, 1), new ComparableStack(ModItems.thruster_small, 1), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.circuit_targeting_tier1, 1), },200);

View File

@ -2431,9 +2431,6 @@ public class ModItems {
public static Item mech_key;
public static Item turret_spitfire_ammo;
public static Item turret_cheapo_ammo;
public static Item bucket_mud;
public static Item bucket_acid;
public static Item bucket_toxic;
@ -4862,9 +4859,6 @@ public class ModItems {
mech_key = new ItemCustomLore().setUnlocalizedName("mech_key").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":mech_key");
turret_spitfire_ammo = new ItemTurretAmmo(ModBlocks.turret_spitfire, 2).setUnlocalizedName("turret_spitfire_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":turret_spitfire_ammo");
turret_cheapo_ammo = new ItemTurretAmmo(ModBlocks.turret_cheapo, 100).setUnlocalizedName("turret_cheapo_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":turret_cheapo_ammo");
template_folder = new ItemTemplateFolder().setUnlocalizedName("template_folder").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":template_folder");
journal_pip = new ItemTemplateFolder().setUnlocalizedName("journal_pip").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":journal_pip");
journal_bj = new ItemTemplateFolder().setUnlocalizedName("journal_bj").setMaxStackSize(1).setCreativeTab(MainRegistry.templateTab).setTextureName(RefStrings.MODID + ":journal_bj");
@ -7460,10 +7454,6 @@ public class ModItems {
GameRegistry.registerItem(ammo_folly_nuclear, ammo_folly_nuclear.getUnlocalizedName());
GameRegistry.registerItem(ammo_folly_du, ammo_folly_du.getUnlocalizedName());
//Turret Ammo
GameRegistry.registerItem(turret_spitfire_ammo, turret_spitfire_ammo.getUnlocalizedName());
GameRegistry.registerItem(turret_cheapo_ammo, turret_cheapo_ammo.getUnlocalizedName());
//-C-l-i-p-s- Magazines
GameRegistry.registerItem(clip_revolver_iron, clip_revolver_iron.getUnlocalizedName());
GameRegistry.registerItem(clip_revolver, clip_revolver.getUnlocalizedName());

View File

@ -1,39 +1,3 @@
package com.hbm.items.machine;
import java.util.Arrays;
import com.hbm.blocks.turret.TurretBase;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemTurretChip extends ItemTurretBiometry {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) {
if((world.getBlock(x, y, z) instanceof TurretBase)) {
if(getNames(stack) == null)
return false;
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileEntityTurretBase) {
((TileEntityTurretBase) te).isAI = true;
((TileEntityTurretBase) te).players = Arrays.asList(getNames(stack));
}
if(world.isRemote) {
player.addChatMessage(new ChatComponentText("Transferred turret ownership!"));
}
world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
return true;
}
return false;
}
}
public class ItemTurretChip extends ItemTurretBiometry { }

View File

@ -5,9 +5,7 @@ import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.turret.TurretBase;
import com.hbm.lib.Library;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import com.hbm.tileentity.turret.TileEntityTurretBaseNT;
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@ -43,27 +41,6 @@ public class ItemTurretControl extends Item {
TileEntity te = world.getTileEntity(x, y, z);
if(te != null && te instanceof TileEntityTurretBase) {
TileEntityTurretBase turret = (TileEntityTurretBase) te;
if(!turret.isAI) {
turret.rotationYaw = player.rotationYaw;
turret.rotationPitch = player.rotationPitch;
if(turret.rotationPitch < -60)
turret.rotationPitch = -60;
if(turret.rotationPitch > 30)
turret.rotationPitch = 30;
if(turret instanceof TileEntityTurretCheapo) {
if(turret.rotationPitch < -30)
turret.rotationPitch = -30;
if(turret.rotationPitch > 15)
turret.rotationPitch = 15;
}
}
}
if(te != null && te instanceof TileEntityTurretBaseNT) {
TileEntityTurretBaseNT turret = (TileEntityTurretBaseNT) te;
@ -194,19 +171,8 @@ public class ItemTurretControl extends Item {
int x = stack.getTagCompound().getInteger("xCoord");
int y = stack.getTagCompound().getInteger("yCoord");
int z = stack.getTagCompound().getInteger("zCoord");
if(world.getBlock(x, y, z) instanceof TurretBase) {
TileEntity te = world.getTileEntity(x, y, z);
if(te != null && te instanceof TileEntityTurretBase) {
TileEntityTurretBase turret = (TileEntityTurretBase) te;
if(!turret.isAI) {
((TurretBase) world.getBlock(x, y, z)).executeReleaseAction(world, j, player.rotationYaw, player.rotationPitch, x, y, z);
}
}
}
/// ///
}
}
@ -239,15 +205,8 @@ public class ItemTurretControl extends Item {
if(world.getBlock(x, y, z) instanceof TurretBase) {
TileEntity te = world.getTileEntity(x, y, z);
if(te != null && te instanceof TileEntityTurretBase) {
TileEntityTurretBase turret = (TileEntityTurretBase) te;
if(!turret.isAI && turret.ammo > 0) {
if(((TurretBase) world.getBlock(x, y, z)).executeHoldAction(world, stack.getMaxItemUseDuration() - count, player.rotationYaw, player.rotationPitch, x, y, z))
turret.ammo--;
}
}
/// ///
}
if(world.getTileEntity(x, y, z) instanceof TileEntityTurretBaseNT) {

View File

@ -1,41 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemTurretAmmo extends Item {
Block turret;
int count;
public ItemTurretAmmo(Block turret, int count) {
this.turret = turret;
this.count = count;
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f0, float f1, float f2)
{
if(player.isSneaking())
return false;
if(world.getBlock(x, y, z) == turret) {
if(world.getTileEntity(x, y, z) instanceof TileEntityTurretBase) {
((TileEntityTurretBase)world.getTileEntity(x, y, z)).ammo += count;
player.inventory.consumeInventoryItem(this);
world.playSoundAtEntity(player, "hbm:weapon.reloadTurret", 1.0F, 1.0F);
}
return true;
}
return false;
}
}

View File

@ -174,14 +174,6 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityNukePrototype.class, new RenderNukePrototype());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCharge.class, new RenderExplosiveCharge());
//turrets
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHeavy.class, new RenderHeavyTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretRocket.class, new RenderRocketTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretLight.class, new RenderLightTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretFlamer.class, new RenderFlamerTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretTau.class, new RenderTauTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretSpitfire.class, new RenderSpitfireTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretCIWS.class, new RenderCIWSTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretCheapo.class, new RenderCheapoTurret());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretChekhov.class, new RenderTurretChekhov());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretFriendly.class, new RenderTurretFriendly());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretJeremy.class, new RenderTurretJeremy());
@ -196,12 +188,6 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTurretHIMARS.class, new RenderTurretHIMARS());
//mines
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLandmine.class, new RenderLandmine());
//cel prime
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrime.class, new RenderCelPrimeTower());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrimeTerminal.class, new RenderCelPrimePart());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrimeBattery.class, new RenderCelPrimePart());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrimePort.class, new RenderCelPrimePart());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCelPrimeTanks.class, new RenderCelPrimePart());
//machines
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCentrifuge.class, new RenderCentrifuge());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineGasCent.class, new RenderCentrifuge());

View File

@ -774,7 +774,7 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.upgrade_centrifuge, 1), new Object[] { "PHP", "PUP", "DTD", 'P', ModItems.centrifuge_element, 'H', Blocks.hopper, 'U', ModItems.upgrade_shredder, 'D', ANY_PLASTIC.ingot(), 'T', ModBlocks.machine_transformer });
addRecipeAuto(new ItemStack(ModItems.upgrade_crystallizer, 1), new Object[] { "PHP", "CUC", "DTD", 'P', new ItemStack(ModItems.fluid_barrel_full, 1, Fluids.ACID.getID()), 'H', ModItems.circuit_targeting_tier4, 'C', ModBlocks.barrel_steel, 'U', ModItems.upgrade_centrifuge, 'D', ModItems.motor, 'T', ModBlocks.machine_transformer });
addRecipeAuto(new ItemStack(ModItems.upgrade_screm, 1), new Object[] { "SUS", "SCS", "SUS", 'S', STEEL.plate(), 'U', ModItems.upgrade_template, 'C', ModItems.crystal_xen });
addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"GNG", "RUR", "GMG", 'R', RUBBER.ingot(), 'M', ModItems.motor, 'G', ModItems.coil_gold, 'N', TCALLOY.ingot(), 'U', ModItems.upgrade_template}); //TODO: gate this behind the upwards gate of the oil chain when it exists
addRecipeAuto(new ItemStack(ModItems.upgrade_gc_speed, 1), new Object[] {"GNG", "RUR", "GMG", 'R', RUBBER.ingot(), 'M', ModItems.motor, 'G', ModItems.coil_gold, 'N', NB.ingot(), 'U', ModItems.upgrade_template});
addRecipeAuto(new ItemStack(ModItems.upgrade_stack, 1, 0), new Object[] { " C ", "PUP", " C ", 'C', ModItems.circuit_aluminium, 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_PNEUMATIC), 'U', ModItems.upgrade_template });
addRecipeAuto(new ItemStack(ModItems.upgrade_stack, 1, 1), new Object[] { " C ", "PUP", " C ", 'C', ModItems.circuit_copper, 'P', DictFrame.fromOne(ModItems.part_generic, EnumPartType.PISTON_HYDRAULIC), 'U', new ItemStack(ModItems.upgrade_stack, 1, 0) });

View File

@ -949,12 +949,16 @@ public class MainRegistry {
ignoreMappings.add("hbm:tile.turret_flamer");
ignoreMappings.add("hbm:tile.turret_tau");
ignoreMappings.add("hbm:tile.turret_cwis");
ignoreMappings.add("hbm:tile.turret_spitfire");
ignoreMappings.add("hbm:tile.turret_cheapo");
ignoreMappings.add("hbm:item.turret_light_ammo");
ignoreMappings.add("hbm:item.turret_heavy_ammo");
ignoreMappings.add("hbm:item.turret_rocket_ammo");
ignoreMappings.add("hbm:item.turret_flamer_ammo");
ignoreMappings.add("hbm:item.turret_tau_ammo");
ignoreMappings.add("hbm:item.turret_cwis_ammo");
ignoreMappings.add("hbm:item.turret_spitfire_ammo");
ignoreMappings.add("hbm:item.turret_cheapo_ammo");
ignoreMappings.add("hbm:tile.cel_prime");
ignoreMappings.add("hbm:tile.cel_prime_terminal");
ignoreMappings.add("hbm:tile.cel_prime_battery");

View File

@ -5,7 +5,6 @@ import com.hbm.items.weapon.ItemMissile.PartSize;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.tileentity.bomb.TileEntityCompactLauncher;
import com.hbm.tileentity.bomb.TileEntityLaunchTable;
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
import com.hbm.tileentity.bomb.TileEntityNukeN45;
import com.hbm.tileentity.deco.TileEntityBomber;
import com.hbm.tileentity.machine.TileEntityAMSBase;
@ -14,15 +13,11 @@ import com.hbm.tileentity.machine.TileEntityAMSLimiter;
import com.hbm.tileentity.machine.TileEntityMachineArcFurnace;
import com.hbm.tileentity.machine.TileEntityMachineBoiler;
import com.hbm.tileentity.machine.TileEntityMachineBoilerElectric;
import com.hbm.tileentity.machine.TileEntityMachineCentrifuge;
import com.hbm.tileentity.machine.TileEntityMachineCoal;
import com.hbm.tileentity.machine.TileEntityMachineDiesel;
import com.hbm.tileentity.machine.TileEntityMachineElectricFurnace;
import com.hbm.tileentity.machine.TileEntityMachineGasCent;
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
import com.hbm.tileentity.machine.TileEntityMachineSeleniumEngine;
import com.hbm.tileentity.machine.TileEntityRadioRec;
@ -111,16 +106,6 @@ public class AuxGaugePacket implements IMessage {
else if(m.id == 3)
base.field = m.value;
}
if (te instanceof TileEntityTurretCIWS) {
TileEntityTurretCIWS cwis = (TileEntityTurretCIWS)te;
cwis.rotation = m.value;
}
if (te instanceof TileEntityTurretCheapo) {
TileEntityTurretCheapo cwis = (TileEntityTurretCheapo)te;
cwis.rotation = m.value;
}
if (te instanceof TileEntityMachineSeleniumEngine) {
TileEntityMachineSeleniumEngine selenium = (TileEntityMachineSeleniumEngine)te;

View File

@ -33,8 +33,6 @@ public class PacketDispatcher {
wrapper.registerMessage(TEFluidPacket.Handler.class, TEFluidPacket.class, i++, Side.CLIENT);
//Sound packet that keeps client and server separated
wrapper.registerMessage(LoopedSoundPacket.Handler.class, LoopedSoundPacket.class, i++, Side.CLIENT);
//Turret rotation for rendering
wrapper.registerMessage(TETurretPacket.Handler.class, TETurretPacket.class, i++, Side.CLIENT);
//Signals server to consume items and create template
wrapper.registerMessage(ItemFolderPacket.Handler.class, ItemFolderPacket.class, i++, Side.SERVER);
//Turbofan spin for rendering

View File

@ -1,71 +0,0 @@
package com.hbm.packet;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
public class TETurretPacket implements IMessage {
int x;
int y;
int z;
double yaw;
double pitch;
public TETurretPacket()
{
}
public TETurretPacket(int x, int y, int z, double yaw, double pitch)
{
this.x = x;
this.y = y;
this.z = z;
this.yaw = yaw;
this.pitch = pitch;
}
@Override
public void fromBytes(ByteBuf buf) {
x = buf.readInt();
y = buf.readInt();
z = buf.readInt();
yaw = buf.readDouble();
pitch = buf.readDouble();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(x);
buf.writeInt(y);
buf.writeInt(z);
buf.writeDouble(yaw);
buf.writeDouble(pitch);
}
public static class Handler implements IMessageHandler<TETurretPacket, IMessage> {
@Override
public IMessage onMessage(TETurretPacket m, MessageContext ctx) {
try {
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
if (te != null && te instanceof TileEntityTurretBase) {
TileEntityTurretBase turret = (TileEntityTurretBase) te;
turret.rotationYaw = m.yaw;
turret.rotationPitch = m.pitch;
}
} catch(Exception ex) {
}
return null;
}
}
}

View File

@ -1,95 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import com.hbm.tileentity.turret.TileEntityTurretCIWS;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderCIWSTurret extends TileEntitySpecialRenderer {
public RenderCIWSTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_ciws_base_tex);
ResourceManager.turret_cwis_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_ciws_rotor_tex);
ResourceManager.turret_cwis_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_ciws_head_tex);
ResourceManager.turret_cwis_head.renderAll();
GL11.glPopMatrix();
renderTileEntityAt4(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt4(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
GL11.glRotated(((TileEntityTurretCIWS)tileEntity).rotation, 0F, 0F, 1F);
this.bindTexture(ResourceManager.turret_ciws_gun_tex);
ResourceManager.turret_cwis_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,61 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.bomb.TileEntityCelPrimeBattery;
import com.hbm.tileentity.bomb.TileEntityCelPrimePort;
import com.hbm.tileentity.bomb.TileEntityCelPrimeTanks;
import com.hbm.tileentity.bomb.TileEntityCelPrimeTerminal;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderCelPrimePart extends TileEntitySpecialRenderer {
public RenderCelPrimePart() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(90, 0F, 1F, 0F);
switch(tileEntity.getBlockMetadata())
{
case 2:
GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3:
GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(0, 0F, 1F, 0F); break;
}
if(tileEntity instanceof TileEntityCelPrimeTerminal) {
bindTexture(ResourceManager.universal);
ResourceManager.cp_terminal.renderAll();
}
if(tileEntity instanceof TileEntityCelPrimeBattery) {
bindTexture(ResourceManager.universal);
ResourceManager.cp_battery.renderAll();
}
if(tileEntity instanceof TileEntityCelPrimePort) {
bindTexture(ResourceManager.universal);
ResourceManager.cp_port.renderAll();
}
if(tileEntity instanceof TileEntityCelPrimeTanks) {
bindTexture(ResourceManager.universal);
ResourceManager.cp_tanks.renderAll();
}
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
}

View File

@ -1,43 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderCelPrimeTower extends TileEntitySpecialRenderer {
public RenderCelPrimeTower() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(90, 0F, 1F, 0F);
switch(tileEntity.getBlockMetadata())
{
case 2:
GL11.glRotatef(90, 0F, 1F, 0F); break;
case 4:
GL11.glRotatef(180, 0F, 1F, 0F); break;
case 3:
GL11.glRotatef(270, 0F, 1F, 0F); break;
case 5:
GL11.glRotatef(0, 0F, 1F, 0F); break;
}
bindTexture(ResourceManager.universal);
ResourceManager.cp_tower.renderAll();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
}

View File

@ -1,98 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import com.hbm.tileentity.turret.TileEntityTurretCheapo;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderCheapoTurret extends TileEntitySpecialRenderer {
public RenderCheapoTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_cheapo_base_tex);
ResourceManager.turret_cheapo_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_cheapo_rotor_tex);
ResourceManager.turret_cheapo_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1.25D, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_cheapo_head_tex);
ResourceManager.turret_cheapo_head.renderAll();
GL11.glPopMatrix();
renderTileEntityAt4(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt4(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1.25D, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
GL11.glTranslated(0, 0.25D, 0);
GL11.glRotated(((TileEntityTurretCheapo)tileEntity).rotation, 0F, 0F, 1F);
this.bindTexture(ResourceManager.turret_cheapo_gun_tex);
ResourceManager.turret_cheapo_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,74 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderFlamerTurret extends TileEntitySpecialRenderer {
public RenderFlamerTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_heavy_base_tex);
ResourceManager.turret_heavy_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_flamer_rotor_tex);
ResourceManager.turret_heavy_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_flamer_gun_tex);
ResourceManager.turret_flamer_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,74 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderHeavyTurret extends TileEntitySpecialRenderer {
public RenderHeavyTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_heavy_base_tex);
ResourceManager.turret_heavy_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_heavy_rotor_tex);
ResourceManager.turret_heavy_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_heavy_gun_tex);
ResourceManager.turret_heavy_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,74 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderLightTurret extends TileEntitySpecialRenderer {
public RenderLightTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_heavy_base_tex);
ResourceManager.turret_heavy_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_light_rotor_tex);
ResourceManager.turret_heavy_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_light_gun_tex);
ResourceManager.turret_light_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,74 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderRocketTurret extends TileEntitySpecialRenderer {
public RenderRocketTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_heavy_base_tex);
ResourceManager.turret_heavy_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_rocket_rotor_tex);
ResourceManager.turret_heavy_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_rocket_gun_tex);
ResourceManager.turret_rocket_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,74 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderSpitfireTurret extends TileEntitySpecialRenderer {
public RenderSpitfireTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.universal);
ResourceManager.turret_spitfire_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.universal);
ResourceManager.turret_spitfire_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.universal);
ResourceManager.turret_spitfire_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -1,74 +0,0 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.turret.TileEntityTurretBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderTauTurret extends TileEntitySpecialRenderer {
public RenderTauTurret() { }
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
double yaw = 0;
double pitch = 0;
if(tileEntity instanceof TileEntityTurretBase) {
yaw = ((TileEntityTurretBase)tileEntity).rotationYaw;
pitch = ((TileEntityTurretBase)tileEntity).rotationPitch;
}
this.bindTexture(ResourceManager.turret_heavy_base_tex);
ResourceManager.turret_heavy_base.renderAll();
GL11.glPopMatrix();
renderTileEntityAt2(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
this.bindTexture(ResourceManager.turret_tau_rotor_tex);
ResourceManager.turret_heavy_rotor.renderAll();
GL11.glPopMatrix();
renderTileEntityAt3(tileEntity, x, y, z, f, yaw, pitch);
}
public void renderTileEntityAt3(TileEntity tileEntity, double x, double y, double z, float f, double yaw, double pitch)
{
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 1, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glRotatef(180, 0F, 1F, 0F);
GL11.glRotated(yaw + 180, 0F, -1F, 0F);
GL11.glRotated(pitch, 1F, 0F, 0F);
this.bindTexture(ResourceManager.turret_tau_gun_tex);
ResourceManager.turret_tau_gun.renderAll();
GL11.glPopMatrix();
}
}

View File

@ -82,11 +82,6 @@ public class TileMappings {
put(TileEntityFluidDuctSimple.class, "tileentity_universal_duct_simple");
put(TileEntityFluidDuct.class, "tileentity_universal_duct");
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
put(TileEntityTurretHeavy.class, "tileentity_turret_heavy");
put(TileEntityTurretRocket.class, "tileentity_turret_rocket");
put(TileEntityTurretLight.class, "tileentity_turret_light");
put(TileEntityTurretFlamer.class, "tileentity_turret_flamer");
put(TileEntityTurretTau.class, "tileentity_turret_tau");
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
put(TileEntityCrateIron.class, "tileentity_crate_iron");
put(TileEntityCrateSteel.class, "tileentity_crate_steel");
@ -98,18 +93,10 @@ public class TileMappings {
put(TileEntityAMSLimiter.class, "tileentity_ams_limiter");
put(TileEntityMachineSiren.class, "tileentity_siren");
put(TileEntityMachineSPP.class, "tileentity_spp");
put(TileEntityTurretSpitfire.class, "tileentity_turret_spitfire");
put(TileEntityMachineRadGen.class, "tileentity_radgen");
put(TileEntityMachineTransformer.class, "tileentity_transformer");
put(TileEntityTurretCIWS.class, "tileentity_turret_cwis");
put(TileEntityMachineRadar.class, "tileentity_radar");
put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
put(TileEntityTurretCheapo.class, "tileentity_turret_cheapo");
put(TileEntityCelPrime.class, "tileentity_cel_prime");
put(TileEntityCelPrimeTerminal.class, "tileentity_cel_prime_access");
put(TileEntityCelPrimeBattery.class, "tileentity_cel_prime_energy");
put(TileEntityCelPrimePort.class, "tileentity_cel_prime_connector");
put(TileEntityCelPrimeTanks.class, "tileentity_cel_prime_storage");
put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
put(TileEntityReactorResearch.class, "tileentity_small_reactor");

View File

@ -1,285 +0,0 @@
package com.hbm.tileentity.bomb;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityCelPrime extends TileEntity implements ISidedInventory {
public ItemStack slots[];
private String customName;
public String[] cmd;
private int bootStatus = 0;
private int bootRequired = 10;
private int bootDelay;
public TileEntityCelPrime() {
slots = new ItemStack[2];
cmd = new String[18];
bootDelay = 100;
}
@Override
public int getSizeInventory() {
return slots.length;
}
@Override
public ItemStack getStackInSlot(int i) {
return slots[i];
}
@Override
public ItemStack decrStackSize(int i, int j) {
if(slots[i] != null)
{
if(slots[i].stackSize <= j)
{
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
}
ItemStack itemStack1 = slots[i].splitStack(j);
if (slots[i].stackSize == 0)
{
slots[i] = null;
}
return itemStack1;
} else {
return null;
}
}
@Override
public ItemStack getStackInSlotOnClosing(int i) {
if(slots[i] != null)
{
ItemStack itemStack = slots[i];
slots[i] = null;
return itemStack;
} else {
return null;
}
}
@Override
public void setInventorySlotContents(int i, ItemStack itemStack) {
slots[i] = itemStack;
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
{
itemStack.stackSize = getInventoryStackLimit();
}
}
@Override
public String getInventoryName() {
return this.hasCustomInventoryName() ? this.customName : "container.celPrime";
}
@Override
public boolean hasCustomInventoryName() {
return this.customName != null && this.customName.length() > 0;
}
public void setCustomName(String name) {
this.customName = name;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
{
return false;
}else{
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
}
}
@Override
public void openInventory() {
}
@Override
public void closeInventory() {
}
@Override
public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
return false;
}
@Override
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
return null;
}
@Override
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
return this.isItemValidForSlot(i, itemStack);
}
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
return j != 0 || i != 1 || itemStack.getItem() == Items.bucket;
}
@Override
public void updateEntity() {
if(!hasBooted()) {
if(bootDelay > 0) {
bootDelay--;
} else {
bootDelay = 100;
printMsgFromBoot();
bootStatus++;
}
}
}
private boolean hasBooted() {
return this.bootStatus == this.bootRequired;
}
private void printMsgFromBoot() {
switch(bootStatus) {
case 0:
appendText("*** Crusader Mainframe Mark 3 ***");
appendText("(C) 2077 CMC International");
break;
case 1:
appendText("");
appendText("ReiOS v6.24");
appendText("64k RAM System");
appendText("334077 KB free space");
break;
case 2:
appendText("No external PCI devices found!");
appendText("");
appendText("Self-test in progress...");
break;
case 3:
appendText("Hardware self-test successful!");
appendText("");
appendText("Establishing network uplink...");
break;
case 4:
appendText("Uplink established!");
appendText("Connecting to TOR circuit...");
break;
case 5:
appendText("Connected nodes: 1/3");
break;
case 6:
appendText("Connected nodes: 2/3");
break;
case 7:
appendText("Connected nodes: 3/3");
appendText("Connection successful!");
appendText("");
appendText("Checking for updates...");
break;
case 8:
appendText("Software already up-to-date.");
break;
case 9:
appendText("All systems ready!");
appendText("");
appendText("");
appendText("");
appendText("==============================");
appendText("CEL PRIME is a WIP feature and not");
appendText("yet functional. please don't ask me how");
appendText("it works because it DOESN'T!");
appendText("==============================");
break;
}
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
NBTTagList list = nbt.getTagList("items", 10);
slots = new ItemStack[getSizeInventory()];
for(int i = 0; i < list.tagCount(); i++)
{
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
byte b0 = nbt1.getByte("slot");
if(b0 >= 0 && b0 < slots.length)
{
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
}
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
for(int i = 0; i < slots.length; i++)
{
if(slots[i] != null)
{
NBTTagCompound nbt1 = new NBTTagCompound();
nbt1.setByte("slot", (byte)i);
slots[i].writeToNBT(nbt1);
list.appendTag(nbt1);
}
}
nbt.setTag("items", list);
}
private void fillCmd() {
for(int i = 0; i < cmd.length; i++) {
if(cmd[i] == null)
cmd[i] = "";
}
}
private void appendText(String text) {
for(int i = 0; i < cmd.length; i++) {
if(cmd[i] == null) {
cmd[i] = text;
return;
}
}
for(int i = 1; i < cmd.length; i++) {
cmd[i - 1] = cmd[i];
}
cmd[cmd.length - 1] = text;
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
}

View File

@ -1,7 +0,0 @@
package com.hbm.tileentity.bomb;
import net.minecraft.tileentity.TileEntity;
public class TileEntityCelPrimeBattery extends TileEntity {
}

View File

@ -1,7 +0,0 @@
package com.hbm.tileentity.bomb;
import net.minecraft.tileentity.TileEntity;
public class TileEntityCelPrimePort extends TileEntity {
}

View File

@ -1,7 +0,0 @@
package com.hbm.tileentity.bomb;
import net.minecraft.tileentity.TileEntity;
public class TileEntityCelPrimeTanks extends TileEntity {
}

View File

@ -1,7 +0,0 @@
package com.hbm.tileentity.bomb;
import net.minecraft.tileentity.TileEntity;
public class TileEntityCelPrimeTerminal extends TileEntity {
}

View File

@ -1,174 +0,0 @@
package com.hbm.tileentity.turret;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.turret.TurretBase;
import com.hbm.entity.logic.EntityBomber;
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
import com.hbm.entity.missile.EntityMissileCustom;
import com.hbm.lib.Library;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TETurretPacket;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
public abstract class TileEntityTurretBase extends TileEntity {
public double rotationYaw;
public double rotationPitch;
public boolean isAI = false;
public List<String> players = new ArrayList();
public int use;
public int ammo = 0;
@Override
public void updateEntity() {
if(isAI) {
Object[] iter = worldObj.loadedEntityList.toArray();
double radius = 1000;
if(this instanceof TileEntityTurretFlamer)
radius /= 2;
if(this instanceof TileEntityTurretSpitfire)
radius *= 3;
if(this instanceof TileEntityTurretCIWS)
radius *= 250;
Entity target = null;
for (int i = 0; i < iter.length; i++)
{
Entity e = (Entity) iter[i];
if (isInSight(e))
{
double distance = e.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5);
if (distance < radius)
{
radius = distance;
target = e;
}
}
}
if(target != null) {
Vec3 turret = Vec3.createVectorHelper(target.posX - (xCoord + 0.5), target.posY + target.getEyeHeight() - (yCoord + 1), target.posZ - (zCoord + 0.5));
if(this instanceof TileEntityTurretCIWS || this instanceof TileEntityTurretSpitfire || this instanceof TileEntityTurretCheapo) {
turret = Vec3.createVectorHelper(target.posX - (xCoord + 0.5), target.posY + target.getEyeHeight() - (yCoord + 1.5), target.posZ - (zCoord + 0.5));
}
rotationPitch = -Math.asin(turret.yCoord/turret.lengthVector()) * 180 / Math.PI;
rotationYaw = -Math.atan2(turret.xCoord, turret.zCoord) * 180 / Math.PI;
if(rotationPitch < -60)
rotationPitch = -60;
if(rotationPitch > 30)
rotationPitch = 30;
if(this instanceof TileEntityTurretCheapo) {
if(rotationPitch < -30)
rotationPitch = -30;
if(rotationPitch > 15)
rotationPitch = 15;
}
if(worldObj.getBlock(xCoord, yCoord, zCoord) instanceof TurretBase && ammo > 0) {
if(((TurretBase)worldObj.getBlock(xCoord, yCoord, zCoord)).executeHoldAction(worldObj, use, rotationYaw, rotationPitch, xCoord, yCoord, zCoord))
ammo--;
}
use++;
} else {
use = 0;
}
}
if(!worldObj.isRemote)
PacketDispatcher.wrapper.sendToAllAround(new TETurretPacket(xCoord, yCoord, zCoord, rotationYaw, rotationPitch), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
}
private boolean isInSight(Entity e) {
if(!(e instanceof EntityLivingBase) && !(e instanceof EntityMissileBaseAdvanced) && !(e instanceof EntityBomber) && !(e instanceof EntityMissileCustom))
return false;
if(this instanceof TileEntityTurretCIWS && !(e instanceof EntityMissileBaseAdvanced) && !(e instanceof EntityBomber) && !(e instanceof EntityMissileCustom))
return false;
if(e instanceof EntityPlayer && players.contains((((EntityPlayer)e).getDisplayName())))
return false;
Vec3 turret;
if(this instanceof TileEntityTurretSpitfire || this instanceof TileEntityTurretCIWS || this instanceof TileEntityTurretCheapo)
turret = Vec3.createVectorHelper(xCoord + 0.5, yCoord + 1.5, zCoord + 0.5);
else
turret = Vec3.createVectorHelper(xCoord + 0.5, yCoord + 1, zCoord + 0.5);
Vec3 entity = Vec3.createVectorHelper(e.posX, e.posY + e.getEyeHeight(), e.posZ);
Vec3 side = Vec3.createVectorHelper(entity.xCoord - turret.xCoord, entity.yCoord - turret.yCoord, entity.zCoord - turret.zCoord);
side = side.normalize();
turret.xCoord += side.xCoord;
turret.yCoord += side.yCoord;
turret.zCoord += side.zCoord;
if(this instanceof TileEntityTurretTau)
return true;
return !Library.isObstructed(worldObj, turret.xCoord, turret.yCoord, turret.zCoord, entity.xCoord, entity.yCoord, entity.zCoord);
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return TileEntity.INFINITE_EXTENT_AABB;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
return 65536.0D;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
rotationYaw = nbt.getDouble("yaw");
rotationPitch = nbt.getDouble("pitch");
isAI = nbt.getBoolean("AI");
ammo = nbt.getInteger("ammo");
int playercount = nbt.getInteger("playercount");
for(int i = 0; i < playercount; i++) {
players.add(nbt.getString("player_" + i));
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setDouble("yaw", rotationYaw);
nbt.setDouble("pitch", rotationPitch);
nbt.setBoolean("AI", isAI);
nbt.setInteger("ammo", ammo);
nbt.setInteger("playercount", players.size());
for(int i = 0; i < players.size(); i++) {
nbt.setString("player_" + i, players.get(i));
}
}
}

View File

@ -1,30 +0,0 @@
package com.hbm.tileentity.turret;
import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
public class TileEntityTurretCIWS extends TileEntityTurretBase {
public int spin;
public int rotation;
@Override
public void updateEntity() {
super.updateEntity();
if(!worldObj.isRemote) {
if(spin > 0)
spin -= 1;
rotation += spin;
rotation = rotation % 360;
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, rotation, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
}
}
}

View File

@ -1,30 +0,0 @@
package com.hbm.tileentity.turret;
import com.hbm.packet.AuxGaugePacket;
import com.hbm.packet.PacketDispatcher;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
public class TileEntityTurretCheapo extends TileEntityTurretBase {
public int spin;
public int rotation;
@Override
public void updateEntity() {
super.updateEntity();
if(!worldObj.isRemote) {
if(spin > 0)
spin -= 1;
rotation += spin;
rotation = rotation % 360;
PacketDispatcher.wrapper.sendToAllAround(new AuxGaugePacket(xCoord, yCoord, zCoord, rotation, 0), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
}
}
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.turret;
public class TileEntityTurretFlamer extends TileEntityTurretBase {
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.turret;
public class TileEntityTurretHeavy extends TileEntityTurretBase {
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.turret;
public class TileEntityTurretLight extends TileEntityTurretBase {
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.turret;
public class TileEntityTurretRocket extends TileEntityTurretBase {
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.turret;
public class TileEntityTurretSpitfire extends TileEntityTurretBase {
}

View File

@ -1,5 +0,0 @@
package com.hbm.tileentity.turret;
public class TileEntityTurretTau extends TileEntityTurretBase {
}