mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
missile rewrite, terrain scan radar
This commit is contained in:
parent
1bc94c989b
commit
353049c538
@ -19,4 +19,19 @@ public interface IRadarDetectableNT {
|
|||||||
public String getUnlocalizedName();
|
public String getUnlocalizedName();
|
||||||
public int getBlipLevel();
|
public int getBlipLevel();
|
||||||
public boolean canBeSeenBy(Object radar);
|
public boolean canBeSeenBy(Object radar);
|
||||||
|
public boolean paramsApplicable(RadarScanParams params);
|
||||||
|
|
||||||
|
public static class RadarScanParams {
|
||||||
|
public boolean scanMissiles = true;
|
||||||
|
public boolean scanShells = true;
|
||||||
|
public boolean scanPlayers = true;
|
||||||
|
public boolean smartMode = true;
|
||||||
|
|
||||||
|
public RadarScanParams(boolean m, boolean s, boolean p, boolean smart) {
|
||||||
|
this.scanMissiles = m;
|
||||||
|
this.scanShells = s;
|
||||||
|
this.scanPlayers = p;
|
||||||
|
this.smartMode = smart;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,11 @@ import org.apache.logging.log4j.Level;
|
|||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.config.GeneralConfig;
|
import com.hbm.config.GeneralConfig;
|
||||||
import com.hbm.entity.missile.*;
|
import com.hbm.entity.missile.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier0.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier1.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier2.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier4.*;
|
||||||
import com.hbm.interfaces.IBomb;
|
import com.hbm.interfaces.IBomb;
|
||||||
import com.hbm.interfaces.Spaghetti;
|
import com.hbm.interfaces.Spaghetti;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
|
|||||||
@ -14,7 +14,6 @@ import com.hbm.main.MainRegistry;
|
|||||||
import com.hbm.tileentity.IPersistentNBT;
|
import com.hbm.tileentity.IPersistentNBT;
|
||||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBAT9000;
|
import com.hbm.tileentity.machine.storage.TileEntityMachineBAT9000;
|
||||||
import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
|||||||
@ -12,7 +12,6 @@ import com.hbm.items.machine.IItemFluidIdentifier;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.tileentity.IPersistentNBT;
|
import com.hbm.tileentity.IPersistentNBT;
|
||||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFluidTank;
|
|
||||||
import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus;
|
import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
package com.hbm.blocks.machine;
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
import com.hbm.config.WeaponConfig;
|
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineRadar;
|
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
@ -10,6 +9,8 @@ import net.minecraft.block.material.Material;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
|
import net.minecraft.util.ChatStyle;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ public class MachineRadar extends BlockContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||||
return new TileEntityMachineRadar();
|
return new TileEntityMachineRadarNT();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -42,41 +43,35 @@ public class MachineRadar extends BlockContainer {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
|
|
||||||
if(y < WeaponConfig.radarAltitude) {
|
if(y < TileEntityMachineRadarNT.radarAltitude) {
|
||||||
if(world.isRemote)
|
if(world.isRemote)
|
||||||
player.addChatMessage(new ChatComponentText("[Radar] Error: Radar altitude not sufficient."));
|
player.addChatMessage(new ChatComponentText("[Radar] Error: Radar altitude not sufficient.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(world.isRemote)
|
if(world.isRemote) {
|
||||||
{
|
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||||
return true;
|
return true;
|
||||||
} else if(!player.isSneaking())
|
} else if(!player.isSneaking()) {
|
||||||
{
|
|
||||||
TileEntityMachineRadar entity = (TileEntityMachineRadar) world.getTileEntity(x, y, z);
|
|
||||||
if(entity != null)
|
|
||||||
{
|
|
||||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canProvidePower()
|
@Override
|
||||||
{
|
public boolean canProvidePower() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int m)
|
@Override
|
||||||
{
|
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int m) {
|
||||||
TileEntityMachineRadar entity = (TileEntityMachineRadar) world.getTileEntity(x, y, z);
|
TileEntityMachineRadarNT entity = (TileEntityMachineRadarNT) world.getTileEntity(x, y, z);
|
||||||
return entity.getRedPower();
|
return entity.getRedPower();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int m)
|
@Override
|
||||||
{
|
public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int m) {
|
||||||
return isProvidingWeakPower(world, x, y, z, m);
|
return isProvidingWeakPower(world, x, y, z, m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -197,17 +197,10 @@ public class NTMAnvil extends BlockFallingNT implements ITooltipProvider, IGUIPr
|
|||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void overrideRenderer(EntityFallingBlockNT falling, RenderBlocks renderBlocks, Tessellator tessellator) {
|
public void overrideRenderer(EntityFallingBlockNT falling, RenderBlocks renderBlocks, Tessellator tessellator) {
|
||||||
|
|
||||||
World world = falling.worldObj;
|
|
||||||
float rotation = 0;
|
float rotation = 0;
|
||||||
|
if(falling.getMeta() == 2) rotation = 90F / 180F * (float) Math.PI;
|
||||||
if(falling.getMeta() == 2)
|
if(falling.getMeta() == 3) rotation = 270F / 180F * (float) Math.PI;
|
||||||
rotation = 90F / 180F * (float) Math.PI;
|
if(falling.getMeta() == 4) rotation = 180F / 180F * (float)Math.PI;
|
||||||
|
|
||||||
if(falling.getMeta() == 3)
|
|
||||||
rotation = 270F / 180F * (float) Math.PI;
|
|
||||||
|
|
||||||
if(falling.getMeta() == 4)
|
|
||||||
rotation = 180F / 180F * (float)Math.PI;
|
|
||||||
|
|
||||||
tessellator.addTranslation(0F, -0.5F, 0F);
|
tessellator.addTranslation(0F, -0.5F, 0F);
|
||||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Top", getIcon(1, 0), tessellator, rotation, true);
|
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.anvil, "Top", getIcon(1, 0), tessellator, rotation, true);
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.hbm.blocks.IBlockMulti;
|
import com.hbm.blocks.IBlockMulti;
|
||||||
import com.hbm.blocks.ILookOverlay;
|
import com.hbm.blocks.ILookOverlay;
|
||||||
import com.hbm.blocks.ModBlocks;
|
|
||||||
import com.hbm.blocks.test.TestPipe;
|
import com.hbm.blocks.test.TestPipe;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
@ -16,7 +15,6 @@ import com.hbm.util.I18nUtil;
|
|||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
|||||||
@ -9,6 +9,11 @@ import com.hbm.entity.grenade.*;
|
|||||||
import com.hbm.entity.item.*;
|
import com.hbm.entity.item.*;
|
||||||
import com.hbm.entity.logic.*;
|
import com.hbm.entity.logic.*;
|
||||||
import com.hbm.entity.missile.*;
|
import com.hbm.entity.missile.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier0.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier1.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier2.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier4.*;
|
||||||
import com.hbm.entity.mob.*;
|
import com.hbm.entity.mob.*;
|
||||||
import com.hbm.entity.mob.botprime.*;
|
import com.hbm.entity.mob.botprime.*;
|
||||||
import com.hbm.entity.mob.siege.*;
|
import com.hbm.entity.mob.siege.*;
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
|||||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||||
|
|
||||||
for(Entity e : list) {
|
for(Entity e : list) {
|
||||||
if(e instanceof EntityMissileBaseAdvanced || e instanceof EntityMissileCustom) {
|
if(e instanceof EntityMissileBaseNT || e instanceof EntityMissileCustom) {
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 15F, true, false, true);
|
ExplosionLarge.explode(worldObj, posX, posY, posZ, 15F, true, false, true);
|
||||||
this.setDead();
|
this.setDead();
|
||||||
return;
|
return;
|
||||||
@ -110,7 +110,7 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
|||||||
double closest = 1000D;
|
double closest = 1000D;
|
||||||
|
|
||||||
for(Entity e : list) {
|
for(Entity e : list) {
|
||||||
if(e instanceof EntityMissileBaseAdvanced || e instanceof EntityMissileCustom) {
|
if(e instanceof EntityMissileBaseNT || e instanceof EntityMissileCustom) {
|
||||||
double dis = Math.sqrt(Math.pow(e.posX - posX, 2) + Math.pow(e.posY - posY, 2) + Math.pow(e.posZ - posZ, 2));
|
double dis = Math.sqrt(Math.pow(e.posX - posX, 2) + Math.pow(e.posY - posY, 2) + Math.pow(e.posZ - posZ, 2));
|
||||||
|
|
||||||
if(dis < closest) {
|
if(dis < closest) {
|
||||||
|
|||||||
@ -1,59 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.entity.effect.EntityBlackHole;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileBHole extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileBHole(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileBHole(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
if (!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
|
|
||||||
|
|
||||||
EntityBlackHole bl = new EntityBlackHole(this.worldObj, 1.5F);
|
|
||||||
bl.posX = this.posX;
|
|
||||||
bl.posY = this.posY;
|
|
||||||
bl.posZ = this.posZ;
|
|
||||||
this.worldObj.spawnEntityInWorld(bl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.wire_aluminium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.hull_small_aluminium, 2));
|
|
||||||
list.add(new ItemStack(ModItems.ducttape, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.grenade_black_hole, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,289 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.entity.logic.IChunkLoader;
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.main.MainRegistry;
|
|
||||||
import com.hbm.packet.AuxParticlePacket;
|
|
||||||
import com.hbm.packet.PacketDispatcher;
|
|
||||||
|
|
||||||
import api.hbm.entity.IRadarDetectable;
|
|
||||||
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.init.Blocks;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.util.DamageSource;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.util.Vec3;
|
|
||||||
import net.minecraft.world.ChunkCoordIntPair;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.common.ForgeChunkManager;
|
|
||||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
|
||||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
|
||||||
|
|
||||||
public abstract class EntityMissileBaseAdvanced extends Entity implements IChunkLoader, IRadarDetectable {
|
|
||||||
|
|
||||||
int startX;
|
|
||||||
int startZ;
|
|
||||||
int targetX;
|
|
||||||
int targetZ;
|
|
||||||
public int velocity;
|
|
||||||
double decelY;
|
|
||||||
double accelXZ;
|
|
||||||
boolean isCluster = false;
|
|
||||||
private Ticket loaderTicket;
|
|
||||||
public int health = 50;
|
|
||||||
|
|
||||||
public EntityMissileBaseAdvanced(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
this.ignoreFrustumCheck = true;
|
|
||||||
startX = (int) posX;
|
|
||||||
startZ = (int) posZ;
|
|
||||||
targetX = (int) posX;
|
|
||||||
targetZ = (int) posZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canBeCollidedWith() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
|
|
||||||
if(this.isEntityInvulnerable()) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
if(!this.isDead && !this.worldObj.isRemote) {
|
|
||||||
health -= p_70097_2_;
|
|
||||||
|
|
||||||
if(this.health <= 0) {
|
|
||||||
this.setDead();
|
|
||||||
this.killMissile();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void killMissile() {
|
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
|
||||||
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
|
||||||
ExplosionLarge.spawnMissileDebris(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 0.25, getDebris(), getDebrisRareDrop());
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileBaseAdvanced(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world);
|
|
||||||
this.ignoreFrustumCheck = true;
|
|
||||||
this.setLocationAndAngles(x, y, z, 0, 0);
|
|
||||||
startX = (int) x;
|
|
||||||
startZ = (int) z;
|
|
||||||
targetX = a;
|
|
||||||
targetZ = b;
|
|
||||||
this.motionY = 2;
|
|
||||||
|
|
||||||
Vec3 vector = Vec3.createVectorHelper(targetX - startX, 0, targetZ - startZ);
|
|
||||||
accelXZ = decelY = 1 / vector.lengthVector();
|
|
||||||
decelY *= 2;
|
|
||||||
|
|
||||||
velocity = 1;
|
|
||||||
|
|
||||||
this.setSize(1.5F, 1.5F);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
|
|
||||||
this.dataWatcher.addObject(8, Integer.valueOf(this.health));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
|
||||||
motionX = nbt.getDouble("moX");
|
|
||||||
motionY = nbt.getDouble("moY");
|
|
||||||
motionZ = nbt.getDouble("moZ");
|
|
||||||
posX = nbt.getDouble("poX");
|
|
||||||
posY = nbt.getDouble("poY");
|
|
||||||
posZ = nbt.getDouble("poZ");
|
|
||||||
decelY = nbt.getDouble("decel");
|
|
||||||
accelXZ = nbt.getDouble("accel");
|
|
||||||
targetX = nbt.getInteger("tX");
|
|
||||||
targetZ = nbt.getInteger("tZ");
|
|
||||||
startX = nbt.getInteger("sX");
|
|
||||||
startZ = nbt.getInteger("sZ");
|
|
||||||
velocity = nbt.getInteger("veloc");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
|
||||||
nbt.setDouble("moX", motionX);
|
|
||||||
nbt.setDouble("moY", motionY);
|
|
||||||
nbt.setDouble("moZ", motionZ);
|
|
||||||
nbt.setDouble("poX", posX);
|
|
||||||
nbt.setDouble("poY", posY);
|
|
||||||
nbt.setDouble("poZ", posZ);
|
|
||||||
nbt.setDouble("decel", decelY);
|
|
||||||
nbt.setDouble("accel", accelXZ);
|
|
||||||
nbt.setInteger("tX", targetX);
|
|
||||||
nbt.setInteger("tZ", targetZ);
|
|
||||||
nbt.setInteger("sX", startX);
|
|
||||||
nbt.setInteger("sZ", startZ);
|
|
||||||
nbt.setInteger("veloc", velocity);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void rotation() {
|
|
||||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
|
||||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
|
||||||
|
|
||||||
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
|
|
||||||
{
|
|
||||||
this.prevRotationPitch += 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
|
|
||||||
{
|
|
||||||
this.prevRotationYaw -= 360.0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
|
|
||||||
{
|
|
||||||
this.prevRotationYaw += 360.0F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdate() {
|
|
||||||
|
|
||||||
if(velocity < 1)
|
|
||||||
velocity = 1;
|
|
||||||
if(this.ticksExisted > 40)
|
|
||||||
velocity = 3;
|
|
||||||
else if(this.ticksExisted > 20)
|
|
||||||
velocity = 2;
|
|
||||||
|
|
||||||
this.dataWatcher.updateObject(8, Integer.valueOf(this.health));
|
|
||||||
|
|
||||||
this.prevPosX = this.posX;
|
|
||||||
this.prevPosY = this.posY;
|
|
||||||
this.prevPosZ = this.posZ;
|
|
||||||
|
|
||||||
//TODO: instead of crappy skipping, implement a hitscan
|
|
||||||
for(int i = 0; i < velocity; i++) {
|
|
||||||
//this.posX += this.motionX;
|
|
||||||
//this.posY += this.motionY;
|
|
||||||
//this.posZ += this.motionZ;
|
|
||||||
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
|
||||||
|
|
||||||
this.rotation();
|
|
||||||
|
|
||||||
this.motionY -= decelY;
|
|
||||||
|
|
||||||
Vec3 vector = Vec3.createVectorHelper(targetX - startX, 0, targetZ - startZ);
|
|
||||||
vector = vector.normalize();
|
|
||||||
vector.xCoord *= accelXZ;
|
|
||||||
vector.zCoord *= accelXZ;
|
|
||||||
|
|
||||||
if(motionY > 0) {
|
|
||||||
motionX += vector.xCoord;
|
|
||||||
motionZ += vector.zCoord;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(motionY < 0) {
|
|
||||||
motionX -= vector.xCoord;
|
|
||||||
motionZ -= vector.zCoord;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacket(posX, posY, posZ, 2),
|
|
||||||
new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 300));
|
|
||||||
|
|
||||||
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air &&
|
|
||||||
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water &&
|
|
||||||
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water) {
|
|
||||||
|
|
||||||
if(!this.worldObj.isRemote) {
|
|
||||||
onImpact();
|
|
||||||
}
|
|
||||||
this.killAndClear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
loadNeighboringChunks((int) (posX / 16), (int) (posZ / 16));
|
|
||||||
|
|
||||||
if(motionY < -1 && this.isCluster && !worldObj.isRemote) {
|
|
||||||
cluster();
|
|
||||||
this.setDead();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public boolean isInRangeToRenderDist(double distance) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract void onImpact();
|
|
||||||
|
|
||||||
public abstract List<ItemStack> getDebris();
|
|
||||||
|
|
||||||
public abstract ItemStack getDebrisRareDrop();
|
|
||||||
|
|
||||||
public void cluster() { }
|
|
||||||
|
|
||||||
public void init(Ticket ticket) {
|
|
||||||
if(!worldObj.isRemote) {
|
|
||||||
|
|
||||||
if(ticket != null) {
|
|
||||||
|
|
||||||
if(loaderTicket == null) {
|
|
||||||
|
|
||||||
loaderTicket = ticket;
|
|
||||||
loaderTicket.bindEntity(this);
|
|
||||||
loaderTicket.getModData();
|
|
||||||
}
|
|
||||||
|
|
||||||
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(chunkCoordX, chunkCoordZ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<ChunkCoordIntPair> loadedChunks = new ArrayList<ChunkCoordIntPair>();
|
|
||||||
|
|
||||||
public void loadNeighboringChunks(int newChunkX, int newChunkZ) {
|
|
||||||
if(!worldObj.isRemote && loaderTicket != null) {
|
|
||||||
|
|
||||||
clearChunkLoader();
|
|
||||||
|
|
||||||
loadedChunks.clear();
|
|
||||||
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ));
|
|
||||||
loadedChunks.add(new ChunkCoordIntPair(newChunkX + (int) Math.ceil((this.posX + this.motionX) / 16D), newChunkZ + (int) Math.ceil((this.posZ + this.motionZ) / 16D)));
|
|
||||||
|
|
||||||
for(ChunkCoordIntPair chunk : loadedChunks) {
|
|
||||||
ForgeChunkManager.forceChunk(loaderTicket, chunk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void killAndClear() {
|
|
||||||
this.setDead();
|
|
||||||
this.clearChunkLoader();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearChunkLoader() {
|
|
||||||
if(!worldObj.isRemote && loaderTicket != null) {
|
|
||||||
for(ChunkCoordIntPair chunk : loadedChunks) {
|
|
||||||
ForgeChunkManager.unforceChunk(loaderTicket, chunk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
270
src/main/java/com/hbm/entity/missile/EntityMissileBaseNT.java
Normal file
270
src/main/java/com/hbm/entity/missile/EntityMissileBaseNT.java
Normal file
@ -0,0 +1,270 @@
|
|||||||
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.entity.logic.IChunkLoader;
|
||||||
|
import com.hbm.entity.projectile.EntityThrowableInterp;
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
|
|
||||||
|
import api.hbm.entity.IRadarDetectable;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.ChunkCoordIntPair;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeChunkManager;
|
||||||
|
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||||
|
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||||
|
|
||||||
|
public abstract class EntityMissileBaseNT extends EntityThrowableInterp implements IChunkLoader, IRadarDetectable {
|
||||||
|
|
||||||
|
public int startX;
|
||||||
|
public int startZ;
|
||||||
|
public int targetX;
|
||||||
|
public int targetZ;
|
||||||
|
public double velocity;
|
||||||
|
public double decelY;
|
||||||
|
public double accelXZ;
|
||||||
|
public boolean isCluster = false;
|
||||||
|
private Ticket loaderTicket;
|
||||||
|
public int health = 50;
|
||||||
|
|
||||||
|
public EntityMissileBaseNT(World world) {
|
||||||
|
super(world);
|
||||||
|
this.ignoreFrustumCheck = true;
|
||||||
|
startX = (int) posX;
|
||||||
|
startZ = (int) posZ;
|
||||||
|
targetX = (int) posX;
|
||||||
|
targetZ = (int) posZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityMissileBaseNT(World world, float x, float y, float z, int a, int b) {
|
||||||
|
super(world);
|
||||||
|
this.ignoreFrustumCheck = true;
|
||||||
|
this.setLocationAndAngles(x, y, z, 0, 0);
|
||||||
|
startX = (int) x;
|
||||||
|
startZ = (int) z;
|
||||||
|
targetX = a;
|
||||||
|
targetZ = b;
|
||||||
|
this.motionY = 2;
|
||||||
|
|
||||||
|
Vec3 vector = Vec3.createVectorHelper(targetX - startX, 0, targetZ - startZ);
|
||||||
|
accelXZ = decelY = 1 / vector.lengthVector();
|
||||||
|
decelY *= 2;
|
||||||
|
velocity = 0;
|
||||||
|
|
||||||
|
this.setSize(1.5F, 1.5F);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
|
||||||
|
this.dataWatcher.addObject(8, Integer.valueOf(this.health));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected double motionMult() {
|
||||||
|
return velocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doesImpactEntities() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
super.onUpdate();
|
||||||
|
|
||||||
|
if(velocity < 4) velocity += 0.025;
|
||||||
|
|
||||||
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
|
this.motionY -= decelY * velocity;
|
||||||
|
|
||||||
|
Vec3 vector = Vec3.createVectorHelper(targetX - startX, 0, targetZ - startZ);
|
||||||
|
vector = vector.normalize();
|
||||||
|
vector.xCoord *= accelXZ;
|
||||||
|
vector.zCoord *= accelXZ;
|
||||||
|
|
||||||
|
if(motionY > 0) {
|
||||||
|
motionX += vector.xCoord * velocity;
|
||||||
|
motionZ += vector.zCoord * velocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(motionY < 0) {
|
||||||
|
motionX -= vector.xCoord * velocity;
|
||||||
|
motionZ -= vector.zCoord * velocity;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(motionY < -velocity && this.isCluster) {
|
||||||
|
cluster();
|
||||||
|
this.setDead();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
loadNeighboringChunks((int) Math.floor(posX / 16), (int) Math.floor(posZ / 16));
|
||||||
|
} else {
|
||||||
|
Vec3 vec = Vec3.createVectorHelper(motionX, motionY, motionZ).normalize();
|
||||||
|
MainRegistry.proxy.particleControl(posX - vec.xCoord, posY - vec.yCoord, posZ - vec.zCoord, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||||
|
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||||
|
for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);
|
||||||
|
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) this.prevRotationPitch += 360.0F;
|
||||||
|
while(this.rotationYaw - this.prevRotationYaw < -180.0F) this.prevRotationYaw -= 360.0F;
|
||||||
|
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) this.prevRotationYaw += 360.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readEntityFromNBT(nbt);
|
||||||
|
motionX = nbt.getDouble("moX");
|
||||||
|
motionY = nbt.getDouble("moY");
|
||||||
|
motionZ = nbt.getDouble("moZ");
|
||||||
|
posX = nbt.getDouble("poX");
|
||||||
|
posY = nbt.getDouble("poY");
|
||||||
|
posZ = nbt.getDouble("poZ");
|
||||||
|
decelY = nbt.getDouble("decel");
|
||||||
|
accelXZ = nbt.getDouble("accel");
|
||||||
|
targetX = nbt.getInteger("tX");
|
||||||
|
targetZ = nbt.getInteger("tZ");
|
||||||
|
startX = nbt.getInteger("sX");
|
||||||
|
startZ = nbt.getInteger("sZ");
|
||||||
|
velocity = nbt.getDouble("veloc");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeEntityToNBT(nbt);
|
||||||
|
nbt.setDouble("moX", motionX);
|
||||||
|
nbt.setDouble("moY", motionY);
|
||||||
|
nbt.setDouble("moZ", motionZ);
|
||||||
|
nbt.setDouble("poX", posX);
|
||||||
|
nbt.setDouble("poY", posY);
|
||||||
|
nbt.setDouble("poZ", posZ);
|
||||||
|
nbt.setDouble("decel", decelY);
|
||||||
|
nbt.setDouble("accel", accelXZ);
|
||||||
|
nbt.setInteger("tX", targetX);
|
||||||
|
nbt.setInteger("tZ", targetZ);
|
||||||
|
nbt.setInteger("sX", startX);
|
||||||
|
nbt.setInteger("sZ", startZ);
|
||||||
|
nbt.setDouble("veloc", velocity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canBeCollidedWith() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||||
|
if(this.isEntityInvulnerable()) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if(!this.isDead && !this.worldObj.isRemote) {
|
||||||
|
health -= amount;
|
||||||
|
|
||||||
|
if(this.health <= 0) {
|
||||||
|
this.killMissile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void killMissile() {
|
||||||
|
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
||||||
|
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
||||||
|
ExplosionLarge.spawnMissileDebris(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 0.25, getDebris(), getDebrisRareDrop());
|
||||||
|
this.killAndClear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean isInRangeToRenderDist(double distance) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onImpact(MovingObjectPosition mop) {
|
||||||
|
if(mop != null && mop.typeOfHit == mop.typeOfHit.BLOCK) {
|
||||||
|
this.onImpact();
|
||||||
|
this.killAndClear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onImpact();
|
||||||
|
public abstract List<ItemStack> getDebris();
|
||||||
|
public abstract ItemStack getDebrisRareDrop();
|
||||||
|
public void cluster() { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getGravityVelocity() {
|
||||||
|
return 0.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float getAirDrag() {
|
||||||
|
return 1F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float getWaterDrag() {
|
||||||
|
return 1F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(Ticket ticket) {
|
||||||
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
|
if(ticket != null) {
|
||||||
|
|
||||||
|
if(loaderTicket == null) {
|
||||||
|
|
||||||
|
loaderTicket = ticket;
|
||||||
|
loaderTicket.bindEntity(this);
|
||||||
|
loaderTicket.getModData();
|
||||||
|
}
|
||||||
|
|
||||||
|
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(chunkCoordX, chunkCoordZ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ChunkCoordIntPair> loadedChunks = new ArrayList<ChunkCoordIntPair>();
|
||||||
|
|
||||||
|
public void loadNeighboringChunks(int newChunkX, int newChunkZ) {
|
||||||
|
if(!worldObj.isRemote && loaderTicket != null) {
|
||||||
|
|
||||||
|
clearChunkLoader();
|
||||||
|
|
||||||
|
loadedChunks.clear();
|
||||||
|
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ));
|
||||||
|
loadedChunks.add(new ChunkCoordIntPair(newChunkX + (int) Math.floor((this.posX + this.motionX * this.motionMult()) / 16D), newChunkZ + (int) Math.floor((this.posZ + this.motionZ * this.motionMult()) / 16D)));
|
||||||
|
|
||||||
|
for(ChunkCoordIntPair chunk : loadedChunks) {
|
||||||
|
ForgeChunkManager.forceChunk(loaderTicket, chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void killAndClear() {
|
||||||
|
this.setDead();
|
||||||
|
this.clearChunkLoader();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearChunkLoader() {
|
||||||
|
if(!worldObj.isRemote && loaderTicket != null) {
|
||||||
|
for(ChunkCoordIntPair chunk : loadedChunks) {
|
||||||
|
ForgeChunkManager.unforceChunk(loaderTicket, chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,55 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileBunkerBuster extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileBunkerBuster(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileBunkerBuster(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
for(int i = 0; i < 15; i++)
|
|
||||||
{
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY - i, this.posZ, 5F, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 5);
|
|
||||||
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 5);
|
|
||||||
ExplosionLarge.spawnRubble(worldObj, this.posX, this.posY, this.posZ, 5);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_small, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_buster_small);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER1;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileBurst extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileBurst(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileBurst(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
for(int i = 0; i < 4; i++)
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 50.0F, true);
|
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 50.0F, true, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier3, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_generic_large);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileBusterStrong extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileBusterStrong(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileBusterStrong(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
for(int i = 0; i < 20; i++)
|
|
||||||
{
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY - i, this.posZ, 7.5F, true);
|
|
||||||
}
|
|
||||||
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 8);
|
|
||||||
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 8);
|
|
||||||
ExplosionLarge.spawnRubble(worldObj, this.posX, this.posY, this.posZ, 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 6));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_medium, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_buster_medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileCluster extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileCluster(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileCluster(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
this.isCluster = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5F, true);
|
|
||||||
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cluster() {
|
|
||||||
this.onImpact();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_small, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_cluster_small);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileClusterStrong extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileClusterStrong(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileClusterStrong(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
this.isCluster = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 15F, true);
|
|
||||||
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 50, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cluster() {
|
|
||||||
this.onImpact();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 6));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_medium, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_cluster_medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -7,7 +7,7 @@ import com.hbm.explosion.ExplosionLarge;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class EntityMissileDoomsday extends EntityMissileBaseAdvanced {
|
public class EntityMissileDoomsday extends EntityMissileBaseNT {
|
||||||
|
|
||||||
public EntityMissileDoomsday(World p_i1582_1_) {
|
public EntityMissileDoomsday(World p_i1582_1_) {
|
||||||
super(p_i1582_1_);
|
super(p_i1582_1_);
|
||||||
|
|||||||
@ -1,58 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.explosion.ExplosionNT;
|
|
||||||
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileDrill extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileDrill(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileDrill(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
for(int i = 0; i < 30; i++)
|
|
||||||
{
|
|
||||||
ExplosionNT explosion = new ExplosionNT(worldObj, this, this.posX, this.posY - i, this.posZ, 10F);
|
|
||||||
explosion.addAllAttrib(ExAttrib.ERRODE);
|
|
||||||
explosion.explode(); //an explosion exploded!
|
|
||||||
}
|
|
||||||
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 25);
|
|
||||||
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 12);
|
|
||||||
ExplosionLarge.jolt(worldObj, this.posX, this.posY, this.posZ, 10, 50, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier3, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_buster_large);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,59 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.blocks.ModBlocks;
|
|
||||||
import com.hbm.entity.effect.EntityEMPBlast;
|
|
||||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileEMP extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileEMP(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileEMP(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
if (!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
ExplosionNukeGeneric.empBlast(worldObj, (int)posX, (int)posY, (int)posZ, 50);
|
|
||||||
EntityEMPBlast wave = new EntityEMPBlast(worldObj, 50);
|
|
||||||
wave.posX = posX;
|
|
||||||
wave.posY = posY;
|
|
||||||
wave.posZ = posZ;
|
|
||||||
worldObj.spawnEntityInWorld(wave);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.wire_aluminium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.hull_small_aluminium, 2));
|
|
||||||
list.add(new ItemStack(ModItems.ducttape, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModBlocks.emp_bomb, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,54 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.entity.logic.EntityEMP;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileEMPStrong extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileEMPStrong(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileEMPStrong(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
|
|
||||||
EntityEMP emp = new EntityEMP(worldObj);
|
|
||||||
emp.posX = posX;
|
|
||||||
emp.posY = posY;
|
|
||||||
emp.posZ = posZ;
|
|
||||||
|
|
||||||
worldObj.spawnEntityInWorld(emp);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 6));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_medium, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_generic_medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionThermo;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileEndo extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileEndo(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileEndo(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
|
||||||
ExplosionThermo.freeze(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 30);
|
|
||||||
ExplosionThermo.freezer(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 40);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 14));
|
|
||||||
list.add(new ItemStack(ModItems.plate_aluminium, 8));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_thermo_exo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionThermo;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileExo extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileExo(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileExo(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
|
||||||
ExplosionThermo.scorch(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 30);
|
|
||||||
ExplosionThermo.setEntitiesOnFire(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 40);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 14));
|
|
||||||
list.add(new ItemStack(ModItems.plate_aluminium, 8));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_thermo_exo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,190 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileGeneric extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileGeneric(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileGeneric(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10.0F, true, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_small, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_generic_small);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*public EntityMissileGeneric(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileGeneric(World p_i1582_1_, int x, int z, double a, double b, double c) {
|
|
||||||
super(p_i1582_1_, x, z, a, b, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUpdate()
|
|
||||||
{
|
|
||||||
|
|
||||||
this.posX += this.motionX;
|
|
||||||
this.posY += this.motionY;
|
|
||||||
this.posZ += this.motionZ;
|
|
||||||
|
|
||||||
this.rotation();
|
|
||||||
|
|
||||||
switch(phase)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
if(loc0 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc0);
|
|
||||||
if(loc0.posX + 2 > this.posX && loc0.posX - 2 < this.posX &&
|
|
||||||
loc0.posY + 2 > this.posY && loc0.posY - 2 < this.posY &&
|
|
||||||
loc0.posZ + 2 > this.posZ && loc0.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if(loc1 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc1);
|
|
||||||
if(loc1.posX + 2 > this.posX && loc1.posX - 2 < this.posX &&
|
|
||||||
loc1.posY + 2 > this.posY && loc1.posY - 2 < this.posY &&
|
|
||||||
loc1.posZ + 2 > this.posZ && loc1.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if(loc2 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc2);
|
|
||||||
if(loc2.posX + 2 > this.posX && loc2.posX - 2 < this.posX &&
|
|
||||||
loc2.posY + 2 > this.posY && loc2.posY - 2 < this.posY &&
|
|
||||||
loc2.posZ + 2 > this.posZ && loc2.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
if(loc3 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc3);
|
|
||||||
if(loc3.posX + 2 > this.posX && loc3.posX - 2 < this.posX &&
|
|
||||||
loc3.posY + 2 > this.posY && loc3.posY - 2 < this.posY &&
|
|
||||||
loc3.posZ + 2 > this.posZ && loc3.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
if(loc4 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc4);
|
|
||||||
if(loc4.posX + 2 > this.posX && loc4.posX - 2 < this.posX &&
|
|
||||||
loc4.posY + 2 > this.posY && loc4.posY - 2 < this.posY &&
|
|
||||||
loc4.posZ + 2 > this.posZ && loc4.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
if(loc5 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc5);
|
|
||||||
if(loc5.posX + 2 > this.posX && loc5.posX - 2 < this.posX &&
|
|
||||||
loc5.posY + 2 > this.posY && loc5.posY - 2 < this.posY &&
|
|
||||||
loc5.posZ + 2 > this.posZ && loc5.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 6;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
if(loc6 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc6);
|
|
||||||
if(loc6.posX + 2 > this.posX && loc6.posX - 2 < this.posX &&
|
|
||||||
loc6.posY + 2 > this.posY && loc6.posY - 2 < this.posY &&
|
|
||||||
loc6.posZ + 2 > this.posZ && loc6.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 7;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
if(loc7 != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(loc7);
|
|
||||||
if(loc7.posX + 2 > this.posX && loc7.posX - 2 < this.posX &&
|
|
||||||
loc7.posY + 2 > this.posY && loc7.posY - 2 < this.posY &&
|
|
||||||
loc7.posZ + 2 > this.posZ && loc7.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
if(target != null)
|
|
||||||
{
|
|
||||||
freePizzaGoddammit(target);
|
|
||||||
if(target.posX + 2 > this.posX && target.posX - 2 < this.posX &&
|
|
||||||
target.posY + 2 > this.posY && target.posY - 2 < this.posY &&
|
|
||||||
target.posZ + 2 > this.posZ && target.posZ - 2 < this.posZ)
|
|
||||||
{
|
|
||||||
this.phase = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
|
||||||
|
|
||||||
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air && this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water && this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water)
|
|
||||||
{
|
|
||||||
if(!this.worldObj.isRemote)
|
|
||||||
{
|
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10.0F, true, true, true);
|
|
||||||
}
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileIncendiary extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileIncendiary(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileIncendiary(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
ExplosionLarge.explodeFire(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 10.0F, true, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_small, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_incendiary_small);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileIncendiaryStrong extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileIncendiaryStrong(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileIncendiaryStrong(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
ExplosionLarge.explodeFire(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 25.0F, true, true, true);
|
|
||||||
ExplosionChaos.flameDeath(this.worldObj, (int)((float)this.posX + 0.5F), (int)((float)this.posY + 0.5F), (int)((float)this.posZ + 0.5F), 25);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 6));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_medium, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_incendiary_medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileInferno extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileInferno(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileInferno(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
ExplosionLarge.explodeFire(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 35.0F, true, true, true);
|
|
||||||
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10);
|
|
||||||
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier3, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_incendiary_large);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionNukeSmall;
|
|
||||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileMicro extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileMicro(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileMicro(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
if(!this.worldObj.isRemote) {
|
|
||||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_HIGH);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.wire_aluminium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.hull_small_aluminium, 2));
|
|
||||||
list.add(new ItemStack(ModItems.ducttape, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.config.BombConfig;
|
|
||||||
import com.hbm.entity.effect.EntityNukeTorex;
|
|
||||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileMirv extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileMirv(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileMirv(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
|
|
||||||
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ));
|
|
||||||
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius * 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 20));
|
|
||||||
list.add(new ItemStack(ModItems.plate_aluminium, 12));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier5, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_mirv);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.config.BombConfig;
|
|
||||||
import com.hbm.entity.effect.EntityNukeTorex;
|
|
||||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileNuclear extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileNuclear(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileNuclear(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
|
|
||||||
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ));
|
|
||||||
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 20));
|
|
||||||
list.add(new ItemStack(ModItems.plate_aluminium, 12));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_nuclear);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,55 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionChaos;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileRain extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileRain(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileRain(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
this.isCluster = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 25F, true);
|
|
||||||
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 100, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void cluster() {
|
|
||||||
this.onImpact();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier3, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_cluster_large);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.config.BombConfig;
|
|
||||||
import com.hbm.entity.effect.EntityCloudFleija;
|
|
||||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileSchrabidium extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileSchrabidium(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileSchrabidium(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
if(!this.worldObj.isRemote) {
|
|
||||||
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius);
|
|
||||||
if(!ex.isDead) {
|
|
||||||
worldObj.spawnEntityInWorld(ex);
|
|
||||||
|
|
||||||
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
|
|
||||||
cloud.posX = this.posX;
|
|
||||||
cloud.posY = this.posY;
|
|
||||||
cloud.posZ = this.posZ;
|
|
||||||
this.worldObj.spawnEntityInWorld(cloud);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.wire_aluminium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.hull_small_aluminium, 2));
|
|
||||||
list.add(new ItemStack(ModItems.ducttape, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.powder_schrabidium, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -17,7 +17,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class EntityMissileShuttle extends EntityMissileBaseAdvanced {
|
public class EntityMissileShuttle extends EntityMissileBaseNT {
|
||||||
|
|
||||||
public EntityMissileShuttle(World p_i1582_1_) {
|
public EntityMissileShuttle(World p_i1582_1_) {
|
||||||
super(p_i1582_1_);
|
super(p_i1582_1_);
|
||||||
|
|||||||
@ -1,48 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileStrong extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileStrong(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileStrong(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 25.0F, true, true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 10));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 6));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_medium, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_generic_medium);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,58 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.blocks.ModBlocks;
|
|
||||||
import com.hbm.blocks.bomb.BlockTaint;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileTaint extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileTaint(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileTaint(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
|
||||||
|
|
||||||
for(int i = 0; i < 100; i++) {
|
|
||||||
int a = rand.nextInt(11) + (int)this.posX - 5;
|
|
||||||
int b = rand.nextInt(11) + (int)this.posY - 5;
|
|
||||||
int c = rand.nextInt(11) + (int)this.posZ - 5;
|
|
||||||
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && BlockTaint.hasPosNeightbour(worldObj, a, b, c))
|
|
||||||
worldObj.setBlock(a, b, c, ModBlocks.taint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.wire_aluminium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
|
||||||
list.add(new ItemStack(ModItems.hull_small_aluminium, 2));
|
|
||||||
list.add(new ItemStack(ModItems.powder_magic, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.powder_spark_mix, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
108
src/main/java/com/hbm/entity/missile/EntityMissileTier0.java
Normal file
108
src/main/java/com/hbm/entity/missile/EntityMissileTier0.java
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.blocks.bomb.BlockTaint;
|
||||||
|
import com.hbm.config.BombConfig;
|
||||||
|
import com.hbm.entity.effect.EntityBlackHole;
|
||||||
|
import com.hbm.entity.effect.EntityCloudFleija;
|
||||||
|
import com.hbm.entity.effect.EntityEMPBlast;
|
||||||
|
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||||
|
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||||
|
import com.hbm.explosion.ExplosionNukeSmall;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public abstract class EntityMissileTier0 extends EntityMissileBaseNT {
|
||||||
|
|
||||||
|
public EntityMissileTier0(World world) { super(world); }
|
||||||
|
public EntityMissileTier0(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
list.add(new ItemStack(ModItems.wire_aluminium, 4));
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
||||||
|
list.add(new ItemStack(ModItems.hull_small_aluminium, 2));
|
||||||
|
list.add(new ItemStack(ModItems.ducttape, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RadarTargetType getTargetType() {
|
||||||
|
return RadarTargetType.MISSILE_TIER0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileMicro extends EntityMissileTier0 {
|
||||||
|
public EntityMissileMicro(World world) { super(world); }
|
||||||
|
public EntityMissileMicro(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() { ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_HIGH); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileSchrabidium extends EntityMissileTier0 {
|
||||||
|
public EntityMissileSchrabidium(World world) { super(world); }
|
||||||
|
public EntityMissileSchrabidium(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius);
|
||||||
|
if(!ex.isDead) {
|
||||||
|
worldObj.spawnEntityInWorld(ex);
|
||||||
|
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
|
||||||
|
cloud.posX = this.posX;
|
||||||
|
cloud.posY = this.posY;
|
||||||
|
cloud.posZ = this.posZ;
|
||||||
|
this.worldObj.spawnEntityInWorld(cloud);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.powder_schrabidium, 1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileBHole extends EntityMissileTier0 {
|
||||||
|
public EntityMissileBHole(World world) { super(world); }
|
||||||
|
public EntityMissileBHole(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
|
||||||
|
EntityBlackHole bl = new EntityBlackHole(this.worldObj, 1.5F);
|
||||||
|
bl.posX = this.posX;
|
||||||
|
bl.posY = this.posY;
|
||||||
|
bl.posZ = this.posZ;
|
||||||
|
this.worldObj.spawnEntityInWorld(bl);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.grenade_black_hole, 1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileTaint extends EntityMissileTier0 {
|
||||||
|
public EntityMissileTaint(World world) { super(world); }
|
||||||
|
public EntityMissileTaint(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
||||||
|
for(int i = 0; i < 100; i++) {
|
||||||
|
int a = rand.nextInt(11) + (int) this.posX - 5;
|
||||||
|
int b = rand.nextInt(11) + (int) this.posY - 5;
|
||||||
|
int c = rand.nextInt(11) + (int) this.posZ - 5;
|
||||||
|
if(worldObj.getBlock(a, b, c).isReplaceable(worldObj, a, b, c) && BlockTaint.hasPosNeightbour(worldObj, a, b, c)) worldObj.setBlock(a, b, c, ModBlocks.taint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.powder_spark_mix, 1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileEMP extends EntityMissileTier0 {
|
||||||
|
public EntityMissileEMP(World world) { super(world); }
|
||||||
|
public EntityMissileEMP(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
ExplosionNukeGeneric.empBlast(worldObj, (int)posX, (int)posY, (int)posZ, 50);
|
||||||
|
EntityEMPBlast wave = new EntityEMPBlast(worldObj, 50);
|
||||||
|
wave.posX = posX;
|
||||||
|
wave.posY = posY;
|
||||||
|
wave.posZ = posZ;
|
||||||
|
worldObj.spawnEntityInWorld(wave);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModBlocks.emp_bomb, 1); }
|
||||||
|
}
|
||||||
|
}
|
||||||
68
src/main/java/com/hbm/entity/missile/EntityMissileTier1.java
Normal file
68
src/main/java/com/hbm/entity/missile/EntityMissileTier1.java
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.explosion.ExplosionChaos;
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public abstract class EntityMissileTier1 extends EntityMissileBaseNT {
|
||||||
|
|
||||||
|
public EntityMissileTier1(World world) { super(world); }
|
||||||
|
public EntityMissileTier1(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 4));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_small, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier1, 1));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RadarTargetType getTargetType() {
|
||||||
|
return RadarTargetType.MISSILE_TIER1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileGeneric extends EntityMissileTier1 {
|
||||||
|
public EntityMissileGeneric(World world) { super(world); }
|
||||||
|
public EntityMissileGeneric(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() { ExplosionLarge.explode(worldObj, posX, posY, posZ, 10.0F, true, true, true); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_generic_small); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileIncendiary extends EntityMissileTier1 {
|
||||||
|
public EntityMissileIncendiary(World world) { super(world); }
|
||||||
|
public EntityMissileIncendiary(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() { ExplosionLarge.explodeFire(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 10.0F, true, true, true); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_incendiary_small); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileCluster extends EntityMissileTier1 {
|
||||||
|
public EntityMissileCluster(World world) { super(world); }
|
||||||
|
public EntityMissileCluster(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); this.isCluster = true; }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5F, true);
|
||||||
|
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25, 100);
|
||||||
|
}
|
||||||
|
@Override public void cluster() { this.onImpact(); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_cluster_small); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileBunkerBuster extends EntityMissileTier1 {
|
||||||
|
public EntityMissileBunkerBuster(World world) { super(world); }
|
||||||
|
public EntityMissileBunkerBuster(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
for(int i = 0; i < 15; i++) this.worldObj.createExplosion(this, this.posX, this.posY - i, this.posZ, 5F, true);
|
||||||
|
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 5);
|
||||||
|
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 5);
|
||||||
|
ExplosionLarge.spawnRubble(worldObj, this.posX, this.posY, this.posZ, 5);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_buster_small); }
|
||||||
|
}
|
||||||
|
}
|
||||||
88
src/main/java/com/hbm/entity/missile/EntityMissileTier2.java
Normal file
88
src/main/java/com/hbm/entity/missile/EntityMissileTier2.java
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.entity.logic.EntityEMP;
|
||||||
|
import com.hbm.explosion.ExplosionChaos;
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public abstract class EntityMissileTier2 extends EntityMissileBaseNT {
|
||||||
|
|
||||||
|
public EntityMissileTier2(World world) { super(world); }
|
||||||
|
public EntityMissileTier2(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
|
||||||
|
list.add(new ItemStack(ModItems.plate_steel, 10));
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 6));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_medium, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier2, 1));
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RadarTargetType getTargetType() {
|
||||||
|
return RadarTargetType.MISSILE_TIER2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileStrong extends EntityMissileTier2 {
|
||||||
|
public EntityMissileStrong(World world) { super(world); }
|
||||||
|
public EntityMissileStrong(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() { ExplosionLarge.explode(worldObj, posX, posY, posZ, 25.0F, true, true, true); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_generic_medium); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileIncendiaryStrong extends EntityMissileTier2 {
|
||||||
|
public EntityMissileIncendiaryStrong(World world) { super(world); }
|
||||||
|
public EntityMissileIncendiaryStrong(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
ExplosionLarge.explodeFire(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 25.0F, true, true, true);
|
||||||
|
ExplosionChaos.flameDeath(this.worldObj, (int)((float)this.posX + 0.5F), (int)((float)this.posY + 0.5F), (int)((float)this.posZ + 0.5F), 25);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_incendiary_medium); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileClusterStrong extends EntityMissileTier2 {
|
||||||
|
public EntityMissileClusterStrong(World world) { super(world); }
|
||||||
|
public EntityMissileClusterStrong(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); this.isCluster = true; }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 15F, true);
|
||||||
|
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 50, 100);
|
||||||
|
}
|
||||||
|
@Override public void cluster() { this.onImpact(); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_cluster_medium); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileBusterStrong extends EntityMissileTier2 {
|
||||||
|
public EntityMissileBusterStrong(World world) { super(world); }
|
||||||
|
public EntityMissileBusterStrong(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
for(int i = 0; i < 20; i++) this.worldObj.createExplosion(this, this.posX, this.posY - i, this.posZ, 7.5F, true);
|
||||||
|
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 8);
|
||||||
|
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 8);
|
||||||
|
ExplosionLarge.spawnRubble(worldObj, this.posX, this.posY, this.posZ, 8);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_buster_medium); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileEMPStrong extends EntityMissileTier2 {
|
||||||
|
public EntityMissileEMPStrong(World world) { super(world); }
|
||||||
|
public EntityMissileEMPStrong(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
EntityEMP emp = new EntityEMP(worldObj);
|
||||||
|
emp.posX = posX;
|
||||||
|
emp.posY = posY;
|
||||||
|
emp.posZ = posZ;
|
||||||
|
worldObj.spawnEntityInWorld(emp);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_generic_medium); }
|
||||||
|
}
|
||||||
|
}
|
||||||
125
src/main/java/com/hbm/entity/missile/EntityMissileTier3.java
Normal file
125
src/main/java/com/hbm/entity/missile/EntityMissileTier3.java
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.explosion.ExplosionChaos;
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.explosion.ExplosionNT;
|
||||||
|
import com.hbm.explosion.ExplosionThermo;
|
||||||
|
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public abstract class EntityMissileTier3 extends EntityMissileBaseNT {
|
||||||
|
|
||||||
|
public EntityMissileTier3(World world) { super(world); }
|
||||||
|
public EntityMissileTier3(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
|
||||||
|
list.add(new ItemStack(ModItems.plate_steel, 16));
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_large, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier3, 1));
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RadarTargetType getTargetType() {
|
||||||
|
return RadarTargetType.MISSILE_TIER3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileBurst extends EntityMissileTier3 {
|
||||||
|
public EntityMissileBurst(World world) { super(world); }
|
||||||
|
public EntityMissileBurst(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
for(int i = 0; i < 4; i++) this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 50.0F, true);
|
||||||
|
ExplosionLarge.explode(worldObj, posX, posY, posZ, 50.0F, true, true, true);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_generic_large); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileInferno extends EntityMissileTier3 {
|
||||||
|
public EntityMissileInferno(World world) { super(world); }
|
||||||
|
public EntityMissileInferno(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
ExplosionLarge.explodeFire(worldObj, this.posX + 0.5F, this.posY + 0.5F, this.posZ + 0.5F, 35.0F, true, true, true);
|
||||||
|
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10);
|
||||||
|
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 25);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_incendiary_large); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileRain extends EntityMissileTier3 {
|
||||||
|
public EntityMissileRain(World world) { super(world); }
|
||||||
|
public EntityMissileRain(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); this.isCluster = true; }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 25F, true);
|
||||||
|
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 100, 100);
|
||||||
|
}
|
||||||
|
@Override public void cluster() { this.onImpact(); }
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_cluster_large); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileDrill extends EntityMissileTier3 {
|
||||||
|
public EntityMissileDrill(World world) { super(world); }
|
||||||
|
public EntityMissileDrill(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
for(int i = 0; i < 30; i++) {
|
||||||
|
ExplosionNT explosion = new ExplosionNT(worldObj, this, this.posX, this.posY - i, this.posZ, 10F);
|
||||||
|
explosion.addAllAttrib(ExAttrib.ERRODE);
|
||||||
|
explosion.explode(); //an explosion exploded!
|
||||||
|
}
|
||||||
|
ExplosionLarge.spawnParticles(worldObj, this.posX, this.posY, this.posZ, 25);
|
||||||
|
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 12);
|
||||||
|
ExplosionLarge.jolt(worldObj, this.posX, this.posY, this.posZ, 10, 50, 1);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_buster_large); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileEndo extends EntityMissileTier3 {
|
||||||
|
public EntityMissileEndo(World world) { super(world); }
|
||||||
|
public EntityMissileEndo(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
||||||
|
ExplosionThermo.freeze(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 30);
|
||||||
|
ExplosionThermo.freezer(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 40);
|
||||||
|
}
|
||||||
|
@Override public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
||||||
|
list.add(new ItemStack(ModItems.plate_steel, 14));
|
||||||
|
list.add(new ItemStack(ModItems.plate_aluminium, 8));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_large, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_thermo_exo); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileExo extends EntityMissileTier3 {
|
||||||
|
public EntityMissileExo(World world) { super(world); }
|
||||||
|
public EntityMissileExo(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 10.0F, true);
|
||||||
|
ExplosionThermo.scorch(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 30);
|
||||||
|
ExplosionThermo.setEntitiesOnFire(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 40);
|
||||||
|
}
|
||||||
|
@Override public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 10));
|
||||||
|
list.add(new ItemStack(ModItems.plate_steel, 14));
|
||||||
|
list.add(new ItemStack(ModItems.plate_aluminium, 8));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_large, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_thermo_exo); }
|
||||||
|
}
|
||||||
|
}
|
||||||
76
src/main/java/com/hbm/entity/missile/EntityMissileTier4.java
Normal file
76
src/main/java/com/hbm/entity/missile/EntityMissileTier4.java
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
package com.hbm.entity.missile;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.config.BombConfig;
|
||||||
|
import com.hbm.entity.effect.EntityNukeTorex;
|
||||||
|
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public abstract class EntityMissileTier4 extends EntityMissileBaseNT {
|
||||||
|
|
||||||
|
public EntityMissileTier4(World world) { super(world); }
|
||||||
|
public EntityMissileTier4(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 16));
|
||||||
|
list.add(new ItemStack(ModItems.plate_steel, 20));
|
||||||
|
list.add(new ItemStack(ModItems.plate_aluminium, 12));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_large, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RadarTargetType getTargetType() {
|
||||||
|
return RadarTargetType.MISSILE_TIER1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileNuclear extends EntityMissileTier4 {
|
||||||
|
public EntityMissileNuclear(World world) { super(world); }
|
||||||
|
public EntityMissileNuclear(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
this.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius, posX, posY, posZ));
|
||||||
|
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_nuclear); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileMirv extends EntityMissileTier4 {
|
||||||
|
public EntityMissileMirv(World world) { super(world); }
|
||||||
|
public EntityMissileMirv(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(worldObj, BombConfig.missileRadius * 2, posX, posY, posZ));
|
||||||
|
EntityNukeTorex.statFac(worldObj, posX, posY, posZ, BombConfig.missileRadius * 2);
|
||||||
|
}
|
||||||
|
@Override public List<ItemStack> getDebris() {
|
||||||
|
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||||
|
list.add(new ItemStack(ModItems.plate_titanium, 16));
|
||||||
|
list.add(new ItemStack(ModItems.plate_steel, 20));
|
||||||
|
list.add(new ItemStack(ModItems.plate_aluminium, 12));
|
||||||
|
list.add(new ItemStack(ModItems.thruster_large, 1));
|
||||||
|
list.add(new ItemStack(ModItems.circuit_targeting_tier5, 1));
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_mirv); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class EntityMissileVolcano extends EntityMissileTier4 {
|
||||||
|
public EntityMissileVolcano(World world) { super(world); }
|
||||||
|
public EntityMissileVolcano(World world, float x, float y, float z, int a, int b) { super(world, x, y, z, a, b); }
|
||||||
|
@Override public void onImpact() {
|
||||||
|
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10.0F, true, true, true);
|
||||||
|
for(int x = -1; x <= 1; x++) for(int y = -1; y <= 1; y++) for(int z = -1; z <= 1; z++) worldObj.setBlock((int)Math.floor(posX + x), (int)Math.floor(posY + y), (int)Math.floor(posZ + z), ModBlocks.volcanic_lava_block);
|
||||||
|
worldObj.setBlock((int)Math.floor(posX), (int)Math.floor(posY), (int)Math.floor(posZ), ModBlocks.volcano_core);
|
||||||
|
}
|
||||||
|
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.warhead_volcano); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,61 +0,0 @@
|
|||||||
package com.hbm.entity.missile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.hbm.blocks.ModBlocks;
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class EntityMissileVolcano extends EntityMissileBaseAdvanced {
|
|
||||||
|
|
||||||
public EntityMissileVolcano(World p_i1582_1_) {
|
|
||||||
super(p_i1582_1_);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EntityMissileVolcano(World world, float x, float y, float z, int a, int b) {
|
|
||||||
super(world, x, y, z, a, b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onImpact() {
|
|
||||||
|
|
||||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10.0F, true, true, true);
|
|
||||||
|
|
||||||
for(int x = -1; x <= 1; x++) {
|
|
||||||
for(int y = -1; y <= 1; y++) {
|
|
||||||
for(int z = -1; z <= 1; z++) {
|
|
||||||
worldObj.setBlock((int)Math.floor(posX + x), (int)Math.floor(posY + y), (int)Math.floor(posZ + z), ModBlocks.volcanic_lava_block);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
worldObj.setBlock((int)Math.floor(posX), (int)Math.floor(posY), (int)Math.floor(posZ), ModBlocks.volcano_core);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDebris() {
|
|
||||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
|
||||||
|
|
||||||
list.add(new ItemStack(ModItems.plate_titanium, 16));
|
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 20));
|
|
||||||
list.add(new ItemStack(ModItems.plate_aluminium, 12));
|
|
||||||
list.add(new ItemStack(ModItems.thruster_large, 1));
|
|
||||||
list.add(new ItemStack(ModItems.circuit_targeting_tier4, 1));
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getDebrisRareDrop() {
|
|
||||||
return new ItemStack(ModItems.warhead_volcano);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public RadarTargetType getTargetType() {
|
|
||||||
return RadarTargetType.MISSILE_TIER4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -185,7 +185,7 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
|||||||
nextPos = Vec3.createVectorHelper(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
|
nextPos = Vec3.createVectorHelper(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.worldObj.isRemote) {
|
if(!this.worldObj.isRemote && this.doesImpactEntities()) {
|
||||||
|
|
||||||
Entity hitEntity = null;
|
Entity hitEntity = null;
|
||||||
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX * motionMult(), this.motionY * motionMult(), this.motionZ * motionMult()).expand(1.0D, 1.0D, 1.0D));
|
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX * motionMult(), this.motionY * motionMult(), this.motionZ * motionMult()).expand(1.0D, 1.0D, 1.0D));
|
||||||
@ -282,6 +282,10 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean doesImpactEntities() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean doesPenetrate() {
|
public boolean doesPenetrate() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,12 +5,20 @@ import java.util.Arrays;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.packet.NBTControlPacket;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
import com.hbm.util.I18nUtil;
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
|
import api.hbm.entity.RadarEntry;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
|
||||||
public class GUIMachineRadarNT extends GuiScreen {
|
public class GUIMachineRadarNT extends GuiScreen {
|
||||||
|
|
||||||
@ -33,6 +41,27 @@ public class GUIMachineRadarNT extends GuiScreen {
|
|||||||
this.guiTop = (this.height - this.ySize) / 2;
|
this.guiTop = (this.height - this.ySize) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int x, int y, int i) {
|
||||||
|
super.mouseClicked(x, y, i);
|
||||||
|
|
||||||
|
String cmd = null;
|
||||||
|
|
||||||
|
if(checkClick(x, y, -10, 88, 8, 8)) cmd = "missiles";
|
||||||
|
if(checkClick(x, y, -10, 98, 8, 8)) cmd = "shells";
|
||||||
|
if(checkClick(x, y, -10, 108, 8, 8)) cmd = "players";
|
||||||
|
if(checkClick(x, y, -10, 118, 8, 8)) cmd = "smart";
|
||||||
|
if(checkClick(x, y, -10, 128, 8, 8)) cmd = "red";
|
||||||
|
if(checkClick(x, y, -10, 138, 8, 8)) cmd = "map";
|
||||||
|
|
||||||
|
if(cmd != null) {
|
||||||
|
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||||
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
data.setBoolean(cmd, true);
|
||||||
|
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, radar.xCoord, radar.yCoord, radar.zCoord));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
@ -42,22 +71,143 @@ public class GUIMachineRadarNT extends GuiScreen {
|
|||||||
GL11.glEnable(GL11.GL_LIGHTING);
|
GL11.glEnable(GL11.GL_LIGHTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawGuiContainerForegroundLayer(int x, int y) {
|
private void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||||
if(checkClick(x, y, -10, 88, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.detectMissiles")), x, y);
|
|
||||||
if(checkClick(x, y, -10, 98, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.detectShells")), x, y);
|
if(checkClick(mouseX, mouseY, 8, 221, 200, 7)) this.func_146283_a(Arrays.asList(BobMathUtil.getShortNumber(radar.power) + "/" + BobMathUtil.getShortNumber(radar.maxPower) + "HE"), mouseX, mouseY);
|
||||||
if(checkClick(x, y, -10, 108, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.detectPlayers")), x, y);
|
|
||||||
if(checkClick(x, y, -10, 118, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.smartMode")), x, y);
|
if(checkClick(mouseX, mouseY, -10, 88, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.detectMissiles")), mouseX, mouseY);
|
||||||
if(checkClick(x, y, -10, 128, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.redMode")), x, y);
|
if(checkClick(mouseX, mouseY, -10, 98, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.detectShells")), mouseX, mouseY);
|
||||||
if(checkClick(x, y, -10, 138, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.showMap")), x, y);
|
if(checkClick(mouseX, mouseY, -10, 108, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.detectPlayers")), mouseX, mouseY);
|
||||||
|
if(checkClick(mouseX, mouseY, -10, 118, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.smartMode")), mouseX, mouseY);
|
||||||
|
if(checkClick(mouseX, mouseY, -10, 128, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.redMode")), mouseX, mouseY);
|
||||||
|
if(checkClick(mouseX, mouseY, -10, 138, 8, 8)) this.func_146283_a(Arrays.asList(I18nUtil.resolveKeyArray("radar.showMap")), mouseX, mouseY);
|
||||||
|
|
||||||
|
if(!radar.entries.isEmpty()) {
|
||||||
|
for(RadarEntry m : radar.entries) {
|
||||||
|
int x = guiLeft + (int)((m.posX - radar.xCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D)) + 108;
|
||||||
|
int z = guiTop + (int)((m.posZ - radar.zCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D)) + 117;
|
||||||
|
|
||||||
|
if(mouseX + 5 > x && mouseX - 4 <= x && mouseY + 5 > z && mouseY - 4 <= z) {
|
||||||
|
|
||||||
|
String[] text = new String[] { I18nUtil.resolveKey(m.unlocalizedName), m.posX + " / " + m.posZ, "Alt.: " + m.posY };
|
||||||
|
this.func_146283_a(Arrays.asList(text), x, z);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
private void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||||
|
drawTexturedModalRect(guiLeft - 14, guiTop + 84, 224, 0, 14, 66);
|
||||||
|
|
||||||
|
if(radar.scanMissiles ^ (radar.jammed && radar.getWorldObj().rand.nextBoolean())) drawTexturedModalRect(guiLeft - 10, guiTop + 88, 238, 4, 8, 8);
|
||||||
|
if(radar.scanShells ^ (radar.jammed && radar.getWorldObj().rand.nextBoolean())) drawTexturedModalRect(guiLeft - 10, guiTop + 98, 238, 14, 8, 8);
|
||||||
|
if(radar.scanPlayers ^ (radar.jammed && radar.getWorldObj().rand.nextBoolean())) drawTexturedModalRect(guiLeft - 10, guiTop + 108, 238, 24, 8, 8);
|
||||||
|
if(radar.smartMode ^ (radar.jammed && radar.getWorldObj().rand.nextBoolean())) drawTexturedModalRect(guiLeft - 10, guiTop + 118, 238, 34, 8, 8);
|
||||||
|
if(radar.redMode ^ (radar.jammed && radar.getWorldObj().rand.nextBoolean())) drawTexturedModalRect(guiLeft - 10, guiTop + 128, 238, 44, 8, 8);
|
||||||
|
if(radar.showMap ^ (radar.jammed && radar.getWorldObj().rand.nextBoolean())) drawTexturedModalRect(guiLeft - 10, guiTop + 138, 238, 54, 8, 8);
|
||||||
|
|
||||||
|
if(radar.jammed) {
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
for(int j = 0; j < 5; j++) {
|
||||||
|
drawTexturedModalRect(guiLeft + 8 + i * 40, guiTop + 17 + j * 40, 216, 118 + radar.getWorldObj().rand.nextInt(81), 40, 40);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(radar.showMap) {
|
||||||
|
Tessellator tess = Tessellator.instance;
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
tess.startDrawingQuads();
|
||||||
|
for(int i = 0; i < 40_000; i++) {
|
||||||
|
int iX = i % 200;
|
||||||
|
int iZ = i / 200;
|
||||||
|
byte b = radar.map[i];
|
||||||
|
if(b > 0) {
|
||||||
|
int color = ((b * 8) % 256) << 8;
|
||||||
|
tess.setColorOpaque_I(color);
|
||||||
|
tess.addVertex(guiLeft + 8 + iX, guiTop + 18 + iZ, this.zLevel);
|
||||||
|
tess.addVertex(guiLeft + 9 + iX, guiTop + 18 + iZ, this.zLevel);
|
||||||
|
tess.addVertex(guiLeft + 9 + iX, guiTop + 17 + iZ, this.zLevel);
|
||||||
|
tess.addVertex(guiLeft + 8 + iX, guiTop + 17 + iZ, this.zLevel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tess.draw();
|
||||||
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
}
|
||||||
|
|
||||||
|
Vec3 tr = Vec3.createVectorHelper(100, 0, 0);
|
||||||
|
Vec3 tl = Vec3.createVectorHelper(100, 0, 0);
|
||||||
|
Vec3 bl = Vec3.createVectorHelper(0, -5, 0);
|
||||||
|
float rot = -(radar.getWorldObj().getTotalWorldTime() + f) / 20F % (float) (Math.PI * 2);
|
||||||
|
tr.rotateAroundZ(rot);
|
||||||
|
tl.rotateAroundZ(rot + 0.25F);
|
||||||
|
bl.rotateAroundZ(rot);
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||||
|
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||||
|
Tessellator tess = Tessellator.instance;
|
||||||
|
tess.startDrawingQuads();
|
||||||
|
tess.setColorRGBA_I(0x00ff00, 0); tess.addVertex(guiLeft + 108, guiTop + 117, this.zLevel);
|
||||||
|
tess.setColorRGBA_I(0x00ff00, 255); tess.addVertex(guiLeft + 108 + tr.xCoord, guiTop + 117 + tr.yCoord, this.zLevel);
|
||||||
|
tess.setColorRGBA_I(0x00ff00, 0); tess.addVertex(guiLeft + 108 + tl.xCoord, guiTop + 117 + tl.yCoord, this.zLevel);
|
||||||
|
tess.setColorRGBA_I(0x00ff00, 0); tess.addVertex(guiLeft + 108 + bl.xCoord, guiTop + 117 + bl.yCoord, this.zLevel);
|
||||||
|
tess.draw();
|
||||||
|
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||||
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
|
||||||
|
if(!radar.entries.isEmpty()) {
|
||||||
|
for(RadarEntry m : radar.entries) {
|
||||||
|
double x = (m.posX - radar.xCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D) - 4D;
|
||||||
|
double z = (m.posZ - radar.zCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D) - 4D;
|
||||||
|
int t = m.blipLevel;
|
||||||
|
drawTexturedModalRectDouble(guiLeft + 108 + x, guiTop + 117 + z, 216, 8 * t, 8, 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void drawTexturedModalRectDouble(double x, double y, int sourceX, int sourceY, int sizeX, int sizeY) {
|
||||||
|
float f = 0.00390625F;
|
||||||
|
float f1 = 0.00390625F;
|
||||||
|
Tessellator tessellator = Tessellator.instance;
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.addVertexWithUV(x, y + sizeY, this.zLevel, (sourceX + 0) * f, (sourceY + sizeY) * f1);
|
||||||
|
tessellator.addVertexWithUV(x + sizeX, y + sizeY, this.zLevel, (sourceX + sizeX) * f, (sourceY + sizeY) * f1);
|
||||||
|
tessellator.addVertexWithUV(x + sizeX, y, this.zLevel, (sourceX + sizeX) * f, (sourceY + 0) * f1);
|
||||||
|
tessellator.addVertexWithUV(x, y, this.zLevel, (sourceX + 0) * f, (sourceY + 0) * f1);
|
||||||
|
tessellator.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean checkClick(int x, int y, int left, int top, int sizeX, int sizeY) {
|
protected boolean checkClick(int x, int y, int left, int top, int sizeX, int sizeY) {
|
||||||
return guiLeft + left <= x && guiLeft + left + sizeX > x && guiTop + top < y && guiTop + top + sizeY >= y;
|
return guiLeft + left <= x && guiLeft + left + sizeX > x && guiTop + top < y && guiTop + top + sizeY >= y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void keyTyped(char c, int key) {
|
||||||
|
if(key == 1 || key == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||||
|
this.mc.thePlayer.closeScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean doesGuiPauseGame() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateScreen() {
|
||||||
|
super.updateScreen();
|
||||||
|
|
||||||
|
if(!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) {
|
||||||
|
this.mc.thePlayer.closeScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,10 +2,8 @@ package com.hbm.items.tool;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.entity.effect.EntityNukeTorex;
|
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.saveddata.TomSaveData;
|
import com.hbm.saveddata.TomSaveData;
|
||||||
import com.hbm.util.TrackerUtil;
|
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.item.ItemSword;
|
import net.minecraft.item.ItemSword;
|
||||||
import net.minecraft.potion.Potion;
|
import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.potion.PotionEffect;
|
import net.minecraft.potion.PotionEffect;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
|||||||
@ -57,6 +57,11 @@ import com.hbm.entity.grenade.*;
|
|||||||
import com.hbm.entity.item.*;
|
import com.hbm.entity.item.*;
|
||||||
import com.hbm.entity.logic.*;
|
import com.hbm.entity.logic.*;
|
||||||
import com.hbm.entity.missile.*;
|
import com.hbm.entity.missile.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier0.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier1.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier2.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||||
|
import com.hbm.entity.missile.EntityMissileTier4.*;
|
||||||
import com.hbm.entity.mob.*;
|
import com.hbm.entity.mob.*;
|
||||||
import com.hbm.entity.mob.botprime.*;
|
import com.hbm.entity.mob.botprime.*;
|
||||||
import com.hbm.entity.mob.siege.*;
|
import com.hbm.entity.mob.siege.*;
|
||||||
@ -236,7 +241,7 @@ public class ClientProxy extends ServerProxy {
|
|||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadar.class, new RenderRadar());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadarNT.class, new RenderRadar());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSeleniumEngine.class, new RenderSelenium());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSeleniumEngine.class, new RenderSelenium());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReactorResearch.class, new RenderSmallReactor());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReactorResearch.class, new RenderSmallReactor());
|
||||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineShredderLarge.class, new RenderMachineShredder());
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineShredderLarge.class, new RenderMachineShredder());
|
||||||
|
|||||||
@ -20,8 +20,6 @@ import com.hbm.blocks.generic.BlockAshes;
|
|||||||
import com.hbm.config.GeneralConfig;
|
import com.hbm.config.GeneralConfig;
|
||||||
import com.hbm.config.MobConfig;
|
import com.hbm.config.MobConfig;
|
||||||
import com.hbm.config.RadiationConfig;
|
import com.hbm.config.RadiationConfig;
|
||||||
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
|
||||||
import com.hbm.entity.missile.EntityMissileCustom;
|
|
||||||
import com.hbm.entity.mob.EntityCyberCrab;
|
import com.hbm.entity.mob.EntityCyberCrab;
|
||||||
import com.hbm.entity.mob.EntityDuck;
|
import com.hbm.entity.mob.EntityDuck;
|
||||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||||
@ -66,6 +64,7 @@ import com.hbm.packet.PermaSyncPacket;
|
|||||||
import com.hbm.packet.PlayerInformPacket;
|
import com.hbm.packet.PlayerInformPacket;
|
||||||
import com.hbm.potion.HbmPotion;
|
import com.hbm.potion.HbmPotion;
|
||||||
import com.hbm.saveddata.AuxSavedData;
|
import com.hbm.saveddata.AuxSavedData;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||||
import com.hbm.tileentity.network.RTTYSystem;
|
import com.hbm.tileentity.network.RTTYSystem;
|
||||||
import com.hbm.tileentity.network.RequestNetwork;
|
import com.hbm.tileentity.network.RequestNetwork;
|
||||||
import com.hbm.util.AchievementHandler;
|
import com.hbm.util.AchievementHandler;
|
||||||
@ -1099,19 +1098,20 @@ public class ModEventHandler {
|
|||||||
if(event.phase == event.phase.START) {
|
if(event.phase == event.phase.START) {
|
||||||
RTTYSystem.updateBroadcastQueue();
|
RTTYSystem.updateBroadcastQueue();
|
||||||
RequestNetwork.updateEntries();
|
RequestNetwork.updateEntries();
|
||||||
|
TileEntityMachineRadarNT.updateSystem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void enteringChunk(EnteringChunk evt) {
|
public void enteringChunk(EnteringChunk evt) {
|
||||||
|
|
||||||
if(evt.entity instanceof EntityMissileBaseAdvanced) {
|
/*if(evt.entity instanceof EntityMissileBaseNT) {
|
||||||
((EntityMissileBaseAdvanced) evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ);
|
((EntityMissileBaseNT) evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(evt.entity instanceof EntityMissileCustom) {
|
if(evt.entity instanceof EntityMissileCustom) {
|
||||||
((EntityMissileCustom) evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ);
|
((EntityMissileCustom) evt.entity).loadNeighboringChunks(evt.newChunkX, evt.newChunkZ);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|||||||
@ -28,11 +28,17 @@ public class BufPacket implements IMessage {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fromBytes(ByteBuf buf) {
|
public void fromBytes(ByteBuf buf) {
|
||||||
|
this.x = buf.readInt();
|
||||||
|
this.y = buf.readInt();
|
||||||
|
this.z = buf.readInt();
|
||||||
this.buf = buf;
|
this.buf = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toBytes(ByteBuf buf) {
|
public void toBytes(ByteBuf buf) {
|
||||||
|
buf.writeInt(x);
|
||||||
|
buf.writeInt(y);
|
||||||
|
buf.writeInt(z);
|
||||||
this.rec.serialize(buf);
|
this.rec.serialize(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,10 +3,7 @@ package com.hbm.render.entity.rocket;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.missile.EntityMissileAntiBallistic;
|
import com.hbm.entity.missile.EntityMissileAntiBallistic;
|
||||||
import com.hbm.entity.missile.EntityMissileBunkerBuster;
|
import com.hbm.entity.missile.EntityMissileTier1.*;
|
||||||
import com.hbm.entity.missile.EntityMissileCluster;
|
|
||||||
import com.hbm.entity.missile.EntityMissileGeneric;
|
|
||||||
import com.hbm.entity.missile.EntityMissileIncendiary;
|
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
|||||||
@ -2,10 +2,7 @@ package com.hbm.render.entity.rocket;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.missile.EntityMissileBurst;
|
import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||||
import com.hbm.entity.missile.EntityMissileDrill;
|
|
||||||
import com.hbm.entity.missile.EntityMissileInferno;
|
|
||||||
import com.hbm.entity.missile.EntityMissileRain;
|
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.hbm.render.entity.rocket;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.missile.EntityMissileVolcano;
|
import com.hbm.entity.missile.EntityMissileTier4.EntityMissileVolcano;
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
|||||||
@ -2,11 +2,7 @@ package com.hbm.render.entity.rocket;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.missile.EntityMissileBusterStrong;
|
import com.hbm.entity.missile.EntityMissileTier2.*;
|
||||||
import com.hbm.entity.missile.EntityMissileClusterStrong;
|
|
||||||
import com.hbm.entity.missile.EntityMissileEMPStrong;
|
|
||||||
import com.hbm.entity.missile.EntityMissileIncendiaryStrong;
|
|
||||||
import com.hbm.entity.missile.EntityMissileStrong;
|
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
|||||||
@ -2,10 +2,7 @@ package com.hbm.render.entity.rocket;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.missile.EntityMissileBHole;
|
import com.hbm.entity.missile.EntityMissileTier0.*;
|
||||||
import com.hbm.entity.missile.EntityMissileEMP;
|
|
||||||
import com.hbm.entity.missile.EntityMissileSchrabidium;
|
|
||||||
import com.hbm.entity.missile.EntityMissileTaint;
|
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
|||||||
@ -2,8 +2,7 @@ package com.hbm.render.entity.rocket;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.entity.missile.EntityMissileEndo;
|
import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||||
import com.hbm.entity.missile.EntityMissileExo;
|
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.Render;
|
import net.minecraft.client.renderer.entity.Render;
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.hbm.render.tileentity;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachineRadar;
|
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@ -21,8 +21,8 @@ public class RenderRadar extends TileEntitySpecialRenderer {
|
|||||||
bindTexture(ResourceManager.radar_base_tex);
|
bindTexture(ResourceManager.radar_base_tex);
|
||||||
ResourceManager.radar.renderPart("Base");
|
ResourceManager.radar.renderPart("Base");
|
||||||
|
|
||||||
TileEntityMachineRadar radar = (TileEntityMachineRadar) tileEntity;
|
TileEntityMachineRadarNT radar = (TileEntityMachineRadarNT) tileEntity;
|
||||||
GL11.glRotatef(radar.prevRotation + (radar.rotation - radar.prevRotation) * f, 0F, 1F, 0F);
|
GL11.glRotatef(radar.prevRotation + (radar.rotation - radar.prevRotation) * f, 0F, -1F, 0F);
|
||||||
GL11.glTranslated(-0.125D, 0, 0);
|
GL11.glTranslated(-0.125D, 0, 0);
|
||||||
|
|
||||||
bindTexture(ResourceManager.radar_dish_tex);
|
bindTexture(ResourceManager.radar_dish_tex);
|
||||||
@ -30,5 +30,4 @@ public class RenderRadar extends TileEntitySpecialRenderer {
|
|||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -112,7 +112,7 @@ public class TileMappings {
|
|||||||
put(TileEntityMachineSPP.class, "tileentity_spp");
|
put(TileEntityMachineSPP.class, "tileentity_spp");
|
||||||
put(TileEntityMachineRadGen.class, "tileentity_radgen");
|
put(TileEntityMachineRadGen.class, "tileentity_radgen");
|
||||||
put(TileEntityMachineTransformer.class, "tileentity_transformer");
|
put(TileEntityMachineTransformer.class, "tileentity_transformer");
|
||||||
put(TileEntityMachineRadar.class, "tileentity_radar");
|
put(TileEntityMachineRadarNT.class, "tileentity_radar");
|
||||||
put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
|
put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
|
||||||
put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
||||||
put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
put(TileEntityMachineSatLinker.class, "tileentity_satlinker");
|
||||||
|
|||||||
@ -7,16 +7,21 @@ import java.util.function.Function;
|
|||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.config.WeaponConfig;
|
||||||
import com.hbm.extprop.HbmLivingProps;
|
import com.hbm.extprop.HbmLivingProps;
|
||||||
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.gui.GUIMachineRadarNT;
|
import com.hbm.inventory.gui.GUIMachineRadarNT;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.tileentity.IConfigurableMachine;
|
import com.hbm.tileentity.IConfigurableMachine;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
import com.hbm.util.Tuple.Pair;
|
import com.hbm.util.Tuple.Triplet;
|
||||||
|
|
||||||
|
import api.hbm.energy.IEnergyUser;
|
||||||
import api.hbm.entity.IRadarDetectable;
|
import api.hbm.entity.IRadarDetectable;
|
||||||
import api.hbm.entity.IRadarDetectableNT;
|
import api.hbm.entity.IRadarDetectableNT;
|
||||||
|
import api.hbm.entity.IRadarDetectableNT.RadarScanParams;
|
||||||
import api.hbm.entity.RadarEntry;
|
import api.hbm.entity.RadarEntry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
@ -27,6 +32,7 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldServer;
|
import net.minecraft.world.WorldServer;
|
||||||
@ -35,7 +41,7 @@ import net.minecraft.world.WorldServer;
|
|||||||
* Now with SmЯt™ lag-free entity detection! (patent pending)
|
* Now with SmЯt™ lag-free entity detection! (patent pending)
|
||||||
* @author hbm
|
* @author hbm
|
||||||
*/
|
*/
|
||||||
public class TileEntityMachineRadarNT extends TileEntityMachineBase implements IGUIProvider, IConfigurableMachine {
|
public class TileEntityMachineRadarNT extends TileEntityMachineBase implements IEnergyUser, IGUIProvider, IConfigurableMachine, IControlReceiver {
|
||||||
|
|
||||||
public boolean scanMissiles = true;
|
public boolean scanMissiles = true;
|
||||||
public boolean scanShells = true;
|
public boolean scanShells = true;
|
||||||
@ -51,11 +57,18 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
public long power = 0;
|
public long power = 0;
|
||||||
|
|
||||||
|
protected int pingTimer = 0;
|
||||||
|
protected int lastPower;
|
||||||
|
protected final static int maxTimer = 80;
|
||||||
|
|
||||||
public static int maxPower = 100_000;
|
public static int maxPower = 100_000;
|
||||||
public static int consumption = 500;
|
public static int consumption = 500;
|
||||||
public static int radarRange = 1_000;
|
public static int radarRange = 1_000;
|
||||||
public static int radarBuffer = 30;
|
public static int radarBuffer = 30;
|
||||||
public static int radarAltitude = 55;
|
public static int radarAltitude = 55;
|
||||||
|
public static int chunkLoadCap = 5;
|
||||||
|
|
||||||
|
public byte[] map = new byte[40_000];
|
||||||
|
|
||||||
public List<RadarEntry> entries = new ArrayList();
|
public List<RadarEntry> entries = new ArrayList();
|
||||||
|
|
||||||
@ -71,6 +84,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
radarRange = IConfigurableMachine.grab(obj, "I:radarRange", radarRange);
|
radarRange = IConfigurableMachine.grab(obj, "I:radarRange", radarRange);
|
||||||
radarBuffer = IConfigurableMachine.grab(obj, "I:radarBuffer", radarBuffer);
|
radarBuffer = IConfigurableMachine.grab(obj, "I:radarBuffer", radarBuffer);
|
||||||
radarAltitude = IConfigurableMachine.grab(obj, "I:radarAltitude", radarAltitude);
|
radarAltitude = IConfigurableMachine.grab(obj, "I:radarAltitude", radarAltitude);
|
||||||
|
chunkLoadCap = IConfigurableMachine.grab(obj, "I:chunkLoadCap", chunkLoadCap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -80,6 +94,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
writer.name("I:radarRange").value(radarRange);
|
writer.name("I:radarRange").value(radarRange);
|
||||||
writer.name("I:radarBuffer").value(radarBuffer);
|
writer.name("I:radarBuffer").value(radarBuffer);
|
||||||
writer.name("I:radarAltitude").value(radarAltitude);
|
writer.name("I:radarAltitude").value(radarAltitude);
|
||||||
|
writer.name("I:chunkLoadCap").value(chunkLoadCap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TileEntityMachineRadarNT() {
|
public TileEntityMachineRadarNT() {
|
||||||
@ -96,47 +111,57 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
|
if(worldObj.getTotalWorldTime() % 20 == 0) this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
|
||||||
|
|
||||||
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||||
this.jammed = false;
|
this.jammed = false;
|
||||||
allocateTargets();
|
allocateTargets();
|
||||||
|
|
||||||
this.networkPackNT(25);
|
if(this.lastPower != getRedPower()) worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void allocateTargets() {
|
if(worldObj.getBlock(xCoord, yCoord - 1, zCoord) != ModBlocks.muffler) {
|
||||||
this.entries.clear();
|
|
||||||
|
|
||||||
if(this.yCoord < radarAltitude) return;
|
pingTimer++;
|
||||||
if(this.power <= consumption) return;
|
|
||||||
this.power -= consumption;
|
|
||||||
|
|
||||||
int scan = this.scanRange();
|
if(power > 0 && pingTimer >= maxTimer) {
|
||||||
|
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "hbm:block.sonarPing", 5.0F, 1.0F);
|
||||||
for(Entity e : matchingEntities) {
|
pingTimer = 0;
|
||||||
|
|
||||||
if(e.dimension == worldObj.provider.dimensionId && Math.abs(e.posX - (xCoord + 0.5)) <= scan && Math.abs(e.posZ - (zCoord + 0.5)) <= scan && e.posY - yCoord < radarBuffer) {
|
|
||||||
|
|
||||||
if(e instanceof EntityLivingBase && HbmLivingProps.getDigamma((EntityLivingBase) e) > 0.001) {
|
|
||||||
this.jammed = true;
|
|
||||||
entries.clear();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(Function<Pair<Entity, Object>, RadarEntry> converter : converters) {
|
if(this.showMap) {
|
||||||
|
int chunkLoadCap = 5;
|
||||||
|
int chunkLoads = 0;
|
||||||
|
for(int i = 0; i < 100; i++) {
|
||||||
|
int index = (int) (worldObj.getTotalWorldTime() % 400) * 100 + i;
|
||||||
|
int iX = (index % 200) * radarRange * 2 / 200;
|
||||||
|
int iZ = index / 200 * radarRange * 2 / 200;
|
||||||
|
|
||||||
RadarEntry entry = converter.apply(new Pair(e, this));
|
int x = xCoord - radarRange + iX;
|
||||||
if(entry != null) {
|
int z = zCoord - radarRange + iZ;
|
||||||
this.entries.add(entry);
|
|
||||||
break;
|
if(worldObj.getChunkProvider().chunkExists(x >> 4, z >> 4)) {
|
||||||
|
this.map[index] = (byte) worldObj.getHeightValue(x, z);
|
||||||
|
} else {
|
||||||
|
if(this.map[index] == 0 && chunkLoads < chunkLoadCap) {
|
||||||
|
worldObj.getChunkFromChunkCoords(x >> 4, z >> 4);
|
||||||
|
this.map[index] = (byte) worldObj.getHeightValue(x, z);
|
||||||
|
chunkLoads++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected int scanRange() {
|
this.networkPackNT(25);
|
||||||
return radarRange;
|
} else {
|
||||||
|
prevRotation = rotation;
|
||||||
|
if(power > 0) rotation += 5F;
|
||||||
|
|
||||||
|
if(rotation >= 360) {
|
||||||
|
rotation -= 360F;
|
||||||
|
prevRotation -= 360F;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -151,6 +176,16 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
buf.writeBoolean(this.jammed);
|
buf.writeBoolean(this.jammed);
|
||||||
buf.writeInt(entries.size());
|
buf.writeInt(entries.size());
|
||||||
for(RadarEntry entry : entries) entry.toBytes(buf);
|
for(RadarEntry entry : entries) entry.toBytes(buf);
|
||||||
|
if(this.showMap) {
|
||||||
|
buf.writeBoolean(true);
|
||||||
|
short index = (short) (worldObj.getTotalWorldTime() % 400);
|
||||||
|
buf.writeShort(index);
|
||||||
|
for(int i = index * 100; i < (index + 1) * 100; i++) {
|
||||||
|
buf.writeByte(this.map[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
buf.writeBoolean(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -164,11 +199,124 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
this.showMap = buf.readBoolean();
|
this.showMap = buf.readBoolean();
|
||||||
this.jammed = buf.readBoolean();
|
this.jammed = buf.readBoolean();
|
||||||
int count = buf.readInt();
|
int count = buf.readInt();
|
||||||
|
this.entries.clear();
|
||||||
for(int i = 0; i < count; i++) {
|
for(int i = 0; i < count; i++) {
|
||||||
RadarEntry entry = new RadarEntry();
|
RadarEntry entry = new RadarEntry();
|
||||||
entry.fromBytes(buf);
|
entry.fromBytes(buf);
|
||||||
this.entries.add(entry);
|
this.entries.add(entry);
|
||||||
}
|
}
|
||||||
|
if(buf.readBoolean()) {
|
||||||
|
int index = buf.readShort();
|
||||||
|
for(int i = index * 100; i < (index + 1) * 100; i++) {
|
||||||
|
this.map[i] = buf.readByte();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void allocateTargets() {
|
||||||
|
this.entries.clear();
|
||||||
|
|
||||||
|
if(this.yCoord < radarAltitude) return;
|
||||||
|
if(this.power <= consumption) return;
|
||||||
|
this.power -= consumption;
|
||||||
|
|
||||||
|
int scan = this.scanRange();
|
||||||
|
|
||||||
|
RadarScanParams params = new RadarScanParams(this.scanMissiles, this.scanShells, this.scanPlayers, this.smartMode);
|
||||||
|
|
||||||
|
for(Entity e : matchingEntities) {
|
||||||
|
|
||||||
|
if(e.dimension == worldObj.provider.dimensionId && Math.abs(e.posX - (xCoord + 0.5)) <= scan && Math.abs(e.posZ - (zCoord + 0.5)) <= scan && e.posY - yCoord > radarBuffer) {
|
||||||
|
|
||||||
|
if(e instanceof EntityLivingBase && HbmLivingProps.getDigamma((EntityLivingBase) e) > 0.001) {
|
||||||
|
this.jammed = true;
|
||||||
|
entries.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Function<Triplet<Entity, Object, RadarScanParams>, RadarEntry> converter : converters) {
|
||||||
|
|
||||||
|
RadarEntry entry = converter.apply(new Triplet(e, this, params));
|
||||||
|
if(entry != null) {
|
||||||
|
this.entries.add(entry);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRedPower() {
|
||||||
|
|
||||||
|
if(!entries.isEmpty()) {
|
||||||
|
|
||||||
|
/// PROXIMITY ///
|
||||||
|
if(redMode) {
|
||||||
|
|
||||||
|
double maxRange = WeaponConfig.radarRange * Math.sqrt(2D);
|
||||||
|
int power = 0;
|
||||||
|
|
||||||
|
for(int i = 0; i < entries.size(); i++) {
|
||||||
|
RadarEntry e = entries.get(i);
|
||||||
|
double dist = Math.sqrt(Math.pow(e.posX - xCoord, 2) + Math.pow(e.posZ - zCoord, 2));
|
||||||
|
int p = 15 - (int)Math.floor(dist / maxRange * 15);
|
||||||
|
|
||||||
|
if(p > power) power = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
return power;
|
||||||
|
|
||||||
|
/// TIER ///
|
||||||
|
} else {
|
||||||
|
|
||||||
|
int power = 0;
|
||||||
|
|
||||||
|
for(int i = 0; i < entries.size(); i++) {
|
||||||
|
|
||||||
|
if(entries.get(i).blipLevel + 1 > power) {
|
||||||
|
power = entries.get(i).blipLevel + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return power;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int scanRange() {
|
||||||
|
return radarRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPower(long i) {
|
||||||
|
power = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getPower() {
|
||||||
|
return power;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getMaxPower() {
|
||||||
|
return maxPower;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasPermission(EntityPlayer player) {
|
||||||
|
return this.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void receiveControl(NBTTagCompound data) {
|
||||||
|
if(data.hasKey("missiles")) this.scanMissiles = !this.scanMissiles;
|
||||||
|
if(data.hasKey("shells")) this.scanShells = !this.scanShells;
|
||||||
|
if(data.hasKey("players")) this.scanPlayers = !this.scanPlayers;
|
||||||
|
if(data.hasKey("smart")) this.smartMode = !this.smartMode;
|
||||||
|
if(data.hasKey("red")) this.redMode = !this.redMode;
|
||||||
|
if(data.hasKey("map")) this.showMap = !this.showMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisAlignedBB bb = null;
|
AxisAlignedBB bb = null;
|
||||||
@ -192,8 +340,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public double getMaxRenderDistanceSquared()
|
public double getMaxRenderDistanceSquared() {
|
||||||
{
|
|
||||||
return 65536.0D;
|
return 65536.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,7 +354,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
/** List of lambdas that are supplied a Pair with the entity and radar in question to generate a RadarEntry
|
/** List of lambdas that are supplied a Pair with the entity and radar in question to generate a RadarEntry
|
||||||
The converters coming first have the highest priority */
|
The converters coming first have the highest priority */
|
||||||
public static List<Function<Pair<Entity, Object>, RadarEntry>> converters = new ArrayList();
|
public static List<Function<Triplet<Entity, Object, RadarScanParams>, RadarEntry>> converters = new ArrayList();
|
||||||
public static List<Class> classes = new ArrayList();
|
public static List<Class> classes = new ArrayList();
|
||||||
public static List<Entity> matchingEntities = new ArrayList();
|
public static List<Entity> matchingEntities = new ArrayList();
|
||||||
|
|
||||||
@ -241,21 +388,25 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
|||||||
public static void registerConverters() {
|
public static void registerConverters() {
|
||||||
//IRadarDetectableNT
|
//IRadarDetectableNT
|
||||||
converters.add(x -> {
|
converters.add(x -> {
|
||||||
Entity e = x.getKey();
|
Entity e = x.getX();
|
||||||
if(e instanceof IRadarDetectableNT) {
|
if(e instanceof IRadarDetectableNT) {
|
||||||
IRadarDetectableNT detectable = (IRadarDetectableNT) e;
|
IRadarDetectableNT detectable = (IRadarDetectableNT) e;
|
||||||
if(detectable.canBeSeenBy(x.getValue())) return new RadarEntry(detectable, e);
|
if(detectable.canBeSeenBy(x.getY()) && detectable.paramsApplicable(x.getZ())) return new RadarEntry(detectable, e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
//IRadarDetectable, Legacy
|
//IRadarDetectable, Legacy
|
||||||
converters.add(x -> {
|
converters.add(x -> {
|
||||||
if(x.getKey() instanceof IRadarDetectable) return new RadarEntry((IRadarDetectable) x.getKey(), x.getKey());
|
Entity e = x.getX();
|
||||||
|
RadarScanParams params = x.getZ();
|
||||||
|
if(e instanceof IRadarDetectable && params.scanMissiles) {
|
||||||
|
return new RadarEntry((IRadarDetectable) e, e);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
//Players
|
//Players
|
||||||
converters.add(x -> {
|
converters.add(x -> {
|
||||||
if(x.getKey() instanceof EntityPlayer) return new RadarEntry((EntityPlayer) x.getKey());
|
if(x.getX() instanceof EntityPlayer && x.getZ().scanPlayers) return new RadarEntry((EntityPlayer) x.getX());
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import java.util.function.BiFunction;
|
|||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
import com.hbm.entity.logic.EntityBomber;
|
import com.hbm.entity.logic.EntityBomber;
|
||||||
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
|
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||||
import com.hbm.entity.missile.EntityMissileCustom;
|
import com.hbm.entity.missile.EntityMissileCustom;
|
||||||
import com.hbm.entity.missile.EntitySiegeDropship;
|
import com.hbm.entity.missile.EntitySiegeDropship;
|
||||||
import com.hbm.entity.projectile.EntityBulletBaseNT;
|
import com.hbm.entity.projectile.EntityBulletBaseNT;
|
||||||
@ -642,7 +642,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
|||||||
|
|
||||||
if(targetMachines) {
|
if(targetMachines) {
|
||||||
|
|
||||||
if(e instanceof EntityMissileBaseAdvanced) return true;
|
if(e instanceof EntityMissileBaseNT) return true;
|
||||||
if(e instanceof EntityMissileCustom) return true;
|
if(e instanceof EntityMissileCustom) return true;
|
||||||
if(e instanceof EntityMinecart) return true;
|
if(e instanceof EntityMinecart) return true;
|
||||||
if(e instanceof EntityRailCarBase) return true;
|
if(e instanceof EntityRailCarBase) return true;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
Loading…
x
Reference in New Issue
Block a user