diff --git a/build.gradle b/build.gradle index abb8646a7..da5ad931a 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,7 @@ minecraft { replaceIn "mekanism/common/Mekanism.java" replaceIn "mekanism/generators/common/MekanismGenerators.java" replaceIn "mekanism/tools/common/MekanismTools.java" + replaceIn "mekanism/defense/common/DefenseTech.java" replace "GRADLE_MODVERSION", mod_version replace "GRADLE_VERSIONMOD", alt_version } @@ -140,10 +141,24 @@ task generatorsJar(type: Jar) { } } +task defensetechJar(type: Jar) { + classifier = 'DefenseTech' + from('etc/defensetech') { + include '*.info' + expand 'version': mod_version, 'mc_version': minecraft_version, 'fmp_version': FMP_version + } + + from zipTree(jar.outputs.getFiles().getSingleFile()).matching { + include 'mekanism/defensetech/**' + exclude 'mcmod.info' + } +} + coreJar.dependsOn('reobf') toolsJar.dependsOn('reobf') generatorsJar.dependsOn('reobf') alltJar.dependsOn('reobf') +defensetechJar.dependsOn('reobf') task MDKZip(type: Zip) { @@ -181,7 +196,7 @@ task fullBuild(type: Delete) { delete jar } -fullBuild.dependsOn('toolsJar', 'coreJar', 'generatorsJar', 'MDKZip', 'alltJar', 'apiJar', 'devJar') +fullBuild.dependsOn('toolsJar', 'coreJar', 'generatorsJar', 'MDKZip', 'alltJar', 'apiJar', 'devJar','defensetechJar') artifactory { contextUrl = System.getenv("MAVEN_URL") @@ -216,7 +231,7 @@ publishing { artifactId = project.archivesBaseName groupId = project.group version = project.version - artifacts = [toolsJar, coreJar, generatorsJar, MDKZip, alltJar, apiJar, devJar] + artifacts = [toolsJar, coreJar, generatorsJar, MDKZip, alltJar, apiJar, devJar, defensetechJar] components.java.withVariantsFromConfiguration(configurations.runtimeElements) { skip() } diff --git a/etc/defensetech/logo.png b/etc/defensetech/logo.png new file mode 100644 index 000000000..da48f4f2b Binary files /dev/null and b/etc/defensetech/logo.png differ diff --git a/etc/defensetech/mcmod.info b/etc/defensetech/mcmod.info new file mode 100644 index 000000000..b02134210 --- /dev/null +++ b/etc/defensetech/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "DefenseTech", + "name": "DefenseTech", + "description": "DefenseTech is a Minecraft add-on featuring high-tech weaponry and defense technologies, including missiles, devastating explosives, and other nifty gadgets. The mod serves as a continuation of Calclavia's classic mod 'ICBM.'", + "version": "${version}", + "mcversion": "${mc_version}", + "authors": [ + "aidancbrady" + ], + "credits": "", + "logoFile": "/defense_banner.png", + "screenshots": [], + "dependencies": ["Mekanism"] +} +] diff --git a/src/main/java/mekanism/defense/api/ExplosionEvent.java b/src/main/java/mekanism/defense/api/ExplosionEvent.java new file mode 100644 index 000000000..1058801f4 --- /dev/null +++ b/src/main/java/mekanism/defense/api/ExplosionEvent.java @@ -0,0 +1,124 @@ +package defense.api; + +import net.minecraft.entity.Entity; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import cpw.mods.fml.common.eventhandler.Cancelable; +import cpw.mods.fml.common.eventhandler.Event; + +/** Use ForgeSubscribe to subscribe to this event. This event is called every single time when a registered + * explosion happens. + * + * @author Calclavia */ +@Cancelable +public class ExplosionEvent extends Event +{ + /** The explosion object. Can be cast into {@link Explosion}. This event can be canceled to + * prevent a specific part of an explosion from being executed. */ + public World world; + public double x, y, z; + public IExplosion iExplosion; + + /** Pre-cast explosion class. */ + public Explosion explosion; + + public ExplosionEvent(World world, IExplosion iExplosion) + { + this.world = world; + this.iExplosion = iExplosion; + this.x = ((Explosion) iExplosion).explosionX; + this.y = ((Explosion) iExplosion).explosionY; + this.z = ((Explosion) iExplosion).explosionZ; + + if (this.iExplosion instanceof Explosion) + { + this.explosion = (Explosion) this.iExplosion; + } + } + + /** Called before an explosive is detonated or a missile is placed to check if detonation is + * possible. You may cancel and explosion here if needed. After this it will be a bit too late + * to prevent destruction without any losses. + * + * @author Calclavia */ + @Cancelable + public static class ExplosivePreDetonationEvent extends Event + { + /** The world object */ + public World world; + /** The entity causing the explosion. This could be null */ + public Entity entity; + /** The position in which the explosion might happen. */ + public double x, y, z; + /** The explosive object. */ + public IExplosive explosion; + /** The explosive type. */ + public ExplosiveType type; + + public ExplosivePreDetonationEvent(World world, double x, double y, double z, ExplosiveType type, IExplosive explosion) + { + this.world = world; + this.type = type; + this.explosion = explosion; + this.x = x; + this.y = y; + this.z = z; + } + + public ExplosivePreDetonationEvent(World world, Entity entity, ExplosiveType type, IExplosive explosion) + { + this.world = world; + this.entity = entity; + this.type = type; + this.explosion = explosion; + this.x = entity.posX; + this.y = entity.posY; + this.z = entity.posZ; + } + } + + /** Called when an explosion is constructed. + * + * @author Calclavia */ + public static class ExplosionConstructionEvent extends ExplosionEvent + { + public ExplosionConstructionEvent(World world, IExplosion explosion) + { + super(world, explosion); + } + } + + /** Called before an explosion happens. + * + * @author Calclavia */ + public static class PreExplosionEvent extends ExplosionEvent + { + public PreExplosionEvent(World world, IExplosion explosion) + { + super(world, explosion); + } + } + + /** Called while an explosion happens. May be called every single tick if explosion is + * procedural. (E.g: Red matter explosive) + * + * @author Calclavia */ + public static class DoExplosionEvent extends ExplosionEvent + { + public DoExplosionEvent(World world, IExplosion explosion) + { + super(world, explosion); + } + } + + /** Called after an explosion happens. + * + * @author Calclavia */ + public static class PostExplosionEvent extends ExplosionEvent + { + public PostExplosionEvent(World world, IExplosion explosion) + { + super(world, explosion); + } + } +} diff --git a/src/main/java/mekanism/defense/api/ExplosiveType.java b/src/main/java/mekanism/defense/api/ExplosiveType.java new file mode 100644 index 000000000..4ccbd823d --- /dev/null +++ b/src/main/java/mekanism/defense/api/ExplosiveType.java @@ -0,0 +1,24 @@ +package defense.api; + +public enum ExplosiveType +{ + ALL, + /** An explosive in TNT block form. */ + BLOCK, + /** An explosive in item form such as a grenade. */ + ITEM, + /** An explosive in aircraft form such as a missile. */ + AIR, + /** An explosive in vehicle form such as a minecart. */ + VEHICLE; + + public static ExplosiveType get(int id) + { + if (id >= 0 && id < ExplosiveType.values().length) + { + return ExplosiveType.values()[id]; + } + + return null; + } +} diff --git a/src/main/java/mekanism/defense/api/FrequencyGrid.java b/src/main/java/mekanism/defense/api/FrequencyGrid.java new file mode 100644 index 000000000..ebb85e7ea --- /dev/null +++ b/src/main/java/mekanism/defense/api/FrequencyGrid.java @@ -0,0 +1,168 @@ +package defense.api; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.WeakHashMap; + +import mekanism.api.Pos3D; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import cpw.mods.fml.common.FMLCommonHandler; + +/** + * A grid MFFS uses to search for machines with frequencies that can be linked and spread Fortron + * energy. + * + * @author Calclavia + * + */ +public class FrequencyGrid +{ + private static FrequencyGrid CLIENT_INSTANCE = new FrequencyGrid(); + private static FrequencyGrid SERVER_INSTANCE = new FrequencyGrid(); + + private final Set frequencyGrid = Collections.newSetFromMap(new WeakHashMap()); + + public void register(IBlockFrequency tileEntity) + { + synchronized(frequencyGrid) + { + try { + Iterator it = frequencyGrid.iterator(); + + while(it.hasNext()) + { + IBlockFrequency frequency = it.next(); + + if(frequency == null) + { + it.remove(); + continue; + } + + if(((TileEntity)frequency).isInvalid()) + { + it.remove(); + continue; + } + + if(new Pos3D((TileEntity)frequency).equals(new Pos3D((TileEntity)tileEntity))) + { + it.remove(); + continue; + } + } + } catch(Exception e) { + e.printStackTrace(); + } + + frequencyGrid.add(tileEntity); + } + } + + public void unregister(IBlockFrequency tileEntity) + { + synchronized(frequencyGrid) + { + frequencyGrid.remove(tileEntity); + cleanUp(); + } + } + + public Set get() + { + return frequencyGrid; + } + + /** + * Gets a list of TileEntities that has a specific frequency. + * + * @param frequency - The Frequency + * */ + public Set get(int frequency) + { + Set set = new HashSet(); + + for(IBlockFrequency tile : this.get()) + { + if(tile != null && !((TileEntity) tile).isInvalid()) + { + if(tile.getFrequency() == frequency) + { + set.add(tile); + } + } + } + + return set; + } + + public void cleanUp() + { + Set tilesToRemove = new HashSet(); + Iterator it = this.frequencyGrid.iterator(); + + while(it.hasNext()) + { + IBlockFrequency frequency = it.next(); + + if(frequency == null) + { + tilesToRemove.add(frequency); + continue; + } + + if(((TileEntity)frequency).isInvalid()) + { + tilesToRemove.add(frequency); + continue; + } + + if(((TileEntity)frequency).getWorldObj().getTileEntity(((TileEntity)frequency).xCoord, ((TileEntity)frequency).yCoord, ((TileEntity)frequency).zCoord) != ((TileEntity)frequency)) + { + tilesToRemove.add(frequency); + continue; + } + } + + for(IBlockFrequency tile : tilesToRemove) + { + unregister(tile); + } + } + + public Set get(World world, Pos3D position, int radius, int frequency) + { + Set set = new HashSet(); + + for(IBlockFrequency tileEntity : get(frequency)) + { + if(((TileEntity)tileEntity).getWorldObj() == world) + { + if(new Pos3D((TileEntity)tileEntity).distance(position) <= radius) + { + set.add(tileEntity); + } + } + } + + return set; + } + + /** + * Called to re-initiate the grid. Used when server restarts or when player rejoins a world to + * clean up previously registered objects. + */ + public static void reinitiate() + { + CLIENT_INSTANCE = new FrequencyGrid(); + SERVER_INSTANCE = new FrequencyGrid(); + } + + public static FrequencyGrid instance() + { + return FMLCommonHandler.instance().getEffectiveSide().isClient() ? CLIENT_INSTANCE : SERVER_INSTANCE; + } +} diff --git a/src/main/java/mekanism/defense/api/IAntiPoisonArmor.java b/src/main/java/mekanism/defense/api/IAntiPoisonArmor.java new file mode 100644 index 000000000..549d48bb5 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IAntiPoisonArmor.java @@ -0,0 +1,23 @@ +package defense.api; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +/** Apply this to all item armors and it will prevent the player from receiving a specific type of + * poison. */ +public interface IAntiPoisonArmor +{ + /** @itemStack - The item stack this armor is in. + * @type - The type of poison given to this entity + * @return - Returns true if this armor prevents poison from the player. */ + public boolean isProtectedFromPoison(ItemStack itemStack, EntityLivingBase entityLiving, String type); + + /** Called when this piece of armor protects a player from a specific poison. + * + * @itemStack - The item stack this armor is in. + * @type - The type of poison given to this entity */ + public void onProtectFromPoison(ItemStack itemStack, EntityLivingBase entityLiving, String type); + + /** Basically the slot on the entity of 0-3 */ + public int getArmorType(); +} diff --git a/src/main/java/mekanism/defense/api/IAntiPoisonBlock.java b/src/main/java/mekanism/defense/api/IAntiPoisonBlock.java new file mode 100644 index 000000000..02e492925 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IAntiPoisonBlock.java @@ -0,0 +1,11 @@ +package defense.api; + +import net.minecraft.world.World; + +public interface IAntiPoisonBlock +{ + /** Returns true if this armor prevents poison from passing through. + * + * @return */ + public boolean isPoisonPrevention(World par1World, int x, int y, int z, String type); +} diff --git a/src/main/java/mekanism/defense/api/IBlockFrequency.java b/src/main/java/mekanism/defense/api/IBlockFrequency.java new file mode 100644 index 000000000..486b16afd --- /dev/null +++ b/src/main/java/mekanism/defense/api/IBlockFrequency.java @@ -0,0 +1,22 @@ +package defense.api; + +/** + * Applied to all blocks that has a frequency. + * + * @author Calclavia + */ + +public interface IBlockFrequency +{ + /** + * @return The frequency of this object. + */ + public int getFrequency(); + + /** + * Sets the frequency + * + * @param frequency - The frequency of this object. + */ + public void setFrequency(int frequency); +} diff --git a/src/main/java/mekanism/defense/api/IEMPBlock.java b/src/main/java/mekanism/defense/api/IEMPBlock.java new file mode 100644 index 000000000..bcd3bece1 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IEMPBlock.java @@ -0,0 +1,16 @@ +package defense.api; + +import net.minecraft.world.World; + +/** Applied to all blocks that has a custom reaction to EMPs. Blocks not TileEntities. + * + * @author Calclavia */ +public interface IEMPBlock +{ + /** Called when this block gets attacked by EMP. + * + * @param world - The world object. + * @param position - The position. + * @param empExplosive - The explosion */ + public void onEMP(World world, int x, int y, int z, IExplosion empExplosive); +} diff --git a/src/main/java/mekanism/defense/api/IEMPItem.java b/src/main/java/mekanism/defense/api/IEMPItem.java new file mode 100644 index 000000000..1594418f4 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IEMPItem.java @@ -0,0 +1,17 @@ +package defense.api; + +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; + +/** Applied to all items that can be protected from EMP somehow. + * + * @author Calclavia */ +public interface IEMPItem +{ + /** Called when this item is being EMPed + * + * @param itemStack - The itemstack attacked by EMP + * @param entity - The entity holding the item + * @param empExplosives - The IExplosive object */ + public void onEMP(ItemStack itemStack, Entity entity, IExplosion empExplosive); +} diff --git a/src/main/java/mekanism/defense/api/IEntityExplosion.java b/src/main/java/mekanism/defense/api/IEntityExplosion.java new file mode 100644 index 000000000..e7d2b8334 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IEntityExplosion.java @@ -0,0 +1,9 @@ +package defense.api; + +/** An entity that is currently conducting an explosion. + * + * @author Calclavia */ +public interface IEntityExplosion +{ + public void endExplosion(); +} diff --git a/src/main/java/mekanism/defense/api/IExplosion.java b/src/main/java/mekanism/defense/api/IExplosion.java new file mode 100644 index 000000000..2df0703ea --- /dev/null +++ b/src/main/java/mekanism/defense/api/IExplosion.java @@ -0,0 +1,17 @@ +package defense.api; + +/** The actual explosion interface. Extends Explosion.java. + * + * @author Calclavia */ +public interface IExplosion +{ + /** Called to initiate the explosion. */ + public void explode(); + + /** @return The radius of effect of the explosion. */ + public float getRadius(); + + /** @return The energy emitted by this explosive. In Joules and approximately based off of a real + * life equivalent. */ + public long getEnergy(); +} diff --git a/src/main/java/mekanism/defense/api/IExplosive.java b/src/main/java/mekanism/defense/api/IExplosive.java new file mode 100644 index 000000000..f920ce86a --- /dev/null +++ b/src/main/java/mekanism/defense/api/IExplosive.java @@ -0,0 +1,60 @@ +package defense.api; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.Entity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; + +/** An interface used to find various types of explosive's information. + * + * @author Calclavia */ +public interface IExplosive extends ITier +{ + /** @return Gets the explosive's ID. */ + public int getID(); + + /** @return The unique name key in the language file. */ + public String getUnlocalizedName(); + + /** @return Gets the specific translated name of the block versions of the explosive. */ + public String getExplosiveName(); + + /** @return Gets the specific translated name of the grenade versions of the explosive. */ + public String getGrenadeName(); + + /** @return Gets the specific translated name of the missile versions of the explosive. */ + public String getMissileName(); + + /** @return Gets the specific translated name of the minecart versions of the explosive. */ + public String getMinecartName(); + + /** @return The tier of the explosive. */ + @Override + public int getTier(); + + /** Creates a new explosion at a given location. + * + * @param world The world in which the explosion takes place. + * @param x The X-Coord + * @param y The Y-Coord + * @param z The Z-Coord + * @param entity Entity that caused the explosion. */ + public void createExplosion(World world, double x, double y, double z, Entity entity); + + @SideOnly(Side.CLIENT) + public ModelBase getBlockModel(); + + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel(); + + @SideOnly(Side.CLIENT) + public ResourceLocation getBlockResource(); + + @SideOnly(Side.CLIENT) + public IIcon getIcon(); + +} diff --git a/src/main/java/mekanism/defense/api/IExplosiveContainer.java b/src/main/java/mekanism/defense/api/IExplosiveContainer.java new file mode 100644 index 000000000..a94452f12 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IExplosiveContainer.java @@ -0,0 +1,14 @@ +package defense.api; + +import net.minecraft.nbt.NBTTagCompound; + +/** An object that contains a reference to IExplosive. Carried by explosives, grenades and missile + * entities etc. + * + * @author Calclavia */ +public interface IExplosiveContainer +{ + public NBTTagCompound getTagCompound(); + + public IExplosive getExplosiveType(); +} diff --git a/src/main/java/mekanism/defense/api/IExplosiveIgnore.java b/src/main/java/mekanism/defense/api/IExplosiveIgnore.java new file mode 100644 index 000000000..8e4be5997 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IExplosiveIgnore.java @@ -0,0 +1,10 @@ +package defense.api; + + +/** Applied to entities that ignore the affects of a specific explosion. + * + * @author Calclavia */ +public interface IExplosiveIgnore +{ + public boolean canIgnore(IExplosion explosion); +} diff --git a/src/main/java/mekanism/defense/api/IItemFrequency.java b/src/main/java/mekanism/defense/api/IItemFrequency.java new file mode 100644 index 000000000..24b234826 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IItemFrequency.java @@ -0,0 +1,20 @@ +package defense.api; + +import net.minecraft.item.ItemStack; + +/** Applied to all items that has a frequency. + * + * @author Calclavia */ + +public interface IItemFrequency +{ + /** @param data - Pass an ItemStack if dealing with items with frequencies. + * @return The frequency of this object. */ + public int getFrequency(ItemStack itemStack); + + /** Sets the frequency + * + * @param frequency - The frequency of this object. + * @param data - Pass an ItemStack if dealing with items with frequencies. */ + public void setFrequency(int frequency, ItemStack itemStack); +} diff --git a/src/main/java/mekanism/defense/api/IItemTracker.java b/src/main/java/mekanism/defense/api/IItemTracker.java new file mode 100644 index 000000000..283a0f6b6 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IItemTracker.java @@ -0,0 +1,12 @@ +package defense.api; + +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IItemTracker +{ + public void setTrackingEntity(ItemStack itemStack, Entity entity); + + public Entity getTrackingEntity(World worldObj, ItemStack itemStack); +} diff --git a/src/main/java/mekanism/defense/api/ILauncherContainer.java b/src/main/java/mekanism/defense/api/ILauncherContainer.java new file mode 100644 index 000000000..478757d81 --- /dev/null +++ b/src/main/java/mekanism/defense/api/ILauncherContainer.java @@ -0,0 +1,14 @@ +package defense.api; + +import net.minecraft.inventory.IInventory; + +/** Applied to TileEntities that contains missiles within them. + * + * @author Calclavia */ +public interface ILauncherContainer extends IInventory +{ + /** Retrieves the launcher controller controlling this container. */ + public ILauncherController getController(); + + public void setContainingMissile(IMissile missile); +} diff --git a/src/main/java/mekanism/defense/api/ILauncherController.java b/src/main/java/mekanism/defense/api/ILauncherController.java new file mode 100644 index 000000000..ae88fecfb --- /dev/null +++ b/src/main/java/mekanism/defense/api/ILauncherController.java @@ -0,0 +1,39 @@ +package defense.api; + +import mekanism.api.Pos3D; +import net.minecraft.item.ItemStack; + +/** Applied to all launcher TileEntitiies that operates the launching of missiles. + * + * @author Calclavia */ +public interface ILauncherController +{ + /** What type of launcher is this? */ + public LauncherType getLauncherType(); + + /** Launches the missile into the specified target. */ + public void launch(); + + /** Can the launcher launch the missile? */ + public boolean canLaunch(); + + /** @return The status of the launcher. */ + public String getStatus(); + + /** @return The target of the launcher. */ + public Pos3D getTarget(); + + /** @param target Sets the target of the launcher */ + public void setTarget(Pos3D target); + + /** Places a missile into the launcher. */ + public void placeMissile(ItemStack itemStack); + + public IMissile getMissile(); + + public enum LauncherType + { + TRADITIONAL, + CRUISE + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/api/IMissile.java b/src/main/java/mekanism/defense/api/IMissile.java new file mode 100644 index 000000000..cf345cc06 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IMissile.java @@ -0,0 +1,38 @@ +package defense.api; + +import mekanism.api.Pos3D; + +/** This is an interface applied by all missile entities. You may cast this into an @Entity. The + * "set" version of the function will make the entity do the action on the next tick. + * + * @author Calclavia */ +public interface IMissile extends IExplosiveContainer +{ + /** Blows up this missile. It will detonate the missile with the appropriate explosion. */ + public void explode(); + + public void setExplode(); + + /** Blows up this missile like a TNT explosion. Small explosion used for events such as a missile + * crashing or failure to explode will result in this function being called. */ + public void normalExplode(); + + public void setNormalExplode(); + + /** Drops the specified missile as an item. */ + public void dropMissileAsItem(); + + /** The amount of ticks this missile has been flying for. Returns -1 if the missile is not + * flying. */ + public int getTicksInAir(); + + /** Gets the launcher this missile is launched from. */ + public ILauncherContainer getLauncher(); + + /** Launches the missile into a specific target. + * + * @param target */ + public void launch(Pos3D target); + + public void launch(Pos3D target, int height); +} diff --git a/src/main/java/mekanism/defense/api/IRadarDetectable.java b/src/main/java/mekanism/defense/api/IRadarDetectable.java new file mode 100644 index 000000000..cc3647d79 --- /dev/null +++ b/src/main/java/mekanism/defense/api/IRadarDetectable.java @@ -0,0 +1,22 @@ +package defense.api; + +import net.minecraft.tileentity.TileEntity; + +/** Make your TileEntity implement this to have special reaction to radar scanning. + * + * @author Calclavia */ +public interface IRadarDetectable +{ + /** + * Whether or not this TileEntity can be detected by radar. + * @param radar - the radar TileEntity + * @return if this TileEntity is detectable by radar + */ + public boolean canDetect(TileEntity radar); + + /** + * Gets the name displayed by a radar block's interface for this TileEntity + * @return this TileEntity's radar display name + */ + public String getRadarDisplayName(); +} diff --git a/src/main/java/mekanism/defense/api/ITarget.java b/src/main/java/mekanism/defense/api/ITarget.java new file mode 100644 index 000000000..8ec718cd4 --- /dev/null +++ b/src/main/java/mekanism/defense/api/ITarget.java @@ -0,0 +1,45 @@ +package defense.api; + +import mekanism.api.Pos3D; + +/** This should only be used to improve or restrict the targeting behavior of an entity. By default + * sentry guns and other automated tracking will target an entity. Especially if they use build in + * interfaces such as IMob from MC. As well IMissile is automatically tracked but it + * is recommended to use this to help targeting predict the position. The other use of this + * interface is to apply anti-targeting to an entity. For example canBeTargeted will prevent the + * entity from being target out right. As well predicted position can be used to trick missiles into + * missing. + * + * @author Darkguardsman */ +public interface ITarget +{ + /** Gets the predicted position of this entity after a specified amount of ticks. + * + * @param ticks - The amount of time. + * @return The predicted Vector, or if not predictable, the current position. */ + public Pos3D getPredictedPosition(int ticks); + + /** Can this be targeted by automated targeting systems or AIs. Used to implement radar jammers, + * cloaking devices, and other addons for the Entity being targeted + * + * @param entity - entity that is targeting this, can be an Entity, EntityLiving, or TileEntity + * @return true if it can */ + public boolean canBeTargeted(Object entity); + + /** Type of target */ + public TargetType getType(); + + public static enum TargetType + { + /** General air should only be applied to living entities */ + AIR, + /** Anything that is an instance of IMissile */ + MISSILE, + /** Flying machine that may or may not be piloted */ + PLANE, + /** Any living entity that walks or hovers on the ground */ + GROUND, + /** Causes all sentry types to target */ + ANY; + } +} diff --git a/src/main/java/mekanism/defense/api/ITier.java b/src/main/java/mekanism/defense/api/ITier.java new file mode 100644 index 000000000..fd738f257 --- /dev/null +++ b/src/main/java/mekanism/defense/api/ITier.java @@ -0,0 +1,17 @@ +package defense.api; + +/** This interface should be applied to all things that has a tier/level. + * + * @author Calclavia */ +public interface ITier +{ + /** Gets the tier of this object + * + * @return - The tier */ + public int getTier(); + + /** Sets the tier of the object + * + * @param tier - The tier to be set */ + public void setTier(int tier); +} diff --git a/src/main/java/mekanism/defense/api/RadarRegistry.java b/src/main/java/mekanism/defense/api/RadarRegistry.java new file mode 100644 index 000000000..9e611fc6f --- /dev/null +++ b/src/main/java/mekanism/defense/api/RadarRegistry.java @@ -0,0 +1,148 @@ +package defense.api; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +import defense.common.Vector2; +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; + +/** This class allows you to register TileEntities and Entities to be detectable by radar machinery. + * + * Make sure you unregister your object when it invalidates! + * + * @author Calclavia */ +public class RadarRegistry +{ + private static Set detectableTileEntities = new HashSet(); + private static Set detectableEntities = new HashSet(); + + public static void register(TileEntity tileEntity) + { + if (!detectableTileEntities.contains(tileEntity)) + { + detectableTileEntities.add(tileEntity); + } + } + + public static void unregister(TileEntity tileEntity) + { + if (detectableTileEntities.contains(tileEntity)) + { + detectableTileEntities.remove(tileEntity); + } + } + + public static void register(Entity entity) + { + if (!detectableEntities.contains(entity)) + { + detectableEntities.add(entity); + } + } + + public static void unregister(Entity entity) + { + if (detectableEntities.contains(entity)) + { + detectableEntities.remove(entity); + } + } + + public static List getTileEntitiesInArea(Vector2 minVector, Vector2 maxVector) + { + cleanUpArray(); + List returnArray = new ArrayList(); + + for (TileEntity tileEntity : detectableTileEntities) + { + Vector2 point = new Vector2(new Pos3D(tileEntity)); + + if ((point.x > minVector.x && point.x < maxVector.x) && (point.y > minVector.y && point.y < maxVector.y)) + { + returnArray.add(tileEntity); + } + } + + return returnArray; + } + + public static List getEntitiesWithinRadius(Vector2 vector, int radius) + { + cleanUpArray(); + List returnArray = new ArrayList(); + + for (Entity entity : detectableEntities) + { + if (Vector2.distance(vector, new Vector2(new Pos3D(entity))) <= radius) + { + returnArray.add(entity); + } + } + + return returnArray; + } + + public static Set getTileEntities() + { + cleanUpArray(); + return detectableTileEntities; + } + + public static Set getEntities() + { + cleanUpArray(); + return detectableEntities; + } + + public static void cleanUpArray() + { + try + { + Iterator it = detectableTileEntities.iterator(); + + while (it.hasNext()) + { + TileEntity tileEntity = it.next(); + + if (tileEntity == null) + { + it.remove(); + } + else if (tileEntity.isInvalid()) + { + it.remove(); + } + else if (tileEntity.getWorldObj().getTileEntity(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord) != tileEntity) + { + it.remove(); + } + } + + Iterator it2 = detectableEntities.iterator(); + + while (it2.hasNext()) + { + Entity entity = it2.next(); + + if (entity == null) + { + it2.remove(); + } + else if (entity.isDead) + { + it2.remove(); + } + } + } + catch (Exception e) + { + System.out.println("Failed to clean up radar list properly."); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/mekanism/defense/client/ClientPlayerTickHandler.java b/src/main/java/mekanism/defense/client/ClientPlayerTickHandler.java new file mode 100644 index 000000000..0a77fbd7f --- /dev/null +++ b/src/main/java/mekanism/defense/client/ClientPlayerTickHandler.java @@ -0,0 +1,39 @@ +package defense.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; +import defense.common.DefenseTechItems; + +public class ClientPlayerTickHandler +{ + @SubscribeEvent + public void onTick(PlayerTickEvent event) + { + if(event.phase == Phase.START) + { + try { + EntityPlayer player = (EntityPlayer)event.player; + + ItemStack currentItem = player.getCurrentEquippedItem(); + + if(currentItem != null && (player != Minecraft.getMinecraft().renderViewEntity || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0)) + { + if(currentItem.getItem() == DefenseTechItems.itemRocketLauncher) + { + if(player.getItemInUseCount() <= 0) + { + player.setItemInUse(currentItem, Integer.MAX_VALUE); + } + } + } + } catch (Exception e) { + System.out.println("Failed to tick properly."); + e.printStackTrace(); + } + } + } +} diff --git a/src/main/java/mekanism/defense/client/ClientProxy.java b/src/main/java/mekanism/defense/client/ClientProxy.java new file mode 100644 index 000000000..4ea365cb4 --- /dev/null +++ b/src/main/java/mekanism/defense/client/ClientProxy.java @@ -0,0 +1,305 @@ +package defense.client; + +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.particle.EffectRenderer; +import net.minecraft.client.particle.EntityDiggingFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.entity.RenderMinecart; +import net.minecraft.client.renderer.entity.RendererLivingEntity; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IItemFrequency; +import defense.client.gui.GuiCruiseLauncher; +import defense.client.gui.GuiEMPTower; +import defense.client.gui.GuiFrequency; +import defense.client.gui.GuiLauncherScreen; +import defense.client.gui.GuiRadarStation; +import defense.client.render.RenderUtils; +import defense.client.render.block.BlockRenderingHandler; +import defense.client.render.entity.RenderEntityExplosive; +import defense.client.render.entity.RenderExplosion; +import defense.client.render.entity.RenderGrenade; +import defense.client.render.entity.RenderLightBeam; +import defense.client.render.entity.RenderMissile; +import defense.client.render.item.RenderItemMachine; +import defense.client.render.item.RenderItemMissile; +import defense.client.render.item.RenderRocketLauncher; +import defense.client.render.particle.FXAntimatterPartical; +import defense.client.render.particle.FXElectricBolt; +import defense.client.render.particle.FXElectricBoltSpawner; +import defense.client.render.particle.FXEnderPortalPartical; +import defense.client.render.particle.FXShockWave; +import defense.client.render.particle.FXSmoke; +import defense.client.render.tile.RenderBombBlock; +import defense.client.render.tile.RenderCruiseLauncher; +import defense.client.render.tile.RenderEmpTower; +import defense.client.render.tile.RenderLauncherBase; +import defense.client.render.tile.RenderLauncherFrame; +import defense.client.render.tile.RenderLauncherScreen; +import defense.client.render.tile.RenderRadarStation; +import defense.common.CommonProxy; +import defense.common.DefenseTech; +import defense.common.DefenseTechBlocks; +import defense.common.DefenseTechItems; +import defense.common.entity.EntityBombCart; +import defense.common.entity.EntityExplosion; +import defense.common.entity.EntityExplosive; +import defense.common.entity.EntityFlyingBlock; +import defense.common.entity.EntityFragments; +import defense.common.entity.EntityGrenade; +import defense.common.entity.EntityLightBeam; +import defense.common.entity.EntityMissile; +import defense.common.entity.RenderEntityBlock; +import defense.common.entity.RenderShrapnel; +import defense.common.explosion.missile.MissileMovingSound; +import defense.common.potion.PoisonFrostBite; +import defense.common.tile.TileCruiseLauncher; +import defense.common.tile.TileEMPTower; +import defense.common.tile.TileExplosive; +import defense.common.tile.TileLauncherBase; +import defense.common.tile.TileLauncherFrame; +import defense.common.tile.TileLauncherScreen; +import defense.common.tile.TileRadarStation; + +@SideOnly(Side.CLIENT) +public class ClientProxy extends CommonProxy +{ + private boolean disableReflectionFX = false; + + @Override + public void preInit() + { + super.preInit(); + + FMLCommonHandler.instance().bus().register(new ClientPlayerTickHandler()); + FMLCommonHandler.instance().bus().register(new ClientTickHandler()); + } + + @Override + public void init() + { + super.init(); + + MinecraftForgeClient.registerItemRenderer(DefenseTechItems.itemRocketLauncher, new RenderRocketLauncher()); + MinecraftForgeClient.registerItemRenderer(DefenseTechItems.itemMissile, new RenderItemMissile()); + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(DefenseTechBlocks.blockMachine), new RenderItemMachine()); + + RenderingRegistry.registerEntityRenderingHandler(EntityFlyingBlock.class, new RenderEntityBlock()); + RenderingRegistry.registerEntityRenderingHandler(EntityFragments.class, new RenderShrapnel()); + RenderingRegistry.registerEntityRenderingHandler(EntityExplosive.class, new RenderEntityExplosive()); + RenderingRegistry.registerEntityRenderingHandler(EntityMissile.class, new RenderMissile(0.5F)); + RenderingRegistry.registerEntityRenderingHandler(EntityExplosion.class, new RenderExplosion()); + RenderingRegistry.registerEntityRenderingHandler(EntityLightBeam.class, new RenderLightBeam()); + RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderGrenade()); + RenderingRegistry.registerEntityRenderingHandler(EntityBombCart.class, new RenderMinecart()); + + RenderingRegistry.registerBlockHandler(new RenderBombBlock()); + RenderingRegistry.registerBlockHandler(new BlockRenderingHandler()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileCruiseLauncher.class, new RenderCruiseLauncher()); + ClientRegistry.bindTileEntitySpecialRenderer(TileLauncherBase.class, new RenderLauncherBase()); + ClientRegistry.bindTileEntitySpecialRenderer(TileLauncherScreen.class, new RenderLauncherScreen()); + ClientRegistry.bindTileEntitySpecialRenderer(TileLauncherFrame.class, new RenderLauncherFrame()); + ClientRegistry.bindTileEntitySpecialRenderer(TileRadarStation.class, new RenderRadarStation()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEMPTower.class, new RenderEmpTower()); + ClientRegistry.bindTileEntitySpecialRenderer(TileExplosive.class, new RenderBombBlock()); + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer entityPlayer, World world, int x, int y, int z) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(entityPlayer.inventory.getCurrentItem() != null && entityPlayer.inventory.getCurrentItem().getItem() instanceof IItemFrequency) + { + return new GuiFrequency(entityPlayer, entityPlayer.inventory.getCurrentItem()); + } + else if(tileEntity instanceof TileCruiseLauncher) + { + return new GuiCruiseLauncher(entityPlayer.inventory, (TileCruiseLauncher)tileEntity); + } + else if(tileEntity instanceof TileLauncherScreen) + { + return new GuiLauncherScreen(((TileLauncherScreen)tileEntity)); + } + else if(tileEntity instanceof TileRadarStation) + { + return new GuiRadarStation(((TileRadarStation)tileEntity)); + } + else if(tileEntity instanceof TileEMPTower) + { + return new GuiEMPTower((TileEMPTower)tileEntity); + } + + return null; + } + + @Override + public boolean isFancyGraphicsEnabled() + { + return Minecraft.getMinecraft().gameSettings.fancyGraphics; + } + + @Override + public int getParticleSetting() + { + return Minecraft.getMinecraft().gameSettings.particleSetting; + } + + @Override + public void spawnParticle(String name, World world, Pos3D position, double motionX, double motionY, double motionZ, float red, float green, float blue, float scale, double distance) + { + EntityFX fx = null; + + if (name.equals("smoke")) + { + fx = new FXSmoke(world, position, red, green, blue, scale, distance); + } + else if (name.equals("missile_smoke")) + { + fx = (new FXSmoke(world, position, red, green, blue, scale, distance)).setAge(100); + } + else if (name.equals("portal")) + { + fx = new FXEnderPortalPartical(world, position, red, green, blue, scale, distance); + } + else if (name.equals("antimatter")) + { + fx = new FXAntimatterPartical(world, position, red, green, blue, scale, distance); + } + else if (name.equals("digging")) + { + fx = new EntityDiggingFX(world, position.xPos, position.yPos, position.zPos, motionX, motionY, motionZ, Block.getBlockById((int)red), 0, (int) green); + fx.multipleParticleScaleBy(blue); + } + else if (name.equals("shockwave")) + { + fx = new FXShockWave(world, position, red, green, blue, scale, distance); + } + + if (fx != null) + { + fx.motionX = motionX; + fx.motionY = motionY; + fx.motionZ = motionZ; + FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx); + } + } + + @Override + public void spawnShock(World world, Pos3D startVec, Pos3D targetVec) + { + FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXElectricBolt(world, startVec, targetVec, 0)); + } + + @Override + public void spawnShock(World world, Pos3D startVec, Pos3D targetVec, int duration) + { + FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXElectricBoltSpawner(world, startVec, targetVec, 0, duration)); + } + + @Override + public void playSound(EntityMissile missile) + { + FMLClientHandler.instance().getClient().getSoundHandler().playSound(new MissileMovingSound(missile)); + } + + @Override + public List getEntityFXs() + { + if (!this.disableReflectionFX) + { + try + { + EffectRenderer renderer = Minecraft.getMinecraft().effectRenderer; + List[] fxLayers = (List[]) ReflectionHelper.getPrivateValue(EffectRenderer.class, renderer, 2); + + return fxLayers[0]; + } + catch (Exception e) + { + DefenseTech.LOGGER.severe("Failed to use relfection on entity effects."); + e.printStackTrace(); + this.disableReflectionFX = true; + } + } + return null; + } + + // TODO: Work on this! + // @ForgeSubscribe + public void renderingLivingEvent(Pre evt) + { + if (evt.entity instanceof EntityLivingBase) + { + if (evt.entity.getActivePotionEffect(PoisonFrostBite.INSTANCE) != null) + { + try + { + ModelBase modelBase = (ModelBase) ReflectionHelper.getPrivateValue(RendererLivingEntity.class, evt.renderer, 2); + + if (modelBase != null) + { + if (evt.entity.isInvisible()) + { + GL11.glDepthMask(false); + } + else + { + GL11.glDepthMask(true); + } + + float f1 = evt.entity.ticksExisted; + // this.bindTexture(evt.renderer.func_110829_a); + RenderUtils.setTerrainTexture(); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f2 = f1 * 0.01F; + float f3 = f1 * 0.01F; + GL11.glTranslatef(f2, f3, 0.0F); + GL11.glScalef(2, 2, 2); + evt.renderer.setRenderPassModel(modelBase); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_BLEND); + float f4 = 0.5F; + GL11.glColor4f(f4, f4, f4, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + modelBase.render(evt.entity, (float) evt.entity.posX, (float) evt.entity.posY, (float) evt.entity.posZ, evt.entity.rotationPitch, evt.entity.rotationYaw, 0.0625F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + } + } + catch (Exception e) + { + DefenseTech.LOGGER.severe("Failed to render entity layer object"); + e.printStackTrace(); + } + } + } + } +} diff --git a/src/main/java/mekanism/defense/client/ClientTickHandler.java b/src/main/java/mekanism/defense/client/ClientTickHandler.java new file mode 100644 index 000000000..9674837f3 --- /dev/null +++ b/src/main/java/mekanism/defense/client/ClientTickHandler.java @@ -0,0 +1,64 @@ +package defense.client; + +import mekanism.api.EnumColor; +import mekanism.api.MekanismConfig.general; +import mekanism.common.Version; +import mekanism.common.util.LangUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.util.ChatComponentText; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import defense.common.DefenseTech; +import defense.common.Reference; + +public class ClientTickHandler +{ + public static Minecraft mc = FMLClientHandler.instance().getClient(); + + public boolean hasNotified = false; + + @SubscribeEvent + public void onTick(ClientTickEvent event) + { + if(event.phase == Phase.START) + { + if(!hasNotified && mc.theWorld != null && DefenseTech.latestVersionNumber != null && DefenseTech.recentNews != null) + { + try { + if(general.updateNotifications) + { + if(!DefenseTech.latestVersionNumber.equals("null")) + { + if(Version.get(DefenseTech.latestVersionNumber).comparedState(DefenseTech.versionNumber) == 1) + { + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + Reference.CHAT_DESC + EnumColor.GREY + " -------------")); + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + " " + LangUtils.localize("update.outdated") + ".")); + + if(Version.get(DefenseTech.latestVersionNumber).comparedState(DefenseTech.versionNumber) == 1) + { + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.INDIGO + " " + Reference.NAME + ": " + EnumColor.DARK_RED + DefenseTech.versionNumber)); + } + + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + " " + LangUtils.localize("update.consider") + " " + EnumColor.DARK_GREY + DefenseTech.latestVersionNumber)); + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + " " + LangUtils.localize("update.newFeatures") + ": " + EnumColor.INDIGO + DefenseTech.recentNews)); + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + " " + LangUtils.localize("update.visit") + " " + EnumColor.DARK_GREY + "aidancbrady.com/defensetech" + EnumColor.GREY + " " + LangUtils.localize("update.toDownload") + ".")); + mc.thePlayer.addChatMessage(new ChatComponentText(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------")); + } + else if(Version.get(DefenseTech.latestVersionNumber).comparedState(DefenseTech.versionNumber) == -1) + { + mc.thePlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + " " + EnumColor.GREY + LangUtils.localize("update.devBuild") + " " + EnumColor.DARK_GREY + DefenseTech.versionNumber)); + } + } + else { + DefenseTech.LOGGER.info("Minecraft is in offline mode, could not check for updates."); + } + } + } catch(Exception e) {} + + hasNotified = true; + } + } + } +} diff --git a/src/main/java/mekanism/defense/client/gui/ConfigGuiFactory.java b/src/main/java/mekanism/defense/client/gui/ConfigGuiFactory.java new file mode 100644 index 000000000..c6f6eb5d9 --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/ConfigGuiFactory.java @@ -0,0 +1,34 @@ +package defense.client.gui; + +import java.util.Set; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import cpw.mods.fml.client.IModGuiFactory; + +public class ConfigGuiFactory implements IModGuiFactory +{ + @Override + public void initialize(Minecraft minecraftInstance) + { + + } + + @Override + public Class mainConfigGuiClass() + { + return GuiDefenseTechConfig.class; + } + + @Override + public Set runtimeGuiCategories() + { + return null; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) + { + return null; + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiBase.java b/src/main/java/mekanism/defense/client/gui/GuiBase.java new file mode 100644 index 000000000..8834d8f76 --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiBase.java @@ -0,0 +1,44 @@ +package defense.client.gui; + +import mekanism.common.inventory.container.ContainerNull; +import mekanism.common.tile.TileEntityContainerBlock; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import defense.common.Reference; + +public abstract class GuiBase extends GuiContainer +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_empty.png"); + + protected int containerWidth; + protected int containerHeight; + + private TileEntity tileEntity; + + public GuiBase() + { + super(new ContainerNull()); + } + + public GuiBase(TileEntityContainerBlock tile) + { + super(new ContainerNull(tile)); + tileEntity = tile; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + containerWidth = (width - xSize) / 2; + containerHeight = (height - ySize) / 2; + drawTexturedModalRect(containerWidth, containerHeight, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiContainerBase.java b/src/main/java/mekanism/defense/client/gui/GuiContainerBase.java new file mode 100644 index 000000000..999be1157 --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiContainerBase.java @@ -0,0 +1,115 @@ +package defense.client.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import defense.common.Reference; + +public abstract class GuiContainerBase extends GuiContainer +{ + public static final ResourceLocation GUI_EMPTY_TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_container.png"); + public static final ResourceLocation GUI_COMPONENTS = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_components.png"); + + public ResourceLocation baseTexture; + + protected int containerWidth; + protected int containerHeight; + + public GuiContainerBase(Container container) + { + super(container); + this.baseTexture = GUI_EMPTY_TEXTURE; + } + + protected void drawSlot(int x, int y, ItemStack itemStack) + { + this.mc.renderEngine.bindTexture(this.baseTexture); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + this.drawTexturedModalRect(this.containerWidth + x, this.containerHeight + y, 0, 0, 18, 18); + + this.drawItemStack(itemStack, this.containerWidth + x, this.containerHeight + y); + } + + protected void drawSlot(int x, int y, GuiSlotType type, float r, float g, float b) + { + this.mc.renderEngine.bindTexture(GUI_COMPONENTS); + GL11.glColor4f(r, g, b, 1.0F); + + this.drawTexturedModalRect(this.containerWidth + x, this.containerHeight + y, 0, 0, 18, 18); + + if (type != GuiSlotType.NONE) + { + this.drawTexturedModalRect(this.containerWidth + x, this.containerHeight + y, 0, 18 * type.ordinal(), 18, 18); + } + } + + protected void drawSlot(int x, int y) + { + this.drawSlot(x, y, GuiSlotType.NONE); + } + + protected void drawSlot(int x, int y, GuiSlotType type) + { + this.drawSlot(x, y, type, 1, 1, 1); + } + + protected void drawItemStack(ItemStack itemStack, int x, int y) + { + x += 1; + y += 1; + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + + // drawTexturedModelRectFromIcon + // GL11.glEnable(GL11.GL_BLEND); + // GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.renderEngine, itemStack, x, y); + // GL11.glDisable(GL11.GL_BLEND); + } + + protected void drawBar(int x, int y, float scale) + { + this.mc.renderEngine.bindTexture(GUI_COMPONENTS); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + /** Draw background progress bar/ */ + this.drawTexturedModalRect(this.containerWidth + x, this.containerHeight + y, 18, 0, 22, 15); + + if (scale > 0) + { + /** Draw white color actual progress. */ + this.drawTexturedModalRect(this.containerWidth + x, this.containerHeight + y, 18, 15, 22 - (int) (scale * 22), 15); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + + this.mc.renderEngine.bindTexture(this.baseTexture); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + this.drawTexturedModalRect(this.containerWidth, this.containerHeight, 0, 0, this.xSize, this.ySize); + } + + public enum GuiSlotType + { + NONE, + BATTERY, + LIQUID, + ARR_UP, + ARR_DOWN, + ARR_LEFT, + ARR_RIGHT, + ARR_UP_RIGHT, + ARR_UP_LEFT, + ARR_DOWN_LEFT, + ARR_DOWN_RIGHT + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiCruiseLauncher.java b/src/main/java/mekanism/defense/client/gui/GuiCruiseLauncher.java new file mode 100644 index 000000000..951488fec --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiCruiseLauncher.java @@ -0,0 +1,178 @@ +package defense.client.gui; + +import java.util.ArrayList; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import mekanism.common.Mekanism; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import defense.common.Reference; +import defense.common.inventory.container.ContainerCruiseLauncher; +import defense.common.tile.TileCruiseLauncher; + +public class GuiCruiseLauncher extends GuiContainer +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_cruise_launcher.png"); + + private TileCruiseLauncher tileEntity; + private GuiTextField textFieldX; + private GuiTextField textFieldZ; + private GuiTextField textFieldY; + private GuiTextField textFieldFreq; + + private int containerWidth; + private int containerHeight; + + public GuiCruiseLauncher(InventoryPlayer par1InventoryPlayer, TileCruiseLauncher tileEntity) + { + super(new ContainerCruiseLauncher(par1InventoryPlayer, tileEntity)); + this.tileEntity = tileEntity; + } + + @Override + public void initGui() + { + super.initGui(); + this.textFieldX = new GuiTextField(fontRendererObj, 20, 21, 35, 12); + this.textFieldY = new GuiTextField(fontRendererObj, 20, 37, 35, 12); + this.textFieldZ = new GuiTextField(fontRendererObj, 20, 52, 35, 12); + this.textFieldFreq = new GuiTextField(fontRendererObj, 70, 33, 35, 12); + this.textFieldFreq.setMaxStringLength(4); + this.textFieldX.setMaxStringLength(6); + this.textFieldZ.setMaxStringLength(6); + this.textFieldY.setMaxStringLength(6); + + this.textFieldFreq.setText(this.tileEntity.getFrequency() + ""); + + if (this.tileEntity.getTarget() == null) + { + this.textFieldX.setText(Math.round(this.tileEntity.xCoord) + ""); + this.textFieldZ.setText(Math.round(this.tileEntity.zCoord) + ""); + this.textFieldY.setText(Math.round(this.tileEntity.yCoord) + ""); + } + else + { + this.textFieldX.setText(Math.round(this.tileEntity.getTarget().xPos) + ""); + this.textFieldZ.setText(Math.round(this.tileEntity.getTarget().zPos) + ""); + this.textFieldY.setText(Math.round(this.tileEntity.getTarget().yPos) + ""); + } + } + + @Override + public void keyTyped(char par1, int par2) + { + super.keyTyped(par1, par2); + this.textFieldX.textboxKeyTyped(par1, par2); + this.textFieldZ.textboxKeyTyped(par1, par2); + this.textFieldY.textboxKeyTyped(par1, par2); + this.textFieldFreq.textboxKeyTyped(par1, par2); + + try + { + Pos3D newTarget = new Pos3D(Integer.parseInt(this.textFieldX.getText()), Integer.parseInt(this.textFieldY.getText()), Integer.parseInt(this.textFieldZ.getText())); + this.tileEntity.setTarget(newTarget); + + ArrayList data = new ArrayList(); + + data.add(2); + data.add((int)tileEntity.getTarget().xPos); + data.add((int)tileEntity.getTarget().yPos); + data.add((int)tileEntity.getTarget().zPos); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + catch (NumberFormatException e) + { + } + + try + { + short newFrequency = (short) Math.max(Short.parseShort(this.textFieldFreq.getText()), 0); + this.tileEntity.setFrequency(newFrequency); + + ArrayList data = new ArrayList(); + + data.add(1); + data.add(tileEntity.getFrequency()); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + catch (NumberFormatException e) + { + } + } + + /** Args: x, y, buttonClicked */ + @Override + public void mouseClicked(int par1, int par2, int par3) + { + super.mouseClicked(par1, par2, par3); + this.textFieldX.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + this.textFieldZ.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + this.textFieldY.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + this.textFieldFreq.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + } + + /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) + { + this.fontRendererObj.drawString("\u00a77" + tileEntity.getInventoryName(), 52, 6, 4210752); + + this.fontRendererObj.drawString(LangUtils.localize("gui.misc.x"), 8, 23, 4210752); + this.fontRendererObj.drawString(LangUtils.localize("gui.misc.y"), 8, 39, 4210752); + this.fontRendererObj.drawString(LangUtils.localize("gui.misc.z"), 8, 54, 4210752); + + this.fontRendererObj.drawString(LangUtils.localize("gui.misc.freq"), 70, 20, 4210752); + + this.textFieldX.drawTextBox(); + this.textFieldZ.drawTextBox(); + this.textFieldY.drawTextBox(); + this.textFieldFreq.drawTextBox(); + + this.fontRendererObj.drawString(this.tileEntity.getStatus(), 70, 50, 4210752); + //voltage + this.fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(this.tileEntity.getEnergy()) + "/" + MekanismUtils.getEnergyDisplay(this.tileEntity.getMaxEnergy()), 70, 70, 4210752); + + this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + /** Draw the background layer for the GuiContainer (everything behind the items) */ + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + containerWidth = (this.width - this.xSize) / 2; + containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); + } + + @Override + public void updateScreen() + { + super.updateScreen(); + + if (!this.textFieldX.isFocused()) + this.textFieldX.setText(Math.round(this.tileEntity.getTarget().xPos) + ""); + if (!this.textFieldZ.isFocused()) + this.textFieldZ.setText(Math.round(this.tileEntity.getTarget().zPos) + ""); + if (!this.textFieldY.isFocused()) + this.textFieldY.setText(Math.round(this.tileEntity.getTarget().yPos) + ""); + if (!this.textFieldFreq.isFocused()) + this.textFieldFreq.setText(this.tileEntity.getFrequency() + ""); + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiDefenseTechConfig.java b/src/main/java/mekanism/defense/client/gui/GuiDefenseTechConfig.java new file mode 100644 index 000000000..5cfa84d7a --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiDefenseTechConfig.java @@ -0,0 +1,66 @@ +package defense.client.gui; + +import java.util.ArrayList; +import java.util.List; + +import mekanism.common.util.LangUtils; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.config.ConfigElement; +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.client.config.DummyConfigElement.DummyCategoryElement; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.GuiConfigEntries; +import cpw.mods.fml.client.config.GuiConfigEntries.CategoryEntry; +import cpw.mods.fml.client.config.IConfigElement; +import defense.common.Reference; +import defense.common.Settings; + +public class GuiDefenseTechConfig extends GuiConfig +{ + public GuiDefenseTechConfig(GuiScreen parent) + { + super(parent, getConfigElements(), Reference.NAME, false, false, Reference.NAME); + } + + private static List getConfigElements() + { + List list = new ArrayList(); + list.add(new DummyCategoryElement(LangUtils.localize("defensetech.configgui.ctgy.general"), "defensetech.configgui.ctgy.general", GeneralEntry.class)); + list.add(new DummyCategoryElement(LangUtils.localize("defensetech.configgui.ctgy.explosives"), "defensetech.configgui.ctgy.explosives", ExplosivesEntry.class)); + return list; + } + + public static class GeneralEntry extends CategoryEntry + { + public GeneralEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop); + } + + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(owningScreen, + new ConfigElement(Settings.CONFIGURATION.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), + owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false, + GuiConfig.getAbridgedConfigPath(Settings.CONFIGURATION.toString())); + } + } + + public static class ExplosivesEntry extends CategoryEntry + { + public ExplosivesEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop) + { + super(owningScreen, owningEntryList, prop); + } + + @Override + protected GuiScreen buildChildScreen() + { + return new GuiConfig(owningScreen, + new ConfigElement(Settings.CONFIGURATION.getCategory("explosives")).getChildElements(), + owningScreen.modID, Configuration.CATEGORY_GENERAL, false, false, + GuiConfig.getAbridgedConfigPath(Settings.CONFIGURATION.toString())); + } + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiEMPTower.java b/src/main/java/mekanism/defense/client/gui/GuiEMPTower.java new file mode 100644 index 000000000..c7071c8a8 --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiEMPTower.java @@ -0,0 +1,177 @@ +package defense.client.gui; + +import java.util.ArrayList; + +import mekanism.api.Coord4D; +import mekanism.common.Mekanism; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import defense.common.Reference; +import defense.common.tile.TileEMPTower; + +public class GuiEMPTower extends GuiBase +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_empty.png"); + + private TileEMPTower tileEntity; + private GuiTextField textFieldBanJing; + + private int containerWidth; + private int containerHeight; + + public GuiEMPTower(TileEMPTower tileEntity) + { + super(tileEntity); + this.tileEntity = tileEntity; + this.ySize = 166; + } + + /** Adds the buttons (and other controls) to the screen in question. */ + @Override + public void initGui() + { + super.initGui(); + this.buttonList.clear(); + + this.buttonList.add(new GuiButton(0, this.width / 2 - 77, this.height / 2 - 10, 50, 20, LangUtils.localize("gui.empTower.missiles"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 25, this.height / 2 - 10, 65, 20, LangUtils.localize("gui.empTower.elec"))); + this.buttonList.add(new GuiButton(2, this.width / 2 + 43, this.height / 2 - 10, 35, 20, LangUtils.localize("gui.empTower.both"))); + + this.textFieldBanJing = new GuiTextField(fontRendererObj, 72, 28, 30, 12); + this.textFieldBanJing.setMaxStringLength(3); + this.textFieldBanJing.setText(this.tileEntity.empRadius + ""); + } + + /** Fired when a control is clicked. This is the equivalent of + * ActionListener.actionPerformed(ActionEvent e). */ + @Override + protected void actionPerformed(GuiButton par1GuiButton) + { + switch (par1GuiButton.id) + { + case 0: + this.tileEntity.empMode = 1; + break; + case 1: + this.tileEntity.empMode = 2; + break; + case 2: + this.tileEntity.empMode = 0; + break; + } + + ArrayList data = new ArrayList(); + + data.add(2); + data.add(tileEntity.empMode); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + + /** Call this method from you GuiScreen to process the keys into textbox. */ + @Override + public void keyTyped(char par1, int par2) + { + super.keyTyped(par1, par2); + this.textFieldBanJing.textboxKeyTyped(par1, par2); + + try + { + int radius = Math.min(Math.max(Integer.parseInt(this.textFieldBanJing.getText()), 10), TileEMPTower.MAX_RADIUS); + this.tileEntity.empRadius = radius; + + ArrayList data = new ArrayList(); + + data.add(1); + data.add(tileEntity.empRadius); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + catch (NumberFormatException e) + { + + } + } + + /** Args: x, y, buttonClicked */ + @Override + public void mouseClicked(int x, int y, int par3) + { + super.mouseClicked(x, y, par3); + this.textFieldBanJing.mouseClicked(x - containerWidth, y - containerHeight, par3); + } + + /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString("\u00a77" + LangUtils.localize("gui.empTower.name"), 65, 6, 4210752); + + this.fontRendererObj.drawString(LangUtils.localize("gui.empTower.radius").replaceAll("%p", " "), 12, 30, 4210752); + this.textFieldBanJing.drawTextBox(); + + this.fontRendererObj.drawString(LangUtils.localize("gui.empTower.effect"), 12, 55, 4210752); + + // Shows the EMP mode of the EMP Tower + String mode = LangUtils.localize("gui.empTower.effectDebilitate"); + + if (this.tileEntity.empMode == 1) + { + mode = LangUtils.localize("gui.empTower.effectDisrupt"); + } + else if (this.tileEntity.empMode == 2) + { + mode = LangUtils.localize("gui.empTower.effectDeplete"); + } + + this.fontRendererObj.drawString(LangUtils.localize("gui.empTower.mode") + " " + mode, 12, 105, 4210752); + + // Shows the status of the EMP Tower + String color = "\u00a74"; + String status = LangUtils.localize("gui.misc.idle"); + + if (tileEntity.getEnergy() < tileEntity.energyToUse) + { + status = LangUtils.localize("gui.misc.nopower"); + } + else + { + color = "\u00a72"; + status = LangUtils.localize("gui.empTower.ready"); + } + + this.fontRendererObj.drawString(color + LangUtils.localize("gui.misc.status") + " " + status, 12, 120, 4210752); + //voltage + this.fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()) + "/" + MekanismUtils.getEnergyDisplay(this.tileEntity.getMaxEnergy()), 12, 150, 4210752); + } + + /** Draw the background layer for the GuiContainer (everything behind the items) */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + containerWidth = (this.width - this.xSize) / 2; + containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); + } + + @Override + public void updateScreen() + { + super.updateScreen(); + + if (!this.textFieldBanJing.isFocused()) + this.textFieldBanJing.setText(this.tileEntity.empRadius + ""); + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiFrequency.java b/src/main/java/mekanism/defense/client/gui/GuiFrequency.java new file mode 100644 index 000000000..d865f079a --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiFrequency.java @@ -0,0 +1,110 @@ + package defense.client.gui; + +import java.util.ArrayList; + +import mekanism.common.util.LangUtils; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import defense.api.IItemFrequency; +import defense.common.DefenseTech; +import defense.common.Reference; +import defense.common.network.PacketItem.ItemMessage; + +public class GuiFrequency extends GuiBase +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_empty.png"); + + private ItemStack itemStack; + + private GuiTextField textFieldFrequency; + + private int containerWidth; + private int containerHeight; + private EntityPlayer player; + + public GuiFrequency(EntityPlayer player, ItemStack par1ItemStack) + { + this.player = player; + this.itemStack = par1ItemStack; + this.ySize = 166; + } + + /** Adds the buttons (and other controls) to the screen in question. */ + @Override + public void initGui() + { + super.initGui(); + + this.textFieldFrequency = new GuiTextField(fontRendererObj, 80, 50, 40, 12); + this.textFieldFrequency.setMaxStringLength(4); + + if (itemStack != null) + { + this.textFieldFrequency.setText(((IItemFrequency) this.itemStack.getItem()).getFrequency(this.itemStack) + ""); + } + } + + /** Call this method from you GuiScreen to process the keys into textbox. */ + @Override + public void keyTyped(char par1, int par2) + { + super.keyTyped(par1, par2); + this.textFieldFrequency.textboxKeyTyped(par1, par2); + + try + { + int newFrequency = Math.max(0, Integer.parseInt(this.textFieldFrequency.getText())); + this.textFieldFrequency.setText(newFrequency + ""); + + if (((IItemFrequency) this.itemStack.getItem()).getFrequency(this.itemStack) != newFrequency) + { + ((IItemFrequency) this.itemStack.getItem()).setFrequency(newFrequency, this.itemStack); + + ArrayList data = new ArrayList(); + data.add(newFrequency); + + DefenseTech.netHandler.sendToServer(new ItemMessage(data)); + } + } + catch (NumberFormatException e) + { + } + } + + /** Args: x, y, buttonClicked */ + @Override + public void mouseClicked(int par1, int par2, int par3) + { + super.mouseClicked(par1, par2, par3); + this.textFieldFrequency.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + } + + /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString("\u00a77" + LangUtils.localize("gui.tracker.freq"), 62, 6, 4210752); + this.fontRendererObj.drawString(LangUtils.localize("gui.tracker.freq") + ":", 15, 52, 4210752); + this.textFieldFrequency.drawTextBox(); + } + + /** Draw the background layer for the GuiContainer (everything behind the items) */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + this.containerWidth = (this.width - this.xSize) / 2; + this.containerHeight = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(containerWidth, containerHeight, 0, 0, this.xSize, this.ySize); + } + +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiLauncherScreen.java b/src/main/java/mekanism/defense/client/gui/GuiLauncherScreen.java new file mode 100644 index 000000000..06ad2cf4d --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiLauncherScreen.java @@ -0,0 +1,246 @@ +package defense.client.gui; + +import java.util.ArrayList; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import mekanism.common.Mekanism; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import defense.common.Reference; +import defense.common.tile.TileLauncherScreen; + +public class GuiLauncherScreen extends GuiBase +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_empty.png"); + + private TileLauncherScreen tileEntity; + private GuiTextField target_xCoord_field; + private GuiTextField target_yCoord_field; + private GuiTextField target_zCoord_field; + private GuiTextField target_freq_field; + private GuiTextField target_height_field; + + private int containerWidth; + private int containerHeight; + + public GuiLauncherScreen(TileLauncherScreen tile) + { + super(tile); + tileEntity = tile; + ySize = 166; + } + + /** Adds the buttons (and other controls) to the screen in question. */ + @Override + public void initGui() + { + super.initGui(); + target_xCoord_field = new GuiTextField(fontRendererObj, 110, 37, 45, 12); + target_zCoord_field = new GuiTextField(fontRendererObj, 110, 52, 45, 12); + target_yCoord_field = new GuiTextField(fontRendererObj, 110, 67, 45, 12); + target_height_field = new GuiTextField(fontRendererObj, 110, 82, 45, 12); + target_freq_field = new GuiTextField(fontRendererObj, 110, 97, 45, 12); + + target_freq_field.setMaxStringLength(4); + target_xCoord_field.setMaxStringLength(6); + target_zCoord_field.setMaxStringLength(6); + target_yCoord_field.setMaxStringLength(3); + target_height_field.setMaxStringLength(3); + + target_freq_field.setText(tileEntity.getFrequency() + ""); + target_height_field.setText(tileEntity.facing + ""); + + if(tileEntity.getTarget() == null) + { + target_xCoord_field.setText(Math.round(tileEntity.xCoord) + ""); + target_zCoord_field.setText(Math.round(tileEntity.zCoord) + ""); + target_yCoord_field.setText("0"); + } + else { + target_xCoord_field.setText(Math.round(tileEntity.getTarget().xPos) + ""); + target_zCoord_field.setText(Math.round(tileEntity.getTarget().zPos) + ""); + target_yCoord_field.setText(Math.round(tileEntity.getTarget().yPos) + ""); + } + } + + /** Call this method from you GuiScreen to process the keys into textbox. */ + @Override + public void keyTyped(char par1, int par2) + { + super.keyTyped(par1, par2); + + target_xCoord_field.textboxKeyTyped(par1, par2); + target_zCoord_field.textboxKeyTyped(par1, par2); + + if(tileEntity.getTier() >= 1) + { + target_yCoord_field.textboxKeyTyped(par1, par2); + target_height_field.textboxKeyTyped(par1, par2); + + if(tileEntity.getTier() > 1) + { + target_freq_field.textboxKeyTyped(par1, par2); + } + } + + try { + Pos3D newTarget = new Pos3D(Integer.parseInt(target_xCoord_field.getText()), Math.max(Integer.parseInt(target_yCoord_field.getText()), 0), Integer.parseInt(target_zCoord_field.getText())); + + tileEntity.setTarget(newTarget); + + ArrayList data = new ArrayList(); + + data.add(2); + data.add((int)tileEntity.getTarget().xPos); + data.add((int)tileEntity.getTarget().yPos); + data.add((int)tileEntity.getTarget().zPos); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } catch (NumberFormatException e) {} + + try { + short newFrequency = (short)Math.max(Short.parseShort(target_freq_field.getText()), 0); + + tileEntity.setFrequency(newFrequency); + + ArrayList data = new ArrayList(); + + data.add(1); + data.add(tileEntity.getFrequency()); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } catch(NumberFormatException e) {} + + try { + short newHeight = (short)Math.max(Math.min(Short.parseShort(target_height_field.getText()), Short.MAX_VALUE), 3); + + tileEntity.launchHeight = newHeight; + + ArrayList data = new ArrayList(); + + data.add(3); + data.add(tileEntity.launchHeight); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } catch(NumberFormatException e) {} + } + + /** Args: x, y, buttonClicked */ + @Override + public void mouseClicked(int par1, int par2, int par3) + { + super.mouseClicked(par1, par2, par3); + + target_xCoord_field.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + target_zCoord_field.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + + if(tileEntity.getTier() >= 1) + { + target_yCoord_field.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + target_height_field.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + + if(tileEntity.getTier() > 1) + { + target_freq_field.mouseClicked(par1 - containerWidth, par2 - containerHeight, par3); + } + } + } + + /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + target_xCoord_field.drawTextBox(); + target_zCoord_field.drawTextBox(); + + // Draw the air detonation GUI + if(tileEntity.getTier() >= 1) + { + target_yCoord_field.drawTextBox(); + fontRendererObj.drawString(LangUtils.localize("gui.launcherScreen.detHeight"), 12, 68, 4210752); + + target_height_field.drawTextBox(); + fontRendererObj.drawString(LangUtils.localize("gui.launcherScreen.lockHeight"), 12, 83, 4210752); + + if(tileEntity.getTier() > 1) + { + target_freq_field.drawTextBox(); + fontRendererObj.drawString(LangUtils.localize("gui.misc.freq"), 12, 98, 4210752); + } + } + + fontRendererObj.drawString("", 45, 6, 4210752); + fontRendererObj.drawString("\u00a77" + LangUtils.localize("gui.launcherScreen.name"), 30, 6, 4210752); + + fontRendererObj.drawString(LangUtils.localize("gui.launcherScreen.target"), 12, 25, 4210752); + fontRendererObj.drawString(LangUtils.localize("gui.misc.XCoord"), 25, 40, 4210752); + fontRendererObj.drawString(LangUtils.localize("gui.misc.ZCoord"), 25, 55, 4210752); + + int inaccuracy = 30; + + if(tileEntity.launcherBase != null) + { + if(tileEntity.launcherBase.supportFrame != null) + { + inaccuracy = tileEntity.launcherBase.supportFrame.getInaccuracy(); + } + } + + fontRendererObj.drawString(LangUtils.localize("gui.launcherScreen.inaccuracy").replaceAll("%p", "" + inaccuracy), 12, 113, 4210752); + + // Shows the status of the missile launcher + fontRendererObj.drawString(LangUtils.localize("gui.misc.status") + " " + tileEntity.getStatus(), 12, 125, 4210752); + //voltage + fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()) + "/" + MekanismUtils.getEnergyDisplay(tileEntity.getMaxEnergy()), 12, 150, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + containerWidth = (width - xSize) / 2; + containerHeight = (height - ySize) / 2; + drawTexturedModalRect(containerWidth, containerHeight, 0, 0, xSize, ySize); + } + + @Override + public void updateScreen() + { + super.updateScreen(); + + if(!target_xCoord_field.isFocused()) + { + target_xCoord_field.setText(Math.round(tileEntity.getTarget().xPos) + ""); + } + + if(!target_zCoord_field.isFocused()) + { + target_zCoord_field.setText(Math.round(tileEntity.getTarget().zPos) + ""); + } + + if(!target_yCoord_field.isFocused()) + { + target_yCoord_field.setText(Math.round(tileEntity.getTarget().yPos) + ""); + } + + if(!target_height_field.isFocused()) + { + target_height_field.setText(tileEntity.launchHeight + ""); + } + + if(!target_freq_field.isFocused()) + { + target_freq_field.setText(tileEntity.getFrequency() + ""); + } + } +} diff --git a/src/main/java/mekanism/defense/client/gui/GuiRadarStation.java b/src/main/java/mekanism/defense/client/gui/GuiRadarStation.java new file mode 100644 index 000000000..54ab55ef3 --- /dev/null +++ b/src/main/java/mekanism/defense/client/gui/GuiRadarStation.java @@ -0,0 +1,322 @@ +package defense.client.gui; + +import java.util.ArrayList; +import java.util.List; + +import mekanism.api.Coord4D; +import mekanism.common.Mekanism; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.util.LangUtils; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import defense.common.Rectangle; +import defense.common.Reference; +import defense.common.Vector2; +import defense.common.block.BlockMachine; +import defense.common.entity.EntityMissile; +import defense.common.tile.TileRadarStation; + +public class GuiRadarStation extends GuiBase +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "gui_radar.png"); + public static final ResourceLocation TEXTURE_RED_DOT = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "reddot.png"); + public static final ResourceLocation TEXTURE_YELLOW_DOT = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "yellowdot.png"); + public static final ResourceLocation TEXTURE_WHITE_DOT = new ResourceLocation(Reference.DOMAIN, Reference.GUI_PATH + "whitedot.png"); + private TileRadarStation tileEntity; + + private int containerPosX; + private int containerPosY; + + private GuiTextField textFieldAlarmRange; + private GuiTextField textFieldSafetyZone; + private GuiTextField textFieldFrequency; + + private List missileCoords = new ArrayList(); + + private Vector2 mouseOverCoords = new Vector2(); + private Vector2 mousePosition = new Vector2(); + + // Radar Map + private Vector2 radarCenter; + private float radarMapRadius; + + private String info = ""; + + private String info2; + + public GuiRadarStation(TileRadarStation tileEntity) + { + this.tileEntity = tileEntity; + mouseOverCoords = new Vector2(this.tileEntity.xCoord, this.tileEntity.zCoord); + ySize = 166; + xSize = 256; + radarCenter = new Vector2(this.containerPosX + this.xSize / 3 - 14, this.containerPosY + this.ySize / 2 + 4); + radarMapRadius = TileRadarStation.MAX_DETECTION_RANGE / 63.8F; + } + + @Override + public void initGui() + { + super.initGui(); + + this.textFieldSafetyZone = new GuiTextField(fontRendererObj, 210, 67, 30, 12); + this.textFieldSafetyZone.setMaxStringLength(3); + this.textFieldSafetyZone.setText(this.tileEntity.safetyRange + ""); + + this.textFieldAlarmRange = new GuiTextField(fontRendererObj, 210, 82, 30, 12); + this.textFieldAlarmRange.setMaxStringLength(3); + this.textFieldAlarmRange.setText(this.tileEntity.alarmRange + ""); + + this.textFieldFrequency = new GuiTextField(fontRendererObj, 155, 112, 50, 12); + this.textFieldFrequency.setMaxStringLength(6); + this.textFieldFrequency.setText(this.tileEntity.getFrequency() + ""); + } + + /** Draw the foreground layer for the GuiContainer (everything in front of the items) */ + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + this.fontRendererObj.drawString("\u00a77" + tileEntity.getInventoryName(), this.xSize / 2 - 30, 6, 4210752); + + this.fontRendererObj.drawString(LangUtils.localize("gui.radar.coords"), 155, 18, 4210752); + this.fontRendererObj.drawString(LangUtils.localize("gui.misc.x") + " " + (int) Math.round(mouseOverCoords.x) + " " + LangUtils.localize("gui.misc.z") + " " + (int) Math.round(mouseOverCoords.y), 155, 30, 4210752); + + this.fontRendererObj.drawString("\u00a76" + this.info, 155, 42, 4210752); + this.fontRendererObj.drawString("\u00a74" + this.info2, 155, 54, 4210752); + + this.fontRendererObj.drawString(LangUtils.localize("gui.radar.zoneSafe"), 152, 70, 4210752); + this.textFieldSafetyZone.drawTextBox(); + this.fontRendererObj.drawString(LangUtils.localize("gui.radar.zoneAlarm"), 150, 85, 4210752); + this.textFieldAlarmRange.drawTextBox(); + + this.fontRendererObj.drawString(LangUtils.localize("gui.misc.freq"), 155, 100, 4210752); + this.textFieldFrequency.drawTextBox(); + + // Shows the status of the radar + String color = "\u00a74"; + String status = LangUtils.localize("gui.misc.idle"); + + if (this.tileEntity.getEnergy() >= tileEntity.ENERGY_USAGE) + { + color = "\u00a72"; + status = LangUtils.localize("gui.radar.on"); + } + else + { + status = LangUtils.localize("gui.radar.nopower"); + } + + //TODO energy + this.fontRendererObj.drawString(color + status, 155, 150, 4210752); + } + + /** Call this method from you GuiScreen to process the keys into textbox. */ + @Override + public void keyTyped(char par1, int par2) + { + super.keyTyped(par1, par2); + this.textFieldSafetyZone.textboxKeyTyped(par1, par2); + this.textFieldAlarmRange.textboxKeyTyped(par1, par2); + this.textFieldFrequency.textboxKeyTyped(par1, par2); + + try + { + int newSafetyRadius = Math.min(TileRadarStation.MAX_DETECTION_RANGE, Math.max(0, Integer.parseInt(this.textFieldSafetyZone.getText()))); + this.tileEntity.safetyRange = newSafetyRadius; + + ArrayList data = new ArrayList(); + + data.add(2); + data.add(tileEntity.safetyRange); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + catch (NumberFormatException e) + { + } + + try + { + int newAlarmRadius = Math.min(TileRadarStation.MAX_DETECTION_RANGE, Math.max(0, Integer.parseInt(this.textFieldAlarmRange.getText()))); + this.tileEntity.alarmRange = newAlarmRadius; + + ArrayList data = new ArrayList(); + + data.add(3); + data.add(tileEntity.alarmRange); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + catch (NumberFormatException e) + { + } + + try + { + this.tileEntity.setFrequency(Integer.parseInt(this.textFieldFrequency.getText())); + + ArrayList data = new ArrayList(); + + data.add(4); + data.add(tileEntity.getFrequency()); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data)); + } + catch (NumberFormatException e) + { + } + + } + + /** Args: x, y, buttonClicked */ + @Override + public void mouseClicked(int par1, int par2, int par3) + { + super.mouseClicked(par1, par2, par3); + this.textFieldAlarmRange.mouseClicked(par1 - containerPosX, par2 - containerPosY, par3); + this.textFieldSafetyZone.mouseClicked(par1 - containerPosX, par2 - containerPosY, par3); + this.textFieldFrequency.mouseClicked(par1 - containerPosX, par2 - containerPosY, par3); + } + + /** Draw the background layer for the GuiContainer (everything behind the items) */ + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + this.containerPosX = (this.width - this.xSize) / 2; + this.containerPosY = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(containerPosX, containerPosY, 0, 0, this.xSize, this.ySize); + + this.radarCenter = new Vector2(this.containerPosX + this.xSize / 3 - 10, this.containerPosY + this.ySize / 2 + 4); + this.radarMapRadius = TileRadarStation.MAX_DETECTION_RANGE / 71f; + + this.info = ""; + this.info2 = ""; + + if (this.tileEntity.getEnergy() >= tileEntity.ENERGY_USAGE) + { + int range = 4; + + for (Entity entity : this.tileEntity.detectedEntities) + { + Vector2 position = new Vector2(radarCenter.x + (entity.posX - this.tileEntity.xCoord) / this.radarMapRadius, radarCenter.y - (entity.posZ - this.tileEntity.zCoord) / this.radarMapRadius); + + if (entity instanceof EntityMissile) + { + if (this.tileEntity.isMissileGoingToHit((EntityMissile) entity)) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_RED_DOT); + } + else + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_YELLOW_DOT); + } + } + else + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_YELLOW_DOT); + } + + this.drawTexturedModalRect(position.intX(), position.intY(), 0, 0, 2, 2); + + // Hover Detection + Vector2 minPosition = position.clone(); + minPosition.add(-range); + Vector2 maxPosition = position.clone(); + maxPosition.add(range); + + if (new Rectangle(minPosition, maxPosition).isIn(this.mousePosition)) + { + this.info = entity.getCommandSenderName(); + + if (entity instanceof EntityPlayer) + { + this.info = "\u00a71" + this.info; + } + + if (entity instanceof EntityMissile) + { + if (((EntityMissile) entity).targetVector != null) + { + this.info2 = "(" + (int)((EntityMissile) entity).targetVector.xPos + ", " + (int)((EntityMissile) entity).targetVector.zPos + ")"; + } + } + } + } + + range = 2; + + for (TileEntity jiQi : this.tileEntity.detectedTiles) + { + Vector2 position = new Vector2(this.radarCenter.x + (jiQi.xCoord - this.tileEntity.xCoord) / this.radarMapRadius, this.radarCenter.y - (jiQi.zCoord - this.tileEntity.zCoord) / this.radarMapRadius); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_WHITE_DOT); + + this.drawTexturedModalRect(position.intX(), position.intY(), 0, 0, 2, 2); + + Vector2 minPosition = position.clone(); + minPosition.add(-range); + Vector2 maxPosition = position.clone(); + maxPosition.add(range); + + if (new Rectangle(minPosition, maxPosition).isIn(this.mousePosition)) + { + if (jiQi.getBlockType() != null) + { + if (jiQi.getBlockType() instanceof BlockMachine) + { + this.info = BlockMachine.getJiQiMing(jiQi); + } + else + { + this.info = jiQi.getBlockType().getLocalizedName(); + } + } + } + } + } + } + + @Override + public void updateScreen() + { + super.updateScreen(); + + if (Mouse.isInsideWindow()) + { + if (Mouse.getEventButton() == -1) + { + this.mousePosition = new Vector2(Mouse.getEventX() * this.width / this.mc.displayWidth, this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1); + + float difference = TileRadarStation.MAX_DETECTION_RANGE / this.radarMapRadius; + + if (this.mousePosition.x > this.radarCenter.x - difference && this.mousePosition.x < this.radarCenter.x + difference && this.mousePosition.y > this.radarCenter.y - difference && this.mousePosition.y < this.radarCenter.y + difference) + { + // Calculate from the mouse position the relative position + // on the grid + int xDifference = (int) (this.mousePosition.x - this.radarCenter.x); + int yDifference = (int) (this.mousePosition.y - this.radarCenter.y); + int xBlockDistance = (int) (xDifference * this.radarMapRadius); + int yBlockDistance = (int) (yDifference * this.radarMapRadius); + + this.mouseOverCoords = new Vector2(this.tileEntity.xCoord + xBlockDistance, this.tileEntity.zCoord - yBlockDistance); + } + } + } + + if (!this.textFieldSafetyZone.isFocused()) + this.textFieldSafetyZone.setText(this.tileEntity.safetyRange + ""); + if (!this.textFieldAlarmRange.isFocused()) + this.textFieldAlarmRange.setText(this.tileEntity.alarmRange + ""); + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelAntiGravitationalMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelAntiGravitationalMissile.java new file mode 100644 index 000000000..f898b6979 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelAntiGravitationalMissile.java @@ -0,0 +1,112 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelAntiGravitationalMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape7; + ModelRenderer Shape8; + ModelRenderer Shape9; + + public ModelAntiGravitationalMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(0F, 0F, 0F, 6, 70, 6); + Shape1.setRotationPoint(-3F, -46F, -3F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 25, 0); + Shape2.addBox(0F, 0F, 0F, 2, 5, 18); + Shape2.setRotationPoint(-1F, 19F, -9F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 25, 25); + Shape3.addBox(0F, 0F, 0F, 18, 5, 2); + Shape3.setRotationPoint(-9F, 19F, -1F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 25, 65); + Shape4.addBox(0F, 0F, 0F, 12, 12, 2); + Shape4.setRotationPoint(-6F, -40F, -1F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 25, 40); + Shape5.addBox(0F, 0F, 0F, 2, 12, 12); + Shape5.setRotationPoint(-1F, -40F, -6F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 0, 80); + Shape6.addBox(0F, 0F, 0F, 10, 15, 10); + Shape6.setRotationPoint(-5F, 9F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 0, 106); + Shape7.addBox(0F, 0F, 0F, 8, 7, 8); + Shape7.setRotationPoint(-4F, -53F, -4F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 70, 0); + Shape8.addBox(0F, 0F, 0F, 4, 4, 4); + Shape8.setRotationPoint(0F, -54F, 0F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, -0.7853982F, 0F, 0.6108652F); + Shape9 = new ModelRenderer(this, 70, 10); + Shape9.addBox(-1F, 0F, -1F, 2, 5, 2); + Shape9.setRotationPoint(0F, -55F, 0F); + Shape9.setTextureSize(128, 128); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + Shape7.render(f5); + Shape8.render(f5); + Shape9.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelAntiMissileMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelAntiMissileMissile.java new file mode 100644 index 000000000..130474be2 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelAntiMissileMissile.java @@ -0,0 +1,264 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelAntiMissileMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2a; + ModelRenderer Shape2b; + ModelRenderer Shape2c; + ModelRenderer Shape3d; + ModelRenderer Shape3; + ModelRenderer Shape3a; + ModelRenderer Shape3b; + ModelRenderer Shape4; + ModelRenderer Shape4a; + ModelRenderer Shape4b; + ModelRenderer Shape4c; + ModelRenderer Shape5; + ModelRenderer Shape5a; + ModelRenderer Shape4d; + ModelRenderer Shape4e; + ModelRenderer Shape4f; + ModelRenderer Shape4g; + ModelRenderer Shape6; + ModelRenderer Shape6a; + ModelRenderer Shape7a; + ModelRenderer Shape7; + ModelRenderer Shape8; + ModelRenderer Shape8a; + ModelRenderer Shape8b; + ModelRenderer Shape8c; + ModelRenderer Shape8d; + + public ModelAntiMissileMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, 0F, -4F, 8, 64, 8); + Shape1.setRotationPoint(0F, -40F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 34, 19); + Shape2.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2.setRotationPoint(-7F, 14F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2a = new ModelRenderer(this, 34, 19); + Shape2a.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2a.setRotationPoint(-7F, 14F, -7F); + Shape2a.setTextureSize(128, 128); + Shape2a.mirror = true; + setRotation(Shape2a, 0F, 0F, 0F); + Shape2b = new ModelRenderer(this, 34, 31); + Shape2b.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2b.setRotationPoint(-7F, 14F, -6F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0F, 0F, 0F); + Shape2c = new ModelRenderer(this, 34, 31); + Shape2c.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2c.setRotationPoint(6F, 14F, -6F); + Shape2c.setTextureSize(128, 128); + Shape2c.mirror = true; + setRotation(Shape2c, 0F, 0F, 0F); + Shape3d = new ModelRenderer(this, 72, 0); + Shape3d.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3d.setRotationPoint(0F, 12F, 0F); + Shape3d.setTextureSize(128, 128); + Shape3d.mirror = true; + setRotation(Shape3d, 0F, 0.7853982F, 0F); + Shape3 = new ModelRenderer(this, 72, 0); + Shape3.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3.setRotationPoint(0F, 12F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, -0.7853982F, 0F); + Shape3a = new ModelRenderer(this, 34, 0); + Shape3a.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3a.setRotationPoint(0F, 12F, 0F); + Shape3a.setTextureSize(128, 128); + Shape3a.mirror = true; + setRotation(Shape3a, 0F, 0.7853982F, 0.7853982F); + Shape3b = new ModelRenderer(this, 34, 0); + Shape3b.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3b.setRotationPoint(0F, 12F, 0F); + Shape3b.setTextureSize(128, 128); + Shape3b.mirror = true; + setRotation(Shape3b, 0F, -0.7853982F, 0.7853982F); + Shape4 = new ModelRenderer(this, 22, 74); + Shape4.addBox(0F, 0F, 0F, 2, 7, 5); + Shape4.setRotationPoint(-1F, -23F, 4F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, -0.5235988F, 0F, 0F); + Shape4a = new ModelRenderer(this, 0, 103); + Shape4a.addBox(0F, 0F, 0F, 5, 8, 2); + Shape4a.setRotationPoint(4F, -23F, -1F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, 0F, 0F, 0.5235988F); + Shape4b = new ModelRenderer(this, 0, 81); + Shape4b.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4b.setRotationPoint(0F, -35F, -4F); + Shape4b.setTextureSize(128, 128); + Shape4b.mirror = true; + setRotation(Shape4b, -0.5235988F, 3.141593F, 0F); + Shape4c = new ModelRenderer(this, 0, 103); + Shape4c.addBox(0F, 0F, -1F, 5, 8, 2); + Shape4c.setRotationPoint(-4F, -23F, 0F); + Shape4c.setTextureSize(128, 128); + Shape4c.mirror = true; + setRotation(Shape4c, 0F, 3.141593F, 0.5235988F); + Shape5 = new ModelRenderer(this, 0, 74); + Shape5.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5.setRotationPoint(0F, -32F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape5a = new ModelRenderer(this, 0, 74); + Shape5a.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5a.setRotationPoint(0F, -32F, 0F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 1.570796F, 0F); + Shape4d = new ModelRenderer(this, 22, 74); + Shape4d.addBox(-1F, 0F, 0F, 2, 8, 5); + Shape4d.setRotationPoint(0F, -23F, -4F); + Shape4d.setTextureSize(128, 128); + Shape4d.mirror = true; + setRotation(Shape4d, -0.5235988F, 3.141593F, 0F); + Shape4e = new ModelRenderer(this, 0, 81); + Shape4e.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4e.setRotationPoint(0F, -35F, 4F); + Shape4e.setTextureSize(128, 128); + Shape4e.mirror = true; + setRotation(Shape4e, -0.5235988F, 0F, 0F); + Shape4f = new ModelRenderer(this, 0, 74); + Shape4f.addBox(0F, 0F, -1F, 5, 4, 2); + Shape4f.setRotationPoint(-4F, -35F, 0F); + Shape4f.setTextureSize(128, 128); + Shape4f.mirror = true; + setRotation(Shape4f, 0F, 3.141593F, 0.5235988F); + Shape4g = new ModelRenderer(this, 0, 74); + Shape4g.addBox(0F, 0F, 0F, 5, 4, 2); + Shape4g.setRotationPoint(4F, -35F, -1F); + Shape4g.setTextureSize(128, 128); + Shape4g.mirror = true; + setRotation(Shape4g, 0F, 0F, 0.5235988F); + Shape6 = new ModelRenderer(this, 72, 16); + Shape6.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6.setRotationPoint(-5F, -37F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 72, 16); + Shape6a.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6a.setRotationPoint(-5F, -41F, -5F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape7a = new ModelRenderer(this, 72, 29); + Shape7a.addBox(0F, 0F, 0F, 8, 4, 8); + Shape7a.setRotationPoint(-4F, -45F, -4F); + Shape7a.setTextureSize(128, 128); + Shape7a.mirror = true; + setRotation(Shape7a, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 72, 43); + Shape7.addBox(0F, 0F, 0F, 6, 2, 6); + Shape7.setRotationPoint(-3F, -47F, -3F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 63, 33); + Shape8.addBox(0F, 0F, 0F, 2, 2, 2); + Shape8.setRotationPoint(2F, -46F, -1F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, -0.7853982F); + Shape8a = new ModelRenderer(this, 63, 33); + Shape8a.addBox(0F, 0F, 0F, 2, 2, 2); + Shape8a.setRotationPoint(-5F, -46F, -1F); + Shape8a.setTextureSize(128, 128); + Shape8a.mirror = true; + setRotation(Shape8a, 0F, 0F, -0.7853982F); + Shape8b = new ModelRenderer(this, 63, 33); + Shape8b.addBox(0F, 0F, 0F, 2, 2, 2); + Shape8b.setRotationPoint(-1F, -46F, 2F); + Shape8b.setTextureSize(128, 128); + Shape8b.mirror = true; + setRotation(Shape8b, 0.7853982F, 0F, 0F); + Shape8c = new ModelRenderer(this, 63, 33); + Shape8c.addBox(0F, 0F, 0F, 2, 2, 2); + Shape8c.setRotationPoint(-1F, -46F, -5F); + Shape8c.setTextureSize(128, 128); + Shape8c.mirror = true; + setRotation(Shape8c, 0.7853982F, 0F, 0F); + Shape8d = new ModelRenderer(this, 72, 53); + Shape8d.addBox(0F, 0F, 0F, 4, 2, 4); + Shape8d.setRotationPoint(-2F, -49F, -2F); + Shape8d.setTextureSize(128, 128); + Shape8d.mirror = true; + setRotation(Shape8d, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape2a.render(f5); + Shape2b.render(f5); + Shape2c.render(f5); + Shape3d.render(f5); + Shape3.render(f5); + Shape3a.render(f5); + Shape3b.render(f5); + Shape4.render(f5); + Shape4a.render(f5); + Shape4b.render(f5); + Shape4c.render(f5); + Shape5.render(f5); + Shape5a.render(f5); + Shape4d.render(f5); + Shape4e.render(f5); + Shape4f.render(f5); + Shape4g.render(f5); + Shape6.render(f5); + Shape6a.render(f5); + Shape7a.render(f5); + Shape7.render(f5); + Shape8.render(f5); + Shape8a.render(f5); + Shape8b.render(f5); + Shape8c.render(f5); + Shape8d.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelAntimatterMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelAntimatterMissile.java new file mode 100644 index 000000000..609117286 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelAntimatterMissile.java @@ -0,0 +1,265 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelAntimatterMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape36; + ModelRenderer Shape4a; + ModelRenderer Shape5a; + ModelRenderer Shape6a; + ModelRenderer Shape6b; + ModelRenderer Shape6c; + ModelRenderer Shape6d; + ModelRenderer Shape6e; + ModelRenderer Shape6f; + ModelRenderer Shape6g; + ModelRenderer Shape6h; + ModelRenderer Shape7; + ModelRenderer Shape8; + ModelRenderer Shape9; + ModelRenderer Shape10a; + ModelRenderer Shape10b; + ModelRenderer Shape10c; + ModelRenderer Shape10d; + ModelRenderer Shape11a; + ModelRenderer Shape11b; + ModelRenderer Shape2e; + ModelRenderer Shape12; + ModelRenderer Shape13; + ModelRenderer Shape14; + + public ModelAntimatterMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 27, 0); + Shape1.addBox(0F, 0F, 0F, 8, 10, 14); + Shape1.setRotationPoint(-8F, 14F, -2F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0.7853982F, 0F); + Shape2 = new ModelRenderer(this, 27, 0); + Shape2.addBox(0F, 0F, 0F, 8, 10, 14); + Shape2.setRotationPoint(2F, 14F, -8F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, -0.7853982F, 0F); + Shape3 = new ModelRenderer(this, 36, 47); + Shape3.addBox(0F, 0F, 0F, 21, 11, 2); + Shape3.setRotationPoint(-8F, 13F, 7F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0.7853982F, 0F); + Shape4 = new ModelRenderer(this, 36, 47); + Shape4.addBox(0F, 0F, 0F, 21, 11, 2); + Shape4.setRotationPoint(-7F, 13F, -8F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, -0.7853982F, 0F); + Shape36 = new ModelRenderer(this, 0, 0); + Shape36.addBox(0F, 0F, 0F, 6, 40, 6); + Shape36.setRotationPoint(-3F, -26F, -3F); + Shape36.setTextureSize(128, 128); + Shape36.mirror = true; + setRotation(Shape36, 0F, 0F, 0F); + Shape4a = new ModelRenderer(this, 27, 25); + Shape4a.addBox(0F, 0F, 0F, 10, 10, 10); + Shape4a.setRotationPoint(-5F, 4F, -5F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, 0F, 0F, 0F); + Shape5a = new ModelRenderer(this, 72, 31); + Shape5a.addBox(0F, 0F, 0F, 8, 4, 8); + Shape5a.setRotationPoint(-4F, -30F, -4F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 89, 8); + Shape6a.addBox(0F, 0F, 0F, 2, 5, 1); + Shape6a.setRotationPoint(-1F, -35F, 3F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape6b = new ModelRenderer(this, 89, 8); + Shape6b.addBox(0F, 0F, 0F, 1, 5, 2); + Shape6b.setRotationPoint(3F, -35F, -1F); + Shape6b.setTextureSize(128, 128); + Shape6b.mirror = true; + setRotation(Shape6b, 0F, 0F, 0F); + Shape6c = new ModelRenderer(this, 89, 8); + Shape6c.addBox(0F, 0F, 0F, 1, 5, 2); + Shape6c.setRotationPoint(-4F, -35F, -1F); + Shape6c.setTextureSize(128, 128); + Shape6c.mirror = true; + setRotation(Shape6c, 0F, 0F, 0F); + Shape6d = new ModelRenderer(this, 89, 8); + Shape6d.addBox(0F, 0F, 0F, 2, 5, 1); + Shape6d.setRotationPoint(-1F, -35F, -4F); + Shape6d.setTextureSize(128, 128); + Shape6d.mirror = true; + setRotation(Shape6d, 0F, 0F, 0F); + Shape6e = new ModelRenderer(this, 103, 8); + Shape6e.addBox(0F, 0F, 0F, 1, 5, 2); + Shape6e.setRotationPoint(-2F, -39F, -1F); + Shape6e.setTextureSize(128, 128); + Shape6e.mirror = true; + setRotation(Shape6e, 0F, 0F, 0.4014257F); + Shape6f = new ModelRenderer(this, 103, 8); + Shape6f.addBox(0F, 0F, 0F, 1, 5, 2); + Shape6f.setRotationPoint(1F, -39F, -1F); + Shape6f.setTextureSize(128, 128); + Shape6f.mirror = true; + setRotation(Shape6f, 0F, 0F, -0.4014257F); + Shape6g = new ModelRenderer(this, 96, 8); + Shape6g.addBox(0F, 0F, 0F, 2, 5, 1); + Shape6g.setRotationPoint(-1F, -39F, -2F); + Shape6g.setTextureSize(128, 128); + Shape6g.mirror = true; + setRotation(Shape6g, -0.4014257F, 0F, 0F); + Shape6h = new ModelRenderer(this, 96, 8); + Shape6h.addBox(0F, 0F, 0F, 2, 5, 1); + Shape6h.setRotationPoint(-1F, -39F, 1F); + Shape6h.setTextureSize(128, 128); + Shape6h.mirror = true; + setRotation(Shape6h, 0.4014257F, 0F, 0F); + Shape7 = new ModelRenderer(this, 110, 0); + Shape7.addBox(0F, 0F, 0F, 4, 1, 4); + Shape7.setRotationPoint(-2F, -40F, -2F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 110, 19); + Shape8.addBox(0F, 0F, 0F, 4, 5, 4); + Shape8.setRotationPoint(-2F, -35F, -2F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape9 = new ModelRenderer(this, 110, 8); + Shape9.addBox(0F, 0F, 0F, 2, 8, 2); + Shape9.setRotationPoint(-1F, -43F, -1F); + Shape9.setTextureSize(128, 128); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + Shape10a = new ModelRenderer(this, 72, 8); + Shape10a.addBox(0F, 0F, 0F, 6, 6, 2); + Shape10a.setRotationPoint(8F, -23F, 1F); + Shape10a.setTextureSize(128, 128); + Shape10a.mirror = true; + // Wing 1 + setRotation(Shape10a, 0F, -3.141593F, 0.7853982F); + Shape10b = new ModelRenderer(this, 72, 17); + Shape10b.addBox(0F, 0F, 0F, 2, 6, 6); + Shape10b.setRotationPoint(-1F, -23F, -8F); + Shape10b.setTextureSize(128, 128); + Shape10b.mirror = true; + setRotation(Shape10b, 0.7853982F, 0F, 0F); + Shape10c = new ModelRenderer(this, 72, 8); + Shape10c.addBox(0F, 0F, 0F, 6, 6, 2); + Shape10c.setRotationPoint(-8F, -23F, -1F); + Shape10c.setTextureSize(128, 128); + Shape10c.mirror = true; + setRotation(Shape10c, 0F, 0F, -0.7853982F); + Shape10d = new ModelRenderer(this, 72, 8); + Shape10d.addBox(0F, 0F, 0F, 6, 6, 2); + Shape10d.setRotationPoint(-1F, -23F, 8F); + Shape10d.setTextureSize(128, 128); + Shape10d.mirror = true; + // Wing 2 + setRotation(Shape10d, 0F, 1.570796F, -0.7853982F); + Shape11a = new ModelRenderer(this, 72, 0); + Shape11a.addBox(0F, 0F, 0F, 16, 5, 2); + Shape11a.setRotationPoint(-8F, -23F, -1F); + Shape11a.setTextureSize(128, 128); + Shape11a.mirror = true; + setRotation(Shape11a, 0F, 0F, 0F); + Shape11b = new ModelRenderer(this, 72, 0); + Shape11b.addBox(0F, 0F, 0F, 16, 5, 2); + Shape11b.setRotationPoint(-1F, -23F, 8F); + Shape11b.setTextureSize(128, 128); + Shape11b.mirror = true; + setRotation(Shape11b, 0F, 1.570796F, 0F); + Shape2e = new ModelRenderer(this, 0, 103); + Shape2e.addBox(0F, 0F, 0F, 16, 10, 4); + Shape2e.setRotationPoint(-8F, 14F, -2F); + Shape2e.setTextureSize(128, 128); + Shape2e.mirror = true; + setRotation(Shape2e, 0F, 0F, 0F); + Shape12 = new ModelRenderer(this, 0, 76); + Shape12.addBox(0F, 0F, 0F, 4, 10, 16); + Shape12.setRotationPoint(-2F, 14F, -8F); + Shape12.setTextureSize(128, 128); + Shape12.mirror = true; + setRotation(Shape12, 0F, 0F, 0F); + Shape13 = new ModelRenderer(this, 0, 47); + Shape13.addBox(0F, 0F, 0F, 3, 14, 14); + Shape13.setRotationPoint(6F, 13F, -8F); + Shape13.setTextureSize(128, 128); + Shape13.mirror = true; + setRotation(Shape13, 0.7853982F, -0.7853982F, 0F); + Shape14 = new ModelRenderer(this, 0, 47); + Shape14.addBox(0F, 0F, 0F, 3, 14, 14); + Shape14.setRotationPoint(8F, 13F, 6F); + Shape14.setTextureSize(128, 128); + Shape14.mirror = true; + setRotation(Shape14, 0.7853982F, -2.356194F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape36.render(f5); + Shape4a.render(f5); + Shape5a.render(f5); + Shape6a.render(f5); + Shape6b.render(f5); + Shape6c.render(f5); + Shape6d.render(f5); + Shape6e.render(f5); + Shape6f.render(f5); + Shape6g.render(f5); + Shape6h.render(f5); + Shape7.render(f5); + Shape8.render(f5); + Shape9.render(f5); + Shape10a.render(f5); + Shape10b.render(f5); + Shape10c.render(f5); + Shape10d.render(f5); + Shape11a.render(f5); + Shape11b.render(f5); + Shape2e.render(f5); + Shape12.render(f5); + Shape13.render(f5); + Shape14.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelAnvilMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelAnvilMissile.java new file mode 100644 index 000000000..e9b7e5089 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelAnvilMissile.java @@ -0,0 +1,391 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelAnvilMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelAnvilMissile() + { + int textureX = 32; + int textureY = 128; + + bodyModel = new ModelRendererTurbo[68]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 19, textureX, textureY); // Import Box0 + bodyModel[4] = new ModelRendererTurbo(this, 0, 19, textureX, textureY); // Import Box1 + bodyModel[5] = new ModelRendererTurbo(this, 0, 19, textureX, textureY); // Import Box2 + bodyModel[6] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Import Box3 + bodyModel[7] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Import Box4 + bodyModel[8] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Import Box5 + bodyModel[9] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Import Box6 + bodyModel[10] = new ModelRendererTurbo(this, 10, 47, textureX, textureY); // Import Box7 + bodyModel[11] = new ModelRendererTurbo(this, 0, 47, textureX, textureY); // Import Box8 + bodyModel[12] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Import Box9 + bodyModel[13] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Import Box10 + bodyModel[14] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Import Box11 + bodyModel[15] = new ModelRendererTurbo(this, 0, 58, textureX, textureY); // Import Box12 + bodyModel[16] = new ModelRendererTurbo(this, 0, 58, textureX, textureY); // Import Box13 + bodyModel[17] = new ModelRendererTurbo(this, 0, 58, textureX, textureY); // Import Box14 + bodyModel[18] = new ModelRendererTurbo(this, 0, 63, textureX, textureY); // Import Box15 + bodyModel[19] = new ModelRendererTurbo(this, 0, 63, textureX, textureY); // Import Box16 + bodyModel[20] = new ModelRendererTurbo(this, 0, 63, textureX, textureY); // Import Box17 + bodyModel[21] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box21 + bodyModel[22] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box22 + bodyModel[23] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box23 + bodyModel[24] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box24 + bodyModel[25] = new ModelRendererTurbo(this, 0, 75, textureX, textureY); // Box 0 + bodyModel[26] = new ModelRendererTurbo(this, 0, 78, textureX, textureY); // Box 1 + bodyModel[27] = new ModelRendererTurbo(this, 0, 84, textureX, textureY); // Box 2 + bodyModel[28] = new ModelRendererTurbo(this, 0, 88, textureX, textureY); // Box 3 + bodyModel[29] = new ModelRendererTurbo(this, 0, 91, textureX, textureY); // Box 6 + bodyModel[30] = new ModelRendererTurbo(this, 0, 94, textureX, textureY); // Box 7 + bodyModel[31] = new ModelRendererTurbo(this, 0, 96, textureX, textureY); // Box 8 + bodyModel[32] = new ModelRendererTurbo(this, 0, 96, textureX, textureY); // Box 9 + bodyModel[33] = new ModelRendererTurbo(this, 0, 94, textureX, textureY); // Box 10 + bodyModel[34] = new ModelRendererTurbo(this, 0, 91, textureX, textureY); // Box 11 + bodyModel[35] = new ModelRendererTurbo(this, 0, 99, textureX, textureY); // Box 12 + bodyModel[36] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Box 13 + bodyModel[37] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 14 + bodyModel[38] = new ModelRendererTurbo(this, 0, 84, textureX, textureY); // Box 15 + bodyModel[39] = new ModelRendererTurbo(this, 0, 88, textureX, textureY); // Box 16 + bodyModel[40] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 17 + bodyModel[41] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 18 + bodyModel[42] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 19 + bodyModel[43] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 21 + bodyModel[44] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 22 + bodyModel[45] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 23 + bodyModel[46] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 24 + bodyModel[47] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 25 + bodyModel[48] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 26 + bodyModel[49] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 27 + bodyModel[50] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 28 + bodyModel[51] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 29 + bodyModel[52] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 30 + bodyModel[53] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 31 + bodyModel[54] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 32 + bodyModel[55] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 33 + bodyModel[56] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 34 + bodyModel[57] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 35 + bodyModel[58] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 36 + bodyModel[59] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 37 + bodyModel[60] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Box 38 + bodyModel[61] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 39 + bodyModel[62] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 40 + bodyModel[63] = new ModelRendererTurbo(this, 18, 0, textureX, textureY); // Box 41 + bodyModel[64] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 42 + bodyModel[65] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 43 + bodyModel[66] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 44 + bodyModel[67] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 45 + + bodyModel[0].addBox(-3F, -1F, -1F, 6, 17, 2, 0F); // Import ImportBox0 + bodyModel[0].setRotationPoint(0F, 2F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-3F, -1F, -3F, 6, 17, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox1 + bodyModel[1].setRotationPoint(0F, 2F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-3F, -1F, 1F, 6, 17, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox2 + bodyModel[2].setRotationPoint(0F, 2F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box0 + bodyModel[3].setRotationPoint(0F, 19F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box1 + bodyModel[4].setRotationPoint(0F, 19F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box2 + bodyModel[5].setRotationPoint(0F, 19F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-3F, -1F, -3F, 6, 10, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box3 + bodyModel[6].setRotationPoint(0F, -8F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-3F, -1F, -1F, 6, 10, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box4 + bodyModel[7].setRotationPoint(0F, -8F, 0F); + bodyModel[7].rotateAngleY = 3.92699082F; + + bodyModel[8].addShapeBox(-3F, -1F, 1F, 6, 10, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box5 + bodyModel[8].setRotationPoint(0F, -8F, 0F); + bodyModel[8].rotateAngleY = 3.92699082F; + + bodyModel[9].addShapeBox(-2F, -1F, -1F, 4, 6, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box6 + bodyModel[9].setRotationPoint(0F, -14F, 0F); + bodyModel[9].rotateAngleY = 3.92699082F; + + bodyModel[10].addShapeBox(-2F, -1F, -2F, 4, 6, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box7 + bodyModel[10].setRotationPoint(0F, -14F, 0F); + bodyModel[10].rotateAngleY = 3.92699082F; + + bodyModel[11].addShapeBox(-2F, -1F, 1F, 4, 6, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box8 + bodyModel[11].setRotationPoint(0F, -14F, 0F); + bodyModel[11].rotateAngleY = 3.92699082F; + + bodyModel[12].addShapeBox(-3F, -1F, 1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F); // Import Box9 + bodyModel[12].setRotationPoint(0F, -16F, 0F); + bodyModel[12].rotateAngleY = 3.92699082F; + + bodyModel[13].addShapeBox(-3F, -1F, -1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box10 + bodyModel[13].setRotationPoint(0F, -16F, 0F); + bodyModel[13].rotateAngleY = 3.92699082F; + + bodyModel[14].addShapeBox(-3F, -1F, -3F, 6, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box11 + bodyModel[14].setRotationPoint(0F, -16F, 0F); + bodyModel[14].rotateAngleY = 3.92699082F; + + bodyModel[15].addShapeBox(-3F, -1F, 1F, 6, 3, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box12 + bodyModel[15].setRotationPoint(0F, -19F, 0F); + bodyModel[15].rotateAngleY = 3.92699082F; + + bodyModel[16].addBox(-3F, -1F, -1F, 6, 3, 2, 0F); // Import Box13 + bodyModel[16].setRotationPoint(0F, -19F, 0F); + bodyModel[16].rotateAngleY = 3.92699082F; + + bodyModel[17].addShapeBox(-3F, -1F, -3F, 6, 3, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box14 + bodyModel[17].setRotationPoint(0F, -19F, 0F); + bodyModel[17].rotateAngleY = 3.92699082F; + + bodyModel[18].addShapeBox(-3F, -1F, -1F, 6, 1, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box15 + bodyModel[18].setRotationPoint(0F, -20F, 0F); + bodyModel[18].rotateAngleY = 3.92699082F; + + bodyModel[19].addShapeBox(-3F, -1F, -3F, 6, 1, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box16 + bodyModel[19].setRotationPoint(0F, -20F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-3F, -1F, 1F, 6, 1, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box17 + bodyModel[20].setRotationPoint(0F, -20F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box21 + bodyModel[21].setRotationPoint(0F, 11F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box22 + bodyModel[22].setRotationPoint(0F, 11F, 0F); + bodyModel[22].rotateAngleY = 5.49778714F; + + bodyModel[23].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box23 + bodyModel[23].setRotationPoint(0F, 11F, 0F); + bodyModel[23].rotateAngleY = 2.35619449F; + + bodyModel[24].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box24 + bodyModel[24].setRotationPoint(0F, 11F, 0F); + bodyModel[24].rotateAngleY = 0.78539816F; + + bodyModel[25].addShapeBox(-1F, -1F, -1F, 2, 1, 2, 0F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 0 + bodyModel[25].setRotationPoint(0F, -21F, 0F); + bodyModel[25].rotateAngleY = 3.92699082F; + + bodyModel[26].addShapeBox(-1F, -1F, -2F, 2, 2, 4, 0F, -1F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 1 + bodyModel[26].setRotationPoint(0F, -23F, 0F); + bodyModel[26].rotateAngleY = 3.92699082F; + + bodyModel[27].addShapeBox(0F, -1F, -2F, 2, 3, 1, 0F, 0F, 0F, 0.5F, -1F, 0F, 0.5F, -1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.05F, 0F, 0F, -0.05F); // Box 2 + bodyModel[27].setRotationPoint(0F, -26F, 0F); + bodyModel[27].rotateAngleY = 3.92699082F; + + bodyModel[28].addShapeBox(0F, -1F, -2.5F, 1, 2, 1, 0F, 0F, 0F, 0.33F, 0F, 0F, 0.33F, 0F, 0F, -0.33F, 0F, 0F, -0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 3 + bodyModel[28].setRotationPoint(0F, -28F, 0F); + bodyModel[28].rotateAngleY = 3.92699082F; + + bodyModel[29].addShapeBox(0F, -1F, -1F, 2, 2, 1, 0F, 0.5F, -1F, -0.05F, -2.5F, 0F, -0.05F, -2.5F, 0F, -0.05F, 0.5F, -1F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F); // Box 6 + bodyModel[29].setRotationPoint(0F, -25F, 0F); + bodyModel[29].rotateAngleY = 3.92699082F; + + bodyModel[30].addShapeBox(-1.5F, -1F, -1F, 1, 1, 1, 0F, -0.5F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, -0.5F, 0F, -0.05F, 0.5F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0.5F, 0F, -0.05F); // Box 7 + bodyModel[30].setRotationPoint(0F, -25F, 0F); + bodyModel[30].rotateAngleY = 3.92699082F; + + bodyModel[31].addShapeBox(-2F, -1F, -1F, 1, 2, 1, 0F, 0F, 0F, -0.05F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, -0.5F, 0F, 0.5F, 0F, 0F, 0.5F, 0F, 0F, -0.5F, -0.5F, 0F); // Box 8 + bodyModel[31].setRotationPoint(0F, -24F, 0F); + bodyModel[31].rotateAngleY = 3.92699082F; + + bodyModel[32].addShapeBox(-2F, -1F, 0F, 1, 2, 1, 0F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, -0.5F, -0.5F, -0.05F, 0.5F, 0F, -0.05F, 0.5F, 0F, -0.05F, -0.5F, -0.5F, -0.05F); // Box 9 + bodyModel[32].setRotationPoint(0F, -24F, 0F); + bodyModel[32].rotateAngleY = 3.92699082F; + + bodyModel[33].addShapeBox(-1.5F, -1F, 0F, 1, 1, 1, 0F, -0.5F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, -0.5F, 0F, -0.05F, 0.5F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0.5F, 0F, -0.05F); // Box 10 + bodyModel[33].setRotationPoint(0F, -25F, 0F); + bodyModel[33].rotateAngleY = 3.92699082F; + + bodyModel[34].addShapeBox(0F, -1F, 0F, 2, 2, 1, 0F, 0.5F, -1F, -0.05F, -2.5F, 0F, -0.05F, -2.5F, 0F, -0.05F, 0.5F, -1F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, -0.05F); // Box 11 + bodyModel[34].setRotationPoint(0F, -25F, 0F); + bodyModel[34].rotateAngleY = 3.92699082F; + + bodyModel[35].addShapeBox(-1F, -1F, 2F, 2, 2, 1, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F); // Box 12 + bodyModel[35].setRotationPoint(0F, -23F, 0F); + bodyModel[35].rotateAngleY = 3.92699082F; + + bodyModel[36].addShapeBox(-2F, -1F, 2F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F); // Box 13 + bodyModel[36].setRotationPoint(0F, -23F, 0F); + bodyModel[36].rotateAngleY = 3.92699082F; + + bodyModel[37].addShapeBox(-2F, -1F, 0F, 1, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[37].setRotationPoint(0F, -23F, 0F); + bodyModel[37].rotateAngleY = 3.92699082F; + + bodyModel[38].addShapeBox(0F, -1F, 1F, 2, 3, 1, 0F, 0F, 0F, -0.5F, -1F, 0F, -0.5F, -1F, 0F, 0.5F, 0F, 0F, 0.5F, 0F, 0F, -0.05F, 0F, 0F, -0.05F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[38].setRotationPoint(0F, -26F, 0F); + bodyModel[38].rotateAngleY = 3.92699082F; + + bodyModel[39].addShapeBox(0F, -1F, 1.5F, 1, 2, 1, 0F, 0F, 0F, -0.33F, 0F, 0F, -0.33F, 0F, 0F, 0.33F, 0F, 0F, 0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 16 + bodyModel[39].setRotationPoint(0F, -28F, 0F); + bodyModel[39].rotateAngleY = 3.92699082F; + + bodyModel[40].addShapeBox(-4F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 17 + bodyModel[40].setRotationPoint(0F, -1F, 0F); + bodyModel[40].rotateAngleY = 4.71238898F; + + bodyModel[41].addShapeBox(-5F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[41].setRotationPoint(0F, -1F, 0F); + bodyModel[41].rotateAngleY = 4.71238898F; + + bodyModel[42].addShapeBox(-6F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 19 + bodyModel[42].setRotationPoint(0F, -1F, 0F); + bodyModel[42].rotateAngleY = 4.71238898F; + + bodyModel[43].addShapeBox(-5F, -1F, -1.5F, 1, 3, 3, 0F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + bodyModel[43].setRotationPoint(0F, -4F, 0F); + bodyModel[43].rotateAngleY = 4.71238898F; + + bodyModel[44].addShapeBox(-6F, -1F, -1.5F, 1, 3, 3, 0F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 22 + bodyModel[44].setRotationPoint(0F, -4F, 0F); + bodyModel[44].rotateAngleY = 4.71238898F; + + bodyModel[45].addShapeBox(-4F, -1F, -1.5F, 1, 3, 3, 0F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 23 + bodyModel[45].setRotationPoint(0F, -4F, 0F); + bodyModel[45].rotateAngleY = 4.71238898F; + + bodyModel[46].addShapeBox(-4F, -1F, -1.5F, 1, 3, 3, 0F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 24 + bodyModel[46].setRotationPoint(0F, -4F, 0F); + bodyModel[46].rotateAngleY = 6.28318531F; + + bodyModel[47].addShapeBox(-5F, -1F, -1.5F, 1, 3, 3, 0F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 25 + bodyModel[47].setRotationPoint(0F, -4F, 0F); + bodyModel[47].rotateAngleY = 6.28318531F; + + bodyModel[48].addShapeBox(-6F, -1F, -1.5F, 1, 3, 3, 0F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 26 + bodyModel[48].setRotationPoint(0F, -4F, 0F); + bodyModel[48].rotateAngleY = 6.28318531F; + + bodyModel[49].addShapeBox(-6F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 27 + bodyModel[49].setRotationPoint(0F, -1F, 0F); + bodyModel[49].rotateAngleY = 6.28318531F; + + bodyModel[50].addShapeBox(-5F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 28 + bodyModel[50].setRotationPoint(0F, -1F, 0F); + bodyModel[50].rotateAngleY = 6.28318531F; + + bodyModel[51].addShapeBox(-4F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 29 + bodyModel[51].setRotationPoint(0F, -1F, 0F); + bodyModel[51].rotateAngleY = 6.28318531F; + + bodyModel[52].addShapeBox(-4F, -1F, -1.5F, 1, 3, 3, 0F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 30 + bodyModel[52].setRotationPoint(0F, -4F, 0F); + bodyModel[52].rotateAngleY = 1.57079633F; + + bodyModel[53].addShapeBox(-5F, -1F, -1.5F, 1, 3, 3, 0F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 31 + bodyModel[53].setRotationPoint(0F, -4F, 0F); + bodyModel[53].rotateAngleY = 1.57079633F; + + bodyModel[54].addShapeBox(-6F, -1F, -1.5F, 1, 3, 3, 0F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 32 + bodyModel[54].setRotationPoint(0F, -4F, 0F); + bodyModel[54].rotateAngleY = 1.57079633F; + + bodyModel[55].addShapeBox(-6F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 33 + bodyModel[55].setRotationPoint(0F, -1F, 0F); + bodyModel[55].rotateAngleY = 1.57079633F; + + bodyModel[56].addShapeBox(-5F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 34 + bodyModel[56].setRotationPoint(0F, -1F, 0F); + bodyModel[56].rotateAngleY = 1.57079633F; + + bodyModel[57].addShapeBox(-4F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 35 + bodyModel[57].setRotationPoint(0F, -1F, 0F); + bodyModel[57].rotateAngleY = 1.57079633F; + + bodyModel[58].addShapeBox(-4F, -1F, -1.5F, 1, 3, 3, 0F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 36 + bodyModel[58].setRotationPoint(0F, -4F, 0F); + bodyModel[58].rotateAngleY = -3.14159265F; + + bodyModel[59].addShapeBox(-5F, -1F, -1.5F, 1, 3, 3, 0F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, -0.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 37 + bodyModel[59].setRotationPoint(0F, -4F, 0F); + bodyModel[59].rotateAngleY = -3.14159265F; + + bodyModel[60].addShapeBox(-6F, -1F, -1.5F, 1, 3, 3, 0F, -1F, 0F, -1.33F, 0.33F, 0F, -1F, 0.33F, 0F, -1F, -1F, 0F, -1.33F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 38 + bodyModel[60].setRotationPoint(0F, -4F, 0F); + bodyModel[60].rotateAngleY = -3.14159265F; + + bodyModel[61].addShapeBox(-6F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 39 + bodyModel[61].setRotationPoint(0F, -1F, 0F); + bodyModel[61].rotateAngleY = -3.14159265F; + + bodyModel[62].addShapeBox(-5F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 40 + bodyModel[62].setRotationPoint(0F, -1F, 0F); + bodyModel[62].rotateAngleY = -3.14159265F; + + bodyModel[63].addShapeBox(-4F, -1F, -1.5F, 1, 22, 3, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 41 + bodyModel[63].setRotationPoint(0F, -1F, 0F); + bodyModel[63].rotateAngleY = -3.14159265F; + + bodyModel[64].addShapeBox(-8F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F); // Box 42 + bodyModel[64].setRotationPoint(0F, -5F, 0F); + bodyModel[64].rotateAngleY = 3.92699082F; + + bodyModel[65].addShapeBox(-8F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F); // Box 43 + bodyModel[65].setRotationPoint(0F, -5F, 0F); + bodyModel[65].rotateAngleY = 5.49778714F; + + bodyModel[66].addShapeBox(-8F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F); // Box 44 + bodyModel[66].setRotationPoint(0F, -5F, 0F); + bodyModel[66].rotateAngleY = 0.78539816F; + + bodyModel[67].addShapeBox(-8F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F); // Box 45 + bodyModel[67].setRotationPoint(0F, -5F, 0F); + bodyModel[67].rotateAngleY = 2.35619449F; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelAttractiveMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelAttractiveMissile.java new file mode 100644 index 000000000..c22238b32 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelAttractiveMissile.java @@ -0,0 +1,533 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelAttractiveMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + + public ModelAttractiveMissile() + { + int textureX = 32; + int textureY = 128; + + bodyModel = new ModelRendererTurbo[93]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 24, textureX, textureY); // Import Box0 + bodyModel[4] = new ModelRendererTurbo(this, 0, 24, textureX, textureY); // Import Box1 + bodyModel[5] = new ModelRendererTurbo(this, 0, 24, textureX, textureY); // Import Box2 + bodyModel[6] = new ModelRendererTurbo(this, 0, 32, textureX, textureY); // Import Box3 + bodyModel[7] = new ModelRendererTurbo(this, 0, 32, textureX, textureY); // Import Box4 + bodyModel[8] = new ModelRendererTurbo(this, 0, 32, textureX, textureY); // Import Box5 + bodyModel[9] = new ModelRendererTurbo(this, 0, 41, textureX, textureY); // Import Box6 + bodyModel[10] = new ModelRendererTurbo(this, 0, 47, textureX, textureY); // Import Box7 + bodyModel[11] = new ModelRendererTurbo(this, 0, 47, textureX, textureY); // Import Box8 + bodyModel[12] = new ModelRendererTurbo(this, 0, 52, textureX, textureY); // Import Box9 + bodyModel[13] = new ModelRendererTurbo(this, 0, 52, textureX, textureY); // Import Box10 + bodyModel[14] = new ModelRendererTurbo(this, 0, 52, textureX, textureY); // Import Box11 + bodyModel[15] = new ModelRendererTurbo(this, 0, 56, textureX, textureY); // Import Box12 + bodyModel[16] = new ModelRendererTurbo(this, 0, 56, textureX, textureY); // Import Box13 + bodyModel[17] = new ModelRendererTurbo(this, 0, 56, textureX, textureY); // Import Box14 + bodyModel[18] = new ModelRendererTurbo(this, 0, 65, textureX, textureY); // Import Box15 + bodyModel[19] = new ModelRendererTurbo(this, 0, 65, textureX, textureY); // Import Box16 + bodyModel[20] = new ModelRendererTurbo(this, 0, 65, textureX, textureY); // Import Box17 + bodyModel[21] = new ModelRendererTurbo(this, 0, 70, textureX, textureY); // Import Box18 + bodyModel[22] = new ModelRendererTurbo(this, 0, 70, textureX, textureY); // Import Box19 + bodyModel[23] = new ModelRendererTurbo(this, 0, 70, textureX, textureY); // Import Box20 + bodyModel[24] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Import Box21 + bodyModel[25] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Import Box22 + bodyModel[26] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Import Box23 + bodyModel[27] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Import Box24 + bodyModel[28] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 0 + bodyModel[29] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 1 + bodyModel[30] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 2 + bodyModel[31] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 3 + bodyModel[32] = new ModelRendererTurbo(this, 0, 93, textureX, textureY); // Box 5 + bodyModel[33] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 12 + bodyModel[34] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 13 + bodyModel[35] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 15 + bodyModel[36] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 16 + bodyModel[37] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 17 + bodyModel[38] = new ModelRendererTurbo(this, 0, 93, textureX, textureY); // Box 29 + bodyModel[39] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 30 + bodyModel[40] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 31 + bodyModel[41] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 32 + bodyModel[42] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 33 + bodyModel[43] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 35 + bodyModel[44] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 36 + bodyModel[45] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 39 + bodyModel[46] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 40 + bodyModel[47] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 41 + bodyModel[48] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 42 + bodyModel[49] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 43 + bodyModel[50] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 44 + bodyModel[51] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 45 + bodyModel[52] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 46 + bodyModel[53] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 47 + bodyModel[54] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 48 + bodyModel[55] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 49 + bodyModel[56] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 50 + bodyModel[57] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 51 + bodyModel[58] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 52 + bodyModel[59] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 53 + bodyModel[60] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 54 + bodyModel[61] = new ModelRendererTurbo(this, 0, 93, textureX, textureY); // Box 55 + bodyModel[62] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 56 + bodyModel[63] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 57 + bodyModel[64] = new ModelRendererTurbo(this, 0, 81, textureX, textureY); // Box 58 + bodyModel[65] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Box 59 + bodyModel[66] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 60 + bodyModel[67] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 61 + bodyModel[68] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 62 + bodyModel[69] = new ModelRendererTurbo(this, 0, 98, textureX, textureY); // Box 63 + bodyModel[70] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 64 + bodyModel[71] = new ModelRendererTurbo(this, 0, 100, textureX, textureY); // Box 65 + bodyModel[72] = new ModelRendererTurbo(this, 0, 93, textureX, textureY); // Box 67 + bodyModel[73] = new ModelRendererTurbo(this, 0, 103, textureX, textureY); // Box 68 + bodyModel[74] = new ModelRendererTurbo(this, 0, 112, textureX, textureY); // Box 69 + bodyModel[75] = new ModelRendererTurbo(this, 0, 112, textureX, textureY); // Box 70 + bodyModel[76] = new ModelRendererTurbo(this, 14, 71, textureX, textureY); // Box 71 + bodyModel[77] = new ModelRendererTurbo(this, 12, 76, textureX, textureY); // Box 72 + bodyModel[78] = new ModelRendererTurbo(this, 14, 71, textureX, textureY); // Box 73 + bodyModel[79] = new ModelRendererTurbo(this, 14, 82, textureX, textureY); // Box 74 + bodyModel[80] = new ModelRendererTurbo(this, 12, 86, textureX, textureY); // Box 75 + bodyModel[81] = new ModelRendererTurbo(this, 14, 82, textureX, textureY); // Box 76 + bodyModel[82] = new ModelRendererTurbo(this, 15, 91, textureX, textureY); // Box 77 + bodyModel[83] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 78 + bodyModel[84] = new ModelRendererTurbo(this, 15, 91, textureX, textureY); // Box 79 + bodyModel[85] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 80 + bodyModel[86] = new ModelRendererTurbo(this, 15, 91, textureX, textureY); // Box 81 + bodyModel[87] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 82 + bodyModel[88] = new ModelRendererTurbo(this, 15, 91, textureX, textureY); // Box 83 + bodyModel[89] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 84 + bodyModel[90] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 85 + bodyModel[91] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 86 + bodyModel[92] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 87 + + bodyModel[0].addBox(-3F, -1F, -1F, 6, 22, 2, 0F); // Import ImportBox0 + bodyModel[0].setRotationPoint(0F, -3F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-3F, -1F, -3F, 6, 22, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox1 + bodyModel[1].setRotationPoint(0F, -3F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-3F, -1F, 1F, 6, 22, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox2 + bodyModel[2].setRotationPoint(0F, -3F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box0 + bodyModel[3].setRotationPoint(0F, 19F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box1 + bodyModel[4].setRotationPoint(0F, 19F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box2 + bodyModel[5].setRotationPoint(0F, 19F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-3F, -1F, -3F, 6, 7, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box3 + bodyModel[6].setRotationPoint(0F, -10F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-3F, -1F, -1F, 6, 7, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box4 + bodyModel[7].setRotationPoint(0F, -10F, 0F); + bodyModel[7].rotateAngleY = 3.92699082F; + + bodyModel[8].addShapeBox(-3F, -1F, 1F, 6, 7, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box5 + bodyModel[8].setRotationPoint(0F, -10F, 0F); + bodyModel[8].rotateAngleY = 3.92699082F; + + bodyModel[9].addShapeBox(-2F, -1F, -1F, 4, 4, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box6 + bodyModel[9].setRotationPoint(0F, -14F, 0F); + bodyModel[9].rotateAngleY = 3.92699082F; + + bodyModel[10].addShapeBox(-2F, -1F, -2F, 4, 4, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box7 + bodyModel[10].setRotationPoint(0F, -14F, 0F); + bodyModel[10].rotateAngleY = 3.92699082F; + + bodyModel[11].addShapeBox(-2F, -1F, 1F, 4, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box8 + bodyModel[11].setRotationPoint(0F, -14F, 0F); + bodyModel[11].rotateAngleY = 3.92699082F; + + bodyModel[12].addShapeBox(-3F, -1F, 1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F); // Import Box9 + bodyModel[12].setRotationPoint(0F, -16F, 0F); + bodyModel[12].rotateAngleY = 3.92699082F; + + bodyModel[13].addShapeBox(-3F, -1F, -1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box10 + bodyModel[13].setRotationPoint(0F, -16F, 0F); + bodyModel[13].rotateAngleY = 3.92699082F; + + bodyModel[14].addShapeBox(-3F, -1F, -3F, 6, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box11 + bodyModel[14].setRotationPoint(0F, -16F, 0F); + bodyModel[14].rotateAngleY = 3.92699082F; + + bodyModel[15].addShapeBox(-3F, -1F, 1F, 6, 7, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box12 + bodyModel[15].setRotationPoint(0F, -23F, 0F); + bodyModel[15].rotateAngleY = 3.92699082F; + + bodyModel[16].addBox(-3F, -1F, -1F, 6, 7, 2, 0F); // Import Box13 + bodyModel[16].setRotationPoint(0F, -23F, 0F); + bodyModel[16].rotateAngleY = 3.92699082F; + + bodyModel[17].addShapeBox(-3F, -1F, -3F, 6, 7, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box14 + bodyModel[17].setRotationPoint(0F, -23F, 0F); + bodyModel[17].rotateAngleY = 3.92699082F; + + bodyModel[18].addShapeBox(-3F, -1F, -1F, 6, 3, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box15 + bodyModel[18].setRotationPoint(0F, -26F, 0F); + bodyModel[18].rotateAngleY = 3.92699082F; + + bodyModel[19].addShapeBox(-3F, -1F, -3F, 6, 3, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box16 + bodyModel[19].setRotationPoint(0F, -26F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-3F, -1F, 1F, 6, 3, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box17 + bodyModel[20].setRotationPoint(0F, -26F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-1.5F, 0F, -0.5F, 3, 1, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Import Box18 + bodyModel[21].setRotationPoint(0F, -27.5F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-1.5F, 0F, -1.5F, 3, 1, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, -0.5F, 0F, -1F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Import Box19 + bodyModel[22].setRotationPoint(0F, -27.5F, 0F); + bodyModel[22].rotateAngleY = 3.92699082F; + + bodyModel[23].addShapeBox(-1.5F, 0F, 0.5F, 3, 1, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, -1F, -0.5F, 0F, -1F, -0.5F, 0F); // Import Box20 + bodyModel[23].setRotationPoint(0F, -27.5F, 0F); + bodyModel[23].rotateAngleY = 3.92699082F; + + bodyModel[24].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box21 + bodyModel[24].setRotationPoint(0F, 11F, 0F); + bodyModel[24].rotateAngleY = 3.92699082F; + + bodyModel[25].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box22 + bodyModel[25].setRotationPoint(0F, 11F, 0F); + bodyModel[25].rotateAngleY = 5.49778714F; + + bodyModel[26].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box23 + bodyModel[26].setRotationPoint(0F, 11F, 0F); + bodyModel[26].rotateAngleY = 2.35619449F; + + bodyModel[27].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box24 + bodyModel[27].setRotationPoint(0F, 11F, 0F); + bodyModel[27].rotateAngleY = 0.78539816F; + + bodyModel[28].addTrapezoid(2F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 0 + bodyModel[28].setRotationPoint(0F, -26F, 0F); + bodyModel[28].rotateAngleY = 2.35619449F; + bodyModel[28].rotateAngleZ = 0.95993109F; + + bodyModel[29].addTrapezoid(5F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 1 + bodyModel[29].setRotationPoint(0F, -26F, 0F); + bodyModel[29].rotateAngleY = 2.35619449F; + bodyModel[29].rotateAngleZ = 0.95993109F; + + bodyModel[30].addTrapezoid(3F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 2 + bodyModel[30].setRotationPoint(0F, -24F, 0F); + bodyModel[30].rotateAngleY = 2.35619449F; + bodyModel[30].rotateAngleZ = 1.04719755F; + + bodyModel[31].addTrapezoid(6F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 3 + bodyModel[31].setRotationPoint(0F, -24F, 0F); + bodyModel[31].rotateAngleY = 2.35619449F; + bodyModel[31].rotateAngleZ = 1.04719755F; + + bodyModel[32].addShapeBox(3F, 3.5F, -0.5F, 1, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F); // Box 5 + bodyModel[32].setRotationPoint(0F, -16F, 0F); + bodyModel[32].rotateAngleY = 3.92699082F; + + bodyModel[33].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 12 + bodyModel[33].setRotationPoint(0F, -19F, 0F); + bodyModel[33].rotateAngleY = 3.92699082F; + + bodyModel[34].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 13 + bodyModel[34].setRotationPoint(0F, -19F, 0F); + bodyModel[34].rotateAngleY = 3.92699082F; + + bodyModel[35].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 15 + bodyModel[35].setRotationPoint(0F, -17F, 0F); + bodyModel[35].rotateAngleY = 3.92699082F; + + bodyModel[36].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 16 + bodyModel[36].setRotationPoint(0F, -19F, 0F); + bodyModel[36].rotateAngleY = 3.92699082F; + + bodyModel[37].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 17 + bodyModel[37].setRotationPoint(0F, -17F, 0F); + bodyModel[37].rotateAngleY = 3.92699082F; + + bodyModel[38].addShapeBox(3F, 3.5F, -0.5F, 1, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F); // Box 29 + bodyModel[38].setRotationPoint(0F, -16F, 0F); + bodyModel[38].rotateAngleY = 2.35619449F; + + bodyModel[39].addTrapezoid(3F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 30 + bodyModel[39].setRotationPoint(0F, -24F, 0F); + bodyModel[39].rotateAngleY = 0.78539816F; + bodyModel[39].rotateAngleZ = 1.04719755F; + + bodyModel[40].addTrapezoid(6F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 31 + bodyModel[40].setRotationPoint(0F, -24F, 0F); + bodyModel[40].rotateAngleY = 0.78539816F; + bodyModel[40].rotateAngleZ = 1.04719755F; + + bodyModel[41].addTrapezoid(5F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 32 + bodyModel[41].setRotationPoint(0F, -26F, 0F); + bodyModel[41].rotateAngleY = 0.78539816F; + bodyModel[41].rotateAngleZ = 0.95993109F; + + bodyModel[42].addTrapezoid(2F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 33 + bodyModel[42].setRotationPoint(0F, -26F, 0F); + bodyModel[42].rotateAngleY = 0.78539816F; + bodyModel[42].rotateAngleZ = 0.95993109F; + + bodyModel[43].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 35 + bodyModel[43].setRotationPoint(0F, -17F, 0F); + bodyModel[43].rotateAngleY = 2.35619449F; + + bodyModel[44].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 36 + bodyModel[44].setRotationPoint(0F, -19F, 0F); + bodyModel[44].rotateAngleY = 2.35619449F; + + bodyModel[45].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 39 + bodyModel[45].setRotationPoint(0F, -17F, 0F); + bodyModel[45].rotateAngleY = 2.35619449F; + + bodyModel[46].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 40 + bodyModel[46].setRotationPoint(0F, -19F, 0F); + bodyModel[46].rotateAngleY = 2.35619449F; + + bodyModel[47].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 41 + bodyModel[47].setRotationPoint(0F, -17F, 0F); + bodyModel[47].rotateAngleY = 3.92699082F; + + bodyModel[48].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 42 + bodyModel[48].setRotationPoint(0F, -17F, 0F); + bodyModel[48].rotateAngleY = 2.35619449F; + + bodyModel[49].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 43 + bodyModel[49].setRotationPoint(0F, -19F, 0F); + bodyModel[49].rotateAngleY = 2.35619449F; + + bodyModel[50].addTrapezoid(2F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 44 + bodyModel[50].setRotationPoint(0F, -26F, 0F); + bodyModel[50].rotateAngleY = -0.78539816F; + bodyModel[50].rotateAngleZ = 0.95993109F; + + bodyModel[51].addTrapezoid(5F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 45 + bodyModel[51].setRotationPoint(0F, -26F, 0F); + bodyModel[51].rotateAngleY = -0.78539816F; + bodyModel[51].rotateAngleZ = 0.95993109F; + + bodyModel[52].addTrapezoid(3F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 46 + bodyModel[52].setRotationPoint(0F, -24F, 0F); + bodyModel[52].rotateAngleY = -0.78539816F; + bodyModel[52].rotateAngleZ = 1.04719755F; + + bodyModel[53].addTrapezoid(6F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 47 + bodyModel[53].setRotationPoint(0F, -24F, 0F); + bodyModel[53].rotateAngleY = -0.78539816F; + bodyModel[53].rotateAngleZ = 1.04719755F; + + bodyModel[54].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 48 + bodyModel[54].setRotationPoint(0F, -19F, 0F); + bodyModel[54].rotateAngleY = 0.78539816F; + + bodyModel[55].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 49 + bodyModel[55].setRotationPoint(0F, -17F, 0F); + bodyModel[55].rotateAngleY = 0.78539816F; + + bodyModel[56].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 50 + bodyModel[56].setRotationPoint(0F, -17F, 0F); + bodyModel[56].rotateAngleY = 0.78539816F; + + bodyModel[57].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 51 + bodyModel[57].setRotationPoint(0F, -19F, 0F); + bodyModel[57].rotateAngleY = 0.78539816F; + + bodyModel[58].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 52 + bodyModel[58].setRotationPoint(0F, -19F, 0F); + bodyModel[58].rotateAngleY = 0.78539816F; + + bodyModel[59].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 53 + bodyModel[59].setRotationPoint(0F, -17F, 0F); + bodyModel[59].rotateAngleY = 0.78539816F; + + bodyModel[60].addShapeBox(3F, 3.5F, -0.5F, 1, 5, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 54 + bodyModel[60].setRotationPoint(0F, -21F, 0F); + bodyModel[60].rotateAngleY = 0.78539816F; + + bodyModel[61].addShapeBox(3F, 3.5F, -0.5F, 1, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F); // Box 55 + bodyModel[61].setRotationPoint(0F, -16F, 0F); + bodyModel[61].rotateAngleY = 0.78539816F; + + bodyModel[62].addTrapezoid(2F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 56 + bodyModel[62].setRotationPoint(0F, -26F, 0F); + bodyModel[62].rotateAngleY = 3.92699082F; + bodyModel[62].rotateAngleZ = 0.95993109F; + + bodyModel[63].addTrapezoid(5F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 57 + bodyModel[63].setRotationPoint(0F, -26F, 0F); + bodyModel[63].rotateAngleY = 3.92699082F; + bodyModel[63].rotateAngleZ = 0.95993109F; + + bodyModel[64].addTrapezoid(3F, -1F, -1F, 3, 2, 2, 0F, -0.50F, ModelRendererTurbo.MR_LEFT); // Box 58 + bodyModel[64].setRotationPoint(0F, -24F, 0F); + bodyModel[64].rotateAngleY = 3.92699082F; + bodyModel[64].rotateAngleZ = 1.04719755F; + + bodyModel[65].addTrapezoid(6F, -0.5F, -0.5F, 3, 1, 1, 0F, -0.40F, ModelRendererTurbo.MR_LEFT); // Box 59 + bodyModel[65].setRotationPoint(0F, -24F, 0F); + bodyModel[65].rotateAngleY = 3.92699082F; + bodyModel[65].rotateAngleZ = 1.04719755F; + + bodyModel[66].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 60 + bodyModel[66].setRotationPoint(0F, -19F, 0F); + bodyModel[66].rotateAngleY = 5.49778714F; + + bodyModel[67].addTrapezoid(3F, 3.5F, 0.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 61 + bodyModel[67].setRotationPoint(0F, -17F, 0F); + bodyModel[67].rotateAngleY = 5.49778714F; + + bodyModel[68].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 62 + bodyModel[68].setRotationPoint(0F, -17F, 0F); + bodyModel[68].rotateAngleY = 5.49778714F; + + bodyModel[69].addTrapezoid(3F, 3.5F, -1.5F, 1, 1, 1, 0F, 0F, ModelRendererTurbo.MR_TOP); // Box 63 + bodyModel[69].setRotationPoint(0F, -19F, 0F); + bodyModel[69].rotateAngleY = 5.49778714F; + + bodyModel[70].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 64 + bodyModel[70].setRotationPoint(0F, -19F, 0F); + bodyModel[70].rotateAngleY = 5.49778714F; + + bodyModel[71].addShapeBox(2F, 3.5F, -3.5F, 2, 1, 2, 0F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F, 0.5F, 0F, 0.5F, 0F, 0F, -2F, -1F, 0F, 0F, 0.5F, 0F, -1.5F); // Box 65 + bodyModel[71].setRotationPoint(0F, -17F, 0F); + bodyModel[71].rotateAngleY = 5.49778714F; + + bodyModel[72].addShapeBox(3F, 3.5F, -0.5F, 1, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F); // Box 67 + bodyModel[72].setRotationPoint(0F, -16F, 0F); + bodyModel[72].rotateAngleY = 5.49778714F; + + bodyModel[73].addBox(-3.5F, -1F, -1.5F, 7, 6, 3, 0F); // Box 68 + bodyModel[73].setRotationPoint(0F, -2F, 0F); + bodyModel[73].rotateAngleY = 3.92699082F; + + bodyModel[74].addShapeBox(-3.5F, -1F, -3.5F, 7, 6, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 69 + bodyModel[74].setRotationPoint(0F, -2F, 0F); + bodyModel[74].rotateAngleY = 3.92699082F; + + bodyModel[75].addShapeBox(-3.5F, -1F, 1.5F, 7, 6, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 70 + bodyModel[75].setRotationPoint(0F, -2F, 0F); + bodyModel[75].rotateAngleY = 3.92699082F; + + bodyModel[76].addShapeBox(-3.5F, -1F, 1.5F, 7, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 71 + bodyModel[76].setRotationPoint(0F, 5F, 0F); + bodyModel[76].rotateAngleY = 3.92699082F; + + bodyModel[77].addBox(-3.5F, -1F, -1.5F, 7, 2, 3, 0F); // Box 72 + bodyModel[77].setRotationPoint(0F, 5F, 0F); + bodyModel[77].rotateAngleY = 3.92699082F; + + bodyModel[78].addShapeBox(-3.5F, -1F, -3.5F, 7, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 73 + bodyModel[78].setRotationPoint(0F, 5F, 0F); + bodyModel[78].rotateAngleY = 3.92699082F; + + bodyModel[79].addShapeBox(-3.5F, -1F, 1.5F, 7, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 74 + bodyModel[79].setRotationPoint(0F, 8F, 0F); + bodyModel[79].rotateAngleY = 3.92699082F; + + bodyModel[80].addBox(-3.5F, -1F, -1.5F, 7, 1, 3, 0F); // Box 75 + bodyModel[80].setRotationPoint(0F, 8F, 0F); + bodyModel[80].rotateAngleY = 3.92699082F; + + bodyModel[81].addShapeBox(-3.5F, -1F, -3.5F, 7, 1, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 76 + bodyModel[81].setRotationPoint(0F, 8F, 0F); + bodyModel[81].rotateAngleY = 3.92699082F; + + bodyModel[82].addShapeBox(-9.5F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 77 + bodyModel[82].setRotationPoint(0F, -2F, 0F); + bodyModel[82].rotateAngleY = 2.35619449F; + + bodyModel[83].addShapeBox(-9.5F, -1F, -0.5F, 6, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F); // Box 78 + bodyModel[83].setRotationPoint(0F, 6F, 0F); + bodyModel[83].rotateAngleY = 2.35619449F; + + bodyModel[84].addShapeBox(-9.5F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 79 + bodyModel[84].setRotationPoint(0F, -2F, 0F); + bodyModel[84].rotateAngleY = 0.78539816F; + + bodyModel[85].addShapeBox(-9.5F, -1F, -0.5F, 6, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F); // Box 80 + bodyModel[85].setRotationPoint(0F, 6F, 0F); + bodyModel[85].rotateAngleY = 0.78539816F; + + bodyModel[86].addShapeBox(-9.5F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 81 + bodyModel[86].setRotationPoint(0F, -2F, 0F); + bodyModel[86].rotateAngleY = 3.92699082F; + + bodyModel[87].addShapeBox(-9.5F, -1F, -0.5F, 6, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F); // Box 82 + bodyModel[87].setRotationPoint(0F, 6F, 0F); + bodyModel[87].rotateAngleY = 3.92699082F; + + bodyModel[88].addShapeBox(-9.5F, -1F, -0.5F, 6, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 83 + bodyModel[88].setRotationPoint(0F, -2F, 0F); + bodyModel[88].rotateAngleY = 5.49778714F; + + bodyModel[89].addShapeBox(-9.5F, -1F, -0.5F, 6, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F); // Box 84 + bodyModel[89].setRotationPoint(0F, 6F, 0F); + bodyModel[89].rotateAngleY = 5.49778714F; + + bodyModel[90].addShapeBox(3F, 3.5F, -0.5F, 1, 5, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 85 + bodyModel[90].setRotationPoint(0F, -21F, 0F); + bodyModel[90].rotateAngleY = 2.35619449F; + + bodyModel[91].addShapeBox(3F, 3.5F, -0.5F, 1, 5, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 86 + bodyModel[91].setRotationPoint(0F, -21F, 0F); + bodyModel[91].rotateAngleY = 3.92699082F; + + bodyModel[92].addShapeBox(3F, 3.5F, -0.5F, 1, 5, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 87 + bodyModel[92].setRotationPoint(0F, -21F, 0F); + bodyModel[92].rotateAngleY = 5.49778714F; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelBreachingMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelBreachingMissile.java new file mode 100644 index 000000000..5f339f295 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelBreachingMissile.java @@ -0,0 +1,232 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelBreachingMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2b; + ModelRenderer Shape2c; + ModelRenderer Shape2d; + ModelRenderer Shape3; + ModelRenderer Shape3a; + ModelRenderer Shape3b; + ModelRenderer Shape3c; + ModelRenderer Shape4; + ModelRenderer Shape4a; + ModelRenderer Shape4b; + ModelRenderer Shape4c; + ModelRenderer Shape5; + ModelRenderer Shape5a; + ModelRenderer Shape4d; + ModelRenderer Shape4e; + ModelRenderer Shape4f; + ModelRenderer Shape4g; + ModelRenderer Shape6; + ModelRenderer Shape6a; + ModelRenderer Shape7; + ModelRenderer Shape7a; + ModelRenderer Shape7b; + + public ModelBreachingMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, 0F, -4F, 8, 64, 8); + Shape1.setRotationPoint(0F, -40F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 34, 19); + Shape2.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2.setRotationPoint(-7F, 14F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2b = new ModelRenderer(this, 34, 19); + Shape2b.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2b.setRotationPoint(-7F, 14F, -7F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0F, 0F, 0F); + Shape2c = new ModelRenderer(this, 34, 31); + Shape2c.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2c.setRotationPoint(-7F, 14F, -6F); + Shape2c.setTextureSize(128, 128); + Shape2c.mirror = true; + setRotation(Shape2c, 0F, 0F, 0F); + Shape2d = new ModelRenderer(this, 34, 31); + Shape2d.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2d.setRotationPoint(6F, 14F, -6F); + Shape2d.setTextureSize(128, 128); + Shape2d.mirror = true; + setRotation(Shape2d, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 72, 0); + Shape3.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3.setRotationPoint(0F, 12F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0.7853982F, 0F); + Shape3a = new ModelRenderer(this, 72, 0); + Shape3a.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3a.setRotationPoint(0F, 12F, 0F); + Shape3a.setTextureSize(128, 128); + Shape3a.mirror = true; + setRotation(Shape3a, 0F, -0.7853982F, 0F); + Shape3b = new ModelRenderer(this, 34, 0); + Shape3b.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3b.setRotationPoint(0F, 12F, 0F); + Shape3b.setTextureSize(128, 128); + Shape3b.mirror = true; + setRotation(Shape3b, 0F, 0.7853982F, 0.7853982F); + Shape3c = new ModelRenderer(this, 34, 0); + Shape3c.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3c.setRotationPoint(0F, 12F, 0F); + Shape3c.setTextureSize(128, 128); + Shape3c.mirror = true; + setRotation(Shape3c, 0F, -0.7853982F, 0.7853982F); + Shape4 = new ModelRenderer(this, 22, 74); + Shape4.addBox(0F, 0F, 0F, 2, 7, 5); + Shape4.setRotationPoint(-1F, -23F, 4F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, -0.5235988F, 0F, 0F); + Shape4a = new ModelRenderer(this, 0, 103); + Shape4a.addBox(0F, 0F, 0F, 5, 8, 2); + Shape4a.setRotationPoint(4F, -23F, -1F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, 0F, 0F, 0.5235988F); + Shape4b = new ModelRenderer(this, 0, 81); + Shape4b.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4b.setRotationPoint(0F, -35F, -4F); + Shape4b.setTextureSize(128, 128); + Shape4b.mirror = true; + setRotation(Shape4b, -0.5235988F, 3.141593F, 0F); + Shape4c = new ModelRenderer(this, 0, 103); + Shape4c.addBox(0F, 0F, -1F, 5, 8, 2); + Shape4c.setRotationPoint(-4F, -23F, 0F); + Shape4c.setTextureSize(128, 128); + Shape4c.mirror = true; + setRotation(Shape4c, 0F, 3.141593F, 0.5235988F); + Shape5 = new ModelRenderer(this, 0, 74); + Shape5.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5.setRotationPoint(0F, -32F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape5a = new ModelRenderer(this, 0, 74); + Shape5a.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5a.setRotationPoint(0F, -32F, 0F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 1.570796F, 0F); + Shape4d = new ModelRenderer(this, 22, 74); + Shape4d.addBox(-1F, 0F, 0F, 2, 8, 5); + Shape4d.setRotationPoint(0F, -23F, -4F); + Shape4d.setTextureSize(128, 128); + Shape4d.mirror = true; + setRotation(Shape4d, -0.5235988F, 3.141593F, 0F); + Shape4e = new ModelRenderer(this, 0, 81); + Shape4e.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4e.setRotationPoint(0F, -35F, 4F); + Shape4e.setTextureSize(128, 128); + Shape4e.mirror = true; + setRotation(Shape4e, -0.5235988F, 0F, 0F); + Shape4f = new ModelRenderer(this, 0, 74); + Shape4f.addBox(0F, 0F, -1F, 5, 4, 2); + Shape4f.setRotationPoint(-4F, -35F, 0F); + Shape4f.setTextureSize(128, 128); + Shape4f.mirror = true; + setRotation(Shape4f, 0F, 3.141593F, 0.5235988F); + Shape4g = new ModelRenderer(this, 0, 74); + Shape4g.addBox(0F, 0F, 0F, 5, 4, 2); + Shape4g.setRotationPoint(4F, -35F, -1F); + Shape4g.setTextureSize(128, 128); + Shape4g.mirror = true; + setRotation(Shape4g, 0F, 0F, 0.5235988F); + Shape6 = new ModelRenderer(this, 72, 16); + Shape6.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6.setRotationPoint(-5F, -37F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 72, 16); + Shape6a.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6a.setRotationPoint(-5F, -41F, -5F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 96, 115); + Shape7.addBox(0F, 0F, 0F, 8, 4, 8); + Shape7.setRotationPoint(-4F, -45F, -4F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape7a = new ModelRenderer(this, 79, 109); + Shape7a.addBox(0F, 0F, 0F, 4, 14, 4); + Shape7a.setRotationPoint(-2F, -59F, -2F); + Shape7a.setTextureSize(128, 128); + Shape7a.mirror = true; + setRotation(Shape7a, 0F, 0F, 0F); + Shape7b = new ModelRenderer(this, 96, 110); + Shape7b.addBox(0F, 0F, 0F, 2, 2, 2); + Shape7b.setRotationPoint(-1F, -61F, -1F); + Shape7b.setTextureSize(128, 128); + Shape7b.mirror = true; + setRotation(Shape7b, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape2b.render(f5); + Shape2c.render(f5); + Shape2d.render(f5); + Shape3.render(f5); + Shape3a.render(f5); + Shape3b.render(f5); + Shape3c.render(f5); + Shape4.render(f5); + Shape4a.render(f5); + Shape4b.render(f5); + Shape4c.render(f5); + Shape5.render(f5); + Shape5a.render(f5); + Shape4d.render(f5); + Shape4e.render(f5); + Shape4f.render(f5); + Shape4g.render(f5); + Shape6.render(f5); + Shape6a.render(f5); + Shape7.render(f5); + Shape7a.render(f5); + Shape7b.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelChemicalMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelChemicalMissile.java new file mode 100644 index 000000000..3b9bba6b4 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelChemicalMissile.java @@ -0,0 +1,387 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelChemicalMissile extends ModelMissileBase +{ + + // fields + ModelRendererTurbo[] bodyModel; + + public ModelChemicalMissile() + { + int textureX = 32; + int textureY = 256; + + bodyModel = new ModelRendererTurbo[67]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 14, textureX, textureY); // Box 3 + bodyModel[2] = new ModelRendererTurbo(this, 0, 14, textureX, textureY); // Box 4 + bodyModel[3] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 5 + bodyModel[4] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 9 + bodyModel[5] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 13 + bodyModel[6] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 14 + bodyModel[7] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 15 + bodyModel[8] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 16 + bodyModel[9] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 17 + bodyModel[10] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 18 + bodyModel[11] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 19 + bodyModel[12] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 20 + bodyModel[13] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 21 + bodyModel[14] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 22 + bodyModel[15] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 23 + bodyModel[16] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 24 + bodyModel[17] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 25 + bodyModel[18] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 26 + bodyModel[19] = new ModelRendererTurbo(this, 0, 59, textureX, textureY); // Box 27 + bodyModel[20] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Box 30 + bodyModel[21] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Box 31 + bodyModel[22] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Box 32 + bodyModel[23] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Box 33 + bodyModel[24] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Box 34 + bodyModel[25] = new ModelRendererTurbo(this, 0, 90, textureX, textureY); // Box 35 + bodyModel[26] = new ModelRendererTurbo(this, 0, 86, textureX, textureY); // Box 36 + bodyModel[27] = new ModelRendererTurbo(this, 0, 90, textureX, textureY); // Box 37 + bodyModel[28] = new ModelRendererTurbo(this, 0, 93, textureX, textureY); // Box 38 + bodyModel[29] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 39 + bodyModel[30] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 40 + bodyModel[31] = new ModelRendererTurbo(this, 0, 108, textureX, textureY); // Box 41 + bodyModel[32] = new ModelRendererTurbo(this, 0, 113, textureX, textureY); // Box 42 + bodyModel[33] = new ModelRendererTurbo(this, 0, 113, textureX, textureY); // Box 43 + bodyModel[34] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 46 + bodyModel[35] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 47 + bodyModel[36] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 48 + bodyModel[37] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 49 + bodyModel[38] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 50 + bodyModel[39] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 51 + bodyModel[40] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 52 + bodyModel[41] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 53 + bodyModel[42] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 54 + bodyModel[43] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 55 + bodyModel[44] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 56 + bodyModel[45] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 57 + bodyModel[46] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 58 + bodyModel[47] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 59 + bodyModel[48] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 60 + bodyModel[49] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 61 + bodyModel[50] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 62 + bodyModel[51] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 63 + bodyModel[52] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 64 + bodyModel[53] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 65 + bodyModel[54] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 66 + bodyModel[55] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 67 + bodyModel[56] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 68 + bodyModel[57] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 69 + bodyModel[58] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 70 + bodyModel[59] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 71 + bodyModel[60] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 72 + bodyModel[61] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 73 + bodyModel[62] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 74 + bodyModel[63] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 75 + bodyModel[64] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 76 + bodyModel[65] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 77 + bodyModel[66] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 78 + + bodyModel[0].addShapeBox(-2F, -1F, -1F, 4, 11, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 0 + bodyModel[0].setRotationPoint(0F, 11F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-2F, -1F, -2F, 4, 11, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 3 + bodyModel[1].setRotationPoint(0F, 11F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-2F, -1F, 1F, 4, 11, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 4 + bodyModel[2].setRotationPoint(0F, 11F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[3].setRotationPoint(0F, 13F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 9 + bodyModel[4].setRotationPoint(0F, 17F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + bodyModel[5].setRotationPoint(0F, 23F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[6].setRotationPoint(0F, 22F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[7].setRotationPoint(0F, 13F, 0F); + bodyModel[7].rotateAngleY = 2.35619449F; + + bodyModel[8].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 16 + bodyModel[8].setRotationPoint(0F, 17F, 0F); + bodyModel[8].rotateAngleY = 2.35619449F; + + bodyModel[9].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 17 + bodyModel[9].setRotationPoint(0F, 23F, 0F); + bodyModel[9].rotateAngleY = 2.35619449F; + + bodyModel[10].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[10].setRotationPoint(0F, 22F, 0F); + bodyModel[10].rotateAngleY = 2.35619449F; + + bodyModel[11].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 19 + bodyModel[11].setRotationPoint(0F, 13F, 0F); + bodyModel[11].rotateAngleY = 0.78539816F; + + bodyModel[12].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 20 + bodyModel[12].setRotationPoint(0F, 17F, 0F); + bodyModel[12].rotateAngleY = 0.78539816F; + + bodyModel[13].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + bodyModel[13].setRotationPoint(0F, 23F, 0F); + bodyModel[13].rotateAngleY = 0.78539816F; + + bodyModel[14].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 22 + bodyModel[14].setRotationPoint(0F, 22F, 0F); + bodyModel[14].rotateAngleY = 0.78539816F; + + bodyModel[15].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 23 + bodyModel[15].setRotationPoint(0F, 13F, 0F); + bodyModel[15].rotateAngleY = 5.49778714F; + + bodyModel[16].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 24 + bodyModel[16].setRotationPoint(0F, 17F, 0F); + bodyModel[16].rotateAngleY = 5.49778714F; + + bodyModel[17].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 25 + bodyModel[17].setRotationPoint(0F, 23F, 0F); + bodyModel[17].rotateAngleY = 5.49778714F; + + bodyModel[18].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 26 + bodyModel[18].setRotationPoint(0F, 22F, 0F); + bodyModel[18].rotateAngleY = 5.49778714F; + + bodyModel[19].addShapeBox(-2F, -1F, -1F, 4, 4, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 27 + bodyModel[19].setRotationPoint(0F, 7F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-2F, -1F, -2F, 4, 4, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 30 + bodyModel[20].setRotationPoint(0F, 7F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-2F, -1F, 1F, 4, 4, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 31 + bodyModel[21].setRotationPoint(0F, 7F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-1.5F, -1F, -0.5F, 3, 12, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 32 + bodyModel[22].setRotationPoint(0F, -5F, 0F); + bodyModel[22].rotateAngleY = 3.92699082F; + + bodyModel[23].addShapeBox(-1.5F, -1F, -1.5F, 3, 12, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 33 + bodyModel[23].setRotationPoint(0F, -5F, 0F); + bodyModel[23].rotateAngleY = 3.92699082F; + + bodyModel[24].addShapeBox(-1.5F, -1F, 0.5F, 3, 12, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 34 + bodyModel[24].setRotationPoint(0F, -5F, 0F); + bodyModel[24].rotateAngleY = 3.92699082F; + + bodyModel[25].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Box 35 + bodyModel[25].setRotationPoint(0F, -6F, 0F); + bodyModel[25].rotateAngleY = 3.92699082F; + + bodyModel[26].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F); // Box 36 + bodyModel[26].setRotationPoint(0F, -6F, 0F); + bodyModel[26].rotateAngleY = 3.92699082F; + + bodyModel[27].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F); // Box 37 + bodyModel[27].setRotationPoint(0F, -6F, 0F); + bodyModel[27].rotateAngleY = 3.92699082F; + + bodyModel[28].addShapeBox(-2F, -1F, -1F, 4, 5, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 38 + bodyModel[28].setRotationPoint(0F, -11F, 0F); + bodyModel[28].rotateAngleY = 3.92699082F; + + bodyModel[29].addShapeBox(-2F, -1F, -2F, 4, 5, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 39 + bodyModel[29].setRotationPoint(0F, -11F, 0F); + bodyModel[29].rotateAngleY = 3.92699082F; + + bodyModel[30].addShapeBox(-2F, -1F, 1F, 4, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 40 + bodyModel[30].setRotationPoint(0F, -11F, 0F); + bodyModel[30].rotateAngleY = 3.92699082F; + + bodyModel[31].addShapeBox(-2F, -1F, -1F, 4, 2, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 41 + bodyModel[31].setRotationPoint(0F, -13F, 0F); + bodyModel[31].rotateAngleY = 3.92699082F; + + bodyModel[32].addShapeBox(-2F, -1F, -2F, 4, 2, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 42 + bodyModel[32].setRotationPoint(0F, -13F, 0F); + bodyModel[32].rotateAngleY = 3.92699082F; + + bodyModel[33].addShapeBox(-2F, -1F, 1F, 4, 2, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 43 + bodyModel[33].setRotationPoint(0F, -13F, 0F); + bodyModel[33].rotateAngleY = 3.92699082F; + + bodyModel[34].addShapeBox(-1.5F, -1F, -0.5F, 3, 1, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 46 + bodyModel[34].setRotationPoint(0F, -14F, 0F); + bodyModel[34].rotateAngleY = 3.92699082F; + + bodyModel[35].addShapeBox(-1.5F, -1F, -1.5F, 3, 1, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 47 + bodyModel[35].setRotationPoint(0F, -14F, 0F); + bodyModel[35].rotateAngleY = 3.92699082F; + + bodyModel[36].addShapeBox(-1.5F, -1F, 0.5F, 3, 1, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 48 + bodyModel[36].setRotationPoint(0F, -14F, 0F); + bodyModel[36].rotateAngleY = 3.92699082F; + + bodyModel[37].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 49 + bodyModel[37].setRotationPoint(0F, -3F, 0F); + bodyModel[37].rotateAngleY = 3.92699082F; + + bodyModel[38].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 50 + bodyModel[38].setRotationPoint(0F, -3F, 0F); + bodyModel[38].rotateAngleY = 3.92699082F; + + bodyModel[39].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 51 + bodyModel[39].setRotationPoint(0F, -3F, 0F); + bodyModel[39].rotateAngleY = 3.92699082F; + + bodyModel[40].addShapeBox(-2F, -1F, -1F, 4, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 52 + bodyModel[40].setRotationPoint(0F, -2F, 0F); + bodyModel[40].rotateAngleY = 3.92699082F; + + bodyModel[41].addShapeBox(-2F, -1F, 1F, 4, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 53 + bodyModel[41].setRotationPoint(0F, -2F, 0F); + bodyModel[41].rotateAngleY = 3.92699082F; + + bodyModel[42].addShapeBox(-2F, -1F, -2F, 4, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 54 + bodyModel[42].setRotationPoint(0F, -2F, 0F); + bodyModel[42].rotateAngleY = 3.92699082F; + + bodyModel[43].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F); // Box 55 + bodyModel[43].setRotationPoint(0F, 0F, 0F); + bodyModel[43].rotateAngleY = 3.92699082F; + + bodyModel[44].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F); // Box 56 + bodyModel[44].setRotationPoint(0F, 0F, 0F); + bodyModel[44].rotateAngleY = 3.92699082F; + + bodyModel[45].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Box 57 + bodyModel[45].setRotationPoint(0F, 0F, 0F); + bodyModel[45].rotateAngleY = 3.92699082F; + + bodyModel[46].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F); // Box 58 + bodyModel[46].setRotationPoint(0F, 6F, 0F); + bodyModel[46].rotateAngleY = 3.92699082F; + + bodyModel[47].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F); // Box 59 + bodyModel[47].setRotationPoint(0F, 6F, 0F); + bodyModel[47].rotateAngleY = 3.92699082F; + + bodyModel[48].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Box 60 + bodyModel[48].setRotationPoint(0F, 6F, 0F); + bodyModel[48].rotateAngleY = 3.92699082F; + + bodyModel[49].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 61 + bodyModel[49].setRotationPoint(0F, 3F, 0F); + bodyModel[49].rotateAngleY = 3.92699082F; + + bodyModel[50].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 62 + bodyModel[50].setRotationPoint(0F, 3F, 0F); + bodyModel[50].rotateAngleY = 3.92699082F; + + bodyModel[51].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 63 + bodyModel[51].setRotationPoint(0F, 3F, 0F); + bodyModel[51].rotateAngleY = 3.92699082F; + + bodyModel[52].addShapeBox(-2F, -1F, -2F, 4, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 64 + bodyModel[52].setRotationPoint(0F, 4F, 0F); + bodyModel[52].rotateAngleY = 3.92699082F; + + bodyModel[53].addShapeBox(-2F, -1F, -1F, 4, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 65 + bodyModel[53].setRotationPoint(0F, 4F, 0F); + bodyModel[53].rotateAngleY = 3.92699082F; + + bodyModel[54].addShapeBox(-2F, -1F, 1F, 4, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 66 + bodyModel[54].setRotationPoint(0F, 4F, 0F); + bodyModel[54].rotateAngleY = 3.92699082F; + + bodyModel[55].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 67 + bodyModel[55].setRotationPoint(0F, 7F, 0F); + bodyModel[55].rotateAngleY = 3.92699082F; + + bodyModel[56].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 68 + bodyModel[56].setRotationPoint(0F, 7F, 0F); + bodyModel[56].rotateAngleY = 3.92699082F; + + bodyModel[57].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 69 + bodyModel[57].setRotationPoint(0F, 6F, 0F); + bodyModel[57].rotateAngleY = 3.92699082F; + + bodyModel[58].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 70 + bodyModel[58].setRotationPoint(0F, 6F, 0F); + bodyModel[58].rotateAngleY = 2.35619449F; + + bodyModel[59].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 71 + bodyModel[59].setRotationPoint(0F, 7F, 0F); + bodyModel[59].rotateAngleY = 2.35619449F; + + bodyModel[60].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 72 + bodyModel[60].setRotationPoint(0F, 7F, 0F); + bodyModel[60].rotateAngleY = 2.35619449F; + + bodyModel[61].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 73 + bodyModel[61].setRotationPoint(0F, 6F, 0F); + bodyModel[61].rotateAngleY = 5.49778714F; + + bodyModel[62].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 74 + bodyModel[62].setRotationPoint(0F, 7F, 0F); + bodyModel[62].rotateAngleY = 5.49778714F; + + bodyModel[63].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 75 + bodyModel[63].setRotationPoint(0F, 7F, 0F); + bodyModel[63].rotateAngleY = 5.49778714F; + + bodyModel[64].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 76 + bodyModel[64].setRotationPoint(0F, 7F, 0F); + bodyModel[64].rotateAngleY = 7.06858347F; + + bodyModel[65].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 77 + bodyModel[65].setRotationPoint(0F, 6F, 0F); + bodyModel[65].rotateAngleY = 7.06858347F; + + bodyModel[66].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 78 + bodyModel[66].setRotationPoint(0F, 7F, 0F); + bodyModel[66].rotateAngleY = 7.06858347F; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelClusterMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelClusterMissile.java new file mode 100644 index 000000000..9b52f9654 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelClusterMissile.java @@ -0,0 +1,288 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelClusterMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2a; + ModelRenderer Shape2b; + ModelRenderer Shape2c; + ModelRenderer Shape3a; + ModelRenderer Shape3; + ModelRenderer Shape3b; + ModelRenderer Shape3c; + ModelRenderer Shape4; + ModelRenderer Shape4a; + ModelRenderer Shape4b; + ModelRenderer Shape4c; + ModelRenderer Shape5a; + ModelRenderer Shape5; + ModelRenderer Shape4d; + ModelRenderer Shape4e; + ModelRenderer Shape4f; + ModelRenderer Shape4g; + ModelRenderer Shape6; + ModelRenderer Shape6a; + ModelRenderer Shape7; + ModelRenderer Shape7a; + ModelRenderer Shape7b; + ModelRenderer Shape7c; + ModelRenderer Shape7d; + ModelRenderer Shape7e; + ModelRenderer Shape7f; + ModelRenderer Shape7g; + ModelRenderer Shape8a; + ModelRenderer Shape8; + + public ModelClusterMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, 0F, -4F, 8, 64, 8); + Shape1.setRotationPoint(0F, -40F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 62, 48); + Shape2.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2.setRotationPoint(-7F, 14F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2a = new ModelRenderer(this, 62, 48); + Shape2a.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2a.setRotationPoint(-7F, 14F, -7F); + Shape2a.setTextureSize(128, 128); + Shape2a.mirror = true; + setRotation(Shape2a, 0F, 0F, 0F); + Shape2b = new ModelRenderer(this, 34, 48); + Shape2b.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2b.setRotationPoint(-7F, 14F, -6F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0F, 0F, 0F); + Shape2c = new ModelRenderer(this, 34, 48); + Shape2c.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2c.setRotationPoint(6F, 14F, -6F); + Shape2c.setTextureSize(128, 128); + Shape2c.mirror = true; + setRotation(Shape2c, 0F, 0F, 0F); + Shape3a = new ModelRenderer(this, 34, 33); + Shape3a.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3a.setRotationPoint(0F, 12F, 0F); + Shape3a.setTextureSize(128, 128); + Shape3a.mirror = true; + setRotation(Shape3a, 0F, 0.7853982F, 0F); + Shape3 = new ModelRenderer(this, 34, 33); + Shape3.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3.setRotationPoint(0F, 12F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, -0.7853982F, 0F); + Shape3b = new ModelRenderer(this, 34, 13); + Shape3b.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3b.setRotationPoint(0F, 12F, 0F); + Shape3b.setTextureSize(128, 128); + Shape3b.mirror = true; + setRotation(Shape3b, 0F, 0.7853982F, 0.7853982F); + Shape3c = new ModelRenderer(this, 34, 13); + Shape3c.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3c.setRotationPoint(0F, 12F, 0F); + Shape3c.setTextureSize(128, 128); + Shape3c.mirror = true; + setRotation(Shape3c, 0F, -0.7853982F, 0.7853982F); + Shape4 = new ModelRenderer(this, 16, 114); + Shape4.addBox(0F, 0F, 0F, 2, 7, 5); + Shape4.setRotationPoint(-1F, -23F, 4F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, -0.5235988F, 0F, 0F); + Shape4a = new ModelRenderer(this, 0, 114); + Shape4a.addBox(0F, 0F, 0F, 5, 8, 2); + Shape4a.setRotationPoint(4F, -23F, -1F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, 0F, 0F, 0.5235988F); + Shape4b = new ModelRenderer(this, 15, 104); + Shape4b.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4b.setRotationPoint(0F, -35F, -4F); + Shape4b.setTextureSize(128, 128); + Shape4b.mirror = true; + setRotation(Shape4b, -0.5235988F, 3.141593F, 0F); + Shape4c = new ModelRenderer(this, 0, 114); + Shape4c.addBox(0F, 0F, -1F, 5, 8, 2); + Shape4c.setRotationPoint(-4F, -23F, 0F); + Shape4c.setTextureSize(128, 128); + Shape4c.mirror = true; + setRotation(Shape4c, 0F, 3.141593F, 0.5235988F); + Shape5a = new ModelRenderer(this, 0, 74); + Shape5a.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5a.setRotationPoint(0F, -32F, 0F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 0, 74); + Shape5.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5.setRotationPoint(0F, -32F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 1.570796F, 0F); + Shape4d = new ModelRenderer(this, 16, 114); + Shape4d.addBox(-1F, 0F, 0F, 2, 8, 5); + Shape4d.setRotationPoint(0F, -23F, -4F); + Shape4d.setTextureSize(128, 128); + Shape4d.mirror = true; + setRotation(Shape4d, -0.5235988F, 3.141593F, 0F); + Shape4e = new ModelRenderer(this, 15, 104); + Shape4e.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4e.setRotationPoint(0F, -35F, 4F); + Shape4e.setTextureSize(128, 128); + Shape4e.mirror = true; + setRotation(Shape4e, -0.5235988F, 0F, 0F); + Shape4f = new ModelRenderer(this, 0, 104); + Shape4f.addBox(0F, 0F, -1F, 5, 4, 2); + Shape4f.setRotationPoint(-4F, -35F, 0F); + Shape4f.setTextureSize(128, 128); + Shape4f.mirror = true; + setRotation(Shape4f, 0F, 3.141593F, 0.5235988F); + Shape4g = new ModelRenderer(this, 0, 104); + Shape4g.addBox(0F, 0F, 0F, 5, 4, 2); + Shape4g.setRotationPoint(4F, -35F, -1F); + Shape4g.setTextureSize(128, 128); + Shape4g.mirror = true; + setRotation(Shape4g, 0F, 0F, 0.5235988F); + Shape6 = new ModelRenderer(this, 34, 0); + Shape6.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6.setRotationPoint(-5F, -37F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 34, 0); + Shape6a.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6a.setRotationPoint(-5F, -41F, -5F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 39, 74); + Shape7.addBox(0F, 0F, 0F, 6, 22, 6); + Shape7.setRotationPoint(-3F, 2F, 4F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape7a = new ModelRenderer(this, 65, 74); + Shape7a.addBox(0F, 0F, 0F, 4, 4, 4); + Shape7a.setRotationPoint(-2F, -2F, 5F); + Shape7a.setTextureSize(128, 128); + Shape7a.mirror = true; + setRotation(Shape7a, 0F, 0F, 0F); + Shape7b = new ModelRenderer(this, 65, 74); + Shape7b.addBox(0F, 0F, 0F, 4, 4, 4); + Shape7b.setRotationPoint(-2F, -2F, -9F); + Shape7b.setTextureSize(128, 128); + Shape7b.mirror = true; + setRotation(Shape7b, 0F, 0F, 0F); + Shape7c = new ModelRenderer(this, 39, 74); + Shape7c.addBox(0F, 0F, 0F, 6, 22, 6); + Shape7c.setRotationPoint(-3F, 2F, -10F); + Shape7c.setTextureSize(128, 128); + Shape7c.mirror = true; + setRotation(Shape7c, 0F, 0F, 0F); + Shape7d = new ModelRenderer(this, 65, 74); + Shape7d.addBox(0F, 0F, 0F, 4, 4, 4); + Shape7d.setRotationPoint(-9F, -2F, -2F); + Shape7d.setTextureSize(128, 128); + Shape7d.mirror = true; + setRotation(Shape7d, 0F, 0F, 0F); + Shape7e = new ModelRenderer(this, 39, 74); + Shape7e.addBox(0F, 0F, 0F, 6, 22, 6); + Shape7e.setRotationPoint(-10F, 2F, -3F); + Shape7e.setTextureSize(128, 128); + Shape7e.mirror = true; + setRotation(Shape7e, 0F, 0F, 0F); + Shape7f = new ModelRenderer(this, 65, 74); + Shape7f.addBox(0F, 0F, 0F, 4, 4, 4); + Shape7f.setRotationPoint(5F, -2F, -2F); + Shape7f.setTextureSize(128, 128); + Shape7f.mirror = true; + setRotation(Shape7f, 0F, 0F, 0F); + Shape7g = new ModelRenderer(this, 39, 74); + Shape7g.addBox(0F, 0F, 0F, 6, 22, 6); + Shape7g.setRotationPoint(4F, 2F, -3F); + Shape7g.setTextureSize(128, 128); + Shape7g.mirror = true; + setRotation(Shape7g, 0F, 0F, 0F); + Shape8a = new ModelRenderer(this, 78, 0); + Shape8a.addBox(0F, 0F, 0F, 8, 5, 8); + Shape8a.setRotationPoint(-4F, -46F, -4F); + Shape8a.setTextureSize(128, 128); + Shape8a.mirror = true; + setRotation(Shape8a, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 78, 15); + Shape8.addBox(0F, 0F, 0F, 6, 2, 6); + Shape8.setRotationPoint(-3F, -48F, -3F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape2a.render(f5); + Shape2b.render(f5); + Shape2c.render(f5); + Shape3a.render(f5); + Shape3.render(f5); + Shape3b.render(f5); + Shape3c.render(f5); + Shape4.render(f5); + Shape4a.render(f5); + Shape4b.render(f5); + Shape4c.render(f5); + Shape5a.render(f5); + Shape5.render(f5); + Shape4d.render(f5); + Shape4e.render(f5); + Shape4f.render(f5); + Shape4g.render(f5); + Shape6.render(f5); + Shape6a.render(f5); + Shape7.render(f5); + Shape7a.render(f5); + Shape7b.render(f5); + Shape7c.render(f5); + Shape7d.render(f5); + Shape7e.render(f5); + Shape7f.render(f5); + Shape7g.render(f5); + Shape8a.render(f5); + Shape8.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelCondensedMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelCondensedMissile.java new file mode 100644 index 000000000..7c4d085a2 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelCondensedMissile.java @@ -0,0 +1,214 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelCondensedMissile extends ModelMissileBase +{ + public static final ModelCondensedMissile INSTANCE = new ModelCondensedMissile(); + + // fields + ModelRendererTurbo[] bodyModel; + + public ModelCondensedMissile() + { + int textureX = 32; + int textureY = 128; + + bodyModel = new ModelRendererTurbo[32]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import Box0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import Box1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import Box2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 19, textureX, textureY); // Box 0 + bodyModel[4] = new ModelRendererTurbo(this, 0, 19, textureX, textureY); // Box 1 + bodyModel[5] = new ModelRendererTurbo(this, 0, 19, textureX, textureY); // Box 2 + bodyModel[6] = new ModelRendererTurbo(this, 0, 28, textureX, textureY); // Box 3 + bodyModel[7] = new ModelRendererTurbo(this, 0, 28, textureX, textureY); // Box 4 + bodyModel[8] = new ModelRendererTurbo(this, 0, 28, textureX, textureY); // Box 5 + bodyModel[9] = new ModelRendererTurbo(this, 0, 37, textureX, textureY); // Box 6 + bodyModel[10] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 7 + bodyModel[11] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 8 + bodyModel[12] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 9 + bodyModel[13] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 10 + bodyModel[14] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 11 + bodyModel[15] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Box 12 + bodyModel[16] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Box 13 + bodyModel[17] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Box 14 + bodyModel[18] = new ModelRendererTurbo(this, 0, 73, textureX, textureY); // Box 15 + bodyModel[19] = new ModelRendererTurbo(this, 0, 73, textureX, textureY); // Box 16 + bodyModel[20] = new ModelRendererTurbo(this, 0, 73, textureX, textureY); // Box 17 + bodyModel[21] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Box 18 + bodyModel[22] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Box 19 + bodyModel[23] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Box 20 + bodyModel[24] = new ModelRendererTurbo(this, 0, 86, textureX, textureY); // Box 21 + bodyModel[25] = new ModelRendererTurbo(this, 0, 86, textureX, textureY); // Box 22 + bodyModel[26] = new ModelRendererTurbo(this, 0, 86, textureX, textureY); // Box 23 + bodyModel[27] = new ModelRendererTurbo(this, 0, 86, textureX, textureY); // Box 24 + bodyModel[28] = new ModelRendererTurbo(this, 0, 96, textureX, textureY); // Box 25 + bodyModel[29] = new ModelRendererTurbo(this, 0, 96, textureX, textureY); // Box 26 + bodyModel[30] = new ModelRendererTurbo(this, 0, 96, textureX, textureY); // Box 27 + bodyModel[31] = new ModelRendererTurbo(this, 0, 96, textureX, textureY); // Box 28 + + bodyModel[0].addBox(-3F, -1F, -1F, 6, 17, 2, 0F); // Import Box0 + bodyModel[0].setRotationPoint(0F, 2F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-3F, -1F, -3F, 6, 17, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box1 + bodyModel[1].setRotationPoint(0F, 2F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-3F, -1F, 1F, 6, 17, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box2 + bodyModel[2].setRotationPoint(0F, 2F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 0 + bodyModel[3].setRotationPoint(0F, 19F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 1 + bodyModel[4].setRotationPoint(0F, 19F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 2 + bodyModel[5].setRotationPoint(0F, 19F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 3 + bodyModel[6].setRotationPoint(0F, -4F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 4 + bodyModel[7].setRotationPoint(0F, -4F, 0F); + bodyModel[7].rotateAngleY = 3.92699082F; + + bodyModel[8].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 5 + bodyModel[8].setRotationPoint(0F, -4F, 0F); + bodyModel[8].rotateAngleY = 3.92699082F; + + bodyModel[9].addShapeBox(-2F, -1F, -1F, 4, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 6 + bodyModel[9].setRotationPoint(0F, -14F, 0F); + bodyModel[9].rotateAngleY = 3.92699082F; + + bodyModel[10].addShapeBox(-2F, -1F, -2F, 4, 10, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 7 + bodyModel[10].setRotationPoint(0F, -14F, 0F); + bodyModel[10].rotateAngleY = 3.92699082F; + + bodyModel[11].addShapeBox(-2F, -1F, 1F, 4, 10, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 8 + bodyModel[11].setRotationPoint(0F, -14F, 0F); + bodyModel[11].rotateAngleY = 3.92699082F; + + bodyModel[12].addShapeBox(-3F, -1F, 1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F); // Box 9 + bodyModel[12].setRotationPoint(0F, -16F, 0F); + bodyModel[12].rotateAngleY = 3.92699082F; + + bodyModel[13].addShapeBox(-3F, -1F, -1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 10 + bodyModel[13].setRotationPoint(0F, -16F, 0F); + bodyModel[13].rotateAngleY = 3.92699082F; + + bodyModel[14].addShapeBox(-3F, -1F, -3F, 6, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 11 + bodyModel[14].setRotationPoint(0F, -16F, 0F); + bodyModel[14].rotateAngleY = 3.92699082F; + + bodyModel[15].addShapeBox(-3F, -1F, 1F, 6, 3, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 12 + bodyModel[15].setRotationPoint(0F, -19F, 0F); + bodyModel[15].rotateAngleY = 3.92699082F; + + bodyModel[16].addBox(-3F, -1F, -1F, 6, 3, 2, 0F); // Box 13 + bodyModel[16].setRotationPoint(0F, -19F, 0F); + bodyModel[16].rotateAngleY = 3.92699082F; + + bodyModel[17].addShapeBox(-3F, -1F, -3F, 6, 3, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[17].setRotationPoint(0F, -19F, 0F); + bodyModel[17].rotateAngleY = 3.92699082F; + + bodyModel[18].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[18].setRotationPoint(0F, -25F, 0F); + bodyModel[18].rotateAngleY = 3.92699082F; + + bodyModel[19].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 16 + bodyModel[19].setRotationPoint(0F, -25F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 17 + bodyModel[20].setRotationPoint(0F, -25F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-1.5F, 0F, -0.5F, 3, 2, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[21].setRotationPoint(0F, -28F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-1.5F, 0F, -1.5F, 3, 2, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 19 + bodyModel[22].setRotationPoint(0F, -28F, 0F); + bodyModel[22].rotateAngleY = 3.92699082F; + + bodyModel[23].addShapeBox(-1.5F, 0F, 0.5F, 3, 2, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 20 + bodyModel[23].setRotationPoint(0F, -28F, 0F); + bodyModel[23].rotateAngleY = 3.92699082F; + + bodyModel[24].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + bodyModel[24].setRotationPoint(0F, 11F, 0F); + bodyModel[24].rotateAngleY = 3.92699082F; + + bodyModel[25].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 22 + bodyModel[25].setRotationPoint(0F, 11F, 0F); + bodyModel[25].rotateAngleY = 5.49778714F; + + bodyModel[26].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 23 + bodyModel[26].setRotationPoint(0F, 11F, 0F); + bodyModel[26].rotateAngleY = 2.35619449F; + + bodyModel[27].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 24 + bodyModel[27].setRotationPoint(0F, 11F, 0F); + bodyModel[27].rotateAngleY = 0.78539816F; + + bodyModel[28].addShapeBox(-5F, -1F, -0.5F, 3, 6, 1, 0F, 0F, -2F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, -0.2F, 0F, -1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.2F); // Box 25 + bodyModel[28].setRotationPoint(0F, -10F, 0F); + bodyModel[28].rotateAngleY = 0.78539816F; + + bodyModel[29].addShapeBox(-5F, -1F, -0.5F, 3, 6, 1, 0F, 0F, -2F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, -0.2F, 0F, -1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.2F); // Box 26 + bodyModel[29].setRotationPoint(0F, -10F, 0F); + bodyModel[29].rotateAngleY = 2.35619449F; + + bodyModel[30].addShapeBox(-5F, -1F, -0.5F, 3, 6, 1, 0F, 0F, -2F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, -0.2F, 0F, -1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.2F); // Box 27 + bodyModel[30].setRotationPoint(0F, -10F, 0F); + bodyModel[30].rotateAngleY = 5.49778714F; + + bodyModel[31].addShapeBox(-5F, -1F, -0.5F, 3, 6, 1, 0F, 0F, -2F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, -0.2F, 0F, -1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -0.2F); // Box 28 + bodyModel[31].setRotationPoint(0F, -10F, 0F); + bodyModel[31].rotateAngleY = 3.92699082F; + + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelContagiousMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelContagiousMissile.java new file mode 100644 index 000000000..ce8c0fa05 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelContagiousMissile.java @@ -0,0 +1,280 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelContagiousMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2a; + ModelRenderer Shape2b; + ModelRenderer Shape2c; + ModelRenderer Shape3a; + ModelRenderer Shape3; + ModelRenderer Shape3c; + ModelRenderer Shape3b; + ModelRenderer Shape4a; + ModelRenderer Shape4; + ModelRenderer Shape4b; + ModelRenderer Shape4c; + ModelRenderer Shape5; + ModelRenderer Shape5a; + ModelRenderer Shape4g; + ModelRenderer Shape4e; + ModelRenderer Shape4f; + ModelRenderer Shape4h; + ModelRenderer Shape6a; + ModelRenderer Shape6; + ModelRenderer Shape7; + ModelRenderer Shape7a; + ModelRenderer Shape7b; + ModelRenderer Shape8; + ModelRenderer Shape8a; + ModelRenderer Shape8b; + ModelRenderer Shape8c; + ModelRenderer Shape8d; + ModelRenderer Shape8e; + + public ModelContagiousMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, 0F, -4F, 8, 64, 8); + Shape1.setRotationPoint(0F, -40F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 34, 19); + Shape2.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2.setRotationPoint(-7F, 14F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2a = new ModelRenderer(this, 34, 19); + Shape2a.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2a.setRotationPoint(-7F, 14F, -7F); + Shape2a.setTextureSize(128, 128); + Shape2a.mirror = true; + setRotation(Shape2a, 0F, 0F, 0F); + Shape2b = new ModelRenderer(this, 34, 31); + Shape2b.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2b.setRotationPoint(-7F, 14F, -6F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0F, 0F, 0F); + Shape2c = new ModelRenderer(this, 34, 31); + Shape2c.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2c.setRotationPoint(6F, 14F, -6F); + Shape2c.setTextureSize(128, 128); + Shape2c.mirror = true; + setRotation(Shape2c, 0F, 0F, 0F); + Shape3a = new ModelRenderer(this, 72, 0); + Shape3a.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3a.setRotationPoint(0F, 12F, 0F); + Shape3a.setTextureSize(128, 128); + Shape3a.mirror = true; + setRotation(Shape3a, 0F, 0.7853982F, 0F); + Shape3 = new ModelRenderer(this, 72, 0); + Shape3.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3.setRotationPoint(0F, 12F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, -0.7853982F, 0F); + Shape3c = new ModelRenderer(this, 34, 0); + Shape3c.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3c.setRotationPoint(0F, 12F, 0F); + Shape3c.setTextureSize(128, 128); + Shape3c.mirror = true; + setRotation(Shape3c, 0F, 0.7853982F, 0.7853982F); + Shape3b = new ModelRenderer(this, 34, 0); + Shape3b.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3b.setRotationPoint(0F, 12F, 0F); + Shape3b.setTextureSize(128, 128); + Shape3b.mirror = true; + setRotation(Shape3b, 0F, -0.7853982F, 0.7853982F); + Shape4a = new ModelRenderer(this, 22, 74); + Shape4a.addBox(0F, 0F, 0F, 2, 7, 5); + Shape4a.setRotationPoint(-1F, -23F, 4F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, -0.5235988F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 103); + Shape4.addBox(0F, 0F, 0F, 5, 8, 2); + Shape4.setRotationPoint(4F, -23F, -1F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0.5235988F); + Shape4b = new ModelRenderer(this, 0, 81); + Shape4b.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4b.setRotationPoint(0F, -35F, -4F); + Shape4b.setTextureSize(128, 128); + Shape4b.mirror = true; + setRotation(Shape4b, -0.5235988F, 3.141593F, 0F); + Shape4c = new ModelRenderer(this, 0, 103); + Shape4c.addBox(0F, 0F, -1F, 5, 8, 2); + Shape4c.setRotationPoint(-4F, -23F, 0F); + Shape4c.setTextureSize(128, 128); + Shape4c.mirror = true; + setRotation(Shape4c, 0F, 3.141593F, 0.5235988F); + Shape5 = new ModelRenderer(this, 0, 74); + Shape5.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5.setRotationPoint(0F, -32F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape5a = new ModelRenderer(this, 0, 74); + Shape5a.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5a.setRotationPoint(0F, -32F, 0F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 1.570796F, 0F); + Shape4g = new ModelRenderer(this, 22, 74); + Shape4g.addBox(-1F, 0F, 0F, 2, 8, 5); + Shape4g.setRotationPoint(0F, -23F, -4F); + Shape4g.setTextureSize(128, 128); + Shape4g.mirror = true; + setRotation(Shape4g, -0.5235988F, 3.141593F, 0F); + Shape4e = new ModelRenderer(this, 0, 81); + Shape4e.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4e.setRotationPoint(0F, -35F, 4F); + Shape4e.setTextureSize(128, 128); + Shape4e.mirror = true; + setRotation(Shape4e, -0.5235988F, 0F, 0F); + Shape4f = new ModelRenderer(this, 0, 74); + Shape4f.addBox(0F, 0F, -1F, 5, 4, 2); + Shape4f.setRotationPoint(-4F, -35F, 0F); + Shape4f.setTextureSize(128, 128); + Shape4f.mirror = true; + setRotation(Shape4f, 0F, 3.141593F, 0.5235988F); + Shape4h = new ModelRenderer(this, 0, 74); + Shape4h.addBox(0F, 0F, 0F, 5, 4, 2); + Shape4h.setRotationPoint(4F, -35F, -1F); + Shape4h.setTextureSize(128, 128); + Shape4h.mirror = true; + setRotation(Shape4h, 0F, 0F, 0.5235988F); + Shape6a = new ModelRenderer(this, 72, 16); + Shape6a.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6a.setRotationPoint(-5F, -37F, -5F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 72, 16); + Shape6.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6.setRotationPoint(-5F, -41F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 61, 31); + Shape7.addBox(0F, 0F, 0F, 8, 4, 8); + Shape7.setRotationPoint(-4F, -45F, -4F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape7a = new ModelRenderer(this, 61, 47); + Shape7a.addBox(0F, 0F, 0F, 6, 4, 6); + Shape7a.setRotationPoint(-3F, -49F, -3F); + Shape7a.setTextureSize(128, 128); + Shape7a.mirror = true; + setRotation(Shape7a, 0F, 0F, 0F); + Shape7b = new ModelRenderer(this, 61, 61); + Shape7b.addBox(0F, 0F, 0F, 4, 4, 4); + Shape7b.setRotationPoint(-2F, -53F, -2F); + Shape7b.setTextureSize(128, 128); + Shape7b.mirror = true; + setRotation(Shape7b, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 95, 31); + Shape8.addBox(-1F, -1F, -6F, 2, 2, 12); + Shape8.setRotationPoint(0F, -43F, 0F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape8a = new ModelRenderer(this, 95, 31); + Shape8a.addBox(-1F, -1F, -6F, 2, 2, 12); + Shape8a.setRotationPoint(0F, -43F, 0F); + Shape8a.setTextureSize(128, 128); + Shape8a.mirror = true; + setRotation(Shape8a, 0F, 1.570796F, 0F); + Shape8b = new ModelRenderer(this, 87, 47); + Shape8b.addBox(-1F, -1F, -5F, 2, 2, 10); + Shape8b.setRotationPoint(0F, -47F, 0F); + Shape8b.setTextureSize(128, 128); + Shape8b.mirror = true; + setRotation(Shape8b, 0F, 0F, 0F); + Shape8c = new ModelRenderer(this, 87, 47); + Shape8c.addBox(-1F, -1F, -5F, 2, 2, 10); + Shape8c.setRotationPoint(0F, -47F, 0F); + Shape8c.setTextureSize(128, 128); + Shape8c.mirror = true; + setRotation(Shape8c, 0F, 1.570796F, 0F); + Shape8d = new ModelRenderer(this, 79, 61); + Shape8d.addBox(-1F, -1F, -4F, 2, 2, 8); + Shape8d.setRotationPoint(0F, -51F, 0F); + Shape8d.setTextureSize(128, 128); + Shape8d.mirror = true; + setRotation(Shape8d, 0F, 0F, 0F); + Shape8e = new ModelRenderer(this, 79, 61); + Shape8e.addBox(-1F, -1F, -4F, 2, 2, 8); + Shape8e.setRotationPoint(0F, -51F, 0F); + Shape8e.setTextureSize(128, 128); + Shape8e.mirror = true; + setRotation(Shape8e, 0F, 1.570796F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape2a.render(f5); + Shape2b.render(f5); + Shape2c.render(f5); + Shape3a.render(f5); + Shape3.render(f5); + Shape3c.render(f5); + Shape3b.render(f5); + Shape4a.render(f5); + Shape4.render(f5); + Shape4b.render(f5); + Shape4c.render(f5); + Shape5.render(f5); + Shape5a.render(f5); + Shape4g.render(f5); + Shape4e.render(f5); + Shape4f.render(f5); + Shape4h.render(f5); + Shape6a.render(f5); + Shape6.render(f5); + Shape7.render(f5); + Shape7a.render(f5); + Shape7b.render(f5); + Shape8.render(f5); + Shape8a.render(f5); + Shape8b.render(f5); + Shape8c.render(f5); + Shape8d.render(f5); + Shape8e.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelDebilitationMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelDebilitationMissile.java new file mode 100644 index 000000000..766d1885f --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelDebilitationMissile.java @@ -0,0 +1,343 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelDebilitationMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelDebilitationMissile() + { + int textureX = 32; + int textureY = 256; + + bodyModel = new ModelRendererTurbo[58]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 14, textureX, textureY); // Box 3 + bodyModel[2] = new ModelRendererTurbo(this, 0, 14, textureX, textureY); // Box 4 + bodyModel[3] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 5 + bodyModel[4] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 9 + bodyModel[5] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 13 + bodyModel[6] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 14 + bodyModel[7] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 15 + bodyModel[8] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 16 + bodyModel[9] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 17 + bodyModel[10] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 18 + bodyModel[11] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 19 + bodyModel[12] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 20 + bodyModel[13] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 21 + bodyModel[14] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 22 + bodyModel[15] = new ModelRendererTurbo(this, 0, 27, textureX, textureY); // Box 23 + bodyModel[16] = new ModelRendererTurbo(this, 0, 40, textureX, textureY); // Box 24 + bodyModel[17] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Box 25 + bodyModel[18] = new ModelRendererTurbo(this, 0, 54, textureX, textureY); // Box 26 + bodyModel[19] = new ModelRendererTurbo(this, 0, 59, textureX, textureY); // Box 27 + bodyModel[20] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Box 30 + bodyModel[21] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Box 31 + bodyModel[22] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Box 32 + bodyModel[23] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Box 33 + bodyModel[24] = new ModelRendererTurbo(this, 0, 72, textureX, textureY); // Box 34 + bodyModel[25] = new ModelRendererTurbo(this, 0, 90, textureX, textureY); // Box 35 + bodyModel[26] = new ModelRendererTurbo(this, 0, 86, textureX, textureY); // Box 36 + bodyModel[27] = new ModelRendererTurbo(this, 0, 90, textureX, textureY); // Box 37 + bodyModel[28] = new ModelRendererTurbo(this, 0, 93, textureX, textureY); // Box 38 + bodyModel[29] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 39 + bodyModel[30] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 40 + bodyModel[31] = new ModelRendererTurbo(this, 0, 108, textureX, textureY); // Box 41 + bodyModel[32] = new ModelRendererTurbo(this, 0, 113, textureX, textureY); // Box 42 + bodyModel[33] = new ModelRendererTurbo(this, 0, 113, textureX, textureY); // Box 43 + bodyModel[34] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 46 + bodyModel[35] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 47 + bodyModel[36] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 48 + bodyModel[37] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 49 + bodyModel[38] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 50 + bodyModel[39] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 51 + bodyModel[40] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 52 + bodyModel[41] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 53 + bodyModel[42] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Box 54 + bodyModel[43] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 55 + bodyModel[44] = new ModelRendererTurbo(this, 0, 120, textureX, textureY); // Box 56 + bodyModel[45] = new ModelRendererTurbo(this, 0, 124, textureX, textureY); // Box 57 + bodyModel[46] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 67 + bodyModel[47] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 68 + bodyModel[48] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 69 + bodyModel[49] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 70 + bodyModel[50] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 71 + bodyModel[51] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 72 + bodyModel[52] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 73 + bodyModel[53] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 74 + bodyModel[54] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 75 + bodyModel[55] = new ModelRendererTurbo(this, 0, 131, textureX, textureY); // Box 76 + bodyModel[56] = new ModelRendererTurbo(this, 0, 139, textureX, textureY); // Box 77 + bodyModel[57] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Box 78 + + bodyModel[0].addShapeBox(-2F, -1F, -1F, 4, 11, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 0 + bodyModel[0].setRotationPoint(0F, 11F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-2F, -1F, -2F, 4, 11, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 3 + bodyModel[1].setRotationPoint(0F, 11F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-2F, -1F, 1F, 4, 11, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 4 + bodyModel[2].setRotationPoint(0F, 11F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[3].setRotationPoint(0F, 13F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 9 + bodyModel[4].setRotationPoint(0F, 17F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + bodyModel[5].setRotationPoint(0F, 23F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[6].setRotationPoint(0F, 22F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[7].setRotationPoint(0F, 13F, 0F); + bodyModel[7].rotateAngleY = 2.35619449F; + + bodyModel[8].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 16 + bodyModel[8].setRotationPoint(0F, 17F, 0F); + bodyModel[8].rotateAngleY = 2.35619449F; + + bodyModel[9].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 17 + bodyModel[9].setRotationPoint(0F, 23F, 0F); + bodyModel[9].rotateAngleY = 2.35619449F; + + bodyModel[10].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[10].setRotationPoint(0F, 22F, 0F); + bodyModel[10].rotateAngleY = 2.35619449F; + + bodyModel[11].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 19 + bodyModel[11].setRotationPoint(0F, 13F, 0F); + bodyModel[11].rotateAngleY = 0.78539816F; + + bodyModel[12].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 20 + bodyModel[12].setRotationPoint(0F, 17F, 0F); + bodyModel[12].rotateAngleY = 0.78539816F; + + bodyModel[13].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + bodyModel[13].setRotationPoint(0F, 23F, 0F); + bodyModel[13].rotateAngleY = 0.78539816F; + + bodyModel[14].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 22 + bodyModel[14].setRotationPoint(0F, 22F, 0F); + bodyModel[14].rotateAngleY = 0.78539816F; + + bodyModel[15].addShapeBox(-1.5F, -1F, 1F, 3, 10, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 23 + bodyModel[15].setRotationPoint(0F, 13F, 0F); + bodyModel[15].rotateAngleY = 5.49778714F; + + bodyModel[16].addShapeBox(-1.5F, -1F, 3F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -3F, 0F, -1F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 24 + bodyModel[16].setRotationPoint(0F, 17F, 0F); + bodyModel[16].rotateAngleY = 5.49778714F; + + bodyModel[17].addShapeBox(-1.5F, -1F, 2F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 25 + bodyModel[17].setRotationPoint(0F, 23F, 0F); + bodyModel[17].rotateAngleY = 5.49778714F; + + bodyModel[18].addShapeBox(-1.5F, -1F, 1F, 3, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 26 + bodyModel[18].setRotationPoint(0F, 22F, 0F); + bodyModel[18].rotateAngleY = 5.49778714F; + + bodyModel[19].addShapeBox(-2F, -1F, -1F, 4, 4, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 27 + bodyModel[19].setRotationPoint(0F, 7F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-2F, -1F, -2F, 4, 4, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 30 + bodyModel[20].setRotationPoint(0F, 7F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-2F, -1F, 1F, 4, 4, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 31 + bodyModel[21].setRotationPoint(0F, 7F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-1.5F, -1F, -0.5F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 32 + bodyModel[22].setRotationPoint(0F, -1F, 0F); + bodyModel[22].rotateAngleY = 3.92699082F; + + bodyModel[23].addShapeBox(-1.5F, -1F, -1.5F, 3, 8, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 33 + bodyModel[23].setRotationPoint(0F, -1F, 0F); + bodyModel[23].rotateAngleY = 3.92699082F; + + bodyModel[24].addShapeBox(-1.5F, -1F, 0.5F, 3, 8, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 34 + bodyModel[24].setRotationPoint(0F, -1F, 0F); + bodyModel[24].rotateAngleY = 3.92699082F; + + bodyModel[25].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Box 35 + bodyModel[25].setRotationPoint(0F, -2F, 0F); + bodyModel[25].rotateAngleY = 3.92699082F; + + bodyModel[26].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F); // Box 36 + bodyModel[26].setRotationPoint(0F, -2F, 0F); + bodyModel[26].rotateAngleY = 3.92699082F; + + bodyModel[27].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F); // Box 37 + bodyModel[27].setRotationPoint(0F, -2F, 0F); + bodyModel[27].rotateAngleY = 3.92699082F; + + bodyModel[28].addShapeBox(-2F, -1F, -1F, 4, 5, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 38 + bodyModel[28].setRotationPoint(0F, -7F, 0F); + bodyModel[28].rotateAngleY = 3.92699082F; + + bodyModel[29].addShapeBox(-2F, -1F, -2F, 4, 5, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 39 + bodyModel[29].setRotationPoint(0F, -7F, 0F); + bodyModel[29].rotateAngleY = 3.92699082F; + + bodyModel[30].addShapeBox(-2F, -1F, 1F, 4, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 40 + bodyModel[30].setRotationPoint(0F, -7F, 0F); + bodyModel[30].rotateAngleY = 3.92699082F; + + bodyModel[31].addShapeBox(-2F, -1F, -1F, 4, 2, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 41 + bodyModel[31].setRotationPoint(0F, -9F, 0F); + bodyModel[31].rotateAngleY = 3.92699082F; + + bodyModel[32].addShapeBox(-2F, -1F, -2F, 4, 2, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 42 + bodyModel[32].setRotationPoint(0F, -9F, 0F); + bodyModel[32].rotateAngleY = 3.92699082F; + + bodyModel[33].addShapeBox(-2F, -1F, 1F, 4, 2, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 43 + bodyModel[33].setRotationPoint(0F, -9F, 0F); + bodyModel[33].rotateAngleY = 3.92699082F; + + bodyModel[34].addShapeBox(-1.5F, -1F, -0.5F, 3, 1, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 46 + bodyModel[34].setRotationPoint(0F, -10F, 0F); + bodyModel[34].rotateAngleY = 3.92699082F; + + bodyModel[35].addShapeBox(-1.5F, -1F, -1.5F, 3, 1, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 47 + bodyModel[35].setRotationPoint(0F, -10F, 0F); + bodyModel[35].rotateAngleY = 3.92699082F; + + bodyModel[36].addShapeBox(-1.5F, -1F, 0.5F, 3, 1, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 48 + bodyModel[36].setRotationPoint(0F, -10F, 0F); + bodyModel[36].rotateAngleY = 3.92699082F; + + bodyModel[37].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 49 + bodyModel[37].setRotationPoint(0F, 1F, 0F); + bodyModel[37].rotateAngleY = 3.92699082F; + + bodyModel[38].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 50 + bodyModel[38].setRotationPoint(0F, 1F, 0F); + bodyModel[38].rotateAngleY = 3.92699082F; + + bodyModel[39].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 51 + bodyModel[39].setRotationPoint(0F, 1F, 0F); + bodyModel[39].rotateAngleY = 3.92699082F; + + bodyModel[40].addShapeBox(-2F, -1F, -1F, 4, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 52 + bodyModel[40].setRotationPoint(0F, 2F, 0F); + bodyModel[40].rotateAngleY = 3.92699082F; + + bodyModel[41].addShapeBox(-2F, -1F, 1F, 4, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 53 + bodyModel[41].setRotationPoint(0F, 2F, 0F); + bodyModel[41].rotateAngleY = 3.92699082F; + + bodyModel[42].addShapeBox(-2F, -1F, -2F, 4, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 54 + bodyModel[42].setRotationPoint(0F, 2F, 0F); + bodyModel[42].rotateAngleY = 3.92699082F; + + bodyModel[43].addShapeBox(-2F, -1F, 1F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F); // Box 55 + bodyModel[43].setRotationPoint(0F, 4F, 0F); + bodyModel[43].rotateAngleY = 3.92699082F; + + bodyModel[44].addShapeBox(-2F, -1F, -1F, 4, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F, -0.5F, 0F, -0.5F); // Box 56 + bodyModel[44].setRotationPoint(0F, 4F, 0F); + bodyModel[44].rotateAngleY = 3.92699082F; + + bodyModel[45].addShapeBox(-2F, -1F, -2F, 4, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Box 57 + bodyModel[45].setRotationPoint(0F, 4F, 0F); + bodyModel[45].rotateAngleY = 3.92699082F; + + bodyModel[46].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 67 + bodyModel[46].setRotationPoint(0F, 7F, 0F); + bodyModel[46].rotateAngleY = 3.92699082F; + + bodyModel[47].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 68 + bodyModel[47].setRotationPoint(0F, 7F, 0F); + bodyModel[47].rotateAngleY = 3.92699082F; + + bodyModel[48].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 69 + bodyModel[48].setRotationPoint(0F, 6F, 0F); + bodyModel[48].rotateAngleY = 3.92699082F; + + bodyModel[49].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 70 + bodyModel[49].setRotationPoint(0F, 6F, 0F); + bodyModel[49].rotateAngleY = 2.35619449F; + + bodyModel[50].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 71 + bodyModel[50].setRotationPoint(0F, 7F, 0F); + bodyModel[50].rotateAngleY = 2.35619449F; + + bodyModel[51].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 72 + bodyModel[51].setRotationPoint(0F, 7F, 0F); + bodyModel[51].rotateAngleY = 2.35619449F; + + bodyModel[52].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 73 + bodyModel[52].setRotationPoint(0F, 6F, 0F); + bodyModel[52].rotateAngleY = 5.49778714F; + + bodyModel[53].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 74 + bodyModel[53].setRotationPoint(0F, 7F, 0F); + bodyModel[53].rotateAngleY = 5.49778714F; + + bodyModel[54].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 75 + bodyModel[54].setRotationPoint(0F, 7F, 0F); + bodyModel[54].rotateAngleY = 5.49778714F; + + bodyModel[55].addShapeBox(-2.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 76 + bodyModel[55].setRotationPoint(0F, 7F, 0F); + bodyModel[55].rotateAngleY = 7.06858347F; + + bodyModel[56].addShapeBox(-6.5F, -1F, -0.5F, 3, 5, 1, 0F, 0F, -4F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -4F, -0.2F, -1F, 1F, -0.2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1F, -0.2F); // Box 77 + bodyModel[56].setRotationPoint(0F, 6F, 0F); + bodyModel[56].rotateAngleY = 7.06858347F; + + bodyModel[57].addShapeBox(-3.5F, -1F, -0.5F, 1, 2, 1, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 78 + bodyModel[57].setRotationPoint(0F, 7F, 0F); + bodyModel[57].rotateAngleY = 7.06858347F; + + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelEMPMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelEMPMissile.java new file mode 100644 index 000000000..93ff7e5e8 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelEMPMissile.java @@ -0,0 +1,272 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelEMPMissile extends ModelMissileBase +{ + // fields + ModelRenderer MAIN_MODULE; + ModelRenderer MOTOR_MODULE_1; + ModelRenderer MOTOR_MODULE_2; + ModelRenderer MOTOR_MODULE_3; + ModelRenderer MOTOR_MODULE_4; + ModelRenderer C1; + ModelRenderer C2; + ModelRenderer C3; + ModelRenderer C4; + ModelRenderer T1; + ModelRenderer T2; + ModelRenderer T3; + ModelRenderer T4; + ModelRenderer WING_1A; + ModelRenderer WING_2A; + ModelRenderer WING_1B; + ModelRenderer WING_2B; + ModelRenderer WING_3A; + ModelRenderer WING_3B; + ModelRenderer WING_4B; + ModelRenderer WING_4A; + ModelRenderer TOP; + ModelRenderer BASE; + ModelRenderer MAIN_COIL; + ModelRenderer COIL_1; + ModelRenderer COIL_2; + ModelRenderer COIL_3; + ModelRenderer COIL_4; + ModelRenderer WARHEAD; + + public ModelEMPMissile() + { + textureWidth = 128; + textureHeight = 128; + + MAIN_MODULE = new ModelRenderer(this, 0, 0); + MAIN_MODULE.addBox(0F, 0F, 0F, 8, 70, 8); + MAIN_MODULE.setRotationPoint(-4F, -63F, -4F); + MAIN_MODULE.setTextureSize(128, 128); + MAIN_MODULE.mirror = true; + setRotation(MAIN_MODULE, 0F, 0F, 0F); + MOTOR_MODULE_1 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_1.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_1.setRotationPoint(-8F, 0F, -8F); + MOTOR_MODULE_1.setTextureSize(128, 128); + MOTOR_MODULE_1.mirror = true; + setRotation(MOTOR_MODULE_1, 0F, 0F, 0F); + MOTOR_MODULE_2 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_2.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_2.setRotationPoint(-8F, 0F, 2F); + MOTOR_MODULE_2.setTextureSize(128, 128); + MOTOR_MODULE_2.mirror = true; + setRotation(MOTOR_MODULE_2, 0F, 0F, 0F); + MOTOR_MODULE_3 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_3.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_3.setRotationPoint(2F, 0F, -8F); + MOTOR_MODULE_3.setTextureSize(128, 128); + MOTOR_MODULE_3.mirror = true; + setRotation(MOTOR_MODULE_3, 0F, 0F, 0F); + MOTOR_MODULE_4 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_4.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_4.setRotationPoint(2F, 0F, 2F); + MOTOR_MODULE_4.setTextureSize(128, 128); + MOTOR_MODULE_4.mirror = true; + setRotation(MOTOR_MODULE_4, 0F, 0F, 0F); + C1 = new ModelRenderer(this, 0, 106); + C1.addBox(0F, 0F, 0F, 2, 1, 2); + C1.setRotationPoint(-6F, 20F, -6F); + C1.setTextureSize(128, 128); + C1.mirror = true; + setRotation(C1, 0F, 0F, 0F); + C2 = new ModelRenderer(this, 0, 106); + C2.addBox(0F, 0F, 0F, 2, 1, 2); + C2.setRotationPoint(-6F, 20F, 4F); + C2.setTextureSize(128, 128); + C2.mirror = true; + setRotation(C2, 0F, 0F, 0F); + C3 = new ModelRenderer(this, 0, 106); + C3.addBox(0F, 0F, 0F, 2, 1, 2); + C3.setRotationPoint(4F, 20F, -6F); + C3.setTextureSize(128, 128); + C3.mirror = true; + setRotation(C3, 0F, 0F, 0F); + C4 = new ModelRenderer(this, 0, 106); + C4.addBox(0F, 0F, 0F, 2, 1, 2); + C4.setRotationPoint(4F, 20F, 4F); + C4.setTextureSize(128, 128); + C4.mirror = true; + setRotation(C4, 0F, 0F, 0F); + T1 = new ModelRenderer(this, 0, 111); + T1.addBox(0F, 0F, 0F, 4, 3, 4); + T1.setRotationPoint(-7F, 21F, -7F); + T1.setTextureSize(128, 128); + T1.mirror = true; + setRotation(T1, 0F, 0F, 0F); + T2 = new ModelRenderer(this, 0, 111); + T2.addBox(0F, 0F, 0F, 4, 3, 4); + T2.setRotationPoint(-7F, 21F, 3F); + T2.setTextureSize(128, 128); + T2.mirror = true; + setRotation(T2, 0F, 0F, 0F); + T3 = new ModelRenderer(this, 0, 111); + T3.addBox(0F, 0F, 0F, 4, 3, 4); + T3.setRotationPoint(3F, 21F, -7F); + T3.setTextureSize(128, 128); + T3.mirror = true; + setRotation(T3, 0F, 0F, 0F); + T4 = new ModelRenderer(this, 0, 111); + T4.addBox(0F, 0F, 0F, 4, 3, 4); + T4.setRotationPoint(3F, 21F, 3F); + T4.setTextureSize(128, 128); + T4.mirror = true; + setRotation(T4, 0F, 0F, 0F); + WING_1A = new ModelRenderer(this, 43, 15); + WING_1A.addBox(-1F, 0F, 0F, 2, 12, 12); + WING_1A.setRotationPoint(0F, -10F, 0F); + WING_1A.setTextureSize(128, 128); + WING_1A.mirror = true; + setRotation(WING_1A, -0.7853982F, 0F, 0F); + WING_2A = new ModelRenderer(this, 43, 0); + WING_2A.addBox(0F, 0F, -1F, 12, 12, 2); + WING_2A.setRotationPoint(0F, -10F, 0F); + WING_2A.setTextureSize(128, 128); + WING_2A.mirror = true; + setRotation(WING_2A, 0F, 0F, 0.7853982F); + WING_1B = new ModelRenderer(this, 72, 28); + WING_1B.addBox(-1F, 0F, -8F, 2, 25, 16); + WING_1B.setRotationPoint(0F, -2F, 0F); + WING_1B.setTextureSize(128, 128); + WING_1B.mirror = true; + setRotation(WING_1B, 0F, 0F, 0F); + WING_2B = new ModelRenderer(this, 72, 0); + WING_2B.addBox(-8F, 0F, -1F, 16, 25, 2); + WING_2B.setRotationPoint(0F, -2F, 0F); + WING_2B.setTextureSize(128, 128); + WING_2B.mirror = true; + setRotation(WING_2B, 0F, 0F, 0F); + WING_3A = new ModelRenderer(this, 34, 55); + WING_3A.addBox(-1F, 0F, -8F, 2, 10, 16); + WING_3A.setRotationPoint(0F, -41F, 0F); + WING_3A.setTextureSize(128, 128); + WING_3A.mirror = true; + setRotation(WING_3A, 0F, 0F, 0F); + WING_3B = new ModelRenderer(this, 34, 82); + WING_3B.addBox(-1F, -6F, -6F, 2, 12, 12); + WING_3B.setRotationPoint(0F, -41F, 0F); + WING_3B.setTextureSize(128, 128); + WING_3B.mirror = true; + setRotation(WING_3B, 0.7853982F, 0F, 0F); + WING_4B = new ModelRenderer(this, 34, 41); + WING_4B.addBox(-8F, 0F, -1F, 16, 10, 2); + WING_4B.setRotationPoint(0F, -41F, 0F); + WING_4B.setTextureSize(128, 128); + WING_4B.mirror = true; + setRotation(WING_4B, 0F, 0F, 0F); + WING_4A = new ModelRenderer(this, 34, 107); + WING_4A.addBox(-6F, -6F, -1F, 12, 12, 2); + WING_4A.setRotationPoint(0F, -41F, 0F); + WING_4A.setTextureSize(128, 128); + WING_4A.mirror = true; + setRotation(WING_4A, 0F, 0F, -0.7853982F); + TOP = new ModelRenderer(this, 72, 70); + TOP.addBox(0F, 0F, 0F, 10, 10, 10); + TOP.setRotationPoint(-5F, -64F, -5F); + TOP.setTextureSize(128, 128); + TOP.mirror = true; + setRotation(TOP, 0F, 0F, 0F); + BASE = new ModelRenderer(this, 64, 92); + BASE.addBox(-6F, 0F, -6F, 12, 1, 12); + BASE.setRotationPoint(0F, -65F, 0F); + BASE.setTextureSize(128, 128); + BASE.mirror = true; + setRotation(BASE, 0F, 0F, 0F); + MAIN_COIL = new ModelRenderer(this, 64, 107); + MAIN_COIL.addBox(-3F, 0F, -3F, 6, 10, 6); + MAIN_COIL.setRotationPoint(0F, -75F, 0F); + MAIN_COIL.setTextureSize(128, 128); + MAIN_COIL.mirror = true; + setRotation(MAIN_COIL, 0F, 0F, 0F); + COIL_1 = new ModelRenderer(this, 90, 107); + COIL_1.addBox(3F, 0F, -5F, 2, 8, 2); + COIL_1.setRotationPoint(0F, -73F, 0F); + COIL_1.setTextureSize(128, 128); + COIL_1.mirror = true; + setRotation(COIL_1, 0F, 0F, 0F); + COIL_2 = new ModelRenderer(this, 90, 107); + COIL_2.addBox(-5F, 0F, 3F, 2, 8, 2); + COIL_2.setRotationPoint(0F, -73F, 0F); + COIL_2.setTextureSize(128, 128); + COIL_2.mirror = true; + setRotation(COIL_2, 0F, 0F, 0F); + COIL_3 = new ModelRenderer(this, 90, 107); + COIL_3.addBox(-5F, 0F, -5F, 2, 8, 2); + COIL_3.setRotationPoint(0F, -73F, 0F); + COIL_3.setTextureSize(128, 128); + COIL_3.mirror = true; + setRotation(COIL_3, 0F, 0F, 0F); + COIL_4 = new ModelRenderer(this, 90, 107); + COIL_4.addBox(3F, 0F, 3F, 2, 8, 2); + COIL_4.setRotationPoint(0F, -73F, 0F); + COIL_4.setTextureSize(128, 128); + COIL_4.mirror = true; + setRotation(COIL_4, 0F, 0F, 0F); + WARHEAD = new ModelRenderer(this, 100, 107); + WARHEAD.addBox(-1F, -4F, -1F, 2, 4, 2); + WARHEAD.setRotationPoint(0F, -75F, 0F); + WARHEAD.setTextureSize(128, 128); + WARHEAD.mirror = true; + setRotation(WARHEAD, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + MAIN_MODULE.render(f5); + MOTOR_MODULE_1.render(f5); + MOTOR_MODULE_2.render(f5); + MOTOR_MODULE_3.render(f5); + MOTOR_MODULE_4.render(f5); + C1.render(f5); + C2.render(f5); + C3.render(f5); + C4.render(f5); + T1.render(f5); + T2.render(f5); + T3.render(f5); + T4.render(f5); + WING_1A.render(f5); + WING_2A.render(f5); + WING_1B.render(f5); + WING_2B.render(f5); + WING_3A.render(f5); + WING_3B.render(f5); + WING_4B.render(f5); + WING_4A.render(f5); + TOP.render(f5); + BASE.render(f5); + MAIN_COIL.render(f5); + COIL_1.render(f5); + COIL_2.render(f5); + COIL_3.render(f5); + COIL_4.render(f5); + WARHEAD.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelEndothermicMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelEndothermicMissile.java new file mode 100644 index 000000000..a550f9da3 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelEndothermicMissile.java @@ -0,0 +1,264 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelEndothermicMissile extends ModelMissileBase +{ + // fields + ModelRenderer MAIN_MODULE; + ModelRenderer MOTOR_MODULE_1; + ModelRenderer MOTOR_MODULE_2; + ModelRenderer MOTOR_MODULE_3; + ModelRenderer MOTOR_MODULE_4; + ModelRenderer C1; + ModelRenderer C2; + ModelRenderer C3; + ModelRenderer C4; + ModelRenderer T1; + ModelRenderer T2; + ModelRenderer T3; + ModelRenderer T4; + ModelRenderer WING_1A; + ModelRenderer WING_2A; + ModelRenderer WING_1B; + ModelRenderer WING_2B; + ModelRenderer WING_3A; + ModelRenderer WING_3B; + ModelRenderer WING_4B; + ModelRenderer WING_4A; + ModelRenderer TOP; + ModelRenderer Shape1; + ModelRenderer Shape1a; + ModelRenderer Shape1b; + ModelRenderer Shape1c; + ModelRenderer Shape1d; + ModelRenderer Shape1e; + + public ModelEndothermicMissile() + { + textureWidth = 128; + textureHeight = 128; + + MAIN_MODULE = new ModelRenderer(this, 0, 0); + MAIN_MODULE.addBox(0F, 0F, 0F, 8, 70, 8); + MAIN_MODULE.setRotationPoint(-4F, -63F, -4F); + MAIN_MODULE.setTextureSize(128, 128); + MAIN_MODULE.mirror = true; + setRotation(MAIN_MODULE, 0F, 0F, 0F); + MOTOR_MODULE_1 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_1.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_1.setRotationPoint(-8F, 0F, -8F); + MOTOR_MODULE_1.setTextureSize(128, 128); + MOTOR_MODULE_1.mirror = true; + setRotation(MOTOR_MODULE_1, 0F, 0F, 0F); + MOTOR_MODULE_2 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_2.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_2.setRotationPoint(-8F, 0F, 2F); + MOTOR_MODULE_2.setTextureSize(128, 128); + MOTOR_MODULE_2.mirror = true; + setRotation(MOTOR_MODULE_2, 0F, 0F, 0F); + MOTOR_MODULE_3 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_3.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_3.setRotationPoint(2F, 0F, -8F); + MOTOR_MODULE_3.setTextureSize(128, 128); + MOTOR_MODULE_3.mirror = true; + setRotation(MOTOR_MODULE_3, 0F, 0F, 0F); + MOTOR_MODULE_4 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_4.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_4.setRotationPoint(2F, 0F, 2F); + MOTOR_MODULE_4.setTextureSize(128, 128); + MOTOR_MODULE_4.mirror = true; + setRotation(MOTOR_MODULE_4, 0F, 0F, 0F); + C1 = new ModelRenderer(this, 0, 106); + C1.addBox(0F, 0F, 0F, 2, 1, 2); + C1.setRotationPoint(-6F, 20F, -6F); + C1.setTextureSize(128, 128); + C1.mirror = true; + setRotation(C1, 0F, 0F, 0F); + C2 = new ModelRenderer(this, 0, 106); + C2.addBox(0F, 0F, 0F, 2, 1, 2); + C2.setRotationPoint(-6F, 20F, 4F); + C2.setTextureSize(128, 128); + C2.mirror = true; + setRotation(C2, 0F, 0F, 0F); + C3 = new ModelRenderer(this, 0, 106); + C3.addBox(0F, 0F, 0F, 2, 1, 2); + C3.setRotationPoint(4F, 20F, -6F); + C3.setTextureSize(128, 128); + C3.mirror = true; + setRotation(C3, 0F, 0F, 0F); + C4 = new ModelRenderer(this, 0, 106); + C4.addBox(0F, 0F, 0F, 2, 1, 2); + C4.setRotationPoint(4F, 20F, 4F); + C4.setTextureSize(128, 128); + C4.mirror = true; + setRotation(C4, 0F, 0F, 0F); + T1 = new ModelRenderer(this, 0, 111); + T1.addBox(0F, 0F, 0F, 4, 3, 4); + T1.setRotationPoint(-7F, 21F, -7F); + T1.setTextureSize(128, 128); + T1.mirror = true; + setRotation(T1, 0F, 0F, 0F); + T2 = new ModelRenderer(this, 0, 111); + T2.addBox(0F, 0F, 0F, 4, 3, 4); + T2.setRotationPoint(-7F, 21F, 3F); + T2.setTextureSize(128, 128); + T2.mirror = true; + setRotation(T2, 0F, 0F, 0F); + T3 = new ModelRenderer(this, 0, 111); + T3.addBox(0F, 0F, 0F, 4, 3, 4); + T3.setRotationPoint(3F, 21F, -7F); + T3.setTextureSize(128, 128); + T3.mirror = true; + setRotation(T3, 0F, 0F, 0F); + T4 = new ModelRenderer(this, 0, 111); + T4.addBox(0F, 0F, 0F, 4, 3, 4); + T4.setRotationPoint(3F, 21F, 3F); + T4.setTextureSize(128, 128); + T4.mirror = true; + setRotation(T4, 0F, 0F, 0F); + WING_1A = new ModelRenderer(this, 43, 15); + WING_1A.addBox(-1F, 0F, 0F, 2, 12, 12); + WING_1A.setRotationPoint(0F, -10F, 0F); + WING_1A.setTextureSize(128, 128); + WING_1A.mirror = true; + setRotation(WING_1A, -0.7853982F, 0F, 0F); + WING_2A = new ModelRenderer(this, 43, 0); + WING_2A.addBox(0F, 0F, -1F, 12, 12, 2); + WING_2A.setRotationPoint(0F, -10F, 0F); + WING_2A.setTextureSize(128, 128); + WING_2A.mirror = true; + setRotation(WING_2A, 0F, 0F, 0.7853982F); + WING_1B = new ModelRenderer(this, 72, 28); + WING_1B.addBox(-1F, 0F, -8F, 2, 25, 16); + WING_1B.setRotationPoint(0F, -2F, 0F); + WING_1B.setTextureSize(128, 128); + WING_1B.mirror = true; + setRotation(WING_1B, 0F, 0F, 0F); + WING_2B = new ModelRenderer(this, 72, 0); + WING_2B.addBox(-8F, 0F, -1F, 16, 25, 2); + WING_2B.setRotationPoint(0F, -2F, 0F); + WING_2B.setTextureSize(128, 128); + WING_2B.mirror = true; + setRotation(WING_2B, 0F, 0F, 0F); + WING_3A = new ModelRenderer(this, 34, 55); + WING_3A.addBox(-1F, 0F, -8F, 2, 10, 16); + WING_3A.setRotationPoint(0F, -41F, 0F); + WING_3A.setTextureSize(128, 128); + WING_3A.mirror = true; + setRotation(WING_3A, 0F, 0F, 0F); + WING_3B = new ModelRenderer(this, 34, 82); + WING_3B.addBox(-1F, -6F, -6F, 2, 12, 12); + WING_3B.setRotationPoint(0F, -41F, 0F); + WING_3B.setTextureSize(128, 128); + WING_3B.mirror = true; + setRotation(WING_3B, 0.7853982F, 0F, 0F); + WING_4B = new ModelRenderer(this, 34, 41); + WING_4B.addBox(-8F, 0F, -1F, 16, 10, 2); + WING_4B.setRotationPoint(0F, -41F, 0F); + WING_4B.setTextureSize(128, 128); + WING_4B.mirror = true; + setRotation(WING_4B, 0F, 0F, 0F); + WING_4A = new ModelRenderer(this, 34, 107); + WING_4A.addBox(-6F, -6F, -1F, 12, 12, 2); + WING_4A.setRotationPoint(0F, -41F, 0F); + WING_4A.setTextureSize(128, 128); + WING_4A.mirror = true; + setRotation(WING_4A, 0F, 0F, -0.7853982F); + TOP = new ModelRenderer(this, 72, 70); + TOP.addBox(0F, 0F, 0F, 10, 10, 10); + TOP.setRotationPoint(-5F, -64F, -5F); + TOP.setTextureSize(128, 128); + TOP.mirror = true; + setRotation(TOP, 0F, 0F, 0F); + Shape1 = new ModelRenderer(this, 108, 92); + Shape1.addBox(0F, 0F, 0F, 2, 6, 2); + Shape1.setRotationPoint(-4F, -70F, -4F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape1a = new ModelRenderer(this, 108, 92); + Shape1a.addBox(0F, 0F, 0F, 2, 6, 2); + Shape1a.setRotationPoint(-4F, -70F, 2F); + Shape1a.setTextureSize(128, 128); + Shape1a.mirror = true; + setRotation(Shape1a, 0F, 0F, 0F); + Shape1b = new ModelRenderer(this, 108, 92); + Shape1b.addBox(0F, 0F, 0F, 2, 6, 2); + Shape1b.setRotationPoint(2F, -70F, -4F); + Shape1b.setTextureSize(128, 128); + Shape1b.mirror = true; + setRotation(Shape1b, 0F, 0F, 0F); + Shape1c = new ModelRenderer(this, 108, 92); + Shape1c.addBox(0F, 0F, 0F, 2, 6, 2); + Shape1c.setRotationPoint(2F, -70F, 2F); + Shape1c.setTextureSize(128, 128); + Shape1c.mirror = true; + setRotation(Shape1c, 0F, 0F, 0F); + Shape1d = new ModelRenderer(this, 64, 92); + Shape1d.addBox(0F, 0F, 0F, 6, 10, 6); + Shape1d.setRotationPoint(-3F, -74F, -3F); + Shape1d.setTextureSize(128, 128); + Shape1d.mirror = true; + setRotation(Shape1d, 0F, 0F, 0F); + Shape1e = new ModelRenderer(this, 90, 92); + Shape1e.addBox(0F, 0F, 0F, 4, 6, 4); + Shape1e.setRotationPoint(-2F, -80F, -2F); + Shape1e.setTextureSize(128, 128); + Shape1e.mirror = true; + setRotation(Shape1e, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + MAIN_MODULE.render(f5); + MOTOR_MODULE_1.render(f5); + MOTOR_MODULE_2.render(f5); + MOTOR_MODULE_3.render(f5); + MOTOR_MODULE_4.render(f5); + C1.render(f5); + C2.render(f5); + C3.render(f5); + C4.render(f5); + T1.render(f5); + T2.render(f5); + T3.render(f5); + T4.render(f5); + WING_1A.render(f5); + WING_2A.render(f5); + WING_1B.render(f5); + WING_2B.render(f5); + WING_3A.render(f5); + WING_3B.render(f5); + WING_4B.render(f5); + WING_4A.render(f5); + TOP.render(f5); + Shape1.render(f5); + Shape1a.render(f5); + Shape1b.render(f5); + Shape1c.render(f5); + Shape1d.render(f5); + Shape1e.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelExothermicMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelExothermicMissile.java new file mode 100644 index 000000000..4ff0c0884 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelExothermicMissile.java @@ -0,0 +1,256 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelExothermicMissile extends ModelMissileBase +{ + // fields + ModelRenderer MAIN_MODULE; + ModelRenderer MOTOR_MODULE_1; + ModelRenderer MOTOR_MODULE_2; + ModelRenderer MOTOR_MODULE_3; + ModelRenderer MOTOR_MODULE_4; + ModelRenderer C1; + ModelRenderer C2; + ModelRenderer C3; + ModelRenderer C4; + ModelRenderer T1; + ModelRenderer T2; + ModelRenderer T3; + ModelRenderer T4; + ModelRenderer WING_1A; + ModelRenderer WING_2A; + ModelRenderer WING_1B; + ModelRenderer WING_2B; + ModelRenderer WING_3A; + ModelRenderer WING_3B; + ModelRenderer WING_4B; + ModelRenderer WING_4A; + ModelRenderer TOP; + ModelRenderer Shape1; + ModelRenderer Shape1a; + ModelRenderer Shape2b; + ModelRenderer Shape1c; + ModelRenderer Shape1d; + + public ModelExothermicMissile() + { + textureWidth = 128; + textureHeight = 128; + + MAIN_MODULE = new ModelRenderer(this, 0, 0); + MAIN_MODULE.addBox(0F, 0F, 0F, 8, 70, 8); + MAIN_MODULE.setRotationPoint(-4F, -63F, -4F); + MAIN_MODULE.setTextureSize(128, 128); + MAIN_MODULE.mirror = true; + setRotation(MAIN_MODULE, 0F, 0F, 0F); + MOTOR_MODULE_1 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_1.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_1.setRotationPoint(-8F, 0F, -8F); + MOTOR_MODULE_1.setTextureSize(128, 128); + MOTOR_MODULE_1.mirror = true; + setRotation(MOTOR_MODULE_1, 0F, 0F, 0F); + MOTOR_MODULE_2 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_2.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_2.setRotationPoint(-8F, 0F, 2F); + MOTOR_MODULE_2.setTextureSize(128, 128); + MOTOR_MODULE_2.mirror = true; + setRotation(MOTOR_MODULE_2, 0F, 0F, 0F); + MOTOR_MODULE_3 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_3.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_3.setRotationPoint(2F, 0F, -8F); + MOTOR_MODULE_3.setTextureSize(128, 128); + MOTOR_MODULE_3.mirror = true; + setRotation(MOTOR_MODULE_3, 0F, 0F, 0F); + MOTOR_MODULE_4 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_4.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_4.setRotationPoint(2F, 0F, 2F); + MOTOR_MODULE_4.setTextureSize(128, 128); + MOTOR_MODULE_4.mirror = true; + setRotation(MOTOR_MODULE_4, 0F, 0F, 0F); + C1 = new ModelRenderer(this, 0, 106); + C1.addBox(0F, 0F, 0F, 2, 1, 2); + C1.setRotationPoint(-6F, 20F, -6F); + C1.setTextureSize(128, 128); + C1.mirror = true; + setRotation(C1, 0F, 0F, 0F); + C2 = new ModelRenderer(this, 0, 106); + C2.addBox(0F, 0F, 0F, 2, 1, 2); + C2.setRotationPoint(-6F, 20F, 4F); + C2.setTextureSize(128, 128); + C2.mirror = true; + setRotation(C2, 0F, 0F, 0F); + C3 = new ModelRenderer(this, 0, 106); + C3.addBox(0F, 0F, 0F, 2, 1, 2); + C3.setRotationPoint(4F, 20F, -6F); + C3.setTextureSize(128, 128); + C3.mirror = true; + setRotation(C3, 0F, 0F, 0F); + C4 = new ModelRenderer(this, 0, 106); + C4.addBox(0F, 0F, 0F, 2, 1, 2); + C4.setRotationPoint(4F, 20F, 4F); + C4.setTextureSize(128, 128); + C4.mirror = true; + setRotation(C4, 0F, 0F, 0F); + T1 = new ModelRenderer(this, 0, 111); + T1.addBox(0F, 0F, 0F, 4, 3, 4); + T1.setRotationPoint(-7F, 21F, -7F); + T1.setTextureSize(128, 128); + T1.mirror = true; + setRotation(T1, 0F, 0F, 0F); + T2 = new ModelRenderer(this, 0, 111); + T2.addBox(0F, 0F, 0F, 4, 3, 4); + T2.setRotationPoint(-7F, 21F, 3F); + T2.setTextureSize(128, 128); + T2.mirror = true; + setRotation(T2, 0F, 0F, 0F); + T3 = new ModelRenderer(this, 0, 111); + T3.addBox(0F, 0F, 0F, 4, 3, 4); + T3.setRotationPoint(3F, 21F, -7F); + T3.setTextureSize(128, 128); + T3.mirror = true; + setRotation(T3, 0F, 0F, 0F); + T4 = new ModelRenderer(this, 0, 111); + T4.addBox(0F, 0F, 0F, 4, 3, 4); + T4.setRotationPoint(3F, 21F, 3F); + T4.setTextureSize(128, 128); + T4.mirror = true; + setRotation(T4, 0F, 0F, 0F); + WING_1A = new ModelRenderer(this, 43, 15); + WING_1A.addBox(-1F, 0F, 0F, 2, 12, 12); + WING_1A.setRotationPoint(0F, -10F, 0F); + WING_1A.setTextureSize(128, 128); + WING_1A.mirror = true; + setRotation(WING_1A, -0.7853982F, 0F, 0F); + WING_2A = new ModelRenderer(this, 43, 0); + WING_2A.addBox(0F, 0F, -1F, 12, 12, 2); + WING_2A.setRotationPoint(0F, -10F, 0F); + WING_2A.setTextureSize(128, 128); + WING_2A.mirror = true; + setRotation(WING_2A, 0F, 0F, 0.7853982F); + WING_1B = new ModelRenderer(this, 72, 28); + WING_1B.addBox(-1F, 0F, -8F, 2, 25, 16); + WING_1B.setRotationPoint(0F, -2F, 0F); + WING_1B.setTextureSize(128, 128); + WING_1B.mirror = true; + setRotation(WING_1B, 0F, 0F, 0F); + WING_2B = new ModelRenderer(this, 72, 0); + WING_2B.addBox(-8F, 0F, -1F, 16, 25, 2); + WING_2B.setRotationPoint(0F, -2F, 0F); + WING_2B.setTextureSize(128, 128); + WING_2B.mirror = true; + setRotation(WING_2B, 0F, 0F, 0F); + WING_3A = new ModelRenderer(this, 34, 55); + WING_3A.addBox(-1F, 0F, -8F, 2, 10, 16); + WING_3A.setRotationPoint(0F, -41F, 0F); + WING_3A.setTextureSize(128, 128); + WING_3A.mirror = true; + setRotation(WING_3A, 0F, 0F, 0F); + WING_3B = new ModelRenderer(this, 34, 82); + WING_3B.addBox(-1F, -6F, -6F, 2, 12, 12); + WING_3B.setRotationPoint(0F, -41F, 0F); + WING_3B.setTextureSize(128, 128); + WING_3B.mirror = true; + setRotation(WING_3B, 0.7853982F, 0F, 0F); + WING_4B = new ModelRenderer(this, 34, 41); + WING_4B.addBox(-8F, 0F, -1F, 16, 10, 2); + WING_4B.setRotationPoint(0F, -41F, 0F); + WING_4B.setTextureSize(128, 128); + WING_4B.mirror = true; + setRotation(WING_4B, 0F, 0F, 0F); + WING_4A = new ModelRenderer(this, 34, 107); + WING_4A.addBox(-6F, -6F, -1F, 12, 12, 2); + WING_4A.setRotationPoint(0F, -41F, 0F); + WING_4A.setTextureSize(128, 128); + WING_4A.mirror = true; + setRotation(WING_4A, 0F, 0F, -0.7853982F); + TOP = new ModelRenderer(this, 72, 70); + TOP.addBox(0F, 0F, 0F, 10, 10, 10); + TOP.setRotationPoint(-5F, -64F, -5F); + TOP.setTextureSize(128, 128); + TOP.mirror = true; + setRotation(TOP, 0F, 0F, 0F); + Shape1 = new ModelRenderer(this, 98, 92); + Shape1.addBox(0F, 0F, 0F, 2, 15, 2); + Shape1.setRotationPoint(-1F, -79F, -1F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape1a = new ModelRenderer(this, 65, 92); + Shape1a.addBox(0F, 0F, 0F, 1, 14, 6); + Shape1a.setRotationPoint(2F, -77F, -3F); + Shape1a.setTextureSize(128, 128); + Shape1a.mirror = true; + setRotation(Shape1a, 0F, 0F, -0.1396263F); + Shape2b = new ModelRenderer(this, 81, 92); + Shape2b.addBox(0F, 0F, 0F, 6, 14, 1); + Shape2b.setRotationPoint(-3F, -77F, 2F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0.1396263F, 0F, 0F); + Shape1c = new ModelRenderer(this, 65, 92); + Shape1c.addBox(0F, 0F, 0F, 1, 14, 6); + Shape1c.setRotationPoint(-3F, -77F, -3F); + Shape1c.setTextureSize(128, 128); + Shape1c.mirror = true; + setRotation(Shape1c, 0F, 0F, 0.1396263F); + Shape1d = new ModelRenderer(this, 81, 92); + Shape1d.addBox(0F, 0F, 0F, 6, 14, 1); + Shape1d.setRotationPoint(-3F, -77F, -3F); + Shape1d.setTextureSize(128, 128); + Shape1d.mirror = true; + setRotation(Shape1d, -0.1396263F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + MAIN_MODULE.render(f5); + MOTOR_MODULE_1.render(f5); + MOTOR_MODULE_2.render(f5); + MOTOR_MODULE_3.render(f5); + MOTOR_MODULE_4.render(f5); + C1.render(f5); + C2.render(f5); + C3.render(f5); + C4.render(f5); + T1.render(f5); + T2.render(f5); + T3.render(f5); + T4.render(f5); + WING_1A.render(f5); + WING_2A.render(f5); + WING_1B.render(f5); + WING_2B.render(f5); + WING_3A.render(f5); + WING_3B.render(f5); + WING_4B.render(f5); + WING_4A.render(f5); + TOP.render(f5); + Shape1.render(f5); + Shape1a.render(f5); + Shape2b.render(f5); + Shape1c.render(f5); + Shape1d.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelFragmentationMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelFragmentationMissile.java new file mode 100644 index 000000000..8fba50ce2 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelFragmentationMissile.java @@ -0,0 +1,288 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelFragmentationMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2a; + ModelRenderer Shape2b; + ModelRenderer Shape2c; + ModelRenderer Shape3; + ModelRenderer Shape3a; + ModelRenderer Shape3b; + ModelRenderer Shape3c; + ModelRenderer Shape4; + ModelRenderer Shape4a; + ModelRenderer Shape4b; + ModelRenderer Shape4c; + ModelRenderer Shape5; + ModelRenderer Shape5a; + ModelRenderer Shape4d; + ModelRenderer Shape4e; + ModelRenderer Shape4f; + ModelRenderer Shape4g; + ModelRenderer Shape6; + ModelRenderer Shape6a; + ModelRenderer Shape7; + ModelRenderer Shape7a; + ModelRenderer Shape7b; + ModelRenderer Shape7c; + ModelRenderer Shape7d; + ModelRenderer Shape7e; + ModelRenderer Shape7f; + ModelRenderer Shape7g; + ModelRenderer Shape7h; + ModelRenderer Shape7i; + + public ModelFragmentationMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, 0F, -4F, 8, 64, 8); + Shape1.setRotationPoint(0F, -40F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 34, 19); + Shape2.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2.setRotationPoint(-7F, 14F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2a = new ModelRenderer(this, 34, 19); + Shape2a.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2a.setRotationPoint(-7F, 14F, -7F); + Shape2a.setTextureSize(128, 128); + Shape2a.mirror = true; + setRotation(Shape2a, 0F, 0F, 0F); + Shape2b = new ModelRenderer(this, 34, 31); + Shape2b.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2b.setRotationPoint(-7F, 14F, -6F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0F, 0F, 0F); + Shape2c = new ModelRenderer(this, 34, 31); + Shape2c.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2c.setRotationPoint(6F, 14F, -6F); + Shape2c.setTextureSize(128, 128); + Shape2c.mirror = true; + setRotation(Shape2c, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 72, 0); + Shape3.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3.setRotationPoint(0F, 12F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0.7853982F, 0F); + Shape3a = new ModelRenderer(this, 72, 0); + Shape3a.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3a.setRotationPoint(0F, 12F, 0F); + Shape3a.setTextureSize(128, 128); + Shape3a.mirror = true; + setRotation(Shape3a, 0F, -0.7853982F, 0F); + Shape3b = new ModelRenderer(this, 34, 0); + Shape3b.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3b.setRotationPoint(0F, 12F, 0F); + Shape3b.setTextureSize(128, 128); + Shape3b.mirror = true; + setRotation(Shape3b, 0F, 0.7853982F, 0.7853982F); + Shape3c = new ModelRenderer(this, 34, 0); + Shape3c.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3c.setRotationPoint(0F, 12F, 0F); + Shape3c.setTextureSize(128, 128); + Shape3c.mirror = true; + setRotation(Shape3c, 0F, -0.7853982F, 0.7853982F); + Shape4 = new ModelRenderer(this, 22, 74); + Shape4.addBox(0F, 0F, 0F, 2, 7, 5); + Shape4.setRotationPoint(-1F, -23F, 4F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, -0.5235988F, 0F, 0F); + Shape4a = new ModelRenderer(this, 0, 103); + Shape4a.addBox(0F, 0F, 0F, 5, 8, 2); + Shape4a.setRotationPoint(4F, -23F, -1F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, 0F, 0F, 0.5235988F); + Shape4b = new ModelRenderer(this, 0, 81); + Shape4b.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4b.setRotationPoint(0F, -35F, -4F); + Shape4b.setTextureSize(128, 128); + Shape4b.mirror = true; + setRotation(Shape4b, -0.5235988F, 3.141593F, 0F); + Shape4c = new ModelRenderer(this, 0, 103); + Shape4c.addBox(0F, 0F, -1F, 5, 8, 2); + Shape4c.setRotationPoint(-4F, -23F, 0F); + Shape4c.setTextureSize(128, 128); + Shape4c.mirror = true; + setRotation(Shape4c, 0F, 3.141593F, 0.5235988F); + Shape5 = new ModelRenderer(this, 0, 74); + Shape5.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5.setRotationPoint(0F, -32F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape5a = new ModelRenderer(this, 0, 74); + Shape5a.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5a.setRotationPoint(0F, -32F, 0F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 1.570796F, 0F); + Shape4d = new ModelRenderer(this, 22, 74); + Shape4d.addBox(-1F, 0F, 0F, 2, 8, 5); + Shape4d.setRotationPoint(0F, -23F, -4F); + Shape4d.setTextureSize(128, 128); + Shape4d.mirror = true; + setRotation(Shape4d, -0.5235988F, 3.141593F, 0F); + Shape4e = new ModelRenderer(this, 0, 81); + Shape4e.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4e.setRotationPoint(0F, -35F, 4F); + Shape4e.setTextureSize(128, 128); + Shape4e.mirror = true; + setRotation(Shape4e, -0.5235988F, 0F, 0F); + Shape4f = new ModelRenderer(this, 0, 74); + Shape4f.addBox(0F, 0F, -1F, 5, 4, 2); + Shape4f.setRotationPoint(-4F, -35F, 0F); + Shape4f.setTextureSize(128, 128); + Shape4f.mirror = true; + setRotation(Shape4f, 0F, 3.141593F, 0.5235988F); + Shape4g = new ModelRenderer(this, 0, 74); + Shape4g.addBox(0F, 0F, 0F, 5, 4, 2); + Shape4g.setRotationPoint(4F, -35F, -1F); + Shape4g.setTextureSize(128, 128); + Shape4g.mirror = true; + setRotation(Shape4g, 0F, 0F, 0.5235988F); + Shape6 = new ModelRenderer(this, 72, 16); + Shape6.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6.setRotationPoint(-5F, -37F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 72, 16); + Shape6a.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6a.setRotationPoint(-5F, -41F, -5F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 80, 111); + Shape7.addBox(0F, 0F, 0F, 12, 4, 12); + Shape7.setRotationPoint(-6F, -45F, -6F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape7a = new ModelRenderer(this, 88, 95); + Shape7a.addBox(0F, 0F, 0F, 10, 4, 10); + Shape7a.setRotationPoint(-5F, -49F, -5F); + Shape7a.setTextureSize(128, 128); + Shape7a.mirror = true; + setRotation(Shape7a, 0F, 0F, 0F); + Shape7b = new ModelRenderer(this, 48, 109); + Shape7b.addBox(0F, 0F, 0F, 1, 4, 14); + Shape7b.setRotationPoint(-4F, -45F, -7F); + Shape7b.setTextureSize(128, 128); + Shape7b.mirror = true; + setRotation(Shape7b, 0F, 0F, 0F); + Shape7c = new ModelRenderer(this, 48, 109); + Shape7c.addBox(0F, 0F, 0F, 1, 4, 14); + Shape7c.setRotationPoint(3F, -45F, -7F); + Shape7c.setTextureSize(128, 128); + Shape7c.mirror = true; + setRotation(Shape7c, 0F, 0F, 0F); + Shape7d = new ModelRenderer(this, 48, 109); + Shape7d.addBox(0F, 0F, 0F, 1, 4, 14); + Shape7d.setRotationPoint(-7F, -45F, -3F); + Shape7d.setTextureSize(128, 128); + Shape7d.mirror = true; + setRotation(Shape7d, 0F, 1.570796F, 0F); + Shape7e = new ModelRenderer(this, 48, 109); + Shape7e.addBox(0F, 0F, 0F, 1, 4, 14); + Shape7e.setRotationPoint(-7F, -45F, 4F); + Shape7e.setTextureSize(128, 128); + Shape7e.mirror = true; + setRotation(Shape7e, 0F, 1.570796F, 0F); + Shape7f = new ModelRenderer(this, 52, 91); + Shape7f.addBox(0F, 0F, 0F, 1, 5, 12); + Shape7f.setRotationPoint(-6F, -50F, -1F); + Shape7f.setTextureSize(128, 128); + Shape7f.mirror = true; + setRotation(Shape7f, 0F, 1.570796F, 0F); + Shape7g = new ModelRenderer(this, 52, 91); + Shape7g.addBox(0F, 0F, 0F, 1, 5, 12); + Shape7g.setRotationPoint(-6F, -50F, 2F); + Shape7g.setTextureSize(128, 128); + Shape7g.mirror = true; + setRotation(Shape7g, 0F, 1.570796F, 0F); + Shape7h = new ModelRenderer(this, 52, 91); + Shape7h.addBox(0F, 0F, 0F, 1, 5, 12); + Shape7h.setRotationPoint(1F, -50F, -6F); + Shape7h.setTextureSize(128, 128); + Shape7h.mirror = true; + setRotation(Shape7h, 0F, 0F, 0F); + Shape7i = new ModelRenderer(this, 52, 91); + Shape7i.addBox(0F, 0F, 0F, 1, 5, 12); + Shape7i.setRotationPoint(-2F, -50F, -6F); + Shape7i.setTextureSize(128, 128); + Shape7i.mirror = true; + setRotation(Shape7i, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape2a.render(f5); + Shape2b.render(f5); + Shape2c.render(f5); + Shape3.render(f5); + Shape3a.render(f5); + Shape3b.render(f5); + Shape3c.render(f5); + Shape4.render(f5); + Shape4a.render(f5); + Shape4b.render(f5); + Shape4c.render(f5); + Shape5.render(f5); + Shape5a.render(f5); + Shape4d.render(f5); + Shape4e.render(f5); + Shape4f.render(f5); + Shape4g.render(f5); + Shape6.render(f5); + Shape6a.render(f5); + Shape7.render(f5); + Shape7a.render(f5); + Shape7b.render(f5); + Shape7c.render(f5); + Shape7d.render(f5); + Shape7e.render(f5); + Shape7f.render(f5); + Shape7g.render(f5); + Shape7h.render(f5); + Shape7i.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelHomingMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelHomingMissile.java new file mode 100644 index 000000000..bf0370e58 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelHomingMissile.java @@ -0,0 +1,373 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelHomingMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelHomingMissile() + { + int textureX = 32; + int textureY = 128; + + bodyModel = new ModelRendererTurbo[64]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 30, textureX, textureY); // Box 4 + bodyModel[4] = new ModelRendererTurbo(this, 0, 30, textureX, textureY); // Box 5 + bodyModel[5] = new ModelRendererTurbo(this, 0, 30, textureX, textureY); // Box 6 + bodyModel[6] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Box 7 + bodyModel[7] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 8 + bodyModel[8] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 9 + bodyModel[9] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 10 + bodyModel[10] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 11 + bodyModel[11] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 12 + bodyModel[12] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 13 + bodyModel[13] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 14 + bodyModel[14] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 15 + bodyModel[15] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 16 + bodyModel[16] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 17 + bodyModel[17] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 18 + bodyModel[18] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 19 + bodyModel[19] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 20 + bodyModel[20] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 21 + bodyModel[21] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 22 + bodyModel[22] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 23 + bodyModel[23] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 24 + bodyModel[24] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 25 + bodyModel[25] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 26 + bodyModel[26] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 27 + bodyModel[27] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Box 28 + bodyModel[28] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 29 + bodyModel[29] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 30 + bodyModel[30] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 31 + bodyModel[31] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 32 + bodyModel[32] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 33 + bodyModel[33] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 34 + bodyModel[34] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 35 + bodyModel[35] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 36 + bodyModel[36] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 37 + bodyModel[37] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 38 + bodyModel[38] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Box 39 + bodyModel[39] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 40 + bodyModel[40] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 41 + bodyModel[41] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 42 + bodyModel[42] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 43 + bodyModel[43] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 44 + bodyModel[44] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 45 + bodyModel[45] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 46 + bodyModel[46] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Box 47 + bodyModel[47] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Box 48 + bodyModel[48] = new ModelRendererTurbo(this, 0, 62, textureX, textureY); // Box 49 + bodyModel[49] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Box 50 + bodyModel[50] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 51 + bodyModel[51] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 52 + bodyModel[52] = new ModelRendererTurbo(this, 0, 87, textureX, textureY); // Box 53 + bodyModel[53] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 54 + bodyModel[54] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 55 + bodyModel[55] = new ModelRendererTurbo(this, 0, 117, textureX, textureY); // Box 56 + bodyModel[56] = new ModelRendererTurbo(this, 10, 87, textureX, textureY); // Box 57 + bodyModel[57] = new ModelRendererTurbo(this, 10, 95, textureX, textureY); // Box 58 + bodyModel[58] = new ModelRendererTurbo(this, 10, 95, textureX, textureY); // Box 59 + bodyModel[59] = new ModelRendererTurbo(this, 10, 87, textureX, textureY); // Box 60 + bodyModel[60] = new ModelRendererTurbo(this, 10, 95, textureX, textureY); // Box 61 + bodyModel[61] = new ModelRendererTurbo(this, 10, 87, textureX, textureY); // Box 62 + bodyModel[62] = new ModelRendererTurbo(this, 10, 95, textureX, textureY); // Box 63 + bodyModel[63] = new ModelRendererTurbo(this, 10, 87, textureX, textureY); // Box 64 + + bodyModel[0].addBox(-3F, -1F, -1F, 6, 23, 2, 0F); // Box 0 + bodyModel[0].setRotationPoint(0F, 2F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-3F, -1F, -3F, 6, 23, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 1 + bodyModel[1].setRotationPoint(0F, 2F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-3F, -1F, 1F, 6, 23, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 2 + bodyModel[2].setRotationPoint(0F, 2F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-3F, -7F, -1F, 6, 6, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 4 + bodyModel[3].setRotationPoint(0F, 2F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-3F, -7F, -3F, 6, 6, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[4].setRotationPoint(0F, 2F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-3F, -7F, 1F, 6, 6, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 6 + bodyModel[5].setRotationPoint(0F, 2F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-0.5F, 0F, 2.5F, 1, 21, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 7 + bodyModel[6].setRotationPoint(0F, 2F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-0.5F, 8F, 3.5F, 1, 13, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -10F, 0F, 0F, -10F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 8 + bodyModel[7].setRotationPoint(0F, 2F, 0F); + bodyModel[7].rotateAngleY = 3.92699082F; + + bodyModel[8].addShapeBox(0.5F, 11F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 9 + bodyModel[8].setRotationPoint(0F, 2F, 0F); + bodyModel[8].rotateAngleY = 3.92699082F; + + bodyModel[9].addShapeBox(1.5F, 11F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 10 + bodyModel[9].setRotationPoint(0F, 2F, 0F); + bodyModel[9].rotateAngleY = 3.92699082F; + + bodyModel[10].addShapeBox(2.5F, 11F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 11 + bodyModel[10].setRotationPoint(0F, 2F, 0F); + bodyModel[10].rotateAngleY = 3.92699082F; + + bodyModel[11].addShapeBox(0.5F, 16F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 12 + bodyModel[11].setRotationPoint(0F, 2F, 0F); + bodyModel[11].rotateAngleY = 3.92699082F; + + bodyModel[12].addShapeBox(1.5F, 16F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 13 + bodyModel[12].setRotationPoint(0F, 2F, 0F); + bodyModel[12].rotateAngleY = 3.92699082F; + + bodyModel[13].addShapeBox(2.5F, 16F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[13].setRotationPoint(0F, 2F, 0F); + bodyModel[13].rotateAngleY = 3.92699082F; + + bodyModel[14].addShapeBox(0.5F, 19F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[14].setRotationPoint(0F, 2F, 0F); + bodyModel[14].rotateAngleY = 3.92699082F; + + bodyModel[15].addShapeBox(1.5F, 19F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 16 + bodyModel[15].setRotationPoint(0F, 2F, 0F); + bodyModel[15].rotateAngleY = 3.92699082F; + + bodyModel[16].addShapeBox(2.5F, 19F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 17 + bodyModel[16].setRotationPoint(0F, 2F, 0F); + bodyModel[16].rotateAngleY = 3.92699082F; + + bodyModel[17].addShapeBox(0.5F, 19F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[17].setRotationPoint(0F, 2F, 0F); + bodyModel[17].rotateAngleY = 2.35619449F; + + bodyModel[18].addShapeBox(1.5F, 19F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 19 + bodyModel[18].setRotationPoint(0F, 2F, 0F); + bodyModel[18].rotateAngleY = 2.35619449F; + + bodyModel[19].addShapeBox(2.5F, 19F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 20 + bodyModel[19].setRotationPoint(0F, 2F, 0F); + bodyModel[19].rotateAngleY = 2.35619449F; + + bodyModel[20].addShapeBox(1.5F, 11F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 21 + bodyModel[20].setRotationPoint(0F, 2F, 0F); + bodyModel[20].rotateAngleY = 2.35619449F; + + bodyModel[21].addShapeBox(2.5F, 11F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 22 + bodyModel[21].setRotationPoint(0F, 2F, 0F); + bodyModel[21].rotateAngleY = 2.35619449F; + + bodyModel[22].addShapeBox(0.5F, 11F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 23 + bodyModel[22].setRotationPoint(0F, 2F, 0F); + bodyModel[22].rotateAngleY = 2.35619449F; + + bodyModel[23].addShapeBox(0.5F, 16F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 24 + bodyModel[23].setRotationPoint(0F, 2F, 0F); + bodyModel[23].rotateAngleY = 2.35619449F; + + bodyModel[24].addShapeBox(1.5F, 16F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 25 + bodyModel[24].setRotationPoint(0F, 2F, 0F); + bodyModel[24].rotateAngleY = 2.35619449F; + + bodyModel[25].addShapeBox(2.5F, 16F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 26 + bodyModel[25].setRotationPoint(0F, 2F, 0F); + bodyModel[25].rotateAngleY = 2.35619449F; + + bodyModel[26].addShapeBox(-0.5F, 8F, 3.5F, 1, 13, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -10F, 0F, 0F, -10F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 27 + bodyModel[26].setRotationPoint(0F, 2F, 0F); + bodyModel[26].rotateAngleY = 2.35619449F; + + bodyModel[27].addShapeBox(-0.5F, 0F, 2.5F, 1, 21, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 28 + bodyModel[27].setRotationPoint(0F, 2F, 0F); + bodyModel[27].rotateAngleY = 2.35619449F; + + bodyModel[28].addShapeBox(0.5F, 19F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 29 + bodyModel[28].setRotationPoint(0F, 2F, 0F); + bodyModel[28].rotateAngleY = 0.78539816F; + + bodyModel[29].addShapeBox(1.5F, 19F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 30 + bodyModel[29].setRotationPoint(0F, 2F, 0F); + bodyModel[29].rotateAngleY = 0.78539816F; + + bodyModel[30].addShapeBox(2.5F, 19F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 31 + bodyModel[30].setRotationPoint(0F, 2F, 0F); + bodyModel[30].rotateAngleY = 0.78539816F; + + bodyModel[31].addShapeBox(1.5F, 11F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 32 + bodyModel[31].setRotationPoint(0F, 2F, 0F); + bodyModel[31].rotateAngleY = 0.78539816F; + + bodyModel[32].addShapeBox(2.5F, 11F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 33 + bodyModel[32].setRotationPoint(0F, 2F, 0F); + bodyModel[32].rotateAngleY = 0.78539816F; + + bodyModel[33].addShapeBox(0.5F, 11F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 34 + bodyModel[33].setRotationPoint(0F, 2F, 0F); + bodyModel[33].rotateAngleY = 0.78539816F; + + bodyModel[34].addShapeBox(0.5F, 16F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 35 + bodyModel[34].setRotationPoint(0F, 2F, 0F); + bodyModel[34].rotateAngleY = 0.78539816F; + + bodyModel[35].addShapeBox(1.5F, 16F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 36 + bodyModel[35].setRotationPoint(0F, 2F, 0F); + bodyModel[35].rotateAngleY = 0.78539816F; + + bodyModel[36].addShapeBox(2.5F, 16F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 37 + bodyModel[36].setRotationPoint(0F, 2F, 0F); + bodyModel[36].rotateAngleY = 0.78539816F; + + bodyModel[37].addShapeBox(-0.5F, 8F, 3.5F, 1, 13, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -10F, 0F, 0F, -10F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 38 + bodyModel[37].setRotationPoint(0F, 2F, 0F); + bodyModel[37].rotateAngleY = 0.78539816F; + + bodyModel[38].addShapeBox(-0.5F, 0F, 2.5F, 1, 21, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 39 + bodyModel[38].setRotationPoint(0F, 2F, 0F); + bodyModel[38].rotateAngleY = 0.78539816F; + + bodyModel[39].addShapeBox(0.5F, 19F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 40 + bodyModel[39].setRotationPoint(0F, 2F, 0F); + bodyModel[39].rotateAngleY = -0.78539816F; + + bodyModel[40].addShapeBox(1.5F, 19F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 41 + bodyModel[40].setRotationPoint(0F, 2F, 0F); + bodyModel[40].rotateAngleY = -0.78539816F; + + bodyModel[41].addShapeBox(2.5F, 19F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 42 + bodyModel[41].setRotationPoint(0F, 2F, 0F); + bodyModel[41].rotateAngleY = -0.78539816F; + + bodyModel[42].addShapeBox(1.5F, 11F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 43 + bodyModel[42].setRotationPoint(0F, 2F, 0F); + bodyModel[42].rotateAngleY = -0.78539816F; + + bodyModel[43].addShapeBox(2.5F, 11F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 44 + bodyModel[43].setRotationPoint(0F, 2F, 0F); + bodyModel[43].rotateAngleY = -0.78539816F; + + bodyModel[44].addShapeBox(0.5F, 11F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 45 + bodyModel[44].setRotationPoint(0F, 2F, 0F); + bodyModel[44].rotateAngleY = -0.78539816F; + + bodyModel[45].addShapeBox(0.5F, 16F, 2.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 46 + bodyModel[45].setRotationPoint(0F, 2F, 0F); + bodyModel[45].rotateAngleY = -0.78539816F; + + bodyModel[46].addShapeBox(1.5F, 16F, 1.5F, 2, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 0F); // Box 47 + bodyModel[46].setRotationPoint(0F, 2F, 0F); + bodyModel[46].rotateAngleY = -0.78539816F; + + bodyModel[47].addShapeBox(2.5F, 16F, 0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 48 + bodyModel[47].setRotationPoint(0F, 2F, 0F); + bodyModel[47].rotateAngleY = -0.78539816F; + + bodyModel[48].addShapeBox(-0.5F, 8F, 3.5F, 1, 13, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -10F, 0F, 0F, -10F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 49 + bodyModel[48].setRotationPoint(0F, 2F, 0F); + bodyModel[48].rotateAngleY = -0.78539816F; + + bodyModel[49].addShapeBox(-0.5F, 0F, 2.5F, 1, 21, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 50 + bodyModel[49].setRotationPoint(0F, 2F, 0F); + bodyModel[49].rotateAngleY = -0.78539816F; + + bodyModel[50].addShapeBox(-1.5F, -35F, -0.5F, 3, 28, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 51 + bodyModel[50].setRotationPoint(0F, 2F, 0F); + bodyModel[50].rotateAngleY = 3.92699082F; + + bodyModel[51].addShapeBox(-1.5F, -35F, -1.5F, 3, 28, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 52 + bodyModel[51].setRotationPoint(0F, 2F, 0F); + bodyModel[51].rotateAngleY = 3.92699082F; + + bodyModel[52].addShapeBox(-1.5F, -35F, 0.5F, 3, 28, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 53 + bodyModel[52].setRotationPoint(0F, 2F, 0F); + bodyModel[52].rotateAngleY = 3.92699082F; + + bodyModel[53].addShapeBox(-1.5F, -41F, -0.5F, 3, 6, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 54 + bodyModel[53].setRotationPoint(0F, 2F, 0F); + bodyModel[53].rotateAngleY = 3.92699082F; + + bodyModel[54].addShapeBox(-1.5F, -41F, -1.5F, 3, 6, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 55 + bodyModel[54].setRotationPoint(0F, 2F, 0F); + bodyModel[54].rotateAngleY = 3.92699082F; + + bodyModel[55].addShapeBox(-1.5F, -41F, 0.5F, 3, 6, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 56 + bodyModel[55].setRotationPoint(0F, 2F, 0F); + bodyModel[55].rotateAngleY = 3.92699082F; + + bodyModel[56].addShapeBox(-0.5F, -12F, 1.5F, 1, 4, 4, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -2F, 0F, -0.2F, -2F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F); // Box 57 + bodyModel[56].setRotationPoint(0F, 2F, 0F); + bodyModel[56].rotateAngleY = 3.92699082F; + + bodyModel[57].addShapeBox(-0.5F, -26F, 1.5F, 1, 11, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Box 58 + bodyModel[57].setRotationPoint(0F, 2F, 0F); + bodyModel[57].rotateAngleY = 3.92699082F; + + bodyModel[58].addShapeBox(-0.5F, -26F, 1.5F, 1, 11, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Box 59 + bodyModel[58].setRotationPoint(0F, 2F, 0F); + bodyModel[58].rotateAngleY = 2.35619449F; + + bodyModel[59].addShapeBox(-0.5F, -12F, 1.5F, 1, 4, 4, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -2F, 0F, -0.2F, -2F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F); // Box 60 + bodyModel[59].setRotationPoint(0F, 2F, 0F); + bodyModel[59].rotateAngleY = 2.35619449F; + + bodyModel[60].addShapeBox(-0.5F, -26F, 1.5F, 1, 11, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Box 61 + bodyModel[60].setRotationPoint(0F, 2F, 0F); + bodyModel[60].rotateAngleY = -0.78539816F; + + bodyModel[61].addShapeBox(-0.5F, -12F, 1.5F, 1, 4, 4, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -2F, 0F, -0.2F, -2F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F); // Box 62 + bodyModel[61].setRotationPoint(0F, 2F, 0F); + bodyModel[61].rotateAngleY = -0.78539816F; + + bodyModel[62].addShapeBox(-0.5F, -26F, 1.5F, 1, 11, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Box 63 + bodyModel[62].setRotationPoint(0F, 2F, 0F); + bodyModel[62].rotateAngleY = 0.78539816F; + + bodyModel[63].addShapeBox(-0.5F, -12F, 1.5F, 1, 4, 4, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -2F, 0F, -0.2F, -2F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F); // Box 64 + bodyModel[63].setRotationPoint(0F, 2F, 0F); + bodyModel[63].rotateAngleY = 0.78539816F; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelHypersonicMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelHypersonicMissile.java new file mode 100644 index 000000000..98798b7a6 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelHypersonicMissile.java @@ -0,0 +1,300 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelHypersonicMissile extends ModelMissileBase +{ + // fields + ModelRenderer MAIN_MODULE; + ModelRenderer MOTOR_MODULE_1; + ModelRenderer MOTOR_MODULE_2; + ModelRenderer MOTOR_MODULE_3; + ModelRenderer MOTOR_MODULE_4; + ModelRenderer C1; + ModelRenderer C2; + ModelRenderer C3; + ModelRenderer C4; + ModelRenderer T1; + ModelRenderer T2; + ModelRenderer T3; + ModelRenderer T4; + ModelRenderer WING_1A; + ModelRenderer WING_2A; + ModelRenderer WING_1B; + ModelRenderer WING_2B; + ModelRenderer WING_3A; + ModelRenderer WING_3B; + ModelRenderer WING_4B; + ModelRenderer WING_4A; + ModelRenderer TOP; + ModelRenderer VOX_1; + ModelRenderer VOX_2; + ModelRenderer VOX3; + ModelRenderer VOX4; + ModelRenderer A; + ModelRenderer B; + ModelRenderer C; + ModelRenderer D; + ModelRenderer E; + ModelRenderer F; + ModelRenderer G; + + public ModelHypersonicMissile() + { + textureWidth = 128; + textureHeight = 128; + + MAIN_MODULE = new ModelRenderer(this, 0, 0); + MAIN_MODULE.addBox(0F, 0F, 0F, 8, 70, 8); + MAIN_MODULE.setRotationPoint(-4F, -63F, -4F); + MAIN_MODULE.setTextureSize(128, 128); + MAIN_MODULE.mirror = true; + setRotation(MAIN_MODULE, 0F, 0F, 0F); + MOTOR_MODULE_1 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_1.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_1.setRotationPoint(-8F, 0F, -8F); + MOTOR_MODULE_1.setTextureSize(128, 128); + MOTOR_MODULE_1.mirror = true; + setRotation(MOTOR_MODULE_1, 0F, 0F, 0F); + MOTOR_MODULE_2 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_2.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_2.setRotationPoint(-8F, 0F, 2F); + MOTOR_MODULE_2.setTextureSize(128, 128); + MOTOR_MODULE_2.mirror = true; + setRotation(MOTOR_MODULE_2, 0F, 0F, 0F); + MOTOR_MODULE_3 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_3.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_3.setRotationPoint(2F, 0F, -8F); + MOTOR_MODULE_3.setTextureSize(128, 128); + MOTOR_MODULE_3.mirror = true; + setRotation(MOTOR_MODULE_3, 0F, 0F, 0F); + MOTOR_MODULE_4 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_4.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_4.setRotationPoint(2F, 0F, 2F); + MOTOR_MODULE_4.setTextureSize(128, 128); + MOTOR_MODULE_4.mirror = true; + setRotation(MOTOR_MODULE_4, 0F, 0F, 0F); + C1 = new ModelRenderer(this, 0, 106); + C1.addBox(0F, 0F, 0F, 2, 1, 2); + C1.setRotationPoint(-6F, 20F, -6F); + C1.setTextureSize(128, 128); + C1.mirror = true; + setRotation(C1, 0F, 0F, 0F); + C2 = new ModelRenderer(this, 0, 106); + C2.addBox(0F, 0F, 0F, 2, 1, 2); + C2.setRotationPoint(-6F, 20F, 4F); + C2.setTextureSize(128, 128); + C2.mirror = true; + setRotation(C2, 0F, 0F, 0F); + C3 = new ModelRenderer(this, 0, 106); + C3.addBox(0F, 0F, 0F, 2, 1, 2); + C3.setRotationPoint(4F, 20F, -6F); + C3.setTextureSize(128, 128); + C3.mirror = true; + setRotation(C3, 0F, 0F, 0F); + C4 = new ModelRenderer(this, 0, 106); + C4.addBox(0F, 0F, 0F, 2, 1, 2); + C4.setRotationPoint(4F, 20F, 4F); + C4.setTextureSize(128, 128); + C4.mirror = true; + setRotation(C4, 0F, 0F, 0F); + T1 = new ModelRenderer(this, 0, 111); + T1.addBox(0F, 0F, 0F, 4, 3, 4); + T1.setRotationPoint(-7F, 21F, -7F); + T1.setTextureSize(128, 128); + T1.mirror = true; + setRotation(T1, 0F, 0F, 0F); + T2 = new ModelRenderer(this, 0, 111); + T2.addBox(0F, 0F, 0F, 4, 3, 4); + T2.setRotationPoint(-7F, 21F, 3F); + T2.setTextureSize(128, 128); + T2.mirror = true; + setRotation(T2, 0F, 0F, 0F); + T3 = new ModelRenderer(this, 0, 111); + T3.addBox(0F, 0F, 0F, 4, 3, 4); + T3.setRotationPoint(3F, 21F, -7F); + T3.setTextureSize(128, 128); + T3.mirror = true; + setRotation(T3, 0F, 0F, 0F); + T4 = new ModelRenderer(this, 0, 111); + T4.addBox(0F, 0F, 0F, 4, 3, 4); + T4.setRotationPoint(3F, 21F, 3F); + T4.setTextureSize(128, 128); + T4.mirror = true; + setRotation(T4, 0F, 0F, 0F); + WING_1A = new ModelRenderer(this, 43, 15); + WING_1A.addBox(-1F, 0F, 0F, 2, 12, 12); + WING_1A.setRotationPoint(0F, -10F, 0F); + WING_1A.setTextureSize(128, 128); + WING_1A.mirror = true; + setRotation(WING_1A, -0.7853982F, 0F, 0F); + WING_2A = new ModelRenderer(this, 43, 0); + WING_2A.addBox(0F, 0F, -1F, 12, 12, 2); + WING_2A.setRotationPoint(0F, -10F, 0F); + WING_2A.setTextureSize(128, 128); + WING_2A.mirror = true; + setRotation(WING_2A, 0F, 0F, 0.7853982F); + WING_1B = new ModelRenderer(this, 72, 28); + WING_1B.addBox(-1F, 0F, -8F, 2, 25, 16); + WING_1B.setRotationPoint(0F, -2F, 0F); + WING_1B.setTextureSize(128, 128); + WING_1B.mirror = true; + setRotation(WING_1B, 0F, 0F, 0F); + WING_2B = new ModelRenderer(this, 72, 0); + WING_2B.addBox(-8F, 0F, -1F, 16, 25, 2); + WING_2B.setRotationPoint(0F, -2F, 0F); + WING_2B.setTextureSize(128, 128); + WING_2B.mirror = true; + setRotation(WING_2B, 0F, 0F, 0F); + WING_3A = new ModelRenderer(this, 34, 55); + WING_3A.addBox(-1F, 0F, -8F, 2, 10, 16); + WING_3A.setRotationPoint(0F, -41F, 0F); + WING_3A.setTextureSize(128, 128); + WING_3A.mirror = true; + setRotation(WING_3A, 0F, 0F, 0F); + WING_3B = new ModelRenderer(this, 34, 82); + WING_3B.addBox(-1F, -6F, -6F, 2, 12, 12); + WING_3B.setRotationPoint(0F, -41F, 0F); + WING_3B.setTextureSize(128, 128); + WING_3B.mirror = true; + setRotation(WING_3B, 0.7853982F, 0F, 0F); + WING_4B = new ModelRenderer(this, 34, 41); + WING_4B.addBox(-8F, 0F, -1F, 16, 10, 2); + WING_4B.setRotationPoint(0F, -41F, 0F); + WING_4B.setTextureSize(128, 128); + WING_4B.mirror = true; + setRotation(WING_4B, 0F, 0F, 0F); + WING_4A = new ModelRenderer(this, 34, 107); + WING_4A.addBox(-6F, -6F, -1F, 12, 12, 2); + WING_4A.setRotationPoint(0F, -41F, 0F); + WING_4A.setTextureSize(128, 128); + WING_4A.mirror = true; + setRotation(WING_4A, 0F, 0F, -0.7853982F); + TOP = new ModelRenderer(this, 72, 70); + TOP.addBox(0F, 0F, 0F, 10, 10, 10); + TOP.setRotationPoint(-5F, -64F, -5F); + TOP.setTextureSize(128, 128); + TOP.mirror = true; + setRotation(TOP, 0F, 0F, 0F); + VOX_1 = new ModelRenderer(this, 113, 99); + VOX_1.addBox(-3F, -3F, 5F, 6, 6, 1); + VOX_1.setRotationPoint(0F, -59F, 0F); + VOX_1.setTextureSize(128, 128); + VOX_1.mirror = true; + setRotation(VOX_1, 0F, 0F, 0F); + VOX_2 = new ModelRenderer(this, 113, 99); + VOX_2.addBox(-3F, -3F, 5F, 6, 6, 1); + VOX_2.setRotationPoint(0F, -59F, 0F); + VOX_2.setTextureSize(128, 128); + VOX_2.mirror = true; + setRotation(VOX_2, 0F, 1.570796F, 0F); + VOX3 = new ModelRenderer(this, 113, 99); + VOX3.addBox(-3F, -3F, 5F, 6, 6, 1); + VOX3.setRotationPoint(0F, -59F, 0F); + VOX3.setTextureSize(128, 128); + VOX3.mirror = true; + setRotation(VOX3, 0F, -1.570796F, 0F); + VOX4 = new ModelRenderer(this, 113, 99); + VOX4.addBox(-3F, -3F, -6F, 6, 6, 1); + VOX4.setRotationPoint(0F, -59F, 0F); + VOX4.setTextureSize(128, 128); + VOX4.mirror = true; + setRotation(VOX4, 0F, 0F, 0F); + A = new ModelRenderer(this, 79, 92); + A.addBox(-4F, 0F, -4F, 8, 6, 8); + A.setRotationPoint(0F, -70F, 0F); + A.setTextureSize(128, 128); + A.mirror = true; + setRotation(A, 0F, 0F, 0F); + B = new ModelRenderer(this, 79, 108); + B.addBox(-3F, 0F, -3F, 6, 6, 6); + B.setRotationPoint(0F, -76F, 0F); + B.setTextureSize(128, 128); + B.mirror = true; + setRotation(B, 0F, 0F, 0F); + C = new ModelRenderer(this, 106, 108); + C.addBox(-2F, 0F, -2F, 4, 6, 4); + C.setRotationPoint(0F, -82F, 0F); + C.setTextureSize(128, 128); + C.mirror = true; + setRotation(C, 0F, 0F, 0F); + D = new ModelRenderer(this, 65, 92); + D.addBox(-1F, 0F, -2F, 2, 18, 4); + D.setRotationPoint(0F, -81F, 0F); + D.setTextureSize(128, 128); + D.mirror = true; + setRotation(D, -0.2094395F, 0F, 0F); + E = new ModelRenderer(this, 65, 92); + E.addBox(-1F, 0F, -2F, 2, 18, 4); + E.setRotationPoint(0F, -81F, 0F); + E.setTextureSize(128, 128); + E.mirror = true; + setRotation(E, -0.2094395F, 1.570796F, 0F); + F = new ModelRenderer(this, 65, 92); + F.addBox(-1F, 0F, -2F, 2, 18, 4); + F.setRotationPoint(0F, -81F, 0F); + F.setTextureSize(128, 128); + F.mirror = true; + setRotation(F, -0.2094395F, -1.570796F, 0F); + G = new ModelRenderer(this, 65, 92); + G.addBox(-1F, 0F, -2F, 2, 18, 4); + G.setRotationPoint(0F, -81F, 0F); + G.setTextureSize(128, 128); + G.mirror = true; + setRotation(G, 0.2094395F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.render(f5); + } + + @Override + public void render(float f5) + { + MAIN_MODULE.render(f5); + MOTOR_MODULE_1.render(f5); + MOTOR_MODULE_2.render(f5); + MOTOR_MODULE_3.render(f5); + MOTOR_MODULE_4.render(f5); + C1.render(f5); + C2.render(f5); + C3.render(f5); + C4.render(f5); + T1.render(f5); + T2.render(f5); + T3.render(f5); + T4.render(f5); + WING_1A.render(f5); + WING_2A.render(f5); + WING_1B.render(f5); + WING_2B.render(f5); + WING_3A.render(f5); + WING_3B.render(f5); + WING_4B.render(f5); + WING_4A.render(f5); + TOP.render(f5); + VOX_1.render(f5); + VOX_2.render(f5); + VOX3.render(f5); + VOX4.render(f5); + A.render(f5); + B.render(f5); + C.render(f5); + D.render(f5); + E.render(f5); + F.render(f5); + G.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelIncendiaryMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelIncendiaryMissile.java new file mode 100644 index 000000000..ec0eb2936 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelIncendiaryMissile.java @@ -0,0 +1,414 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelIncendiaryMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelIncendiaryMissile() + { + int textureX = 64; + int textureY = 256; + + bodyModel = new ModelRendererTurbo[72]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportBox0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 36, textureX, textureY); // Import ImportBox1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 36, textureX, textureY); // Import ImportBox2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox5 + bodyModel[4] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Import ImportBox6 + bodyModel[5] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox7 + bodyModel[6] = new ModelRendererTurbo(this, 0, 92, textureX, textureY); // Import ImportBox8 + bodyModel[7] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox9 + bodyModel[8] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox10 + bodyModel[9] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Import ImportBox11 + bodyModel[10] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Import ImportBox12 + bodyModel[11] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox13 + bodyModel[12] = new ModelRendererTurbo(this, 0, 92, textureX, textureY); // Import ImportBox14 + bodyModel[13] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox15 + bodyModel[14] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox16 + bodyModel[15] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox17 + bodyModel[16] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Import ImportBox18 + bodyModel[17] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Import ImportBox19 + bodyModel[18] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox20 + bodyModel[19] = new ModelRendererTurbo(this, 0, 92, textureX, textureY); // Import ImportBox21 + bodyModel[20] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox22 + bodyModel[21] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox23 + bodyModel[22] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox24 + bodyModel[23] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Import ImportBox25 + bodyModel[24] = new ModelRendererTurbo(this, 0, 110, textureX, textureY); // Import ImportBox26 + bodyModel[25] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox27 + bodyModel[26] = new ModelRendererTurbo(this, 0, 92, textureX, textureY); // Import ImportBox28 + bodyModel[27] = new ModelRendererTurbo(this, 0, 67, textureX, textureY); // Import ImportBox29 + bodyModel[28] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox30 + bodyModel[29] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Import ImportBox31 + bodyModel[30] = new ModelRendererTurbo(this, 0, 80, textureX, textureY); // Import ImportBox32 + bodyModel[31] = new ModelRendererTurbo(this, 0, 115, textureX, textureY); // Import ImportBox33 + bodyModel[32] = new ModelRendererTurbo(this, 0, 119, textureX, textureY); // Import ImportBox34 + bodyModel[33] = new ModelRendererTurbo(this, 0, 123, textureX, textureY); // Import ImportBox36 + bodyModel[34] = new ModelRendererTurbo(this, 0, 123, textureX, textureY); // Import ImportBox37 + bodyModel[35] = new ModelRendererTurbo(this, 0, 115, textureX, textureY); // Import ImportBox38 + bodyModel[36] = new ModelRendererTurbo(this, 0, 119, textureX, textureY); // Import ImportBox39 + bodyModel[37] = new ModelRendererTurbo(this, 0, 123, textureX, textureY); // Import ImportBox40 + bodyModel[38] = new ModelRendererTurbo(this, 0, 115, textureX, textureY); // Import ImportBox41 + bodyModel[39] = new ModelRendererTurbo(this, 0, 119, textureX, textureY); // Import ImportBox42 + bodyModel[40] = new ModelRendererTurbo(this, 0, 123, textureX, textureY); // Import ImportBox43 + bodyModel[41] = new ModelRendererTurbo(this, 0, 115, textureX, textureY); // Import ImportBox44 + bodyModel[42] = new ModelRendererTurbo(this, 0, 119, textureX, textureY); // Import ImportBox45 + bodyModel[43] = new ModelRendererTurbo(this, 0, 127, textureX, textureY); // Import ImportBox46 + bodyModel[44] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Import ImportBox47 + bodyModel[45] = new ModelRendererTurbo(this, 0, 135, textureX, textureY); // Import ImportBox48 + bodyModel[46] = new ModelRendererTurbo(this, 0, 142, textureX, textureY); // Import ImportBox49 + bodyModel[47] = new ModelRendererTurbo(this, 0, 142, textureX, textureY); // Import ImportBox50 + bodyModel[48] = new ModelRendererTurbo(this, 0, 142, textureX, textureY); // Import ImportBox51 + bodyModel[49] = new ModelRendererTurbo(this, 0, 142, textureX, textureY); // Import ImportBox52 + bodyModel[50] = new ModelRendererTurbo(this, 0, 152, textureX, textureY); // Import ImportBox53 + bodyModel[51] = new ModelRendererTurbo(this, 0, 171, textureX, textureY); // Import ImportBox54 + bodyModel[52] = new ModelRendererTurbo(this, 0, 171, textureX, textureY); // Import ImportBox55 + bodyModel[53] = new ModelRendererTurbo(this, 0, 187, textureX, textureY); // Import ImportBox56 + bodyModel[54] = new ModelRendererTurbo(this, 0, 197, textureX, textureY); // Import ImportBox57 + bodyModel[55] = new ModelRendererTurbo(this, 0, 207, textureX, textureY); // Import ImportBox58 + bodyModel[56] = new ModelRendererTurbo(this, 0, 187, textureX, textureY); // Import ImportBox59 + bodyModel[57] = new ModelRendererTurbo(this, 0, 197, textureX, textureY); // Import ImportBox60 + bodyModel[58] = new ModelRendererTurbo(this, 0, 207, textureX, textureY); // Import ImportBox61 + bodyModel[59] = new ModelRendererTurbo(this, 0, 187, textureX, textureY); // Import ImportBox62 + bodyModel[60] = new ModelRendererTurbo(this, 0, 197, textureX, textureY); // Import ImportBox63 + bodyModel[61] = new ModelRendererTurbo(this, 0, 207, textureX, textureY); // Import ImportBox64 + bodyModel[62] = new ModelRendererTurbo(this, 0, 187, textureX, textureY); // Import ImportBox65 + bodyModel[63] = new ModelRendererTurbo(this, 0, 197, textureX, textureY); // Import ImportBox66 + bodyModel[64] = new ModelRendererTurbo(this, 0, 207, textureX, textureY); // Import ImportBox67 + bodyModel[65] = new ModelRendererTurbo(this, 0, 214, textureX, textureY); // Import ImportBox68 + bodyModel[66] = new ModelRendererTurbo(this, 0, 225, textureX, textureY); // Import ImportBox70 + bodyModel[67] = new ModelRendererTurbo(this, 0, 225, textureX, textureY); // Import ImportBox71 + bodyModel[68] = new ModelRendererTurbo(this, 0, 234, textureX, textureY); // Import ImportBox72 + bodyModel[69] = new ModelRendererTurbo(this, 0, 234, textureX, textureY); // Import ImportBox73 + bodyModel[70] = new ModelRendererTurbo(this, 0, 234, textureX, textureY); // Import ImportBox74 + bodyModel[71] = new ModelRendererTurbo(this, 0, 242, textureX, textureY); // Import ImportBox75 + + bodyModel[0].addBox(-4F, -8F, -3F, 8, 29, 6, 0F); // Import ImportBox0 + bodyModel[0].setRotationPoint(0F, -2F, 0F); + bodyModel[0].rotateAngleY = -0.78539816F; + + bodyModel[1].addShapeBox(-4F, -8F, -4F, 8, 29, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox1 + bodyModel[1].setRotationPoint(0F, -2F, 0F); + bodyModel[1].rotateAngleY = -0.78539816F; + + bodyModel[2].addShapeBox(-4F, -8F, 3F, 8, 29, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import ImportBox2 + bodyModel[2].setRotationPoint(0F, -2F, 0F); + bodyModel[2].rotateAngleY = -0.78539816F; + + bodyModel[3].addShapeBox(1F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F); // Import ImportBox5 + bodyModel[3].setRotationPoint(0F, -2F, 0F); + bodyModel[3].rotateAngleY = -0.78539816F; + + bodyModel[4].addShapeBox(-1F, 16F, 4F, 2, 8, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox6 + bodyModel[4].setRotationPoint(0F, -2F, 0F); + bodyModel[4].rotateAngleY = -0.78539816F; + + bodyModel[5].addShapeBox(-2F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 0F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Import ImportBox7 + bodyModel[5].setRotationPoint(0F, -2F, 0F); + bodyModel[5].rotateAngleY = -0.78539816F; + + bodyModel[6].addShapeBox(-1F, 16F, 7F, 2, 8, 1, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox8 + bodyModel[6].setRotationPoint(0F, -2F, 0F); + bodyModel[6].rotateAngleY = -0.78539816F; + + bodyModel[7].addShapeBox(-1F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox9 + bodyModel[7].setRotationPoint(0F, -6F, 0F); + bodyModel[7].rotateAngleY = -0.78539816F; + + bodyModel[8].addShapeBox(0F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox10 + bodyModel[8].setRotationPoint(0F, -6F, 0F); + bodyModel[8].rotateAngleY = -0.78539816F; + + bodyModel[9].addShapeBox(-2F, 21F, 3F, 4, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox11 + bodyModel[9].setRotationPoint(0F, -2F, 0F); + bodyModel[9].rotateAngleY = -0.78539816F; + + bodyModel[10].addShapeBox(-2F, 21F, 3F, 4, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox12 + bodyModel[10].setRotationPoint(0F, -2F, 0F); + bodyModel[10].rotateAngleY = -2.35619449F; + + bodyModel[11].addShapeBox(-2F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 0F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Import ImportBox13 + bodyModel[11].setRotationPoint(0F, -2F, 0F); + bodyModel[11].rotateAngleY = -2.35619449F; + + bodyModel[12].addShapeBox(-1F, 16F, 7F, 2, 8, 1, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox14 + bodyModel[12].setRotationPoint(0F, -2F, 0F); + bodyModel[12].rotateAngleY = -2.35619449F; + + bodyModel[13].addShapeBox(1F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F); // Import ImportBox15 + bodyModel[13].setRotationPoint(0F, -2F, 0F); + bodyModel[13].rotateAngleY = -2.35619449F; + + bodyModel[14].addShapeBox(-1F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox16 + bodyModel[14].setRotationPoint(0F, -6F, 0F); + bodyModel[14].rotateAngleY = -2.35619449F; + + bodyModel[15].addShapeBox(0F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox17 + bodyModel[15].setRotationPoint(0F, -6F, 0F); + bodyModel[15].rotateAngleY = -2.35619449F; + + bodyModel[16].addShapeBox(-1F, 16F, 4F, 2, 8, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox18 + bodyModel[16].setRotationPoint(0F, -2F, 0F); + bodyModel[16].rotateAngleY = -2.35619449F; + + bodyModel[17].addShapeBox(-2F, 21F, 3F, 4, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox19 + bodyModel[17].setRotationPoint(0F, -2F, 0F); + bodyModel[17].rotateAngleY = -3.92699081F; + + bodyModel[18].addShapeBox(-2F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 0F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Import ImportBox20 + bodyModel[18].setRotationPoint(0F, -2F, 0F); + bodyModel[18].rotateAngleY = -3.92699081F; + + bodyModel[19].addShapeBox(-1F, 16F, 7F, 2, 8, 1, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox21 + bodyModel[19].setRotationPoint(0F, -2F, 0F); + bodyModel[19].rotateAngleY = -3.92699081F; + + bodyModel[20].addShapeBox(1F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F); // Import ImportBox22 + bodyModel[20].setRotationPoint(0F, -2F, 0F); + bodyModel[20].rotateAngleY = -3.92699081F; + + bodyModel[21].addShapeBox(-1F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox23 + bodyModel[21].setRotationPoint(0F, -6F, 0F); + bodyModel[21].rotateAngleY = -3.92699081F; + + bodyModel[22].addShapeBox(0F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox24 + bodyModel[22].setRotationPoint(0F, -6F, 0F); + bodyModel[22].rotateAngleY = -3.92699081F; + + bodyModel[23].addShapeBox(-1F, 16F, 4F, 2, 8, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox25 + bodyModel[23].setRotationPoint(0F, -2F, 0F); + bodyModel[23].rotateAngleY = -3.92699081F; + + bodyModel[24].addShapeBox(-2F, 21F, 3F, 4, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox26 + bodyModel[24].setRotationPoint(0F, -2F, 0F); + bodyModel[24].rotateAngleY = -5.49778714F; + + bodyModel[25].addShapeBox(-2F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 0F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Import ImportBox27 + bodyModel[25].setRotationPoint(0F, -2F, 0F); + bodyModel[25].rotateAngleY = -5.49778714F; + + bodyModel[26].addShapeBox(-1F, 16F, 7F, 2, 8, 1, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox28 + bodyModel[26].setRotationPoint(0F, -2F, 0F); + bodyModel[26].rotateAngleY = -5.49778714F; + + bodyModel[27].addShapeBox(1F, 16F, 4F, 1, 8, 4, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, 1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F); // Import ImportBox29 + bodyModel[27].setRotationPoint(0F, -2F, 0F); + bodyModel[27].rotateAngleY = -5.49778714F; + + bodyModel[28].addShapeBox(-1F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox30 + bodyModel[28].setRotationPoint(0F, -6F, 0F); + bodyModel[28].rotateAngleY = -5.49778714F; + + bodyModel[29].addShapeBox(0F, 16F, 4F, 1, 4, 3, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, -3F, 0F, -0.4F, -3F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F, -0.4F, 0F, 0F); // Import ImportBox31 + bodyModel[29].setRotationPoint(0F, -6F, 0F); + bodyModel[29].rotateAngleY = -5.49778714F; + + bodyModel[30].addShapeBox(-1F, 16F, 4F, 2, 8, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox32 + bodyModel[30].setRotationPoint(0F, -2F, 0F); + bodyModel[30].rotateAngleY = -5.49778714F; + + bodyModel[31].addShapeBox(-1.5F, 24F, 5F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F); // Import ImportBox33 + bodyModel[31].setRotationPoint(0F, -2F, 0F); + bodyModel[31].rotateAngleY = -0.78539816F; + + bodyModel[32].addShapeBox(-1.5F, 24F, 4F, 3, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F); // Import ImportBox34 + bodyModel[32].setRotationPoint(0F, -2F, 0F); + bodyModel[32].rotateAngleY = -0.78539816F; + + bodyModel[33].addShapeBox(-1.5F, 24F, 6F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Import ImportBox36 + bodyModel[33].setRotationPoint(0F, -2F, 0F); + bodyModel[33].rotateAngleY = -0.78539816F; + + bodyModel[34].addShapeBox(-1.5F, 24F, 6F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Import ImportBox37 + bodyModel[34].setRotationPoint(0F, -2F, 0F); + bodyModel[34].rotateAngleY = -2.35619449F; + + bodyModel[35].addShapeBox(-1.5F, 24F, 5F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F); // Import ImportBox38 + bodyModel[35].setRotationPoint(0F, -2F, 0F); + bodyModel[35].rotateAngleY = -2.35619449F; + + bodyModel[36].addShapeBox(-1.5F, 24F, 4F, 3, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F); // Import ImportBox39 + bodyModel[36].setRotationPoint(0F, -2F, 0F); + bodyModel[36].rotateAngleY = -2.35619449F; + + bodyModel[37].addShapeBox(-1.5F, 24F, 6F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Import ImportBox40 + bodyModel[37].setRotationPoint(0F, -2F, 0F); + bodyModel[37].rotateAngleY = -3.92699081F; + + bodyModel[38].addShapeBox(-1.5F, 24F, 5F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F); // Import ImportBox41 + bodyModel[38].setRotationPoint(0F, -2F, 0F); + bodyModel[38].rotateAngleY = -3.92699081F; + + bodyModel[39].addShapeBox(-1.5F, 24F, 4F, 3, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F); // Import ImportBox42 + bodyModel[39].setRotationPoint(0F, -2F, 0F); + bodyModel[39].rotateAngleY = -3.92699081F; + + bodyModel[40].addShapeBox(-1.5F, 24F, 6F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Import ImportBox43 + bodyModel[40].setRotationPoint(0F, -2F, 0F); + bodyModel[40].rotateAngleY = -5.49778714F; + + bodyModel[41].addShapeBox(-1.5F, 24F, 5F, 3, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F); // Import ImportBox44 + bodyModel[41].setRotationPoint(0F, -2F, 0F); + bodyModel[41].rotateAngleY = -5.49778714F; + + bodyModel[42].addShapeBox(-1.5F, 24F, 4F, 3, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F); // Import ImportBox45 + bodyModel[42].setRotationPoint(0F, -2F, 0F); + bodyModel[42].rotateAngleY = -5.49778714F; + + bodyModel[43].addShapeBox(-2F, 21F, -1F, 4, 5, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F, 0.5F, 0F, 0.5F); // Import ImportBox46 + bodyModel[43].setRotationPoint(0F, -2F, 0F); + bodyModel[43].rotateAngleY = -0.78539816F; + + bodyModel[44].addShapeBox(-2F, 21F, -2F, 4, 5, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F); // Import ImportBox47 + bodyModel[44].setRotationPoint(0F, -2F, 0F); + bodyModel[44].rotateAngleY = -0.78539816F; + + bodyModel[45].addShapeBox(-2F, 21F, 1F, 4, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0.5F, 0F, -0.5F, 0.5F, 0F, -0.5F, -0.5F, 0F, 0.5F, -0.5F, 0F, 0.5F); // Import ImportBox48 + bodyModel[45].setRotationPoint(0F, -2F, 0F); + bodyModel[45].rotateAngleY = -0.78539816F; + + bodyModel[46].addShapeBox(-0.5F, 18F, 8F, 1, 6, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -4F, 0F, -0.2F, -4F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Import ImportBox49 + bodyModel[46].setRotationPoint(0F, -2F, 0F); + bodyModel[46].rotateAngleY = -5.49778714F; + + bodyModel[47].addShapeBox(-0.5F, 18F, 8F, 1, 6, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -4F, 0F, -0.2F, -4F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Import ImportBox50 + bodyModel[47].setRotationPoint(0F, -2F, 0F); + bodyModel[47].rotateAngleY = -3.92699081F; + + bodyModel[48].addShapeBox(-0.5F, 18F, 8F, 1, 6, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -4F, 0F, -0.2F, -4F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Import ImportBox51 + bodyModel[48].setRotationPoint(0F, -2F, 0F); + bodyModel[48].rotateAngleY = -0.78539816F; + + bodyModel[49].addShapeBox(-0.5F, 18F, 8F, 1, 6, 3, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -4F, 0F, -0.2F, -4F, 0F, -0.2F, 0F, 0F, -0.2F, 0F, 0F, -0.2F, -1F, 0F, -0.2F, -1F, 0F); // Import ImportBox52 + bodyModel[49].setRotationPoint(0F, -2F, 0F); + bodyModel[49].rotateAngleY = -2.35619449F; + + bodyModel[50].addShapeBox(-4F, -20F, -3F, 8, 12, 6, 0F, -1F, 0F, -1F, -1F, 0F, -1F, -1F, 0F, -1F, -1F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox53 + bodyModel[50].setRotationPoint(0F, -2F, 0F); + bodyModel[50].rotateAngleY = -0.78539816F; + + bodyModel[51].addShapeBox(-4F, -20F, -4F, 8, 12, 3, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, -1F, -1F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F); // Import ImportBox54 + bodyModel[51].setRotationPoint(0F, -2F, 0F); + bodyModel[51].rotateAngleY = -0.78539816F; + + bodyModel[52].addShapeBox(-4F, -20F, 1F, 8, 12, 3, 0F, -1F, 0F, -1F, -1F, 0F, -1F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, -1F, 0F, 0F, -1F, 0F, 0F); // Import ImportBox55 + bodyModel[52].setRotationPoint(0F, -2F, 0F); + bodyModel[52].rotateAngleY = -0.78539816F; + + bodyModel[53].addShapeBox(-1F, -10F, 3F, 2, 7, 2, 0F, 0F, 1F, 0F, 0F, 1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F); // Import ImportBox56 + bodyModel[53].setRotationPoint(0F, -2F, 0F); + bodyModel[53].rotateAngleY = -0.78539816F; + + bodyModel[54].addShapeBox(-0.5F, -10F, 5F, 1, 7, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox57 + bodyModel[54].setRotationPoint(0F, -2F, 0F); + bodyModel[54].rotateAngleY = -0.78539816F; + + bodyModel[55].addShapeBox(-0.5F, -8F, 7F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox58 + bodyModel[55].setRotationPoint(0F, -2F, 0F); + bodyModel[55].rotateAngleY = -0.78539816F; + + bodyModel[56].addShapeBox(-1F, -10F, 3F, 2, 7, 2, 0F, 0F, 1F, 0F, 0F, 1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F); // Import ImportBox59 + bodyModel[56].setRotationPoint(0F, -2F, 0F); + bodyModel[56].rotateAngleY = -2.35619449F; + + bodyModel[57].addShapeBox(-0.5F, -10F, 5F, 1, 7, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox60 + bodyModel[57].setRotationPoint(0F, -2F, 0F); + bodyModel[57].rotateAngleY = -2.35619449F; + + bodyModel[58].addShapeBox(-0.5F, -8F, 7F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox61 + bodyModel[58].setRotationPoint(0F, -2F, 0F); + bodyModel[58].rotateAngleY = -2.35619449F; + + bodyModel[59].addShapeBox(-1F, -10F, 3F, 2, 7, 2, 0F, 0F, 1F, 0F, 0F, 1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F); // Import ImportBox62 + bodyModel[59].setRotationPoint(0F, -2F, 0F); + bodyModel[59].rotateAngleY = -5.49778714F; + + bodyModel[60].addShapeBox(-0.5F, -10F, 5F, 1, 7, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox63 + bodyModel[60].setRotationPoint(0F, -2F, 0F); + bodyModel[60].rotateAngleY = -5.49778714F; + + bodyModel[61].addShapeBox(-0.5F, -8F, 7F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox64 + bodyModel[61].setRotationPoint(0F, -2F, 0F); + bodyModel[61].rotateAngleY = -5.49778714F; + + bodyModel[62].addShapeBox(-1F, -10F, 3F, 2, 7, 2, 0F, 0F, 1F, 0F, 0F, 1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F); // Import ImportBox65 + bodyModel[62].setRotationPoint(0F, -2F, 0F); + bodyModel[62].rotateAngleY = -3.92699081F; + + bodyModel[63].addShapeBox(-0.5F, -10F, 5F, 1, 7, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox66 + bodyModel[63].setRotationPoint(0F, -2F, 0F); + bodyModel[63].rotateAngleY = -3.92699081F; + + bodyModel[64].addShapeBox(-0.5F, -8F, 7F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox67 + bodyModel[64].setRotationPoint(0F, -2F, 0F); + bodyModel[64].rotateAngleY = -3.92699081F; + + bodyModel[65].addShapeBox(-3F, -26F, -2F, 6, 6, 4, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox68 + bodyModel[65].setRotationPoint(0F, -2F, 0F); + bodyModel[65].rotateAngleY = -0.78539816F; + + bodyModel[66].addShapeBox(-3F, -26F, -3F, 6, 6, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F); // Import ImportBox70 + bodyModel[66].setRotationPoint(0F, -2F, 0F); + bodyModel[66].rotateAngleY = -0.78539816F; + + bodyModel[67].addShapeBox(-3F, -26F, 1F, 6, 6, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F); // Import ImportBox71 + bodyModel[67].setRotationPoint(0F, -2F, 0F); + bodyModel[67].rotateAngleY = -0.78539816F; + + bodyModel[68].addShapeBox(-3F, -30F, -1F, 6, 4, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox72 + bodyModel[68].setRotationPoint(0F, -2F, 0F); + bodyModel[68].rotateAngleY = -0.78539816F; + + bodyModel[69].addShapeBox(-3F, -30F, -3F, 6, 4, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox73 + bodyModel[69].setRotationPoint(0F, -2F, 0F); + bodyModel[69].rotateAngleY = -0.78539816F; + + bodyModel[70].addShapeBox(-3F, -30F, 1F, 6, 4, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox74 + bodyModel[70].setRotationPoint(0F, -2F, 0F); + bodyModel[70].rotateAngleY = -0.78539816F; + + bodyModel[71].addShapeBox(-0.5F, -35F, -0.5F, 1, 6, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox75 + bodyModel[71].setRotationPoint(0F, -2F, 0F); + bodyModel[71].rotateAngleY = -0.78539816F; + + + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelMissileBase.java b/src/main/java/mekanism/defense/client/model/missile/ModelMissileBase.java new file mode 100644 index 000000000..ecd0c15e6 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelMissileBase.java @@ -0,0 +1,8 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelBase; + +public abstract class ModelMissileBase extends ModelBase +{ + public void render(float size) {} +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelNuclearMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelNuclearMissile.java new file mode 100644 index 000000000..2fae8fb6d --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelNuclearMissile.java @@ -0,0 +1,240 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelNuclearMissile extends ModelMissileBase +{ + // fields + ModelRenderer MAIN_MODULE; + ModelRenderer MOTOR_MODULE_1; + ModelRenderer MOTOR_MODULE_2; + ModelRenderer MOTOR_MODULE_3; + ModelRenderer MOTOR_MODULE_4; + ModelRenderer C1; + ModelRenderer C2; + ModelRenderer C3; + ModelRenderer C4; + ModelRenderer T1; + ModelRenderer T2; + ModelRenderer T3; + ModelRenderer T4; + ModelRenderer WING_1A; + ModelRenderer WING_2A; + ModelRenderer WING_1B; + ModelRenderer WING_2B; + ModelRenderer WING_3A; + ModelRenderer WING_3B; + ModelRenderer WING_4B; + ModelRenderer WING_4A; + ModelRenderer TOP; + ModelRenderer WARHEAD_1; + ModelRenderer WARHEAD_2; + ModelRenderer WARHEAD_3; + + public ModelNuclearMissile() + { + textureWidth = 128; + textureHeight = 128; + + MAIN_MODULE = new ModelRenderer(this, 0, 0); + MAIN_MODULE.addBox(0F, 0F, 0F, 8, 70, 8); + MAIN_MODULE.setRotationPoint(-4F, -63F, -4F); + MAIN_MODULE.setTextureSize(128, 128); + MAIN_MODULE.mirror = true; + setRotation(MAIN_MODULE, 0F, 0F, 0F); + MOTOR_MODULE_1 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_1.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_1.setRotationPoint(-8F, 0F, -8F); + MOTOR_MODULE_1.setTextureSize(128, 128); + MOTOR_MODULE_1.mirror = true; + setRotation(MOTOR_MODULE_1, 0F, 0F, 0F); + MOTOR_MODULE_2 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_2.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_2.setRotationPoint(-8F, 0F, 2F); + MOTOR_MODULE_2.setTextureSize(128, 128); + MOTOR_MODULE_2.mirror = true; + setRotation(MOTOR_MODULE_2, 0F, 0F, 0F); + MOTOR_MODULE_3 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_3.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_3.setRotationPoint(2F, 0F, -8F); + MOTOR_MODULE_3.setTextureSize(128, 128); + MOTOR_MODULE_3.mirror = true; + setRotation(MOTOR_MODULE_3, 0F, 0F, 0F); + MOTOR_MODULE_4 = new ModelRenderer(this, 0, 79); + MOTOR_MODULE_4.addBox(0F, 0F, 0F, 6, 20, 6); + MOTOR_MODULE_4.setRotationPoint(2F, 0F, 2F); + MOTOR_MODULE_4.setTextureSize(128, 128); + MOTOR_MODULE_4.mirror = true; + setRotation(MOTOR_MODULE_4, 0F, 0F, 0F); + C1 = new ModelRenderer(this, 0, 106); + C1.addBox(0F, 0F, 0F, 2, 1, 2); + C1.setRotationPoint(-6F, 20F, -6F); + C1.setTextureSize(128, 128); + C1.mirror = true; + setRotation(C1, 0F, 0F, 0F); + C2 = new ModelRenderer(this, 0, 106); + C2.addBox(0F, 0F, 0F, 2, 1, 2); + C2.setRotationPoint(-6F, 20F, 4F); + C2.setTextureSize(128, 128); + C2.mirror = true; + setRotation(C2, 0F, 0F, 0F); + C3 = new ModelRenderer(this, 0, 106); + C3.addBox(0F, 0F, 0F, 2, 1, 2); + C3.setRotationPoint(4F, 20F, -6F); + C3.setTextureSize(128, 128); + C3.mirror = true; + setRotation(C3, 0F, 0F, 0F); + C4 = new ModelRenderer(this, 0, 106); + C4.addBox(0F, 0F, 0F, 2, 1, 2); + C4.setRotationPoint(4F, 20F, 4F); + C4.setTextureSize(128, 128); + C4.mirror = true; + setRotation(C4, 0F, 0F, 0F); + T1 = new ModelRenderer(this, 0, 111); + T1.addBox(0F, 0F, 0F, 4, 3, 4); + T1.setRotationPoint(-7F, 21F, -7F); + T1.setTextureSize(128, 128); + T1.mirror = true; + setRotation(T1, 0F, 0F, 0F); + T2 = new ModelRenderer(this, 0, 111); + T2.addBox(0F, 0F, 0F, 4, 3, 4); + T2.setRotationPoint(-7F, 21F, 3F); + T2.setTextureSize(128, 128); + T2.mirror = true; + setRotation(T2, 0F, 0F, 0F); + T3 = new ModelRenderer(this, 0, 111); + T3.addBox(0F, 0F, 0F, 4, 3, 4); + T3.setRotationPoint(3F, 21F, -7F); + T3.setTextureSize(128, 128); + T3.mirror = true; + setRotation(T3, 0F, 0F, 0F); + T4 = new ModelRenderer(this, 0, 111); + T4.addBox(0F, 0F, 0F, 4, 3, 4); + T4.setRotationPoint(3F, 21F, 3F); + T4.setTextureSize(128, 128); + T4.mirror = true; + setRotation(T4, 0F, 0F, 0F); + WING_1A = new ModelRenderer(this, 43, 15); + WING_1A.addBox(-1F, 0F, 0F, 2, 12, 12); + WING_1A.setRotationPoint(0F, -10F, 0F); + WING_1A.setTextureSize(128, 128); + WING_1A.mirror = true; + setRotation(WING_1A, -0.7853982F, 0F, 0F); + WING_2A = new ModelRenderer(this, 43, 0); + WING_2A.addBox(0F, 0F, -1F, 12, 12, 2); + WING_2A.setRotationPoint(0F, -10F, 0F); + WING_2A.setTextureSize(128, 128); + WING_2A.mirror = true; + setRotation(WING_2A, 0F, 0F, 0.7853982F); + WING_1B = new ModelRenderer(this, 72, 28); + WING_1B.addBox(-1F, 0F, -8F, 2, 25, 16); + WING_1B.setRotationPoint(0F, -2F, 0F); + WING_1B.setTextureSize(128, 128); + WING_1B.mirror = true; + setRotation(WING_1B, 0F, 0F, 0F); + WING_2B = new ModelRenderer(this, 72, 0); + WING_2B.addBox(-8F, 0F, -1F, 16, 25, 2); + WING_2B.setRotationPoint(0F, -2F, 0F); + WING_2B.setTextureSize(128, 128); + WING_2B.mirror = true; + setRotation(WING_2B, 0F, 0F, 0F); + WING_3A = new ModelRenderer(this, 34, 55); + WING_3A.addBox(-1F, 0F, -8F, 2, 10, 16); + WING_3A.setRotationPoint(0F, -41F, 0F); + WING_3A.setTextureSize(128, 128); + WING_3A.mirror = true; + setRotation(WING_3A, 0F, 0F, 0F); + WING_3B = new ModelRenderer(this, 34, 82); + WING_3B.addBox(-1F, -6F, -6F, 2, 12, 12); + WING_3B.setRotationPoint(0F, -41F, 0F); + WING_3B.setTextureSize(128, 128); + WING_3B.mirror = true; + setRotation(WING_3B, 0.7853982F, 0F, 0F); + WING_4B = new ModelRenderer(this, 34, 41); + WING_4B.addBox(-8F, 0F, -1F, 16, 10, 2); + WING_4B.setRotationPoint(0F, -41F, 0F); + WING_4B.setTextureSize(128, 128); + WING_4B.mirror = true; + setRotation(WING_4B, 0F, 0F, 0F); + WING_4A = new ModelRenderer(this, 34, 107); + WING_4A.addBox(-6F, -6F, -1F, 12, 12, 2); + WING_4A.setRotationPoint(0F, -41F, 0F); + WING_4A.setTextureSize(128, 128); + WING_4A.mirror = true; + setRotation(WING_4A, 0F, 0F, -0.7853982F); + TOP = new ModelRenderer(this, 72, 70); + TOP.addBox(0F, 0F, 0F, 10, 10, 10); + TOP.setRotationPoint(-5F, -64F, -5F); + TOP.setTextureSize(128, 128); + TOP.mirror = true; + setRotation(TOP, 0F, 0F, 0F); + WARHEAD_1 = new ModelRenderer(this, 72, 91); + WARHEAD_1.addBox(0F, 0F, 0F, 8, 6, 8); + WARHEAD_1.setRotationPoint(-4F, -70F, -4F); + WARHEAD_1.setTextureSize(128, 128); + WARHEAD_1.mirror = true; + setRotation(WARHEAD_1, 0F, 0F, 0F); + WARHEAD_2 = new ModelRenderer(this, 72, 106); + WARHEAD_2.addBox(0F, 0F, 0F, 6, 6, 6); + WARHEAD_2.setRotationPoint(-3F, -76F, -3F); + WARHEAD_2.setTextureSize(128, 128); + WARHEAD_2.mirror = true; + setRotation(WARHEAD_2, 0F, 0F, 0F); + WARHEAD_3 = new ModelRenderer(this, 110, 91); + WARHEAD_3.addBox(0F, 0F, 0F, 4, 6, 4); + WARHEAD_3.setRotationPoint(-2F, -82F, -2F); + WARHEAD_3.setTextureSize(128, 128); + WARHEAD_3.mirror = true; + setRotation(WARHEAD_3, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + MAIN_MODULE.render(f5); + MOTOR_MODULE_1.render(f5); + MOTOR_MODULE_2.render(f5); + MOTOR_MODULE_3.render(f5); + MOTOR_MODULE_4.render(f5); + C1.render(f5); + C2.render(f5); + C3.render(f5); + C4.render(f5); + T1.render(f5); + T2.render(f5); + T3.render(f5); + T4.render(f5); + WING_1A.render(f5); + WING_2A.render(f5); + WING_1B.render(f5); + WING_2B.render(f5); + WING_3A.render(f5); + WING_3B.render(f5); + WING_4B.render(f5); + WING_4A.render(f5); + TOP.render(f5); + WARHEAD_1.render(f5); + WARHEAD_2.render(f5); + WARHEAD_3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelRedMatterMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelRedMatterMissile.java new file mode 100644 index 000000000..068b93548 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelRedMatterMissile.java @@ -0,0 +1,264 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelRedMatterMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape1a; + ModelRenderer Shape2; + ModelRenderer Shape2a; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape6a; + ModelRenderer Shape6b; + ModelRenderer Shape6c; + ModelRenderer Shape6d; + ModelRenderer Shape6e; + ModelRenderer Shape6f; + ModelRenderer Shape6g; + ModelRenderer Shape7; + ModelRenderer Shape8; + ModelRenderer Shape9; + ModelRenderer Shape10; + ModelRenderer Shape10a; + ModelRenderer Shape10b; + ModelRenderer Shape10c; + ModelRenderer Shape11d; + ModelRenderer Shape11e; + ModelRenderer Shape2z; + ModelRenderer Shape12; + ModelRenderer Shape13; + ModelRenderer Shape14; + + public ModelRedMatterMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 27, 0); + Shape1.addBox(0F, 0F, 0F, 8, 10, 14); + Shape1.setRotationPoint(-8F, 14F, -2F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0.7853982F, 0F); + Shape1a = new ModelRenderer(this, 27, 0); + Shape1a.addBox(0F, 0F, 0F, 8, 10, 14); + Shape1a.setRotationPoint(2F, 14F, -8F); + Shape1a.setTextureSize(128, 128); + Shape1a.mirror = true; + setRotation(Shape1a, 0F, -0.7853982F, 0F); + Shape2 = new ModelRenderer(this, 36, 47); + Shape2.addBox(0F, 0F, 0F, 21, 11, 2); + Shape2.setRotationPoint(-8F, 13F, 7F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0.7853982F, 0F); + Shape2a = new ModelRenderer(this, 36, 47); + Shape2a.addBox(0F, 0F, 0F, 21, 11, 2); + Shape2a.setRotationPoint(-7F, 13F, -8F); + Shape2a.setTextureSize(128, 128); + Shape2a.mirror = true; + setRotation(Shape2a, 0F, -0.7853982F, 0F); + Shape3 = new ModelRenderer(this, 0, 0); + Shape3.addBox(0F, 0F, 0F, 6, 40, 6); + Shape3.setRotationPoint(-3F, -26F, -3F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 27, 25); + Shape4.addBox(0F, 0F, 0F, 10, 10, 10); + Shape4.setRotationPoint(-5F, 4F, -5F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 72, 31); + Shape5.addBox(0F, 0F, 0F, 8, 4, 8); + Shape5.setRotationPoint(-4F, -30F, -4F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 89, 17); + Shape6.addBox(0F, 0F, 0F, 2, 6, 2); + Shape6.setRotationPoint(-1F, -35F, 4F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 89, 17); + Shape6a.addBox(0F, 0F, 0F, 2, 6, 2); + Shape6a.setRotationPoint(4F, -35F, -1F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape6b = new ModelRenderer(this, 89, 17); + Shape6b.addBox(0F, 0F, 0F, 2, 6, 2); + Shape6b.setRotationPoint(-6F, -35F, -1F); + Shape6b.setTextureSize(128, 128); + Shape6b.mirror = true; + setRotation(Shape6b, 0F, 0F, 0F); + Shape6c = new ModelRenderer(this, 89, 17); + Shape6c.addBox(0F, 0F, 0F, 2, 6, 2); + Shape6c.setRotationPoint(-1F, -35F, -6F); + Shape6c.setTextureSize(128, 128); + Shape6c.mirror = true; + setRotation(Shape6c, 0F, 0F, 0F); + Shape6d = new ModelRenderer(this, 103, 8); + Shape6d.addBox(0F, 0F, 0F, 1, 6, 2); + Shape6d.setRotationPoint(-2F, -39F, -1F); + Shape6d.setTextureSize(128, 128); + Shape6d.mirror = true; + setRotation(Shape6d, 0F, 0F, 0.6108652F); + Shape6e = new ModelRenderer(this, 103, 8); + Shape6e.addBox(0F, 0F, 0F, 1, 6, 2); + Shape6e.setRotationPoint(1F, -39F, -1F); + Shape6e.setTextureSize(128, 128); + Shape6e.mirror = true; + setRotation(Shape6e, 0F, 0F, -0.6108652F); + Shape6f = new ModelRenderer(this, 96, 8); + Shape6f.addBox(0F, 0F, 0F, 2, 6, 1); + Shape6f.setRotationPoint(-1F, -39F, -2F); + Shape6f.setTextureSize(128, 128); + Shape6f.mirror = true; + setRotation(Shape6f, -0.6108652F, 0F, 0F); + Shape6g = new ModelRenderer(this, 96, 8); + Shape6g.addBox(0F, 0F, 0F, 2, 6, 1); + Shape6g.setRotationPoint(-1F, -39F, 1F); + Shape6g.setTextureSize(128, 128); + Shape6g.mirror = true; + setRotation(Shape6g, 0.6108652F, 0F, 0F); + Shape7 = new ModelRenderer(this, 110, 0); + Shape7.addBox(0F, 0F, 0F, 4, 2, 4); + Shape7.setRotationPoint(-2F, -40F, -2F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape8 = new ModelRenderer(this, 84, 46); + Shape8.addBox(0F, 0F, 0F, 10, 5, 10); + Shape8.setRotationPoint(-5F, -34F, -5F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape9 = new ModelRenderer(this, 110, 8); + Shape9.addBox(0F, 0F, 0F, 2, 8, 2); + Shape9.setRotationPoint(-1F, -42F, -1F); + Shape9.setTextureSize(128, 128); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + Shape10 = new ModelRenderer(this, 72, 8); + Shape10.addBox(0F, 0F, 0F, 6, 6, 2); + Shape10.setRotationPoint(8F, -23F, 1F); + Shape10.setTextureSize(128, 128); + Shape10.mirror = false; + setRotation(Shape10, 0F, -3.141593F, -0.7853982F); + Shape10a = new ModelRenderer(this, 72, 17); + Shape10a.addBox(0F, 0F, 0F, 2, 6, 6); + Shape10a.setRotationPoint(-1F, -23F, -8F); + Shape10a.setTextureSize(128, 128); + Shape10a.mirror = false; + setRotation(Shape10a, 0.7853982F, 0F, 0F); + Shape10b = new ModelRenderer(this, 72, 8); + Shape10b.addBox(0F, 0F, 0F, 6, 6, 2); + Shape10b.setRotationPoint(-8F, -23F, -1F); + Shape10b.setTextureSize(128, 128); + Shape10b.mirror = false; + setRotation(Shape10b, 0F, 0F, -0.7853982F); + Shape10c = new ModelRenderer(this, 72, 8); + Shape10c.addBox(0F, 0F, 0F, 6, 6, 2); + Shape10c.setRotationPoint(-1F, -23F, 8F); + Shape10c.setTextureSize(128, 128); + Shape10c.mirror = false; + setRotation(Shape10c, 0F, 1.570796F, -0.7853982F); + Shape11d = new ModelRenderer(this, 72, 0); + Shape11d.addBox(0F, 0F, 0F, 16, 5, 2); + Shape11d.setRotationPoint(-8F, -23F, -1F); + Shape11d.setTextureSize(128, 128); + Shape11d.mirror = true; + setRotation(Shape11d, 0F, 0F, 0F); + Shape11e = new ModelRenderer(this, 72, 0); + Shape11e.addBox(0F, 0F, 0F, 16, 5, 2); + Shape11e.setRotationPoint(-1F, -23F, 8F); + Shape11e.setTextureSize(128, 128); + Shape11e.mirror = true; + setRotation(Shape11e, 0F, 1.570796F, 0F); + Shape2z = new ModelRenderer(this, 0, 103); + Shape2z.addBox(0F, 0F, 0F, 16, 10, 4); + Shape2z.setRotationPoint(-8F, 14F, -2F); + Shape2z.setTextureSize(128, 128); + Shape2z.mirror = true; + setRotation(Shape2z, 0F, 0F, 0F); + Shape12 = new ModelRenderer(this, 0, 76); + Shape12.addBox(0F, 0F, 0F, 4, 10, 16); + Shape12.setRotationPoint(-2F, 14F, -8F); + Shape12.setTextureSize(128, 128); + Shape12.mirror = true; + setRotation(Shape12, 0F, 0F, 0F); + Shape13 = new ModelRenderer(this, 0, 47); + Shape13.addBox(0F, 0F, 0F, 3, 14, 14); + Shape13.setRotationPoint(6F, 13F, -8F); + Shape13.setTextureSize(128, 128); + Shape13.mirror = true; + setRotation(Shape13, 0.7853982F, -0.7853982F, 0F); + Shape14 = new ModelRenderer(this, 0, 47); + Shape14.addBox(0F, 0F, 0F, 3, 14, 14); + Shape14.setRotationPoint(8F, 13F, 6F); + Shape14.setTextureSize(128, 128); + Shape14.mirror = true; + setRotation(Shape14, 0.7853982F, -2.356194F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape1a.render(f5); + Shape2.render(f5); + Shape2a.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + Shape6a.render(f5); + Shape6b.render(f5); + Shape6c.render(f5); + Shape6d.render(f5); + Shape6e.render(f5); + Shape6f.render(f5); + Shape6g.render(f5); + Shape7.render(f5); + Shape8.render(f5); + Shape9.render(f5); + Shape10.render(f5); + Shape10a.render(f5); + Shape10b.render(f5); + Shape10c.render(f5); + Shape11d.render(f5); + Shape11e.render(f5); + Shape2z.render(f5); + Shape12.render(f5); + Shape13.render(f5); + Shape14.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelRegenMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelRegenMissile.java new file mode 100644 index 000000000..5caadf229 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelRegenMissile.java @@ -0,0 +1,288 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelRegenMissile extends ModelMissileBase +{ + // fields + ModelRenderer MAIN_MODULE; + ModelRenderer WING_B1; + ModelRenderer WING_B2; + ModelRenderer WING_B3; + ModelRenderer WING_B4; + ModelRenderer WING_BA1; + ModelRenderer WING_BB1; + ModelRenderer WING_BA2; + ModelRenderer WING_BB2; + ModelRenderer WING_TA1; + ModelRenderer WING_TB1; + ModelRenderer WING_TC3; + ModelRenderer WING_TD1; + ModelRenderer WING_TAC2; + ModelRenderer WING_TBD2; + ModelRenderer WING_TC1; + ModelRenderer WING_TA3; + ModelRenderer WING_TD3; + ModelRenderer WING_TB3; + ModelRenderer T_SUPPORT_1; + ModelRenderer T_SUPPORT_2; + ModelRenderer WARHEAD_SUPPORT_A1; + ModelRenderer WARHEAD_SUPPORT_B1; + ModelRenderer WARHEAD_SUPPORT_C1; + ModelRenderer WRHEAD_SUPPORT_D1; + ModelRenderer WARHEAD_SUPPORT_A2; + ModelRenderer WARHEAD_SUPPORT_C2; + ModelRenderer WARHEAD_SUPPORT_D2; + ModelRenderer WARHEAD_SUPPORT_B2; + ModelRenderer Shape8; + ModelRenderer Shape9; + + public ModelRegenMissile() + { + textureWidth = 128; + textureHeight = 128; + + MAIN_MODULE = new ModelRenderer(this, 0, 0); + MAIN_MODULE.addBox(-4F, 0F, -4F, 8, 64, 8); + MAIN_MODULE.setRotationPoint(0F, -40F, 0F); + MAIN_MODULE.setTextureSize(128, 128); + MAIN_MODULE.mirror = true; + setRotation(MAIN_MODULE, 0F, 0F, 0F); + WING_B1 = new ModelRenderer(this, 34, 19); + WING_B1.addBox(0F, 0F, 0F, 14, 10, 1); + WING_B1.setRotationPoint(-7F, 14F, 6F); + WING_B1.setTextureSize(128, 128); + WING_B1.mirror = true; + setRotation(WING_B1, 0F, 0F, 0F); + WING_B2 = new ModelRenderer(this, 34, 19); + WING_B2.addBox(0F, 0F, 0F, 14, 10, 1); + WING_B2.setRotationPoint(-7F, 14F, -7F); + WING_B2.setTextureSize(128, 128); + WING_B2.mirror = true; + setRotation(WING_B2, 0F, 0F, 0F); + WING_B3 = new ModelRenderer(this, 34, 31); + WING_B3.addBox(0F, 0F, 0F, 1, 10, 12); + WING_B3.setRotationPoint(-7F, 14F, -6F); + WING_B3.setTextureSize(128, 128); + WING_B3.mirror = true; + setRotation(WING_B3, 0F, 0F, 0F); + WING_B4 = new ModelRenderer(this, 34, 31); + WING_B4.addBox(0F, 0F, 0F, 1, 10, 12); + WING_B4.setRotationPoint(6F, 14F, -6F); + WING_B4.setTextureSize(128, 128); + WING_B4.mirror = true; + setRotation(WING_B4, 0F, 0F, 0F); + WING_BA1 = new ModelRenderer(this, 72, 0); + WING_BA1.addBox(-11F, 0F, -1F, 22, 12, 2); + WING_BA1.setRotationPoint(0F, 12F, 0F); + WING_BA1.setTextureSize(128, 128); + WING_BA1.mirror = true; + setRotation(WING_BA1, 0F, 0.7853982F, 0F); + WING_BB1 = new ModelRenderer(this, 72, 0); + WING_BB1.addBox(-11F, 0F, -1F, 22, 12, 2); + WING_BB1.setRotationPoint(0F, 12F, 0F); + WING_BB1.setTextureSize(128, 128); + WING_BB1.mirror = true; + setRotation(WING_BB1, 0F, -0.7853982F, 0F); + WING_BA2 = new ModelRenderer(this, 34, 0); + WING_BA2.addBox(-8F, -8F, -1F, 16, 16, 2); + WING_BA2.setRotationPoint(0F, 12F, 0F); + WING_BA2.setTextureSize(128, 128); + WING_BA2.mirror = true; + setRotation(WING_BA2, 0F, 0.7853982F, 0.7853982F); + WING_BB2 = new ModelRenderer(this, 34, 0); + WING_BB2.addBox(-8F, -8F, -1F, 16, 16, 2); + WING_BB2.setRotationPoint(0F, 12F, 0F); + WING_BB2.setTextureSize(128, 128); + WING_BB2.mirror = true; + setRotation(WING_BB2, 0F, -0.7853982F, 0.7853982F); + WING_TA1 = new ModelRenderer(this, 22, 74); + WING_TA1.addBox(0F, 0F, 0F, 2, 7, 5); + WING_TA1.setRotationPoint(-1F, -23F, 4F); + WING_TA1.setTextureSize(128, 128); + WING_TA1.mirror = true; + setRotation(WING_TA1, -0.5235988F, 0F, 0F); + WING_TB1 = new ModelRenderer(this, 0, 103); + WING_TB1.addBox(0F, 0F, 0F, 5, 8, 2); + WING_TB1.setRotationPoint(4F, -23F, -1F); + WING_TB1.setTextureSize(128, 128); + WING_TB1.mirror = true; + setRotation(WING_TB1, 0F, 0F, 0.5235988F); + WING_TC3 = new ModelRenderer(this, 0, 81); + WING_TC3.addBox(-1F, 0F, 0F, 2, 4, 5); + WING_TC3.setRotationPoint(0F, -35F, -4F); + WING_TC3.setTextureSize(128, 128); + WING_TC3.mirror = true; + setRotation(WING_TC3, -0.5235988F, 3.141593F, 0F); + WING_TD1 = new ModelRenderer(this, 0, 103); + WING_TD1.addBox(0F, 0F, -1F, 5, 8, 2); + WING_TD1.setRotationPoint(-4F, -23F, 0F); + WING_TD1.setTextureSize(128, 128); + WING_TD1.mirror = true; + setRotation(WING_TD1, 0F, 3.141593F, 0.5235988F); + WING_TAC2 = new ModelRenderer(this, 0, 74); + WING_TAC2.addBox(-1F, 0F, -8F, 2, 12, 16); + WING_TAC2.setRotationPoint(0F, -32F, 0F); + WING_TAC2.setTextureSize(128, 128); + WING_TAC2.mirror = true; + setRotation(WING_TAC2, 0F, 0F, 0F); + WING_TBD2 = new ModelRenderer(this, 0, 74); + WING_TBD2.addBox(-1F, 0F, -8F, 2, 12, 16); + WING_TBD2.setRotationPoint(0F, -32F, 0F); + WING_TBD2.setTextureSize(128, 128); + WING_TBD2.mirror = true; + setRotation(WING_TBD2, 0F, 1.570796F, 0F); + WING_TC1 = new ModelRenderer(this, 22, 74); + WING_TC1.addBox(-1F, 0F, 0F, 2, 8, 5); + WING_TC1.setRotationPoint(0F, -23F, -4F); + WING_TC1.setTextureSize(128, 128); + WING_TC1.mirror = true; + setRotation(WING_TC1, -0.5235988F, 3.141593F, 0F); + WING_TA3 = new ModelRenderer(this, 0, 81); + WING_TA3.addBox(-1F, 0F, 0F, 2, 4, 5); + WING_TA3.setRotationPoint(0F, -35F, 4F); + WING_TA3.setTextureSize(128, 128); + WING_TA3.mirror = true; + setRotation(WING_TA3, -0.5235988F, 0F, 0F); + WING_TD3 = new ModelRenderer(this, 0, 74); + WING_TD3.addBox(0F, 0F, -1F, 5, 4, 2); + WING_TD3.setRotationPoint(-4F, -35F, 0F); + WING_TD3.setTextureSize(128, 128); + WING_TD3.mirror = true; + setRotation(WING_TD3, 0F, 3.141593F, 0.5235988F); + WING_TB3 = new ModelRenderer(this, 0, 74); + WING_TB3.addBox(0F, 0F, 0F, 5, 4, 2); + WING_TB3.setRotationPoint(4F, -35F, -1F); + WING_TB3.setTextureSize(128, 128); + WING_TB3.mirror = true; + setRotation(WING_TB3, 0F, 0F, 0.5235988F); + T_SUPPORT_1 = new ModelRenderer(this, 72, 16); + T_SUPPORT_1.addBox(0F, 0F, 0F, 10, 1, 10); + T_SUPPORT_1.setRotationPoint(-5F, -37F, -5F); + T_SUPPORT_1.setTextureSize(128, 128); + T_SUPPORT_1.mirror = true; + setRotation(T_SUPPORT_1, 0F, 0F, 0F); + T_SUPPORT_2 = new ModelRenderer(this, 72, 16); + T_SUPPORT_2.addBox(0F, 0F, 0F, 10, 1, 10); + T_SUPPORT_2.setRotationPoint(-5F, -41F, -5F); + T_SUPPORT_2.setTextureSize(128, 128); + T_SUPPORT_2.mirror = true; + setRotation(T_SUPPORT_2, 0F, 0F, 0F); + WARHEAD_SUPPORT_A1 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_A1.addBox(0F, 0F, 0F, 2, 6, 2); + WARHEAD_SUPPORT_A1.setRotationPoint(-5F, -47F, -1F); + WARHEAD_SUPPORT_A1.setTextureSize(128, 128); + WARHEAD_SUPPORT_A1.mirror = true; + setRotation(WARHEAD_SUPPORT_A1, 0F, 0F, 0F); + WARHEAD_SUPPORT_B1 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_B1.addBox(0F, 0F, 0F, 2, 6, 2); + WARHEAD_SUPPORT_B1.setRotationPoint(-1F, -47F, 3F); + WARHEAD_SUPPORT_B1.setTextureSize(128, 128); + WARHEAD_SUPPORT_B1.mirror = true; + setRotation(WARHEAD_SUPPORT_B1, 0F, 0F, 0F); + WARHEAD_SUPPORT_C1 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_C1.addBox(0F, 0F, 0F, 2, 6, 2); + WARHEAD_SUPPORT_C1.setRotationPoint(3F, -47F, -1F); + WARHEAD_SUPPORT_C1.setTextureSize(128, 128); + WARHEAD_SUPPORT_C1.mirror = true; + setRotation(WARHEAD_SUPPORT_C1, 0F, 0F, 0F); + WRHEAD_SUPPORT_D1 = new ModelRenderer(this, 90, 38); + WRHEAD_SUPPORT_D1.addBox(0F, 0F, 0F, 2, 6, 2); + WRHEAD_SUPPORT_D1.setRotationPoint(-1F, -47F, -5F); + WRHEAD_SUPPORT_D1.setTextureSize(128, 128); + WRHEAD_SUPPORT_D1.mirror = true; + setRotation(WRHEAD_SUPPORT_D1, 0F, 0F, 0F); + WARHEAD_SUPPORT_A2 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_A2.addBox(0F, -6F, 0F, 2, 6, 2); + WARHEAD_SUPPORT_A2.setRotationPoint(-5F, -47F, -1F); + WARHEAD_SUPPORT_A2.setTextureSize(128, 128); + WARHEAD_SUPPORT_A2.mirror = true; + setRotation(WARHEAD_SUPPORT_A2, 0F, 0F, 0.5235988F); + WARHEAD_SUPPORT_C2 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_C2.addBox(-2F, -6F, 0F, 2, 6, 2); + WARHEAD_SUPPORT_C2.setRotationPoint(5F, -47F, -1F); + WARHEAD_SUPPORT_C2.setTextureSize(128, 128); + WARHEAD_SUPPORT_C2.mirror = true; + setRotation(WARHEAD_SUPPORT_C2, 0F, 0F, -0.5235988F); + WARHEAD_SUPPORT_D2 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_D2.addBox(0F, -6F, 0F, 2, 6, 2); + WARHEAD_SUPPORT_D2.setRotationPoint(-1F, -47F, -5F); + WARHEAD_SUPPORT_D2.setTextureSize(128, 128); + WARHEAD_SUPPORT_D2.mirror = true; + setRotation(WARHEAD_SUPPORT_D2, -0.5235988F, 0F, 0F); + WARHEAD_SUPPORT_B2 = new ModelRenderer(this, 90, 38); + WARHEAD_SUPPORT_B2.addBox(0F, -6F, -2F, 2, 6, 2); + WARHEAD_SUPPORT_B2.setRotationPoint(-1F, -47F, 5F); + WARHEAD_SUPPORT_B2.setTextureSize(128, 128); + WARHEAD_SUPPORT_B2.mirror = true; + setRotation(WARHEAD_SUPPORT_B2, 0.5235988F, 0F, 0F); + Shape8 = new ModelRenderer(this, 72, 32); + Shape8.addBox(-2F, 0F, -2F, 4, 4, 4); + Shape8.setRotationPoint(0F, -45F, 0F); + Shape8.setTextureSize(128, 128); + Shape8.mirror = true; + setRotation(Shape8, 0F, 0F, 0F); + Shape9 = new ModelRenderer(this, 90, 32); + Shape9.addBox(-1F, 0F, -1F, 2, 2, 2); + Shape9.setRotationPoint(0F, -48F, 0F); + Shape9.setTextureSize(128, 128); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + MAIN_MODULE.render(f5); + WING_B1.render(f5); + WING_B2.render(f5); + WING_B3.render(f5); + WING_B4.render(f5); + WING_BA1.render(f5); + WING_BB1.render(f5); + WING_BA2.render(f5); + WING_BB2.render(f5); + WING_TA1.render(f5); + WING_TB1.render(f5); + WING_TC3.render(f5); + WING_TD1.render(f5); + WING_TAC2.render(f5); + WING_TBD2.render(f5); + WING_TC1.render(f5); + WING_TA3.render(f5); + WING_TD3.render(f5); + WING_TB3.render(f5); + T_SUPPORT_1.render(f5); + T_SUPPORT_2.render(f5); + WARHEAD_SUPPORT_A1.render(f5); + WARHEAD_SUPPORT_B1.render(f5); + WARHEAD_SUPPORT_C1.render(f5); + WRHEAD_SUPPORT_D1.render(f5); + WARHEAD_SUPPORT_A2.render(f5); + WARHEAD_SUPPORT_C2.render(f5); + WARHEAD_SUPPORT_D2.render(f5); + WARHEAD_SUPPORT_B2.render(f5); + Shape8.render(f5); + Shape9.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelRepulsiveMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelRepulsiveMissile.java new file mode 100644 index 000000000..83731011d --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelRepulsiveMissile.java @@ -0,0 +1,337 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelRepulsiveMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelRepulsiveMissile() + { + int textureX = 32; + int textureY = 128; + + bodyModel = new ModelRendererTurbo[58]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportImportBox0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportImportBox1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Import ImportImportBox2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 15, textureX, textureY); // Import ImportBox0 + bodyModel[4] = new ModelRendererTurbo(this, 0, 15, textureX, textureY); // Import ImportBox1 + bodyModel[5] = new ModelRendererTurbo(this, 0, 15, textureX, textureY); // Import ImportBox2 + bodyModel[6] = new ModelRendererTurbo(this, 0, 23, textureX, textureY); // Import ImportBox3 + bodyModel[7] = new ModelRendererTurbo(this, 0, 23, textureX, textureY); // Import ImportBox4 + bodyModel[8] = new ModelRendererTurbo(this, 0, 23, textureX, textureY); // Import ImportBox5 + bodyModel[9] = new ModelRendererTurbo(this, 0, 32, textureX, textureY); // Import ImportBox6 + bodyModel[10] = new ModelRendererTurbo(this, 0, 47, textureX, textureY); // Import ImportBox7 + bodyModel[11] = new ModelRendererTurbo(this, 0, 47, textureX, textureY); // Import ImportBox8 + bodyModel[12] = new ModelRendererTurbo(this, 0, 61, textureX, textureY); // Import ImportBox9 + bodyModel[13] = new ModelRendererTurbo(this, 0, 61, textureX, textureY); // Import ImportBox10 + bodyModel[14] = new ModelRendererTurbo(this, 0, 61, textureX, textureY); // Import ImportBox11 + bodyModel[15] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import ImportBox12 + bodyModel[16] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import ImportBox13 + bodyModel[17] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import ImportBox14 + bodyModel[18] = new ModelRendererTurbo(this, 0, 69, textureX, textureY); // Import ImportBox15 + bodyModel[19] = new ModelRendererTurbo(this, 0, 69, textureX, textureY); // Import ImportBox16 + bodyModel[20] = new ModelRendererTurbo(this, 0, 69, textureX, textureY); // Import ImportBox17 + bodyModel[21] = new ModelRendererTurbo(this, 0, 75, textureX, textureY); // Import ImportBox18 + bodyModel[22] = new ModelRendererTurbo(this, 0, 75, textureX, textureY); // Import ImportBox19 + bodyModel[23] = new ModelRendererTurbo(this, 0, 75, textureX, textureY); // Import ImportBox20 + bodyModel[24] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Import ImportBox21 + bodyModel[25] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Import ImportBox22 + bodyModel[26] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Import ImportBox23 + bodyModel[27] = new ModelRendererTurbo(this, 0, 82, textureX, textureY); // Import ImportBox24 + bodyModel[28] = new ModelRendererTurbo(this, 0, 91, textureX, textureY); // Box 0 + bodyModel[29] = new ModelRendererTurbo(this, 0, 97, textureX, textureY); // Box 1 + bodyModel[30] = new ModelRendererTurbo(this, 0, 97, textureX, textureY); // Box 2 + bodyModel[31] = new ModelRendererTurbo(this, 0, 91, textureX, textureY); // Box 3 + bodyModel[32] = new ModelRendererTurbo(this, 0, 97, textureX, textureY); // Box 4 + bodyModel[33] = new ModelRendererTurbo(this, 0, 97, textureX, textureY); // Box 5 + bodyModel[34] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 6 + bodyModel[35] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 7 + bodyModel[36] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 8 + bodyModel[37] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 9 + bodyModel[38] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 10 + bodyModel[39] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 11 + bodyModel[40] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 12 + bodyModel[41] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 13 + bodyModel[42] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 14 + bodyModel[43] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 15 + bodyModel[44] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 16 + bodyModel[45] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 17 + bodyModel[46] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 18 + bodyModel[47] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 19 + bodyModel[48] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 20 + bodyModel[49] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 21 + bodyModel[50] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 22 + bodyModel[51] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 23 + bodyModel[52] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 24 + bodyModel[53] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 25 + bodyModel[54] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 26 + bodyModel[55] = new ModelRendererTurbo(this, 0, 109, textureX, textureY); // Box 27 + bodyModel[56] = new ModelRendererTurbo(this, 0, 101, textureX, textureY); // Box 28 + bodyModel[57] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 29 + + bodyModel[0].addBox(-3F, -1F, -1F, 6, 12, 2, 0F); // Import ImportImportBox0 + bodyModel[0].setRotationPoint(0F, 7F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-3F, -1F, -3F, 6, 12, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportImportBox1 + bodyModel[1].setRotationPoint(0F, 7F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-3F, -1F, 1F, 6, 12, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportImportBox2 + bodyModel[2].setRotationPoint(0F, 7F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox0 + bodyModel[3].setRotationPoint(0F, 19F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox1 + bodyModel[4].setRotationPoint(0F, 19F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox2 + bodyModel[5].setRotationPoint(0F, 19F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-3F, -1F, -3F, 6, 7, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox3 + bodyModel[6].setRotationPoint(0F, 0F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-3F, -1F, -1F, 6, 7, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox4 + bodyModel[7].setRotationPoint(0F, 0F, 0F); + bodyModel[7].rotateAngleY = 3.92699082F; + + bodyModel[8].addShapeBox(-3F, -1F, 1F, 6, 7, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox5 + bodyModel[8].setRotationPoint(0F, 0F, 0F); + bodyModel[8].rotateAngleY = 3.92699082F; + + bodyModel[9].addShapeBox(-2F, -1F, -1F, 4, 13, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox6 + bodyModel[9].setRotationPoint(0F, -13F, 0F); + bodyModel[9].rotateAngleY = 3.92699082F; + + bodyModel[10].addShapeBox(-2F, -1F, -2F, 4, 13, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox7 + bodyModel[10].setRotationPoint(0F, -13F, 0F); + bodyModel[10].rotateAngleY = 3.92699082F; + + bodyModel[11].addShapeBox(-2F, -1F, 1F, 4, 13, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import ImportBox8 + bodyModel[11].setRotationPoint(0F, -13F, 0F); + bodyModel[11].rotateAngleY = 3.92699082F; + + bodyModel[12].addShapeBox(-3F, -1F, 1F, 6, 3, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F); // Import ImportBox9 + bodyModel[12].setRotationPoint(0F, -16F, 0F); + bodyModel[12].rotateAngleY = 3.92699082F; + + bodyModel[13].addShapeBox(-3F, -1F, -1F, 6, 3, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import ImportBox10 + bodyModel[13].setRotationPoint(0F, -16F, 0F); + bodyModel[13].rotateAngleY = 3.92699082F; + + bodyModel[14].addShapeBox(-3F, -1F, -3F, 6, 3, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F); // Import ImportBox11 + bodyModel[14].setRotationPoint(0F, -16F, 0F); + bodyModel[14].rotateAngleY = 3.92699082F; + + bodyModel[15].addShapeBox(-3F, -1F, 1F, 6, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox12 + bodyModel[15].setRotationPoint(0F, -17F, 0F); + bodyModel[15].rotateAngleY = 3.92699082F; + + bodyModel[16].addBox(-3F, -1F, -1F, 6, 1, 2, 0F); // Import ImportBox13 + bodyModel[16].setRotationPoint(0F, -17F, 0F); + bodyModel[16].rotateAngleY = 3.92699082F; + + bodyModel[17].addShapeBox(-3F, -1F, -3F, 6, 1, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox14 + bodyModel[17].setRotationPoint(0F, -17F, 0F); + bodyModel[17].rotateAngleY = 3.92699082F; + + bodyModel[18].addShapeBox(-3F, -1F, -1F, 6, 4, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox15 + bodyModel[18].setRotationPoint(0F, -21F, 0F); + bodyModel[18].rotateAngleY = 3.92699082F; + + bodyModel[19].addShapeBox(-3F, -1F, -3F, 6, 4, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox16 + bodyModel[19].setRotationPoint(0F, -21F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-3F, -1F, 1F, 6, 4, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox17 + bodyModel[20].setRotationPoint(0F, -21F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-1.5F, 0F, -0.5F, 3, 6, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Import ImportBox18 + bodyModel[21].setRotationPoint(0F, -27.5F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-1.5F, 0F, -1.5F, 3, 6, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, -0.5F, 0F, -1F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Import ImportBox19 + bodyModel[22].setRotationPoint(0F, -27.5F, 0F); + bodyModel[22].rotateAngleY = 3.92699082F; + + bodyModel[23].addShapeBox(-1.5F, 0F, 0.5F, 3, 6, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, -1F, -0.5F, 0F, -1F, -0.5F, 0F); // Import ImportBox20 + bodyModel[23].setRotationPoint(0F, -27.5F, 0F); + bodyModel[23].rotateAngleY = 3.92699082F; + + bodyModel[24].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox21 + bodyModel[24].setRotationPoint(0F, 11F, 0F); + bodyModel[24].rotateAngleY = 3.92699082F; + + bodyModel[25].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox22 + bodyModel[25].setRotationPoint(0F, 11F, 0F); + bodyModel[25].rotateAngleY = 5.49778714F; + + bodyModel[26].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox23 + bodyModel[26].setRotationPoint(0F, 11F, 0F); + bodyModel[26].rotateAngleY = 2.35619449F; + + bodyModel[27].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox24 + bodyModel[27].setRotationPoint(0F, 11F, 0F); + bodyModel[27].rotateAngleY = 0.78539816F; + + bodyModel[28].addShapeBox(-2.5F, -1F, -1.5F, 5, 3, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 0 + bodyModel[28].setRotationPoint(0F, -12F, 0F); + bodyModel[28].rotateAngleY = 3.92699082F; + + bodyModel[29].addShapeBox(-2.5F, -1F, -2.5F, 5, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 1 + bodyModel[29].setRotationPoint(0F, -12F, 0F); + bodyModel[29].rotateAngleY = 3.92699082F; + + bodyModel[30].addShapeBox(-2.5F, -1F, 1.5F, 5, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 2 + bodyModel[30].setRotationPoint(0F, -12F, 0F); + bodyModel[30].rotateAngleY = 3.92699082F; + + bodyModel[31].addShapeBox(-2.5F, -1F, -1.5F, 5, 3, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 3 + bodyModel[31].setRotationPoint(0F, -5F, 0F); + bodyModel[31].rotateAngleY = 3.92699082F; + + bodyModel[32].addShapeBox(-2.5F, -1F, 1.5F, 5, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 4 + bodyModel[32].setRotationPoint(0F, -5F, 0F); + bodyModel[32].rotateAngleY = 3.92699082F; + + bodyModel[33].addShapeBox(-2.5F, -1F, -2.5F, 5, 3, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[33].setRotationPoint(0F, -5F, 0F); + bodyModel[33].rotateAngleY = 3.92699082F; + + bodyModel[34].addShapeBox(2.5F, -1F, -0.5F, 5, 3, 1, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, -0.4F, 0F, 1F, -0.4F, 0F, 0F, 0F); // Box 6 + bodyModel[34].setRotationPoint(0F, -12F, 0F); + bodyModel[34].rotateAngleY = 3.92699082F; + + bodyModel[35].addShapeBox(2.5F, -1F, -0.5F, 3, 3, 1, 0F, 0F, 0F, 0F, 0F, -4F, -0.4F, 0F, -4F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1.5F, -0.4F, -1F, 1.5F, -0.4F, 0F, 0F, 0F); // Box 7 + bodyModel[35].setRotationPoint(0F, -5F, 0F); + bodyModel[35].rotateAngleY = 3.92699082F; + + bodyModel[36].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 8 + bodyModel[36].setRotationPoint(0F, -11.8F, 0F); + bodyModel[36].rotateAngleY = 4.71238898F; + + bodyModel[37].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 9 + bodyModel[37].setRotationPoint(0F, -10.2F, 0F); + bodyModel[37].rotateAngleY = 4.71238898F; + + bodyModel[38].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 10 + bodyModel[38].setRotationPoint(0F, -3.2F, 0F); + bodyModel[38].rotateAngleY = 4.71238898F; + + bodyModel[39].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 11 + bodyModel[39].setRotationPoint(0F, -4.8F, 0F); + bodyModel[39].rotateAngleY = 4.71238898F; + + bodyModel[40].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 12 + bodyModel[40].setRotationPoint(0F, -3.2F, 0F); + bodyModel[40].rotateAngleY = 3.14159265F; + + bodyModel[41].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + bodyModel[41].setRotationPoint(0F, -4.8F, 0F); + bodyModel[41].rotateAngleY = 3.14159265F; + + bodyModel[42].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[42].setRotationPoint(0F, -11.8F, 0F); + bodyModel[42].rotateAngleY = 3.14159265F; + + bodyModel[43].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[43].setRotationPoint(0F, -10.2F, 0F); + bodyModel[43].rotateAngleY = 3.14159265F; + + bodyModel[44].addShapeBox(2.5F, -1F, -0.5F, 5, 3, 1, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, -0.4F, 0F, 1F, -0.4F, 0F, 0F, 0F); // Box 16 + bodyModel[44].setRotationPoint(0F, -12F, 0F); + bodyModel[44].rotateAngleY = 2.35619449F; + + bodyModel[45].addShapeBox(2.5F, -1F, -0.5F, 3, 3, 1, 0F, 0F, 0F, 0F, 0F, -4F, -0.4F, 0F, -4F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1.5F, -0.4F, -1F, 1.5F, -0.4F, 0F, 0F, 0F); // Box 17 + bodyModel[45].setRotationPoint(0F, -5F, 0F); + bodyModel[45].rotateAngleY = 2.35619449F; + + bodyModel[46].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[46].setRotationPoint(0F, -3.2F, 0F); + bodyModel[46].rotateAngleY = 1.57079633F; + + bodyModel[47].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 19 + bodyModel[47].setRotationPoint(0F, -4.8F, 0F); + bodyModel[47].rotateAngleY = 1.57079633F; + + bodyModel[48].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 20 + bodyModel[48].setRotationPoint(0F, -11.8F, 0F); + bodyModel[48].rotateAngleY = 1.57079633F; + + bodyModel[49].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + bodyModel[49].setRotationPoint(0F, -10.2F, 0F); + bodyModel[49].rotateAngleY = 1.57079633F; + + bodyModel[50].addShapeBox(2.5F, -1F, -0.5F, 5, 3, 1, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, -0.4F, 0F, 1F, -0.4F, 0F, 0F, 0F); // Box 22 + bodyModel[50].setRotationPoint(0F, -12F, 0F); + bodyModel[50].rotateAngleY = 0.78539817F; + + bodyModel[51].addShapeBox(2.5F, -1F, -0.5F, 3, 3, 1, 0F, 0F, 0F, 0F, 0F, -4F, -0.4F, 0F, -4F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1.5F, -0.4F, -1F, 1.5F, -0.4F, 0F, 0F, 0F); // Box 23 + bodyModel[51].setRotationPoint(0F, -5F, 0F); + bodyModel[51].rotateAngleY = 0.78539817F; + + bodyModel[52].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 24 + bodyModel[52].setRotationPoint(0F, -3.2F, 0F); + + bodyModel[53].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 25 + bodyModel[53].setRotationPoint(0F, -4.8F, 0F); + + bodyModel[54].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 26 + bodyModel[54].setRotationPoint(0F, -11.8F, 0F); + + bodyModel[55].addShapeBox(2.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 27 + bodyModel[55].setRotationPoint(0F, -10.2F, 0F); + + bodyModel[56].addShapeBox(2.5F, -1F, -0.5F, 5, 3, 1, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, -0.4F, 0F, 1F, -0.4F, 0F, 0F, 0F); // Box 28 + bodyModel[56].setRotationPoint(0F, -12F, 0F); + bodyModel[56].rotateAngleY = -0.78539816F; + + bodyModel[57].addShapeBox(2.5F, -1F, -0.5F, 3, 3, 1, 0F, 0F, 0F, 0F, 0F, -4F, -0.4F, 0F, -4F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 1.5F, -0.4F, -1F, 1.5F, -0.4F, 0F, 0F, 0F); // Box 29 + bodyModel[57].setRotationPoint(0F, -5F, 0F); + bodyModel[57].rotateAngleY = -0.78539816F; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelShrapnelMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelShrapnelMissile.java new file mode 100644 index 000000000..589b08dee --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelShrapnelMissile.java @@ -0,0 +1,487 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelShrapnelMissile extends ModelMissileBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelShrapnelMissile() + { + int textureX = 32; + int textureY = 128; + + bodyModel = new ModelRendererTurbo[84]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 2, textureX, textureY); // Import ImportBox0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 2, textureX, textureY); // Import ImportBox1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 2, textureX, textureY); // Import ImportBox2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 17, textureX, textureY); // Import Box0 + bodyModel[4] = new ModelRendererTurbo(this, 0, 17, textureX, textureY); // Import Box1 + bodyModel[5] = new ModelRendererTurbo(this, 0, 17, textureX, textureY); // Import Box2 + bodyModel[6] = new ModelRendererTurbo(this, 0, 25, textureX, textureY); // Import Box3 + bodyModel[7] = new ModelRendererTurbo(this, 0, 25, textureX, textureY); // Import Box4 + bodyModel[8] = new ModelRendererTurbo(this, 0, 25, textureX, textureY); // Import Box5 + bodyModel[9] = new ModelRendererTurbo(this, 0, 33, textureX, textureY); // Import Box6 + bodyModel[10] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Import Box7 + bodyModel[11] = new ModelRendererTurbo(this, 0, 50, textureX, textureY); // Import Box8 + bodyModel[12] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box9 + bodyModel[13] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box10 + bodyModel[14] = new ModelRendererTurbo(this, 0, 66, textureX, textureY); // Import Box11 + bodyModel[15] = new ModelRendererTurbo(this, 0, 70, textureX, textureY); // Import Box12 + bodyModel[16] = new ModelRendererTurbo(this, 0, 70, textureX, textureY); // Import Box13 + bodyModel[17] = new ModelRendererTurbo(this, 0, 70, textureX, textureY); // Import Box14 + bodyModel[18] = new ModelRendererTurbo(this, 0, 79, textureX, textureY); // Import Box15 + bodyModel[19] = new ModelRendererTurbo(this, 0, 79, textureX, textureY); // Import Box16 + bodyModel[20] = new ModelRendererTurbo(this, 0, 79, textureX, textureY); // Import Box17 + bodyModel[21] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Import Box18 + bodyModel[22] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Import Box19 + bodyModel[23] = new ModelRendererTurbo(this, 0, 83, textureX, textureY); // Import Box20 + bodyModel[24] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Import Box21 + bodyModel[25] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Import Box22 + bodyModel[26] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Import Box23 + bodyModel[27] = new ModelRendererTurbo(this, 0, 85, textureX, textureY); // Import Box24 + bodyModel[28] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 0 + bodyModel[29] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 1 + bodyModel[30] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 2 + bodyModel[31] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 3 + bodyModel[32] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 4 + bodyModel[33] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 5 + bodyModel[34] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 6 + bodyModel[35] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 7 + bodyModel[36] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 8 + bodyModel[37] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 9 + bodyModel[38] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 10 + bodyModel[39] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 11 + bodyModel[40] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 12 + bodyModel[41] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 13 + bodyModel[42] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 14 + bodyModel[43] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 15 + bodyModel[44] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 16 + bodyModel[45] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 17 + bodyModel[46] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 18 + bodyModel[47] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 19 + bodyModel[48] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 20 + bodyModel[49] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 21 + bodyModel[50] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 22 + bodyModel[51] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 23 + bodyModel[52] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 32 + bodyModel[53] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 33 + bodyModel[54] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 34 + bodyModel[55] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 35 + bodyModel[56] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 36 + bodyModel[57] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 37 + bodyModel[58] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 38 + bodyModel[59] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 39 + bodyModel[60] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 40 + bodyModel[61] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 41 + bodyModel[62] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 42 + bodyModel[63] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 43 + bodyModel[64] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 44 + bodyModel[65] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 45 + bodyModel[66] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 46 + bodyModel[67] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 47 + bodyModel[68] = new ModelRendererTurbo(this, 0, 94, textureX, textureY); // Box 48 + bodyModel[69] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Box 49 + bodyModel[70] = new ModelRendererTurbo(this, 0, 102, textureX, textureY); // Box 50 + bodyModel[71] = new ModelRendererTurbo(this, 0, 108, textureX, textureY); // Box 51 + bodyModel[72] = new ModelRendererTurbo(this, 0, 108, textureX, textureY); // Box 52 + bodyModel[73] = new ModelRendererTurbo(this, 0, 108, textureX, textureY); // Box 53 + bodyModel[74] = new ModelRendererTurbo(this, 0, 108, textureX, textureY); // Box 54 + bodyModel[75] = new ModelRendererTurbo(this, 0, 114, textureX, textureY); // Box 55 + bodyModel[76] = new ModelRendererTurbo(this, 0, 114, textureX, textureY); // Box 56 + bodyModel[77] = new ModelRendererTurbo(this, 0, 116, textureX, textureY); // Box 57 + bodyModel[78] = new ModelRendererTurbo(this, 0, 114, textureX, textureY); // Box 58 + bodyModel[79] = new ModelRendererTurbo(this, 0, 114, textureX, textureY); // Box 59 + bodyModel[80] = new ModelRendererTurbo(this, 0, 116, textureX, textureY); // Box 60 + bodyModel[81] = new ModelRendererTurbo(this, 0, 114, textureX, textureY); // Box 61 + bodyModel[82] = new ModelRendererTurbo(this, 0, 114, textureX, textureY); // Box 62 + bodyModel[83] = new ModelRendererTurbo(this, 0, 116, textureX, textureY); // Box 63 + + bodyModel[0].addBox(-3F, -1F, -1F, 6, 12, 2, 0F); // Import ImportBox0 + bodyModel[0].setRotationPoint(0F, 7F, 0F); + bodyModel[0].rotateAngleY = 3.92699082F; + + bodyModel[1].addShapeBox(-3F, -1F, -3F, 6, 12, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import ImportBox1 + bodyModel[1].setRotationPoint(0F, 7F, 0F); + bodyModel[1].rotateAngleY = 3.92699082F; + + bodyModel[2].addShapeBox(-3F, -1F, 1F, 6, 12, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import ImportBox2 + bodyModel[2].setRotationPoint(0F, 7F, 0F); + bodyModel[2].rotateAngleY = 3.92699082F; + + bodyModel[3].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box0 + bodyModel[3].setRotationPoint(0F, 19F, 0F); + bodyModel[3].rotateAngleY = 3.92699082F; + + bodyModel[4].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box1 + bodyModel[4].setRotationPoint(0F, 19F, 0F); + bodyModel[4].rotateAngleY = 3.92699082F; + + bodyModel[5].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box2 + bodyModel[5].setRotationPoint(0F, 19F, 0F); + bodyModel[5].rotateAngleY = 3.92699082F; + + bodyModel[6].addShapeBox(-3F, -1F, -3F, 6, 6, 2, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box3 + bodyModel[6].setRotationPoint(0F, 1F, 0F); + bodyModel[6].rotateAngleY = 3.92699082F; + + bodyModel[7].addShapeBox(-3F, -1F, -1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box4 + bodyModel[7].setRotationPoint(0F, 1F, 0F); + bodyModel[7].rotateAngleY = 3.92699082F; + + bodyModel[8].addShapeBox(-3F, -1F, 1F, 6, 6, 2, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box5 + bodyModel[8].setRotationPoint(0F, 1F, 0F); + bodyModel[8].rotateAngleY = 3.92699082F; + + bodyModel[9].addShapeBox(-2F, -1F, -1F, 4, 15, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box6 + bodyModel[9].setRotationPoint(0F, -14F, 0F); + bodyModel[9].rotateAngleY = 3.92699082F; + + bodyModel[10].addShapeBox(-2F, -1F, -2F, 4, 15, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box7 + bodyModel[10].setRotationPoint(0F, -14F, 0F); + bodyModel[10].rotateAngleY = 3.92699082F; + + bodyModel[11].addShapeBox(-2F, -1F, 1F, 4, 15, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box8 + bodyModel[11].setRotationPoint(0F, -14F, 0F); + bodyModel[11].rotateAngleY = 3.92699082F; + + bodyModel[12].addShapeBox(-3F, -1F, 1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F); // Import Box9 + bodyModel[12].setRotationPoint(0F, -16F, 0F); + bodyModel[12].rotateAngleY = 3.92699082F; + + bodyModel[13].addShapeBox(-3F, -1F, -1F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box10 + bodyModel[13].setRotationPoint(0F, -16F, 0F); + bodyModel[13].rotateAngleY = 3.92699082F; + + bodyModel[14].addShapeBox(-3F, -1F, -3F, 6, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, -1F, -2F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box11 + bodyModel[14].setRotationPoint(0F, -16F, 0F); + bodyModel[14].rotateAngleY = 3.92699082F; + + bodyModel[15].addShapeBox(-3F, -1F, 1F, 6, 7, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box12 + bodyModel[15].setRotationPoint(0F, -23F, 0F); + bodyModel[15].rotateAngleY = 3.92699082F; + + bodyModel[16].addBox(-3F, -1F, -1F, 6, 7, 2, 0F); // Import Box13 + bodyModel[16].setRotationPoint(0F, -23F, 0F); + bodyModel[16].rotateAngleY = 3.92699082F; + + bodyModel[17].addShapeBox(-3F, -1F, -3F, 6, 7, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box14 + bodyModel[17].setRotationPoint(0F, -23F, 0F); + bodyModel[17].rotateAngleY = 3.92699082F; + + bodyModel[18].addShapeBox(-3F, -1F, -1F, 6, 2, 2, 0F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, -1.5F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box15 + bodyModel[18].setRotationPoint(0F, -25F, 0F); + bodyModel[18].rotateAngleY = 3.92699082F; + + bodyModel[19].addShapeBox(-3F, -1F, -3F, 6, 2, 2, 0F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box16 + bodyModel[19].setRotationPoint(0F, -25F, 0F); + bodyModel[19].rotateAngleY = 3.92699082F; + + bodyModel[20].addShapeBox(-3F, -1F, 1F, 6, 2, 2, 0F, -1.5F, 0F, 0.5F, -1.5F, 0F, 0.5F, -2.5F, 0F, -1.5F, -2.5F, 0F, -1.5F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Import Box17 + bodyModel[20].setRotationPoint(0F, -25F, 0F); + bodyModel[20].rotateAngleY = 3.92699082F; + + bodyModel[21].addShapeBox(-1.5F, 0F, -0.5F, 3, 1, 1, 0F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, -1F, 0F, -0.33F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box18 + bodyModel[21].setRotationPoint(0F, -27F, 0F); + bodyModel[21].rotateAngleY = 3.92699082F; + + bodyModel[22].addShapeBox(-1.5F, 0F, -1.5F, 3, 1, 1, 0F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box19 + bodyModel[22].setRotationPoint(0F, -27F, 0F); + bodyModel[22].rotateAngleY = 3.92699082F; + + bodyModel[23].addShapeBox(-1.5F, 0F, 0.5F, 3, 1, 1, 0F, -1F, 0F, 0.33F, -1F, 0F, 0.33F, -1.33F, 0F, -1F, -1.33F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Import Box20 + bodyModel[23].setRotationPoint(0F, -27F, 0F); + bodyModel[23].rotateAngleY = 3.92699082F; + + bodyModel[24].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box21 + bodyModel[24].setRotationPoint(0F, 11F, 0F); + bodyModel[24].rotateAngleY = 3.92699082F; + + bodyModel[25].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box22 + bodyModel[25].setRotationPoint(0F, 11F, 0F); + bodyModel[25].rotateAngleY = 5.49778714F; + + bodyModel[26].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box23 + bodyModel[26].setRotationPoint(0F, 11F, 0F); + bodyModel[26].rotateAngleY = 2.35619449F; + + bodyModel[27].addShapeBox(-7F, -1F, -0.5F, 4, 8, 1, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Import Box24 + bodyModel[27].setRotationPoint(0F, 11F, 0F); + bodyModel[27].rotateAngleY = 0.78539816F; + + bodyModel[28].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 0 + bodyModel[28].setRotationPoint(0F, -22F, 0F); + bodyModel[28].rotateAngleY = 3.92699082F; + + bodyModel[29].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 1 + bodyModel[29].setRotationPoint(0F, -22F, 0F); + bodyModel[29].rotateAngleY = 4.71238898F; + + bodyModel[30].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 2 + bodyModel[30].setRotationPoint(0F, -22F, 0F); + bodyModel[30].rotateAngleY = 5.49778714F; + + bodyModel[31].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 3 + bodyModel[31].setRotationPoint(0F, -22F, 0F); + bodyModel[31].rotateAngleY = 6.2831853F; + + bodyModel[32].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 4 + bodyModel[32].setRotationPoint(0F, -22F, 0F); + bodyModel[32].rotateAngleY = 0.78539816F; + + bodyModel[33].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[33].setRotationPoint(0F, -22F, 0F); + bodyModel[33].rotateAngleY = 1.57079632F; + + bodyModel[34].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 6 + bodyModel[34].setRotationPoint(0F, -22F, 0F); + bodyModel[34].rotateAngleY = 2.35619449F; + + bodyModel[35].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 7 + bodyModel[35].setRotationPoint(0F, -22F, 0F); + bodyModel[35].rotateAngleY = 3.14159265F; + + bodyModel[36].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 8 + bodyModel[36].setRotationPoint(0F, -20F, 0F); + bodyModel[36].rotateAngleY = 2.35619449F; + + bodyModel[37].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 9 + bodyModel[37].setRotationPoint(0F, -20F, 0F); + bodyModel[37].rotateAngleY = 3.14159265F; + + bodyModel[38].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 10 + bodyModel[38].setRotationPoint(0F, -20F, 0F); + bodyModel[38].rotateAngleY = 1.57079632F; + + bodyModel[39].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 11 + bodyModel[39].setRotationPoint(0F, -20F, 0F); + bodyModel[39].rotateAngleY = 0.78539816F; + + bodyModel[40].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 12 + bodyModel[40].setRotationPoint(0F, -20F, 0F); + bodyModel[40].rotateAngleY = 6.2831853F; + + bodyModel[41].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + bodyModel[41].setRotationPoint(0F, -20F, 0F); + bodyModel[41].rotateAngleY = 5.49778714F; + + bodyModel[42].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + bodyModel[42].setRotationPoint(0F, -20F, 0F); + bodyModel[42].rotateAngleY = 4.71238898F; + + bodyModel[43].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[43].setRotationPoint(0F, -20F, 0F); + bodyModel[43].rotateAngleY = 3.92699082F; + + bodyModel[44].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 16 + bodyModel[44].setRotationPoint(0F, -18F, 0F); + bodyModel[44].rotateAngleY = 2.35619449F; + + bodyModel[45].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 17 + bodyModel[45].setRotationPoint(0F, -18F, 0F); + bodyModel[45].rotateAngleY = 3.14159265F; + + bodyModel[46].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 18 + bodyModel[46].setRotationPoint(0F, -18F, 0F); + bodyModel[46].rotateAngleY = 1.57079632F; + + bodyModel[47].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 19 + bodyModel[47].setRotationPoint(0F, -18F, 0F); + bodyModel[47].rotateAngleY = 0.78539816F; + + bodyModel[48].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 20 + bodyModel[48].setRotationPoint(0F, -18F, 0F); + bodyModel[48].rotateAngleY = 6.2831853F; + + bodyModel[49].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + bodyModel[49].setRotationPoint(0F, -18F, 0F); + bodyModel[49].rotateAngleY = 5.49778714F; + + bodyModel[50].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 22 + bodyModel[50].setRotationPoint(0F, -18F, 0F); + bodyModel[50].rotateAngleY = 4.71238898F; + + bodyModel[51].addShapeBox(-3.7F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 23 + bodyModel[51].setRotationPoint(0F, -18F, 0F); + bodyModel[51].rotateAngleY = 3.92699082F; + + bodyModel[52].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 32 + bodyModel[52].setRotationPoint(0F, -23F, 0F); + bodyModel[52].rotateAngleY = 2.35619449F; + bodyModel[52].rotateAngleZ = 0.48869219F; + + bodyModel[53].addShapeBox(-3.3F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 33 + bodyModel[53].setRotationPoint(0F, -23F, 0F); + bodyModel[53].rotateAngleY = 3.14159265F; + bodyModel[53].rotateAngleZ = 0.48869219F; + + bodyModel[54].addShapeBox(-3.3F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 34 + bodyModel[54].setRotationPoint(0F, -23F, 0F); + bodyModel[54].rotateAngleY = 1.57079632F; + bodyModel[54].rotateAngleZ = 0.48869219F; + + bodyModel[55].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 35 + bodyModel[55].setRotationPoint(0F, -23F, 0F); + bodyModel[55].rotateAngleY = 0.78539816F; + bodyModel[55].rotateAngleZ = 0.48869219F; + + bodyModel[56].addShapeBox(-3.3F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 36 + bodyModel[56].setRotationPoint(0F, -23F, 0F); + bodyModel[56].rotateAngleY = 6.2831853F; + bodyModel[56].rotateAngleZ = 0.48869219F; + + bodyModel[57].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 37 + bodyModel[57].setRotationPoint(0F, -23F, 0F); + bodyModel[57].rotateAngleY = 5.49778714F; + bodyModel[57].rotateAngleZ = 0.48869219F; + + bodyModel[58].addShapeBox(-3.3F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 38 + bodyModel[58].setRotationPoint(0F, -23F, 0F); + bodyModel[58].rotateAngleY = 4.71238898F; + bodyModel[58].rotateAngleZ = 0.48869219F; + + bodyModel[59].addShapeBox(-3.5F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 39 + bodyModel[59].setRotationPoint(0F, -23F, 0F); + bodyModel[59].rotateAngleY = 3.92699082F; + bodyModel[59].rotateAngleZ = 0.48869219F; + + bodyModel[60].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 40 + bodyModel[60].setRotationPoint(0F, -24F, 0F); + bodyModel[60].rotateAngleY = 2.35619449F; + bodyModel[60].rotateAngleZ = 0.82030475F; + + bodyModel[61].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 41 + bodyModel[61].setRotationPoint(0F, -24F, 0F); + bodyModel[61].rotateAngleY = 3.14159265F; + bodyModel[61].rotateAngleZ = 0.82030475F; + + bodyModel[62].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 42 + bodyModel[62].setRotationPoint(0F, -24F, 0F); + bodyModel[62].rotateAngleY = 1.57079632F; + bodyModel[62].rotateAngleZ = 0.82030475F; + + bodyModel[63].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 43 + bodyModel[63].setRotationPoint(0F, -24F, 0F); + bodyModel[63].rotateAngleY = 0.78539816F; + bodyModel[63].rotateAngleZ = 0.82030475F; + + bodyModel[64].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 44 + bodyModel[64].setRotationPoint(0F, -24F, 0F); + bodyModel[64].rotateAngleY = 6.2831853F; + bodyModel[64].rotateAngleZ = 0.82030475F; + + bodyModel[65].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 45 + bodyModel[65].setRotationPoint(0F, -24F, 0F); + bodyModel[65].rotateAngleY = 5.49778714F; + bodyModel[65].rotateAngleZ = 0.82030475F; + + bodyModel[66].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 46 + bodyModel[66].setRotationPoint(0F, -24F, 0F); + bodyModel[66].rotateAngleY = 4.71238898F; + bodyModel[66].rotateAngleZ = 0.82030475F; + + bodyModel[67].addShapeBox(-2.8F, -1F, -0.5F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 47 + bodyModel[67].setRotationPoint(0F, -24F, 0F); + bodyModel[67].rotateAngleY = 3.92699082F; + bodyModel[67].rotateAngleZ = 0.82030475F; + + bodyModel[68].addShapeBox(-2.5F, -1F, -1.5F, 5, 5, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 48 + bodyModel[68].setRotationPoint(0F, -7F, 0F); + bodyModel[68].rotateAngleY = 3.92699082F; + + bodyModel[69].addShapeBox(-2.5F, -1F, -2.5F, 5, 5, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 49 + bodyModel[69].setRotationPoint(0F, -7F, 0F); + bodyModel[69].rotateAngleY = 3.92699082F; + + bodyModel[70].addShapeBox(-2.5F, -1F, 1.5F, 5, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 50 + bodyModel[70].setRotationPoint(0F, -7F, 0F); + bodyModel[70].rotateAngleY = 3.92699082F; + + bodyModel[71].addShapeBox(2.5F, -1F, -0.5F, 7, 5, 1, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F); // Box 51 + bodyModel[71].setRotationPoint(0F, -7F, 0F); + bodyModel[71].rotateAngleY = 3.92699082F; + + bodyModel[72].addShapeBox(2.5F, -1F, -0.5F, 7, 5, 1, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F); // Box 52 + bodyModel[72].setRotationPoint(0F, -7F, 0F); + bodyModel[72].rotateAngleY = 5.49778714F; + + bodyModel[73].addShapeBox(2.5F, -1F, -0.5F, 7, 5, 1, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F); // Box 53 + bodyModel[73].setRotationPoint(0F, -7F, 0F); + bodyModel[73].rotateAngleY = 2.35619449F; + + bodyModel[74].addShapeBox(2.5F, -1F, -0.5F, 7, 5, 1, 0F, 0F, 0F, 0F, 0F, -1F, -0.4F, 0F, -1F, -0.4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -3F, -0.4F, 0F, -3F, -0.4F, 0F, 0F, 0F); // Box 54 + bodyModel[74].setRotationPoint(0F, -7F, 0F); + bodyModel[74].rotateAngleY = 0.78539817F; + + bodyModel[75].addShapeBox(-2.5F, -1F, -2.5F, 5, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 55 + bodyModel[75].setRotationPoint(0F, -9F, 0F); + bodyModel[75].rotateAngleY = 3.92699082F; + + bodyModel[76].addShapeBox(-2.5F, -1F, 1.5F, 5, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 56 + bodyModel[76].setRotationPoint(0F, -9F, 0F); + bodyModel[76].rotateAngleY = 3.92699082F; + + bodyModel[77].addShapeBox(-2.5F, -1F, -1.5F, 5, 1, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 57 + bodyModel[77].setRotationPoint(0F, -9F, 0F); + bodyModel[77].rotateAngleY = 3.92699082F; + + bodyModel[78].addShapeBox(-2.5F, -1F, -2.5F, 5, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 58 + bodyModel[78].setRotationPoint(0F, -11F, 0F); + bodyModel[78].rotateAngleY = 3.92699082F; + + bodyModel[79].addShapeBox(-2.5F, -1F, 1.5F, 5, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 59 + bodyModel[79].setRotationPoint(0F, -11F, 0F); + bodyModel[79].rotateAngleY = 3.92699082F; + + bodyModel[80].addShapeBox(-2.5F, -1F, -1.5F, 5, 1, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 60 + bodyModel[80].setRotationPoint(0F, -11F, 0F); + bodyModel[80].rotateAngleY = 3.92699082F; + + bodyModel[81].addShapeBox(-2.5F, -1F, -2.5F, 5, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 61 + bodyModel[81].setRotationPoint(0F, -13F, 0F); + bodyModel[81].rotateAngleY = 3.92699082F; + + bodyModel[82].addShapeBox(-2.5F, -1F, 1.5F, 5, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 62 + bodyModel[82].setRotationPoint(0F, -13F, 0F); + bodyModel[82].rotateAngleY = 3.92699082F; + + bodyModel[83].addShapeBox(-2.5F, -1F, -1.5F, 5, 1, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 63 + bodyModel[83].setRotationPoint(0F, -13F, 0F); + bodyModel[83].rotateAngleY = 3.92699082F; + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelSonicMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelSonicMissile.java new file mode 100644 index 000000000..ee5a3e33d --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelSonicMissile.java @@ -0,0 +1,239 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelSonicMissile extends ModelMissileBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2a; + ModelRenderer Shape2b; + ModelRenderer Shape2c; + ModelRenderer Shape3; + ModelRenderer Shape3a; + ModelRenderer Shape3b; + ModelRenderer Shape3c; + ModelRenderer Shape4; + ModelRenderer Shape4a; + ModelRenderer Shape4b; + ModelRenderer Shape4c; + ModelRenderer Shape5; + ModelRenderer Shape5a; + ModelRenderer Shape4d; + ModelRenderer Shape4e; + ModelRenderer Shape4f; + ModelRenderer Shape4g; + ModelRenderer Shape6; + ModelRenderer Shape6a; + ModelRenderer Shape7a; + ModelRenderer Shape7; + ModelRenderer Shape7b; + ModelRenderer Shape7c; + + public ModelSonicMissile() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, 0F, -4F, 8, 64, 8); + Shape1.setRotationPoint(0F, -40F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 34, 19); + Shape2.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2.setRotationPoint(-7F, 14F, 6F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2a = new ModelRenderer(this, 34, 19); + Shape2a.addBox(0F, 0F, 0F, 14, 10, 1); + Shape2a.setRotationPoint(-7F, 14F, -7F); + Shape2a.setTextureSize(128, 128); + Shape2a.mirror = true; + setRotation(Shape2a, 0F, 0F, 0F); + Shape2b = new ModelRenderer(this, 34, 31); + Shape2b.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2b.setRotationPoint(-7F, 14F, -6F); + Shape2b.setTextureSize(128, 128); + Shape2b.mirror = true; + setRotation(Shape2b, 0F, 0F, 0F); + Shape2c = new ModelRenderer(this, 34, 31); + Shape2c.addBox(0F, 0F, 0F, 1, 10, 12); + Shape2c.setRotationPoint(6F, 14F, -6F); + Shape2c.setTextureSize(128, 128); + Shape2c.mirror = true; + setRotation(Shape2c, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 72, 0); + Shape3.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3.setRotationPoint(0F, 12F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0.7853982F, 0F); + Shape3a = new ModelRenderer(this, 72, 0); + Shape3a.addBox(-11F, 0F, -1F, 22, 12, 2); + Shape3a.setRotationPoint(0F, 12F, 0F); + Shape3a.setTextureSize(128, 128); + Shape3a.mirror = true; + setRotation(Shape3a, 0F, -0.7853982F, 0F); + Shape3b = new ModelRenderer(this, 34, 0); + Shape3b.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3b.setRotationPoint(0F, 12F, 0F); + Shape3b.setTextureSize(128, 128); + Shape3b.mirror = true; + setRotation(Shape3b, 0F, 0.7853982F, 0.7853982F); + Shape3c = new ModelRenderer(this, 34, 0); + Shape3c.addBox(-8F, -8F, -1F, 16, 16, 2); + Shape3c.setRotationPoint(0F, 12F, 0F); + Shape3c.setTextureSize(128, 128); + Shape3c.mirror = true; + setRotation(Shape3c, 0F, -0.7853982F, 0.7853982F); + Shape4 = new ModelRenderer(this, 22, 74); + Shape4.addBox(0F, 0F, 0F, 2, 7, 5); + Shape4.setRotationPoint(-1F, -23F, 4F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, -0.5235988F, 0F, 0F); + Shape4a = new ModelRenderer(this, 0, 103); + Shape4a.addBox(0F, 0F, 0F, 5, 8, 2); + Shape4a.setRotationPoint(4F, -23F, -1F); + Shape4a.setTextureSize(128, 128); + Shape4a.mirror = true; + setRotation(Shape4a, 0F, 0F, 0.5235988F); + Shape4b = new ModelRenderer(this, 0, 81); + Shape4b.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4b.setRotationPoint(0F, -35F, -4F); + Shape4b.setTextureSize(128, 128); + Shape4b.mirror = true; + setRotation(Shape4b, -0.5235988F, 3.141593F, 0F); + Shape4c = new ModelRenderer(this, 0, 103); + Shape4c.addBox(0F, 0F, -1F, 5, 8, 2); + Shape4c.setRotationPoint(-4F, -23F, 0F); + Shape4c.setTextureSize(128, 128); + Shape4c.mirror = true; + setRotation(Shape4c, 0F, 3.141593F, 0.5235988F); + Shape5 = new ModelRenderer(this, 0, 74); + Shape5.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5.setRotationPoint(0F, -32F, 0F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + Shape5a = new ModelRenderer(this, 0, 74); + Shape5a.addBox(-1F, 0F, -8F, 2, 12, 16); + Shape5a.setRotationPoint(0F, -32F, 0F); + Shape5a.setTextureSize(128, 128); + Shape5a.mirror = true; + setRotation(Shape5a, 0F, 1.570796F, 0F); + Shape4d = new ModelRenderer(this, 22, 74); + Shape4d.addBox(-1F, 0F, 0F, 2, 8, 5); + Shape4d.setRotationPoint(0F, -23F, -4F); + Shape4d.setTextureSize(128, 128); + Shape4d.mirror = true; + setRotation(Shape4d, -0.5235988F, 3.141593F, 0F); + Shape4e = new ModelRenderer(this, 0, 81); + Shape4e.addBox(-1F, 0F, 0F, 2, 4, 5); + Shape4e.setRotationPoint(0F, -35F, 4F); + Shape4e.setTextureSize(128, 128); + Shape4e.mirror = true; + setRotation(Shape4e, -0.5235988F, 0F, 0F); + Shape4f = new ModelRenderer(this, 0, 74); + Shape4f.addBox(0F, 0F, -1F, 5, 4, 2); + Shape4f.setRotationPoint(-4F, -35F, 0F); + Shape4f.setTextureSize(128, 128); + Shape4f.mirror = true; + setRotation(Shape4f, 0F, 3.141593F, 0.5235988F); + Shape4g = new ModelRenderer(this, 0, 74); + Shape4g.addBox(0F, 0F, 0F, 5, 4, 2); + Shape4g.setRotationPoint(4F, -35F, -1F); + Shape4g.setTextureSize(128, 128); + Shape4g.mirror = true; + setRotation(Shape4g, 0F, 0F, 0.5235988F); + Shape6 = new ModelRenderer(this, 72, 16); + Shape6.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6.setRotationPoint(-5F, -37F, -5F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape6a = new ModelRenderer(this, 72, 16); + Shape6a.addBox(0F, 0F, 0F, 10, 1, 10); + Shape6a.setRotationPoint(-5F, -41F, -5F); + Shape6a.setTextureSize(128, 128); + Shape6a.mirror = true; + setRotation(Shape6a, 0F, 0F, 0F); + Shape7a = new ModelRenderer(this, 95, 115); + Shape7a.addBox(0F, 0F, 0F, 8, 4, 8); + Shape7a.setRotationPoint(-4F, -45F, -4F); + Shape7a.setTextureSize(128, 128); + Shape7a.mirror = true; + setRotation(Shape7a, 0F, 0F, 0F); + Shape7 = new ModelRenderer(this, 95, 103); + Shape7.addBox(0F, 0F, 0F, 6, 4, 6); + Shape7.setRotationPoint(-3F, -49F, -3F); + Shape7.setTextureSize(128, 128); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + Shape7b = new ModelRenderer(this, 69, 109); + Shape7b.addBox(-1F, 0F, -5F, 2, 8, 10); + Shape7b.setRotationPoint(0F, -48F, 0F); + Shape7b.setTextureSize(128, 128); + Shape7b.mirror = true; + setRotation(Shape7b, 0F, 0.7853982F, 0F); + Shape7c = new ModelRenderer(this, 69, 109); + Shape7c.addBox(-1F, 0F, -5F, 2, 8, 10); + Shape7c.setRotationPoint(0F, -48F, 0F); + Shape7c.setTextureSize(128, 128); + Shape7c.mirror = true; + setRotation(Shape7c, 0F, -0.7853982F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.render(f5); + } + + @Override + public void render(float f5) + { + Shape1.render(f5); + Shape2.render(f5); + Shape2a.render(f5); + Shape2b.render(f5); + Shape2c.render(f5); + Shape3.render(f5); + Shape3a.render(f5); + Shape3b.render(f5); + Shape3c.render(f5); + Shape4.render(f5); + Shape4a.render(f5); + Shape4b.render(f5); + Shape4c.render(f5); + Shape5.render(f5); + Shape5a.render(f5); + Shape4d.render(f5); + Shape4e.render(f5); + Shape4f.render(f5); + Shape4g.render(f5); + Shape6.render(f5); + Shape6a.render(f5); + Shape7a.render(f5); + Shape7.render(f5); + Shape7b.render(f5); + Shape7c.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/missile/ModelThermobaricMissile.java b/src/main/java/mekanism/defense/client/model/missile/ModelThermobaricMissile.java new file mode 100644 index 000000000..82a8ed4b3 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/missile/ModelThermobaricMissile.java @@ -0,0 +1,336 @@ +package defense.client.model.missile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelThermobaricMissile extends ModelMissileBase +{ + // fields + ModelRenderer A; + ModelRenderer B; + ModelRenderer C; + ModelRenderer D; + ModelRenderer E; + ModelRenderer F; + ModelRenderer G; + ModelRenderer H; + ModelRenderer I; + ModelRenderer J; + ModelRenderer K; + ModelRenderer L; + ModelRenderer M; + ModelRenderer N; + ModelRenderer O; + ModelRenderer P; + ModelRenderer Q; + ModelRenderer R; + ModelRenderer S; + ModelRenderer T; + ModelRenderer U; + ModelRenderer V; + ModelRenderer W; + ModelRenderer X; + ModelRenderer Y; + ModelRenderer Z; + ModelRenderer AA; + ModelRenderer AB; + ModelRenderer AC; + ModelRenderer AD; + ModelRenderer AE; + ModelRenderer AF; + ModelRenderer AG; + ModelRenderer AH; + ModelRenderer AI; + ModelRenderer AJ; + ModelRenderer AK; + + public ModelThermobaricMissile() + { + textureWidth = 128; + textureHeight = 128; + + A = new ModelRenderer(this, 0, 0); + A.addBox(-4F, 0F, -4F, 8, 64, 8); + A.setRotationPoint(0F, -40F, 0F); + A.setTextureSize(128, 128); + A.mirror = true; + setRotation(A, 0F, 0F, 0F); + B = new ModelRenderer(this, 34, 19); + B.addBox(0F, 0F, 0F, 14, 10, 1); + B.setRotationPoint(-7F, 14F, 6F); + B.setTextureSize(128, 128); + B.mirror = true; + setRotation(B, 0F, 0F, 0F); + C = new ModelRenderer(this, 34, 19); + C.addBox(0F, 0F, 0F, 14, 10, 1); + C.setRotationPoint(-7F, 14F, -7F); + C.setTextureSize(128, 128); + C.mirror = true; + setRotation(C, 0F, 0F, 0F); + D = new ModelRenderer(this, 34, 31); + D.addBox(0F, 0F, 0F, 1, 10, 12); + D.setRotationPoint(-7F, 14F, -6F); + D.setTextureSize(128, 128); + D.mirror = true; + setRotation(D, 0F, 0F, 0F); + E = new ModelRenderer(this, 34, 31); + E.addBox(0F, 0F, 0F, 1, 10, 12); + E.setRotationPoint(6F, 14F, -6F); + E.setTextureSize(128, 128); + E.mirror = true; + setRotation(E, 0F, 0F, 0F); + F = new ModelRenderer(this, 72, 0); + F.addBox(-11F, 0F, -1F, 22, 12, 2); + F.setRotationPoint(0F, 12F, 0F); + F.setTextureSize(128, 128); + F.mirror = true; + setRotation(F, 0F, 0.7853982F, 0F); + G = new ModelRenderer(this, 72, 0); + G.addBox(-11F, 0F, -1F, 22, 12, 2); + G.setRotationPoint(0F, 12F, 0F); + G.setTextureSize(128, 128); + G.mirror = true; + setRotation(G, 0F, -0.7853982F, 0F); + H = new ModelRenderer(this, 34, 0); + H.addBox(-8F, -8F, -1F, 16, 16, 2); + H.setRotationPoint(0F, 12F, 0F); + H.setTextureSize(128, 128); + H.mirror = true; + setRotation(H, 0F, 0.7853982F, 0.7853982F); + I = new ModelRenderer(this, 34, 0); + I.addBox(-8F, -8F, -1F, 16, 16, 2); + I.setRotationPoint(0F, 12F, 0F); + I.setTextureSize(128, 128); + I.mirror = true; + setRotation(I, 0F, -0.7853982F, 0.7853982F); + J = new ModelRenderer(this, 22, 74); + J.addBox(0F, 0F, 0F, 2, 7, 5); + J.setRotationPoint(-1F, -23F, 4F); + J.setTextureSize(128, 128); + J.mirror = true; + setRotation(J, -0.5235988F, 0F, 0F); + K = new ModelRenderer(this, 0, 103); + K.addBox(0F, 0F, 0F, 5, 8, 2); + K.setRotationPoint(4F, -23F, -1F); + K.setTextureSize(128, 128); + K.mirror = true; + setRotation(K, 0F, 0F, 0.5235988F); + L = new ModelRenderer(this, 0, 81); + L.addBox(-1F, 0F, 0F, 2, 4, 5); + L.setRotationPoint(0F, -35F, -4F); + L.setTextureSize(128, 128); + L.mirror = true; + setRotation(L, -0.5235988F, 3.141593F, 0F); + M = new ModelRenderer(this, 0, 103); + M.addBox(0F, 0F, -1F, 5, 8, 2); + M.setRotationPoint(-4F, -23F, 0F); + M.setTextureSize(128, 128); + M.mirror = true; + setRotation(M, 0F, 3.141593F, 0.5235988F); + N = new ModelRenderer(this, 0, 74); + N.addBox(-1F, 0F, -8F, 2, 12, 16); + N.setRotationPoint(0F, -32F, 0F); + N.setTextureSize(128, 128); + N.mirror = true; + setRotation(N, 0F, 0F, 0F); + O = new ModelRenderer(this, 0, 74); + O.addBox(-1F, 0F, -8F, 2, 12, 16); + O.setRotationPoint(0F, -32F, 0F); + O.setTextureSize(128, 128); + O.mirror = true; + setRotation(O, 0F, 1.570796F, 0F); + P = new ModelRenderer(this, 22, 74); + P.addBox(-1F, 0F, 0F, 2, 8, 5); + P.setRotationPoint(0F, -23F, -4F); + P.setTextureSize(128, 128); + P.mirror = true; + setRotation(P, -0.5235988F, 3.141593F, 0F); + Q = new ModelRenderer(this, 0, 81); + Q.addBox(-1F, 0F, 0F, 2, 4, 5); + Q.setRotationPoint(0F, -35F, 4F); + Q.setTextureSize(128, 128); + Q.mirror = true; + setRotation(Q, -0.5235988F, 0F, 0F); + R = new ModelRenderer(this, 0, 74); + R.addBox(0F, 0F, -1F, 5, 4, 2); + R.setRotationPoint(-4F, -35F, 0F); + R.setTextureSize(128, 128); + R.mirror = true; + setRotation(R, 0F, 3.141593F, 0.5235988F); + S = new ModelRenderer(this, 0, 74); + S.addBox(0F, 0F, 0F, 5, 4, 2); + S.setRotationPoint(4F, -35F, -1F); + S.setTextureSize(128, 128); + S.mirror = true; + setRotation(S, 0F, 0F, 0.5235988F); + T = new ModelRenderer(this, 72, 16); + T.addBox(0F, 0F, 0F, 10, 1, 10); + T.setRotationPoint(-5F, -37F, -5F); + T.setTextureSize(128, 128); + T.mirror = true; + setRotation(T, 0F, 0F, 0F); + U = new ModelRenderer(this, 72, 16); + U.addBox(0F, 0F, 0F, 10, 1, 10); + U.setRotationPoint(-5F, -41F, -5F); + U.setTextureSize(128, 128); + U.mirror = true; + setRotation(U, 0F, 0F, 0F); + V = new ModelRenderer(this, 72, 113); + V.addBox(1F, 0F, -2F, 3, 6, 4); + V.setRotationPoint(0F, -47F, 0F); + V.setTextureSize(128, 128); + V.mirror = true; + setRotation(V, 0F, 0F, 0F); + W = new ModelRenderer(this, 72, 113); + W.addBox(1F, 0F, -2F, 3, 6, 4); + W.setRotationPoint(0F, -47F, 0F); + W.setTextureSize(128, 128); + W.mirror = true; + setRotation(W, 0F, 2.094395F, 0F); + X = new ModelRenderer(this, 72, 113); + X.addBox(1F, 0F, -2F, 3, 6, 4); + X.setRotationPoint(0F, -47F, 0F); + X.setTextureSize(128, 128); + X.mirror = true; + setRotation(X, 0F, 1.047198F, 0F); + Y = new ModelRenderer(this, 72, 113); + Y.addBox(1F, 0F, -2F, 3, 6, 4); + Y.setRotationPoint(0F, -47F, 0F); + Y.setTextureSize(128, 128); + Y.mirror = true; + setRotation(Y, 0F, 3.141593F, 0F); + Z = new ModelRenderer(this, 72, 113); + Z.addBox(1F, 0F, -2F, 3, 6, 4); + Z.setRotationPoint(0F, -47F, 0F); + Z.setTextureSize(128, 128); + Z.mirror = true; + setRotation(Z, 0F, -1.047198F, 0F); + AA = new ModelRenderer(this, 72, 113); + AA.addBox(1F, 0F, -2F, 3, 6, 4); + AA.setRotationPoint(0F, -47F, 0F); + AA.setTextureSize(128, 128); + AA.mirror = true; + setRotation(AA, 0F, -2.094395F, 0F); + AB = new ModelRenderer(this, 72, 102); + AB.addBox(-6F, 0F, -1F, 12, 6, 2); + AB.setRotationPoint(0F, -47F, 0F); + AB.setTextureSize(128, 128); + AB.mirror = true; + setRotation(AB, 0F, -2.094395F, 0F); + AC = new ModelRenderer(this, 72, 102); + AC.addBox(-6F, 0F, -1F, 12, 6, 2); + AC.setRotationPoint(0F, -47F, 0F); + AC.setTextureSize(128, 128); + AC.mirror = true; + setRotation(AC, 0F, 0F, 0F); + AD = new ModelRenderer(this, 72, 102); + AD.addBox(-6F, 0F, -1F, 12, 6, 2); + AD.setRotationPoint(0F, -47F, 0F); + AD.setTextureSize(128, 128); + AD.mirror = true; + setRotation(AD, 0F, -1.047198F, 0F); + AE = new ModelRenderer(this, 89, 113); + AE.addBox(-5F, 0F, -1F, 2, 6, 2); + AE.setRotationPoint(0F, -51F, 0F); + AE.setTextureSize(128, 128); + AE.mirror = true; + setRotation(AE, 0F, -2.094395F, 0.2617994F); + AF = new ModelRenderer(this, 89, 113); + AF.addBox(-5F, 0F, -1F, 2, 6, 2); + AF.setRotationPoint(0F, -51F, 0F); + AF.setTextureSize(128, 128); + AF.mirror = true; + setRotation(AF, 0F, 0F, 0.2617994F); + AG = new ModelRenderer(this, 89, 113); + AG.addBox(-5F, 0F, -1F, 2, 6, 2); + AG.setRotationPoint(0F, -51F, 0F); + AG.setTextureSize(128, 128); + AG.mirror = true; + setRotation(AG, 0F, -1.047198F, 0.2617994F); + AH = new ModelRenderer(this, 89, 113); + AH.addBox(-5F, 0F, -1F, 2, 6, 2); + AH.setRotationPoint(0F, -51F, 0F); + AH.setTextureSize(128, 128); + AH.mirror = true; + setRotation(AH, 0F, 1.047198F, 0.2617994F); + AI = new ModelRenderer(this, 89, 113); + AI.addBox(-5F, 0F, -1F, 2, 6, 2); + AI.setRotationPoint(0F, -51F, 0F); + AI.setTextureSize(128, 128); + AI.mirror = true; + setRotation(AI, 0F, 2.094395F, 0.2617994F); + AJ = new ModelRenderer(this, 89, 113); + AJ.addBox(-5F, 0F, -1F, 2, 6, 2); + AJ.setRotationPoint(0F, -51F, 0F); + AJ.setTextureSize(128, 128); + AJ.mirror = true; + setRotation(AJ, 0F, 3.141593F, 0.2617994F); + AK = new ModelRenderer(this, 51, 106); + AK.addBox(-2F, 0F, -2F, 4, 11, 4); + AK.setRotationPoint(0F, -58F, 0F); + AK.setTextureSize(128, 128); + AK.mirror = true; + setRotation(AK, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + this.render(f5); + } + + @Override + public void render(float f5) + { + A.render(f5); + B.render(f5); + C.render(f5); + D.render(f5); + E.render(f5); + F.render(f5); + G.render(f5); + H.render(f5); + I.render(f5); + J.render(f5); + K.render(f5); + L.render(f5); + M.render(f5); + N.render(f5); + O.render(f5); + P.render(f5); + Q.render(f5); + R.render(f5); + S.render(f5); + T.render(f5); + U.render(f5); + V.render(f5); + W.render(f5); + X.render(f5); + Y.render(f5); + Z.render(f5); + AA.render(f5); + AB.render(f5); + AC.render(f5); + AD.render(f5); + AE.render(f5); + AF.render(f5); + AG.render(f5); + AH.render(f5); + AI.render(f5); + AJ.render(f5); + AK.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelCruiseLauncherBase.java b/src/main/java/mekanism/defense/client/model/tile/ModelCruiseLauncherBase.java new file mode 100644 index 000000000..737e1c0c4 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelCruiseLauncherBase.java @@ -0,0 +1,111 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelCruiseLauncherBase extends ModelBase +{ + // fields + ModelRenderer SUPPORT_1; + ModelRenderer SUPPORT_2; + ModelRenderer SUPPORT_3; + ModelRenderer SUPPORT_4; + ModelRenderer SUPPORT_5; + ModelRenderer SUPPORT_6; + ModelRenderer MAIN_BODY; + ModelRenderer MAIN_SUPPORT; + ModelRenderer TORQUE_ROT; + + public ModelCruiseLauncherBase() + { + textureWidth = 128; + textureHeight = 128; + + SUPPORT_1 = new ModelRenderer(this, 0, 0); + SUPPORT_1.addBox(-1F, 0F, -21F, 2, 1, 42); + SUPPORT_1.setRotationPoint(0F, 21F, 0F); + SUPPORT_1.setTextureSize(128, 128); + SUPPORT_1.mirror = true; + setRotation(SUPPORT_1, 0F, 0.7853982F, 0F); + SUPPORT_2 = new ModelRenderer(this, 0, 0); + SUPPORT_2.addBox(-1F, 0F, -21F, 2, 1, 42); + SUPPORT_2.setRotationPoint(0F, 21F, 0F); + SUPPORT_2.setTextureSize(128, 128); + SUPPORT_2.mirror = true; + setRotation(SUPPORT_2, 0F, 2.356194F, 0F); + SUPPORT_3 = new ModelRenderer(this, 0, 28); + SUPPORT_3.addBox(0F, 0F, 0F, 4, 3, 4); + SUPPORT_3.setRotationPoint(-16F, 21F, -16F); + SUPPORT_3.setTextureSize(128, 128); + SUPPORT_3.mirror = true; + setRotation(SUPPORT_3, 0F, 0F, 0F); + SUPPORT_4 = new ModelRenderer(this, 0, 28); + SUPPORT_4.addBox(0F, 0F, 0F, 4, 3, 4); + SUPPORT_4.setRotationPoint(12F, 21F, -16F); + SUPPORT_4.setTextureSize(128, 128); + SUPPORT_4.mirror = true; + setRotation(SUPPORT_4, 0F, 0F, 0F); + SUPPORT_5 = new ModelRenderer(this, 0, 28); + SUPPORT_5.addBox(0F, 0F, 0F, 4, 3, 4); + SUPPORT_5.setRotationPoint(12F, 21F, 12F); + SUPPORT_5.setTextureSize(128, 128); + SUPPORT_5.mirror = true; + setRotation(SUPPORT_5, 0F, 0F, 0F); + SUPPORT_6 = new ModelRenderer(this, 0, 28); + SUPPORT_6.addBox(0F, 0F, 0F, 4, 3, 4); + SUPPORT_6.setRotationPoint(-16F, 21F, 12F); + SUPPORT_6.setTextureSize(128, 128); + SUPPORT_6.mirror = true; + setRotation(SUPPORT_6, 0F, 0F, 0F); + MAIN_BODY = new ModelRenderer(this, 0, 46); + MAIN_BODY.addBox(0F, 0F, 0F, 6, 4, 6); + MAIN_BODY.setRotationPoint(-3F, 20F, -3F); + MAIN_BODY.setTextureSize(128, 128); + MAIN_BODY.mirror = true; + setRotation(MAIN_BODY, 0F, 0F, 0F); + MAIN_SUPPORT = new ModelRenderer(this, 0, 59); + MAIN_SUPPORT.addBox(0F, 0F, 0F, 4, 2, 4); + MAIN_SUPPORT.setRotationPoint(-2F, 18F, -2F); + MAIN_SUPPORT.setTextureSize(128, 128); + MAIN_SUPPORT.mirror = true; + setRotation(MAIN_SUPPORT, 0F, 0F, 0F); + TORQUE_ROT = new ModelRenderer(this, 0, 68); + TORQUE_ROT.addBox(-1F, -4F, -1F, 2, 4, 2); + TORQUE_ROT.setRotationPoint(0F, 18F, 0F); + TORQUE_ROT.setTextureSize(128, 128); + TORQUE_ROT.mirror = true; + setRotation(TORQUE_ROT, 0F, 0.7853982F, 0F); + + } + + public void render(float f5) + { + SUPPORT_1.render(f5); + SUPPORT_2.render(f5); + SUPPORT_3.render(f5); + SUPPORT_4.render(f5); + SUPPORT_5.render(f5); + SUPPORT_6.render(f5); + MAIN_BODY.render(f5); + MAIN_SUPPORT.render(f5); + TORQUE_ROT.render(f5); + + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelCruiseLauncherTurret.java b/src/main/java/mekanism/defense/client/model/tile/ModelCruiseLauncherTurret.java new file mode 100644 index 000000000..10df24bf7 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelCruiseLauncherTurret.java @@ -0,0 +1,94 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelCruiseLauncherTurret extends ModelBase +{ + + ModelRenderer CLAMP_1_ROT; + ModelRenderer CLAMP_2_ROT; + ModelRenderer COUNTERBALANCE_1_ROT; + ModelRenderer COUNTERBALANCE_2_ROT; + ModelRenderer RAIL_1_ROT; + ModelRenderer RAIL_2_ROT; + ModelRenderer TORQUE_SUPPORT_ROT; + + public ModelCruiseLauncherTurret() + { + textureWidth = 128; + textureHeight = 128; + + CLAMP_1_ROT = new ModelRenderer(this, 20, 0); + CLAMP_1_ROT.addBox(-1F, -1F, -17F, 6, 6, 1); + CLAMP_1_ROT.setRotationPoint(0F, 13F, 0F); + CLAMP_1_ROT.setTextureSize(128, 128); + CLAMP_1_ROT.mirror = true; + setRotation(CLAMP_1_ROT, 0F, 0F, -2.356194F); + CLAMP_2_ROT = new ModelRenderer(this, 20, 0); + CLAMP_2_ROT.addBox(-1F, -1F, 0F, 6, 6, 1); + CLAMP_2_ROT.setRotationPoint(0F, 13F, 0F); + CLAMP_2_ROT.setTextureSize(128, 128); + CLAMP_2_ROT.mirror = true; + setRotation(CLAMP_2_ROT, 0F, 0F, -2.356194F); + COUNTERBALANCE_1_ROT = new ModelRenderer(this, 84, 0); + COUNTERBALANCE_1_ROT.addBox(1F, -4F, 1F, 4, 4, 8); + COUNTERBALANCE_1_ROT.setRotationPoint(0F, 14F, 0F); + COUNTERBALANCE_1_ROT.setTextureSize(128, 128); + COUNTERBALANCE_1_ROT.mirror = true; + setRotation(COUNTERBALANCE_1_ROT, 0F, 0F, 0F); + COUNTERBALANCE_2_ROT = new ModelRenderer(this, 84, 0); + COUNTERBALANCE_2_ROT.addBox(-5F, -4F, 1F, 4, 4, 8); + COUNTERBALANCE_2_ROT.setRotationPoint(0F, 14F, 0F); + COUNTERBALANCE_2_ROT.setTextureSize(128, 128); + COUNTERBALANCE_2_ROT.mirror = true; + setRotation(COUNTERBALANCE_2_ROT, 0F, 0F, 0F); + RAIL_1_ROT = new ModelRenderer(this, 65, 13); + RAIL_1_ROT.addBox(-5F, -1F, -17F, 4, 1, 18); + RAIL_1_ROT.setRotationPoint(0F, 14F, 0F); + RAIL_1_ROT.setTextureSize(128, 128); + RAIL_1_ROT.mirror = true; + setRotation(RAIL_1_ROT, 0F, 0F, 0.7853982F); + RAIL_2_ROT = new ModelRenderer(this, 65, 13); + RAIL_2_ROT.addBox(-5F, 0F, -17F, 4, 1, 18); + RAIL_2_ROT.setRotationPoint(0F, 14F, 0F); + RAIL_2_ROT.setTextureSize(128, 128); + RAIL_2_ROT.mirror = true; + setRotation(RAIL_2_ROT, 0F, 0F, 2.356194F); + TORQUE_SUPPORT_ROT = new ModelRenderer(this, 47, 17); + TORQUE_SUPPORT_ROT.addBox(-2F, 0F, -2F, 4, 2, 4); + TORQUE_SUPPORT_ROT.setRotationPoint(0F, 13F, 0F); + TORQUE_SUPPORT_ROT.setTextureSize(128, 128); + TORQUE_SUPPORT_ROT.mirror = true; + setRotation(TORQUE_SUPPORT_ROT, 0F, 0F, 0F); + } + + public void render(float f5) + { + CLAMP_1_ROT.render(f5); + CLAMP_2_ROT.render(f5); + COUNTERBALANCE_1_ROT.render(f5); + COUNTERBALANCE_2_ROT.render(f5); + RAIL_1_ROT.render(f5); + RAIL_2_ROT.render(f5); + TORQUE_SUPPORT_ROT.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + @Override + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelEmpTower.java b/src/main/java/mekanism/defense/client/model/tile/ModelEmpTower.java new file mode 100644 index 000000000..2ac166428 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelEmpTower.java @@ -0,0 +1,138 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelEmpTower extends ModelBase +{ + // fields + ModelRenderer Base; + ModelRenderer Support; + ModelRenderer Turret_Support; + ModelRenderer Main_Coil; + ModelRenderer Support_Beam_A1; + ModelRenderer Support_Beam_B1; + ModelRenderer Support_Beam_C1; + ModelRenderer Support_Beam_D1; + ModelRenderer Support_Beam_DB1; + ModelRenderer Support_Beam_CA1; + ModelRenderer Support_Beam_CA2; + ModelRenderer Support_Beam_DB2; + + public ModelEmpTower() + { + textureWidth = 128; + textureHeight = 128; + + Base = new ModelRenderer(this, 0, 0); + Base.addBox(0F, 0F, 0F, 16, 6, 16); + Base.setRotationPoint(-8F, 18F, -8F); + Base.setTextureSize(128, 128); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + Support = new ModelRenderer(this, 0, 24); + Support.addBox(0F, 0F, 0F, 10, 8, 10); + Support.setRotationPoint(-5F, 10F, -5F); + Support.setTextureSize(128, 128); + Support.mirror = true; + setRotation(Support, 0F, 0F, 0F); + Turret_Support = new ModelRenderer(this, 0, 44); + Turret_Support.addBox(-7F, 0F, -7F, 14, 1, 14); + Turret_Support.setRotationPoint(0F, 9F, 0F); + Turret_Support.setTextureSize(128, 128); + Turret_Support.mirror = true; + setRotation(Turret_Support, 0F, 0.7853982F, 0F); + Main_Coil = new ModelRenderer(this, 66, 0); + Main_Coil.addBox(-2F, 0F, -2F, 4, 11, 4); + Main_Coil.setRotationPoint(0F, -5F, 0F); + Main_Coil.setTextureSize(128, 128); + Main_Coil.mirror = true; + setRotation(Main_Coil, 0F, 0F, 0F); + Support_Beam_A1 = new ModelRenderer(this, 66, 16); + Support_Beam_A1.addBox(8F, 0F, -1F, 1, 18, 2); + Support_Beam_A1.setRotationPoint(0F, -8F, 0F); + Support_Beam_A1.setTextureSize(128, 128); + Support_Beam_A1.mirror = true; + setRotation(Support_Beam_A1, 0F, 0F, 0F); + Support_Beam_B1 = new ModelRenderer(this, 73, 16); + Support_Beam_B1.addBox(-1F, 0F, -9F, 2, 18, 1); + Support_Beam_B1.setRotationPoint(0F, -8F, 0F); + Support_Beam_B1.setTextureSize(128, 128); + Support_Beam_B1.mirror = true; + setRotation(Support_Beam_B1, 0F, 0F, 0F); + Support_Beam_C1 = new ModelRenderer(this, 66, 16); + Support_Beam_C1.addBox(-9F, 0F, -1F, 1, 18, 2); + Support_Beam_C1.setRotationPoint(0F, -8F, 0F); + Support_Beam_C1.setTextureSize(128, 128); + Support_Beam_C1.mirror = true; + setRotation(Support_Beam_C1, 0F, 0F, 0F); + Support_Beam_D1 = new ModelRenderer(this, 73, 16); + Support_Beam_D1.addBox(-1F, 0F, 8F, 2, 18, 1); + Support_Beam_D1.setRotationPoint(0F, -8F, 0F); + Support_Beam_D1.setTextureSize(128, 128); + Support_Beam_D1.mirror = true; + setRotation(Support_Beam_D1, 0F, 0F, 0F); + Support_Beam_DB1 = new ModelRenderer(this, 85, 0); + Support_Beam_DB1.addBox(-1F, 0F, -8F, 2, 1, 16); + Support_Beam_DB1.setRotationPoint(0F, 3F, 0F); + Support_Beam_DB1.setTextureSize(128, 128); + Support_Beam_DB1.mirror = true; + setRotation(Support_Beam_DB1, 0F, 0F, 0F); + Support_Beam_CA1 = new ModelRenderer(this, 85, 19); + Support_Beam_CA1.addBox(-8F, 0F, -1F, 16, 1, 2); + Support_Beam_CA1.setRotationPoint(0F, 3F, 0F); + Support_Beam_CA1.setTextureSize(128, 128); + Support_Beam_CA1.mirror = true; + setRotation(Support_Beam_CA1, 0F, 0F, 0F); + Support_Beam_CA2 = new ModelRenderer(this, 85, 19); + Support_Beam_CA2.addBox(-8F, 0F, -1F, 16, 1, 2); + Support_Beam_CA2.setRotationPoint(0F, -3F, 0F); + Support_Beam_CA2.setTextureSize(128, 128); + Support_Beam_CA2.mirror = true; + setRotation(Support_Beam_CA2, 0F, 0F, 0F); + Support_Beam_DB2 = new ModelRenderer(this, 85, 0); + Support_Beam_DB2.addBox(-1F, 0F, -8F, 2, 1, 16); + Support_Beam_DB2.setRotationPoint(0F, -3F, 0F); + Support_Beam_DB2.setTextureSize(128, 128); + Support_Beam_DB2.mirror = true; + setRotation(Support_Beam_DB2, 0F, 0F, 0F); + } + + public void render(float rotation, float f5) + { + Base.render(f5); + Support.render(f5); + + // Rotatables + Turret_Support.rotateAngleY = -rotation; + Turret_Support.render(f5); + Main_Coil.rotateAngleY = -rotation; + Main_Coil.render(f5); + Support_Beam_A1.rotateAngleY = rotation; + Support_Beam_A1.render(f5); + Support_Beam_B1.rotateAngleY = rotation; + Support_Beam_B1.render(f5); + Support_Beam_C1.rotateAngleY = rotation; + Support_Beam_C1.render(f5); + Support_Beam_D1.rotateAngleY = rotation; + Support_Beam_D1.render(f5); + Support_Beam_DB1.rotateAngleY = rotation; + Support_Beam_DB1.render(f5); + Support_Beam_CA1.rotateAngleY = rotation; + Support_Beam_CA1.render(f5); + Support_Beam_CA2.rotateAngleY = rotation; + Support_Beam_CA2.render(f5); + Support_Beam_DB2.rotateAngleY = rotation; + Support_Beam_DB2.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT1.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT1.java new file mode 100644 index 000000000..f51f52732 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT1.java @@ -0,0 +1,94 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelLauncherBaseT1 extends ModelBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelLauncherBaseT1() + { + int textureX = 512; + int textureY = 512; + + bodyModel = new ModelRendererTurbo[13]; + bodyModel[0] = new ModelRendererTurbo(this, 0, 0, textureX, textureY); // Box 0 + bodyModel[1] = new ModelRendererTurbo(this, 0, 44, textureX, textureY); // Box 1 + bodyModel[2] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Box 2 + bodyModel[3] = new ModelRendererTurbo(this, 0, 39, textureX, textureY); // Box 3 + bodyModel[4] = new ModelRendererTurbo(this, 0, 44, textureX, textureY); // Box 4 + bodyModel[5] = new ModelRendererTurbo(this, 0, 52, textureX, textureY); // Box 5 + bodyModel[6] = new ModelRendererTurbo(this, 0, 52, textureX, textureY); // Box 6 + bodyModel[7] = new ModelRendererTurbo(this, 0, 61, textureX, textureY); // Box 7 + bodyModel[8] = new ModelRendererTurbo(this, 0, 71, textureX, textureY); // Box 8 + bodyModel[9] = new ModelRendererTurbo(this, 0, 71, textureX, textureY); // Box 9 + bodyModel[10] = new ModelRendererTurbo(this, 0, 75, textureX, textureY); // Box 10 + bodyModel[11] = new ModelRendererTurbo(this, 0, 89, textureX, textureY); // Box 11 + bodyModel[12] = new ModelRendererTurbo(this, 0, 89, textureX, textureY); // Box 12 + + bodyModel[0].addBox(0F, 0F, 0F, 10, 2, 8, 0F); // Box 0 + bodyModel[0].setRotationPoint(-5F, 22F, -4F); + + bodyModel[1].addShapeBox(0F, 0F, 0F, 4, 2, 3, 0F, -1F, -1F, 0F, -1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 1 + bodyModel[1].setRotationPoint(-2F, 22F, -8F); + + bodyModel[2].addShapeBox(0F, 0F, 0F, 10, 2, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 2 + bodyModel[2].setRotationPoint(-5F, 22F, -5F); + + bodyModel[3].addShapeBox(0F, 0F, 0F, 10, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 3 + bodyModel[3].setRotationPoint(-5F, 22F, 4F); + + bodyModel[4].addShapeBox(0F, 0F, 0F, 4, 2, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -1F, 0F, -1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 4 + bodyModel[4].setRotationPoint(-2F, 22F, 5F); + + bodyModel[5].addShapeBox(0F, 0F, 0F, 3, 2, 4, 0F, 0F, -1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 5 + bodyModel[5].setRotationPoint(-8F, 22F, -2F); + + bodyModel[6].addShapeBox(0F, 0F, 0F, 3, 2, 4, 0F, 0F, 0F, 0F, 0F, -1F, -1F, 0F, -1F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 6 + bodyModel[6].setRotationPoint(5F, 22F, -2F); + + bodyModel[7].addBox(0F, 0F, 0F, 8, 1, 6, 0F); // Box 7 + bodyModel[7].setRotationPoint(-4F, 21F, -3F); + + bodyModel[8].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 8 + bodyModel[8].setRotationPoint(-4F, 21F, -4F); + + bodyModel[9].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 9 + bodyModel[9].setRotationPoint(-4F, 21F, 3F); + + bodyModel[10].addBox(0F, 0F, 0F, 12, 1, 10, 0F); // Box 10 + bodyModel[10].setRotationPoint(-6F, 20F, -5F); + + bodyModel[11].addShapeBox(0F, 0F, 0F, 12, 1, 1, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 11 + bodyModel[11].setRotationPoint(-6F, 20F, -6F); + + bodyModel[12].addShapeBox(0F, 0F, 0F, 12, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F); // Box 12 + bodyModel[12].setRotationPoint(-6F, 20F, 5F); + + } + + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT2.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT2.java new file mode 100644 index 000000000..04a0d848d --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT2.java @@ -0,0 +1,62 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLauncherBaseT2 extends ModelBase +{ + // fields + ModelRenderer Shape1; + ModelRenderer Shape6; + ModelRenderer Shape2; + ModelRenderer Shape3; + + public ModelLauncherBaseT2() + { + textureWidth = 128; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 111); + Shape1.addBox(0F, 0F, 0F, 16, 1, 16); + Shape1.setRotationPoint(-8F, 23F, -8F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape6 = new ModelRenderer(this, 0, 111); + Shape6.addBox(0F, 0F, 0F, 16, 1, 16); + Shape6.setRotationPoint(-8F, 19F, -8F); + Shape6.setTextureSize(128, 128); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 63, 0); + Shape2.addBox(0F, 0F, 0F, 2, 4, 2); + Shape2.setRotationPoint(-8F, 20F, -1F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 63, 0); + Shape3.addBox(0F, 0F, 0F, 2, 4, 2); + Shape3.setRotationPoint(6F, 20F, -1F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + } + + public void render(float f5) + { + Shape1.render(f5); + Shape6.render(f5); + Shape2.render(f5); + Shape3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT3.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT3.java new file mode 100644 index 000000000..9368fa2c0 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherBaseT3.java @@ -0,0 +1,46 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLauncherBaseT3 extends ModelBase +{ + // fields + ModelRenderer Shape12; + ModelRenderer Shape13; + + public ModelLauncherBaseT3() + { + textureWidth = 256; + textureHeight = 256; + + Shape12 = new ModelRenderer(this, 0, 80); + Shape12.addBox(0F, 0F, 0F, 11, 6, 6); + Shape12.setRotationPoint(-5F, 18F, -6F); + Shape12.setTextureSize(256, 256); + Shape12.mirror = true; + setRotation(Shape12, 0F, 0F, 0F); + Shape13 = new ModelRenderer(this, 0, 80); + Shape13.addBox(0F, 0F, 0F, 11, 6, 6); + Shape13.setRotationPoint(-5F, 18F, 1F); + Shape13.setTextureSize(256, 256); + Shape13.mirror = true; + setRotation(Shape13, 0F, 0F, 0F); + } + + public void render(float f5) + { + Shape12.render(f5); + Shape13.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherFrame.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherFrame.java new file mode 100644 index 000000000..bd59dcba2 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherFrame.java @@ -0,0 +1,467 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelLauncherFrame extends ModelBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelLauncherFrame() + { + int textureX = 512; + int textureY = 512; + + bodyModel = new ModelRendererTurbo[106]; + bodyModel[0] = new ModelRendererTurbo(this, 50, 0, textureX, textureY); // Box 0 + bodyModel[1] = new ModelRendererTurbo(this, 50, 52, textureX, textureY); // Box 1 + bodyModel[2] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 2 + bodyModel[3] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 3 + bodyModel[4] = new ModelRendererTurbo(this, 50, 107, textureX, textureY); // Box 4 + bodyModel[5] = new ModelRendererTurbo(this, 50, 122, textureX, textureY); // Box 5 + bodyModel[6] = new ModelRendererTurbo(this, 50, 122, textureX, textureY); // Box 6 + bodyModel[7] = new ModelRendererTurbo(this, 50, 0, textureX, textureY); // Box 7 + bodyModel[8] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 8 + bodyModel[9] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 9 + bodyModel[10] = new ModelRendererTurbo(this, 50, 0, textureX, textureY); // Box 10 + bodyModel[11] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 11 + bodyModel[12] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 12 + bodyModel[13] = new ModelRendererTurbo(this, 50, 122, textureX, textureY); // Box 13 + bodyModel[14] = new ModelRendererTurbo(this, 50, 107, textureX, textureY); // Box 14 + bodyModel[15] = new ModelRendererTurbo(this, 50, 122, textureX, textureY); // Box 15 + bodyModel[16] = new ModelRendererTurbo(this, 50, 0, textureX, textureY); // Box 16 + bodyModel[17] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 17 + bodyModel[18] = new ModelRendererTurbo(this, 50, 100, textureX, textureY); // Box 18 + bodyModel[19] = new ModelRendererTurbo(this, 50, 122, textureX, textureY); // Box 19 + bodyModel[20] = new ModelRendererTurbo(this, 50, 107, textureX, textureY); // Box 20 + bodyModel[21] = new ModelRendererTurbo(this, 50, 122, textureX, textureY); // Box 21 + bodyModel[22] = new ModelRendererTurbo(this, 50, 129, textureX, textureY); // Box 22 + bodyModel[23] = new ModelRendererTurbo(this, 50, 129, textureX, textureY); // Box 23 + bodyModel[24] = new ModelRendererTurbo(this, 50, 129, textureX, textureY); // Box 24 + bodyModel[25] = new ModelRendererTurbo(this, 50, 129, textureX, textureY); // Box 25 + bodyModel[26] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 26 + bodyModel[27] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 27 + bodyModel[28] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 28 + bodyModel[29] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 29 + bodyModel[30] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 30 + bodyModel[31] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 31 + bodyModel[32] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 32 + bodyModel[33] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 33 + bodyModel[34] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 34 + bodyModel[35] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 35 + bodyModel[36] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 36 + bodyModel[37] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 37 + bodyModel[38] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 38 + bodyModel[39] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 39 + bodyModel[40] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 40 + bodyModel[41] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 41 + bodyModel[42] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 42 + bodyModel[43] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 43 + bodyModel[44] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 44 + bodyModel[45] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 45 + bodyModel[46] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 46 + bodyModel[47] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 47 + bodyModel[48] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 48 + bodyModel[49] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 49 + bodyModel[50] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 50 + bodyModel[51] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 51 + bodyModel[52] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 52 + bodyModel[53] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 53 + bodyModel[54] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 54 + bodyModel[55] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 55 + bodyModel[56] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 56 + bodyModel[57] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 57 + bodyModel[58] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 58 + bodyModel[59] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 59 + bodyModel[60] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 60 + bodyModel[61] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 61 + bodyModel[62] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 62 + bodyModel[63] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 63 + bodyModel[64] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 64 + bodyModel[65] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 65 + bodyModel[66] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 66 + bodyModel[67] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 67 + bodyModel[68] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 68 + bodyModel[69] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 69 + bodyModel[70] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 70 + bodyModel[71] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 71 + bodyModel[72] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 72 + bodyModel[73] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 73 + bodyModel[74] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 74 + bodyModel[75] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 75 + bodyModel[76] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 76 + bodyModel[77] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 77 + bodyModel[78] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 78 + bodyModel[79] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 79 + bodyModel[80] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 80 + bodyModel[81] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 81 + bodyModel[82] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 82 + bodyModel[83] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 83 + bodyModel[84] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 84 + bodyModel[85] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 85 + bodyModel[86] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 86 + bodyModel[87] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 87 + bodyModel[88] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 88 + bodyModel[89] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 89 + bodyModel[90] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 90 + bodyModel[91] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 91 + bodyModel[92] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 92 + bodyModel[93] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 93 + bodyModel[94] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 94 + bodyModel[95] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 95 + bodyModel[96] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 96 + bodyModel[97] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 97 + bodyModel[98] = new ModelRendererTurbo(this, 50, 191, textureX, textureY); // Box 98 + bodyModel[99] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 99 + bodyModel[100] = new ModelRendererTurbo(this, 50, 179, textureX, textureY); // Box 100 + bodyModel[101] = new ModelRendererTurbo(this, 50, 198, textureX, textureY); // Box 101 + bodyModel[102] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 102 + bodyModel[103] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 103 + bodyModel[104] = new ModelRendererTurbo(this, 50, 205, textureX, textureY); // Box 104 + bodyModel[105] = new ModelRendererTurbo(this, 50, 210, textureX, textureY); // Box 105 + + bodyModel[0].addBox(0F, 0F, 0F, 16, 2, 12, 0F); // Box 0 + bodyModel[0].setRotationPoint(-8F, 21F, -6F); + + bodyModel[1].addBox(0F, 0F, 0F, 1, 44, 1, 0F); // Box 1 + bodyModel[1].setRotationPoint(-0.5F, -32F, -0.5F); + + bodyModel[2].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 2 + bodyModel[2].setRotationPoint(-8F, 21F, -8F); + + bodyModel[3].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 3 + bodyModel[3].setRotationPoint(-8F, 21F, 6F); + + bodyModel[4].addBox(0F, 0F, 0F, 14, 1, 10, 0F); // Box 4 + bodyModel[4].setRotationPoint(-7F, 20F, -5F); + + bodyModel[5].addShapeBox(0F, 0F, 0F, 14, 1, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[5].setRotationPoint(-7F, 20F, -7F); + + bodyModel[6].addShapeBox(0F, 0F, 0F, 14, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 6 + bodyModel[6].setRotationPoint(-7F, 20F, 5F); + + bodyModel[7].addBox(0F, 0F, 0F, 16, 2, 12, 0F); // Box 7 + bodyModel[7].setRotationPoint(-8F, 18F, -6F); + + bodyModel[8].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 8 + bodyModel[8].setRotationPoint(-8F, 18F, -8F); + + bodyModel[9].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 9 + bodyModel[9].setRotationPoint(-8F, 18F, 6F); + + bodyModel[10].addBox(0F, 0F, 0F, 16, 2, 12, 0F); // Box 10 + bodyModel[10].setRotationPoint(-8F, 15F, -6F); + + bodyModel[11].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 11 + bodyModel[11].setRotationPoint(-8F, 15F, -8F); + + bodyModel[12].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 12 + bodyModel[12].setRotationPoint(-8F, 15F, 6F); + + bodyModel[13].addShapeBox(0F, 0F, 0F, 14, 1, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + bodyModel[13].setRotationPoint(-7F, 17F, -7F); + + bodyModel[14].addBox(0F, 0F, 0F, 14, 1, 10, 0F); // Box 14 + bodyModel[14].setRotationPoint(-7F, 17F, -5F); + + bodyModel[15].addShapeBox(0F, 0F, 0F, 14, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 15 + bodyModel[15].setRotationPoint(-7F, 17F, 5F); + + bodyModel[16].addBox(0F, 0F, 0F, 16, 2, 12, 0F); // Box 16 + bodyModel[16].setRotationPoint(-8F, 12F, -6F); + + bodyModel[17].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 17 + bodyModel[17].setRotationPoint(-8F, 12F, -8F); + + bodyModel[18].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 18 + bodyModel[18].setRotationPoint(-8F, 12F, 6F); + + bodyModel[19].addShapeBox(0F, 0F, 0F, 14, 1, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 19 + bodyModel[19].setRotationPoint(-7F, 14F, -7F); + + bodyModel[20].addBox(0F, 0F, 0F, 14, 1, 10, 0F); // Box 20 + bodyModel[20].setRotationPoint(-7F, 14F, -5F); + + bodyModel[21].addShapeBox(0F, 0F, 0F, 14, 1, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 21 + bodyModel[21].setRotationPoint(-7F, 14F, 5F); + + bodyModel[22].addBox(0F, 0F, 0F, 2, 44, 2, 0F); // Box 22 + bodyModel[22].setRotationPoint(-6F, -32F, -6F); + + bodyModel[23].addBox(0F, 0F, 0F, 2, 44, 2, 0F); // Box 23 + bodyModel[23].setRotationPoint(-6F, -32F, 4F); + + bodyModel[24].addBox(0F, 0F, 0F, 2, 44, 2, 0F); // Box 24 + bodyModel[24].setRotationPoint(4F, -32F, 4F); + + bodyModel[25].addBox(0F, 0F, 0F, 2, 44, 2, 0F); // Box 25 + bodyModel[25].setRotationPoint(4F, -32F, -6F); + + bodyModel[26].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 26 + bodyModel[26].setRotationPoint(-5.5F, -32F, -4F); + + bodyModel[27].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 27 + bodyModel[27].setRotationPoint(-5.5F, -32F, -4F); + + bodyModel[28].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 28 + bodyModel[28].setRotationPoint(-5.5F, -28.5F, -1F); + + bodyModel[29].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 29 + bodyModel[29].setRotationPoint(-5.5F, -19.5F, -1F); + + bodyModel[30].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 30 + bodyModel[30].setRotationPoint(-5.5F, -23F, -4F); + + bodyModel[31].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 31 + bodyModel[31].setRotationPoint(-5.5F, -23F, -4F); + + bodyModel[32].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 32 + bodyModel[32].setRotationPoint(-5.5F, -10.5F, -1F); + + bodyModel[33].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 33 + bodyModel[33].setRotationPoint(-5.5F, -14F, -4F); + + bodyModel[34].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 34 + bodyModel[34].setRotationPoint(-5.5F, -14F, -4F); + + bodyModel[35].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 35 + bodyModel[35].setRotationPoint(-5.5F, -1.5F, -1F); + + bodyModel[36].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 36 + bodyModel[36].setRotationPoint(-5.5F, -5F, -4F); + + bodyModel[37].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 37 + bodyModel[37].setRotationPoint(-5.5F, -5F, -4F); + + bodyModel[38].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 38 + bodyModel[38].setRotationPoint(-1F, -1.5F, -5.5F); + + bodyModel[39].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 39 + bodyModel[39].setRotationPoint(-4F, -5F, -5.5F); + + bodyModel[40].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 40 + bodyModel[40].setRotationPoint(-4F, -5F, -5.5F); + + bodyModel[41].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 41 + bodyModel[41].setRotationPoint(-4F, -14F, -5.5F); + + bodyModel[42].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 42 + bodyModel[42].setRotationPoint(-1F, -10.5F, -5.5F); + + bodyModel[43].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 43 + bodyModel[43].setRotationPoint(-4F, -14F, -5.5F); + + bodyModel[44].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 44 + bodyModel[44].setRotationPoint(-4F, -23F, -5.5F); + + bodyModel[45].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 45 + bodyModel[45].setRotationPoint(-1F, -19.5F, -5.5F); + + bodyModel[46].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 46 + bodyModel[46].setRotationPoint(-4F, -23F, -5.5F); + + bodyModel[47].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 47 + bodyModel[47].setRotationPoint(-1F, -28.5F, -5.5F); + + bodyModel[48].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 48 + bodyModel[48].setRotationPoint(-4F, -32F, -5.5F); + + bodyModel[49].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 49 + bodyModel[49].setRotationPoint(-4F, -32F, -5.5F); + + bodyModel[50].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 50 + bodyModel[50].setRotationPoint(4.5F, -1.5F, -1F); + + bodyModel[51].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 51 + bodyModel[51].setRotationPoint(4.5F, -5F, -4F); + + bodyModel[52].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 52 + bodyModel[52].setRotationPoint(4.5F, -5F, -4F); + + bodyModel[53].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 53 + bodyModel[53].setRotationPoint(4.5F, -14F, -4F); + + bodyModel[54].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 54 + bodyModel[54].setRotationPoint(4.5F, -10.5F, -1F); + + bodyModel[55].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 55 + bodyModel[55].setRotationPoint(4.5F, -14F, -4F); + + bodyModel[56].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 56 + bodyModel[56].setRotationPoint(4.5F, -23F, -4F); + + bodyModel[57].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 57 + bodyModel[57].setRotationPoint(4.5F, -19.5F, -1F); + + bodyModel[58].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 58 + bodyModel[58].setRotationPoint(4.5F, -23F, -4F); + + bodyModel[59].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 59 + bodyModel[59].setRotationPoint(4.5F, -28.5F, -1F); + + bodyModel[60].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 60 + bodyModel[60].setRotationPoint(4.5F, -32F, -4F); + + bodyModel[61].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 61 + bodyModel[61].setRotationPoint(4.5F, -32F, -4F); + + bodyModel[62].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 62 + bodyModel[62].setRotationPoint(-1F, -1.5F, 4.5F); + + bodyModel[63].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 63 + bodyModel[63].setRotationPoint(-4F, -5F, 4.5F); + + bodyModel[64].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 64 + bodyModel[64].setRotationPoint(-4F, -5F, 4.5F); + + bodyModel[65].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 65 + bodyModel[65].setRotationPoint(-4F, -14F, 4.5F); + + bodyModel[66].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 66 + bodyModel[66].setRotationPoint(-1F, -10.5F, 4.5F); + + bodyModel[67].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 67 + bodyModel[67].setRotationPoint(-4F, -14F, 4.5F); + + bodyModel[68].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 68 + bodyModel[68].setRotationPoint(-4F, -23F, 4.5F); + + bodyModel[69].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 69 + bodyModel[69].setRotationPoint(-1F, -19.5F, 4.5F); + + bodyModel[70].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 70 + bodyModel[70].setRotationPoint(-4F, -23F, 4.5F); + + bodyModel[71].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 71 + bodyModel[71].setRotationPoint(-1F, -28.5F, 4.5F); + + bodyModel[72].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 72 + bodyModel[72].setRotationPoint(-4F, -32F, 4.5F); + + bodyModel[73].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 73 + bodyModel[73].setRotationPoint(-4F, -32F, 4.5F); + + bodyModel[74].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 74 + bodyModel[74].setRotationPoint(-0.5F, -28F, -4.5F); + + bodyModel[75].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 75 + bodyModel[75].setRotationPoint(-0.5F, -19F, -4.5F); + + bodyModel[76].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 76 + bodyModel[76].setRotationPoint(-0.5F, -10F, -4.5F); + + bodyModel[77].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 77 + bodyModel[77].setRotationPoint(-0.5F, -1F, -4.5F); + + bodyModel[78].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 78 + bodyModel[78].setRotationPoint(0.5F, -1F, -0.5F); + + bodyModel[79].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 79 + bodyModel[79].setRotationPoint(0.5F, -10F, -0.5F); + + bodyModel[80].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 80 + bodyModel[80].setRotationPoint(0.5F, -19F, -0.5F); + + bodyModel[81].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 81 + bodyModel[81].setRotationPoint(0.5F, -28F, -0.5F); + + bodyModel[82].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 82 + bodyModel[82].setRotationPoint(-0.5F, -1F, 0.5F); + + bodyModel[83].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 83 + bodyModel[83].setRotationPoint(-0.5F, -10F, 0.5F); + + bodyModel[84].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 84 + bodyModel[84].setRotationPoint(-0.5F, -19F, 0.5F); + + bodyModel[85].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 85 + bodyModel[85].setRotationPoint(-0.5F, -28F, 0.5F); + + bodyModel[86].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 86 + bodyModel[86].setRotationPoint(-4.5F, -1F, -0.5F); + + bodyModel[87].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 87 + bodyModel[87].setRotationPoint(-4.5F, -10F, -0.5F); + + bodyModel[88].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 88 + bodyModel[88].setRotationPoint(-4.5F, -19F, -0.5F); + + bodyModel[89].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 89 + bodyModel[89].setRotationPoint(-4.5F, -28F, -0.5F); + + bodyModel[90].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 90 + bodyModel[90].setRotationPoint(-1F, 7.5F, 4.5F); + + bodyModel[91].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 91 + bodyModel[91].setRotationPoint(-0.5F, 8F, 0.5F); + + bodyModel[92].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 92 + bodyModel[92].setRotationPoint(4.5F, 4F, -4F); + + bodyModel[93].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 93 + bodyModel[93].setRotationPoint(4.5F, 4F, -4F); + + bodyModel[94].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 94 + bodyModel[94].setRotationPoint(4.5F, 7.5F, -1F); + + bodyModel[95].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 95 + bodyModel[95].setRotationPoint(-4F, 4F, 4.5F); + + bodyModel[96].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 96 + bodyModel[96].setRotationPoint(-4F, 4F, 4.5F); + + bodyModel[97].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 97 + bodyModel[97].setRotationPoint(-4.5F, 8F, -0.5F); + + bodyModel[98].addShapeBox(0F, 0F, 0F, 1, 2, 2, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F); // Box 98 + bodyModel[98].setRotationPoint(-5.5F, 7.5F, -1F); + + bodyModel[99].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 99 + bodyModel[99].setRotationPoint(-5.5F, 4F, -4F); + + bodyModel[100].addShapeBox(0F, 0F, 0F, 1, 1, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F); // Box 100 + bodyModel[100].setRotationPoint(-5.5F, 4F, -4F); + + bodyModel[101].addShapeBox(0F, 0F, 0F, 2, 2, 1, 0F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F, 0F, 0F, 0.2F); // Box 101 + bodyModel[101].setRotationPoint(-1F, 7.5F, -5.5F); + + bodyModel[102].addShapeBox(0F, 0F, 0F, 1, 1, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 102 + bodyModel[102].setRotationPoint(-0.5F, 8F, -4.5F); + + bodyModel[103].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F); // Box 103 + bodyModel[103].setRotationPoint(-4F, 4F, -5.5F); + + bodyModel[104].addShapeBox(0F, 0F, 0F, 8, 1, 1, 0F, 0F, -8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -8F, 0F, 0F, 8F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 8F, 0F); // Box 104 + bodyModel[104].setRotationPoint(-4F, 4F, -5.5F); + + bodyModel[105].addShapeBox(0F, 0F, 0F, 4, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 105 + bodyModel[105].setRotationPoint(0.5F, 8F, -0.5F); + + } + + + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT1.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT1.java new file mode 100644 index 000000000..08848e9f6 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT1.java @@ -0,0 +1,630 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelLauncherRailT1 extends ModelBase +{ + // fields + // fields + ModelRendererTurbo[] noseModel; + + public ModelLauncherRailT1() + { + int textureX = 512; + int textureY = 512; + + + noseModel = new ModelRendererTurbo[144]; + noseModel[0] = new ModelRendererTurbo(this, 0, 94, textureX, textureY); // Box 13 + noseModel[1] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 14 + noseModel[2] = new ModelRendererTurbo(this, 0, 119, textureX, textureY); // Box 15 + noseModel[3] = new ModelRendererTurbo(this, 0, 132, textureX, textureY); // Box 16 + noseModel[4] = new ModelRendererTurbo(this, 0, 145, textureX, textureY); // Box 21 + noseModel[5] = new ModelRendererTurbo(this, 0, 154, textureX, textureY); // Box 22 + noseModel[6] = new ModelRendererTurbo(this, 0, 160, textureX, textureY); // Box 23 + noseModel[7] = new ModelRendererTurbo(this, 0, 160, textureX, textureY); // Box 24 + noseModel[8] = new ModelRendererTurbo(this, 0, 165, textureX, textureY); // Box 25 + noseModel[9] = new ModelRendererTurbo(this, 0, 172, textureX, textureY); // Box 26 + noseModel[10] = new ModelRendererTurbo(this, 0, 183, textureX, textureY); // Box 27 + noseModel[11] = new ModelRendererTurbo(this, 0, 194, textureX, textureY); // Box 28 + noseModel[12] = new ModelRendererTurbo(this, 0, 226, textureX, textureY); // Box 29 + noseModel[13] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 30 + noseModel[14] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 31 + noseModel[15] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 32 + noseModel[16] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 33 + noseModel[17] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 34 + noseModel[18] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 35 + noseModel[19] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 36 + noseModel[20] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 37 + noseModel[21] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 38 + noseModel[22] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 39 + noseModel[23] = new ModelRendererTurbo(this, 0, 94, textureX, textureY); // Box 40 + noseModel[24] = new ModelRendererTurbo(this, 0, 105, textureX, textureY); // Box 41 + noseModel[25] = new ModelRendererTurbo(this, 0, 119, textureX, textureY); // Box 42 + noseModel[26] = new ModelRendererTurbo(this, 0, 132, textureX, textureY); // Box 43 + noseModel[27] = new ModelRendererTurbo(this, 0, 145, textureX, textureY); // Box 44 + noseModel[28] = new ModelRendererTurbo(this, 0, 154, textureX, textureY); // Box 45 + noseModel[29] = new ModelRendererTurbo(this, 0, 160, textureX, textureY); // Box 46 + noseModel[30] = new ModelRendererTurbo(this, 0, 160, textureX, textureY); // Box 47 + noseModel[31] = new ModelRendererTurbo(this, 0, 165, textureX, textureY); // Box 48 + noseModel[32] = new ModelRendererTurbo(this, 0, 172, textureX, textureY); // Box 49 + noseModel[33] = new ModelRendererTurbo(this, 0, 183, textureX, textureY); // Box 50 + noseModel[34] = new ModelRendererTurbo(this, 0, 194, textureX, textureY); // Box 51 + noseModel[35] = new ModelRendererTurbo(this, 0, 226, textureX, textureY); // Box 52 + noseModel[36] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 53 + noseModel[37] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 54 + noseModel[38] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 55 + noseModel[39] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 56 + noseModel[40] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 57 + noseModel[41] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 58 + noseModel[42] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 59 + noseModel[43] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 60 + noseModel[44] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 61 + noseModel[45] = new ModelRendererTurbo(this, 0, 257, textureX, textureY); // Box 62 + noseModel[46] = new ModelRendererTurbo(this, 0, 266, textureX, textureY); // Box 63 + noseModel[47] = new ModelRendererTurbo(this, 0, 275, textureX, textureY); // Box 64 + noseModel[48] = new ModelRendererTurbo(this, 0, 284, textureX, textureY); // Box 65 + noseModel[49] = new ModelRendererTurbo(this, 0, 291, textureX, textureY); // Box 66 + noseModel[50] = new ModelRendererTurbo(this, 0, 291, textureX, textureY); // Box 67 + noseModel[51] = new ModelRendererTurbo(this, 0, 291, textureX, textureY); // Box 68 + noseModel[52] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 70 + noseModel[53] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 71 + noseModel[54] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 72 + noseModel[55] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 73 + noseModel[56] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 74 + noseModel[57] = new ModelRendererTurbo(this, 0, 300, textureX, textureY); // Box 75 + noseModel[58] = new ModelRendererTurbo(this, 0, 300, textureX, textureY); // Box 76 + noseModel[59] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 77 + noseModel[60] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 78 + noseModel[61] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 79 + noseModel[62] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 80 + noseModel[63] = new ModelRendererTurbo(this, 0, 296, textureX, textureY); // Box 81 + noseModel[64] = new ModelRendererTurbo(this, 0, 266, textureX, textureY); // Box 82 + noseModel[65] = new ModelRendererTurbo(this, 0, 284, textureX, textureY); // Box 83 + noseModel[66] = new ModelRendererTurbo(this, 0, 275, textureX, textureY); // Box 84 + noseModel[67] = new ModelRendererTurbo(this, 0, 291, textureX, textureY); // Box 85 + noseModel[68] = new ModelRendererTurbo(this, 0, 291, textureX, textureY); // Box 86 + noseModel[69] = new ModelRendererTurbo(this, 0, 291, textureX, textureY); // Box 87 + noseModel[70] = new ModelRendererTurbo(this, 0, 340, textureX, textureY); // Box 88 + noseModel[71] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 89 + noseModel[72] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 90 + noseModel[73] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 91 + noseModel[74] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 92 + noseModel[75] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 93 + noseModel[76] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 94 + noseModel[77] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 95 + noseModel[78] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 96 + noseModel[79] = new ModelRendererTurbo(this, 0, 340, textureX, textureY); // Box 97 + noseModel[80] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 98 + noseModel[81] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 99 + noseModel[82] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 100 + noseModel[83] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 101 + noseModel[84] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 102 + noseModel[85] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 103 + noseModel[86] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 104 + noseModel[87] = new ModelRendererTurbo(this, 0, 371, textureX, textureY); // Box 105 + noseModel[88] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 107 + noseModel[89] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 108 + noseModel[90] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 109 + noseModel[91] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 110 + noseModel[92] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 111 + noseModel[93] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 112 + noseModel[94] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 113 + noseModel[95] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 114 + noseModel[96] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 115 + noseModel[97] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 116 + noseModel[98] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 117 + noseModel[99] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 118 + noseModel[100] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 119 + noseModel[101] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 120 + noseModel[102] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 121 + noseModel[103] = new ModelRendererTurbo(this, 0, 375, textureX, textureY); // Box 122 + noseModel[104] = new ModelRendererTurbo(this, 0, 384, textureX, textureY); // Box 123 + noseModel[105] = new ModelRendererTurbo(this, 0, 392, textureX, textureY); // Box 124 + noseModel[106] = new ModelRendererTurbo(this, 0, 399, textureX, textureY); // Box 125 + noseModel[107] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 126 + noseModel[108] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 127 + noseModel[109] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 128 + noseModel[110] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 129 + noseModel[111] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 130 + noseModel[112] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 131 + noseModel[113] = new ModelRendererTurbo(this, 0, 399, textureX, textureY); // Box 132 + noseModel[114] = new ModelRendererTurbo(this, 0, 384, textureX, textureY); // Box 133 + noseModel[115] = new ModelRendererTurbo(this, 0, 392, textureX, textureY); // Box 134 + noseModel[116] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 135 + noseModel[117] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 136 + noseModel[118] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 137 + noseModel[119] = new ModelRendererTurbo(this, 0, 406, textureX, textureY); // Box 138 + noseModel[120] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 139 + noseModel[121] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 140 + noseModel[122] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 141 + noseModel[123] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 142 + noseModel[124] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 143 + noseModel[125] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 144 + noseModel[126] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 145 + noseModel[127] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 146 + noseModel[128] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 147 + noseModel[129] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 148 + noseModel[130] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 149 + noseModel[131] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 150 + noseModel[132] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 151 + noseModel[133] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 152 + noseModel[134] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 153 + noseModel[135] = new ModelRendererTurbo(this, 0, 411, textureX, textureY); // Box 154 + noseModel[136] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 155 + noseModel[137] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 156 + noseModel[138] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 159 + noseModel[139] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 160 + noseModel[140] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 161 + noseModel[141] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 162 + noseModel[142] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 165 + noseModel[143] = new ModelRendererTurbo(this, 0, 418, textureX, textureY); // Box 166 + + noseModel[0].addShapeBox(0F, 0F, 0F, 10, 2, 6, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + noseModel[0].setRotationPoint(-18F, 22F, -3F); + + noseModel[1].addShapeBox(0F, 0F, 0F, 10, 4, 6, 0F, -1F, 0F, 0F, -4F, 0F, 0F, -4F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 14 + noseModel[1].setRotationPoint(-18F, 18F, -3F); + + noseModel[2].addShapeBox(0F, 0F, 0F, 7, 2, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + noseModel[2].setRotationPoint(-17F, 22F, -4F); + + noseModel[3].addShapeBox(0F, 0F, 0F, 7, 2, 8, 0F, -1F, 0F, 0F, -3F, 0F, 0F, -3F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 16 + noseModel[3].setRotationPoint(-17F, 20F, -4F); + + noseModel[4].addShapeBox(0F, 0F, 0F, 4, 4, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 21 + noseModel[4].setRotationPoint(-20F, 20F, -1F); + + noseModel[5].addShapeBox(0F, 0F, 0F, 4, 1, 2, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 22 + noseModel[5].setRotationPoint(-20F, 19F, -1F); + + noseModel[6].addShapeBox(0F, 0F, 0F, 2, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 23 + noseModel[6].setRotationPoint(-22F, 21F, -0.5F); + + noseModel[7].addShapeBox(0F, 0F, 0F, 2, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 24 + noseModel[7].setRotationPoint(-22F, 23F, -0.5F); + + noseModel[8].addShapeBox(0F, 0F, 0F, 1, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 25 + noseModel[8].setRotationPoint(-23F, 20F, -0.5F); + + noseModel[9].addShapeBox(0F, 0F, 0F, 3, 4, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 26 + noseModel[9].setRotationPoint(-17F, 14F, -2F); + + noseModel[10].addShapeBox(0F, 0F, 0F, 3, 4, 4, 0F, -3F, 0F, 0F, 4F, 0F, 0F, 4F, 0F, 0F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 27 + noseModel[10].setRotationPoint(-17F, 10F, -2F); + + noseModel[11].addShapeBox(0F, 0F, 0F, 4, 25, 4, 0F, 0F, 0F, 0F, -1F, -2F, 0F, -1F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 28 + noseModel[11].setRotationPoint(-14F, -15F, -2F); + + noseModel[12].addShapeBox(0F, 0F, 0F, 1, 25, 3, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 29 + noseModel[12].setRotationPoint(-15F, -13F, -1.5F); + + noseModel[13].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 30 + noseModel[13].setRotationPoint(-15F, -12F, -2F); + + noseModel[14].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 31 + noseModel[14].setRotationPoint(-16F, -12F, -2F); + + noseModel[15].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 32 + noseModel[15].setRotationPoint(-16F, -7F, -2F); + + noseModel[16].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 33 + noseModel[16].setRotationPoint(-15F, -7F, -2F); + + noseModel[17].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 34 + noseModel[17].setRotationPoint(-16F, -2F, -2F); + + noseModel[18].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 35 + noseModel[18].setRotationPoint(-15F, -2F, -2F); + + noseModel[19].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 36 + noseModel[19].setRotationPoint(-16F, 3F, -2F); + + noseModel[20].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 37 + noseModel[20].setRotationPoint(-15F, 3F, -2F); + + noseModel[21].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F); // Box 38 + noseModel[21].setRotationPoint(-16F, 8F, -2F); + + noseModel[22].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 39 + noseModel[22].setRotationPoint(-15F, 8F, -2F); + + noseModel[23].addShapeBox(0F, 0F, 0F, 10, 2, 6, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 40 + noseModel[23].setRotationPoint(8F, 22F, -3F); + + noseModel[24].addShapeBox(0F, 0F, 0F, 10, 4, 6, 0F, -4F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 41 + noseModel[24].setRotationPoint(8F, 18F, -3F); + + noseModel[25].addShapeBox(0F, 0F, 0F, 7, 2, 8, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 42 + noseModel[25].setRotationPoint(10F, 22F, -4F); + + noseModel[26].addShapeBox(0F, 0F, 0F, 7, 2, 8, 0F, -3F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -3F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 43 + noseModel[26].setRotationPoint(10F, 20F, -4F); + + noseModel[27].addShapeBox(0F, 0F, 0F, 4, 4, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 44 + noseModel[27].setRotationPoint(16F, 20F, -1F); + + noseModel[28].addShapeBox(0F, 0F, 0F, 4, 1, 2, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 45 + noseModel[28].setRotationPoint(16F, 19F, -1F); + + noseModel[29].addShapeBox(0F, 0F, 0F, 2, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 46 + noseModel[29].setRotationPoint(20F, 21F, -0.5F); + + noseModel[30].addShapeBox(0F, 0F, 0F, 2, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 47 + noseModel[30].setRotationPoint(20F, 23F, -0.5F); + + noseModel[31].addShapeBox(0F, 0F, 0F, 1, 4, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 48 + noseModel[31].setRotationPoint(22F, 20F, -0.5F); + + noseModel[32].addShapeBox(0F, 0F, 0F, 3, 4, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 49 + noseModel[32].setRotationPoint(14F, 14F, -2F); + + noseModel[33].addShapeBox(0F, 0F, 0F, 3, 4, 4, 0F, 4F, 0F, 0F, -3F, 0F, 0F, -3F, 0F, 0F, 4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 50 + noseModel[33].setRotationPoint(14F, 10F, -2F); + + noseModel[34].addShapeBox(0F, 0F, 0F, 4, 25, 4, 0F, -1F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 51 + noseModel[34].setRotationPoint(10F, -15F, -2F); + + noseModel[35].addShapeBox(0F, 0F, 0F, 1, 25, 3, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 52 + noseModel[35].setRotationPoint(14F, -13F, -1.5F); + + noseModel[36].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 53 + noseModel[36].setRotationPoint(14F, -12F, -2F); + + noseModel[37].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 54 + noseModel[37].setRotationPoint(15F, -12F, -2F); + + noseModel[38].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 55 + noseModel[38].setRotationPoint(15F, -7F, -2F); + + noseModel[39].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 56 + noseModel[39].setRotationPoint(14F, -7F, -2F); + + noseModel[40].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 57 + noseModel[40].setRotationPoint(15F, -2F, -2F); + + noseModel[41].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 58 + noseModel[41].setRotationPoint(14F, -2F, -2F); + + noseModel[42].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 59 + noseModel[42].setRotationPoint(15F, 3F, -2F); + + noseModel[43].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 60 + noseModel[43].setRotationPoint(14F, 3F, -2F); + + noseModel[44].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F); // Box 61 + noseModel[44].setRotationPoint(15F, 8F, -2F); + + noseModel[45].addShapeBox(0F, 0F, 0F, 1, 2, 4, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 62 + noseModel[45].setRotationPoint(14F, 8F, -2F); + + noseModel[46].addShapeBox(0F, 0F, 0F, 3, 5, 2, 0F, -2F, 0F, -0.5F, 1F, 0F, -0.5F, 1F, 0F, -0.5F, -2F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 63 + noseModel[46].setRotationPoint(-14F, -18F, -1F); + + noseModel[47].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 64 + noseModel[47].setRotationPoint(-12F, -26F, -0.5F); + + noseModel[48].addShapeBox(0F, 0F, 0F, 1, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F); // Box 65 + noseModel[48].setRotationPoint(-12F, -21F, -0.5F); + + noseModel[49].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 66 + noseModel[49].setRotationPoint(-11F, -26F, -0.5F); + + noseModel[50].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 67 + noseModel[50].setRotationPoint(-11F, -22F, -0.5F); + + noseModel[51].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 68 + noseModel[51].setRotationPoint(-11F, -24F, -0.5F); + + noseModel[52].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 70 + noseModel[52].setRotationPoint(-17F, -11.5F, -0.5F); + + noseModel[53].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 71 + noseModel[53].setRotationPoint(-17F, -6.5F, -0.5F); + + noseModel[54].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 72 + noseModel[54].setRotationPoint(-17F, -1.5F, -0.5F); + + noseModel[55].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 73 + noseModel[55].setRotationPoint(-17F, 3.5F, -0.5F); + + noseModel[56].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 74 + noseModel[56].setRotationPoint(-17F, 8.5F, -0.5F); + + noseModel[57].addShapeBox(0F, 0F, 0F, 1, 35, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F); // Box 75 + noseModel[57].setRotationPoint(-18F, -15F, -0.5F); + + noseModel[58].addShapeBox(0F, 0F, 0F, 1, 35, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F); // Box 76 + noseModel[58].setRotationPoint(17F, -15F, -0.5F); + + noseModel[59].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 77 + noseModel[59].setRotationPoint(16F, -11.5F, -0.5F); + + noseModel[60].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 78 + noseModel[60].setRotationPoint(16F, -6.5F, -0.5F); + + noseModel[61].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 79 + noseModel[61].setRotationPoint(16F, -1.5F, -0.5F); + + noseModel[62].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 80 + noseModel[62].setRotationPoint(16F, 3.5F, -0.5F); + + noseModel[63].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 81 + noseModel[63].setRotationPoint(16F, 8.5F, -0.5F); + + noseModel[64].addShapeBox(0F, 0F, 0F, 3, 5, 2, 0F, 1F, 0F, -0.5F, -2F, 0F, -0.5F, -2F, 0F, -0.5F, 1F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 82 + noseModel[64].setRotationPoint(11F, -18F, -1F); + + noseModel[65].addShapeBox(0F, 0F, 0F, 1, 3, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F); // Box 83 + noseModel[65].setRotationPoint(11F, -21F, -0.5F); + + noseModel[66].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 84 + noseModel[66].setRotationPoint(11F, -26F, -0.5F); + + noseModel[67].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 85 + noseModel[67].setRotationPoint(10F, -22F, -0.5F); + + noseModel[68].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 86 + noseModel[68].setRotationPoint(10F, -24F, -0.5F); + + noseModel[69].addShapeBox(0F, 0F, 0F, 1, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 87 + noseModel[69].setRotationPoint(10F, -26F, -0.5F); + + noseModel[70].addShapeBox(0F, 0F, 0F, 1, 27, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 88 + noseModel[70].setRotationPoint(8F, -19F, -0.5F); + + noseModel[71].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 89 + noseModel[71].setRotationPoint(9F, -15F, -0.5F); + + noseModel[72].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 90 + noseModel[72].setRotationPoint(9F, -12F, -0.5F); + + noseModel[73].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 91 + noseModel[73].setRotationPoint(9F, -9F, -0.5F); + + noseModel[74].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 92 + noseModel[74].setRotationPoint(9F, -6F, -0.5F); + + noseModel[75].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 93 + noseModel[75].setRotationPoint(9F, -3F, -0.5F); + + noseModel[76].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 94 + noseModel[76].setRotationPoint(9F, 0F, -0.5F); + + noseModel[77].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 95 + noseModel[77].setRotationPoint(9F, 3F, -0.5F); + + noseModel[78].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F); // Box 96 + noseModel[78].setRotationPoint(9F, 6F, -0.5F); + + noseModel[79].addShapeBox(0F, 0F, 0F, 1, 27, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 97 + noseModel[79].setRotationPoint(-9F, -19F, -0.5F); + + noseModel[80].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 98 + noseModel[80].setRotationPoint(-12F, -15F, -0.5F); + + noseModel[81].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 99 + noseModel[81].setRotationPoint(-12F, -12F, -0.5F); + + noseModel[82].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 100 + noseModel[82].setRotationPoint(-12F, -9F, -0.5F); + + noseModel[83].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 101 + noseModel[83].setRotationPoint(-12F, -6F, -0.5F); + + noseModel[84].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 102 + noseModel[84].setRotationPoint(-12F, -3F, -0.5F); + + noseModel[85].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 103 + noseModel[85].setRotationPoint(-12F, 0F, -0.5F); + + noseModel[86].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 104 + noseModel[86].setRotationPoint(-12F, 3F, -0.5F); + + noseModel[87].addShapeBox(0F, 0F, 0F, 3, 1, 1, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, 2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 2F, 0F); // Box 105 + noseModel[87].setRotationPoint(-12F, 6F, -0.5F); + + noseModel[88].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 107 + noseModel[88].setRotationPoint(-9F, -19F, 0.5F); + + noseModel[89].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 108 + noseModel[89].setRotationPoint(-9F, -19F, -1.5F); + + noseModel[90].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 109 + noseModel[90].setRotationPoint(-9F, -12F, -1.5F); + + noseModel[91].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 110 + noseModel[91].setRotationPoint(-9F, -12F, 0.5F); + + noseModel[92].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 111 + noseModel[92].setRotationPoint(-9F, -4F, -1.5F); + + noseModel[93].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 112 + noseModel[93].setRotationPoint(-9F, -4F, 0.5F); + + noseModel[94].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 113 + noseModel[94].setRotationPoint(-9F, 3F, -1.5F); + + noseModel[95].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 114 + noseModel[95].setRotationPoint(-9F, 3F, 0.5F); + + noseModel[96].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 115 + noseModel[96].setRotationPoint(8F, 3F, 0.5F); + + noseModel[97].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 116 + noseModel[97].setRotationPoint(8F, 3F, -1.5F); + + noseModel[98].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 117 + noseModel[98].setRotationPoint(8F, -4F, -1.5F); + + noseModel[99].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 118 + noseModel[99].setRotationPoint(8F, -4F, 0.5F); + + noseModel[100].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 119 + noseModel[100].setRotationPoint(8F, -12F, 0.5F); + + noseModel[101].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 120 + noseModel[101].setRotationPoint(8F, -12F, -1.5F); + + noseModel[102].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 121 + noseModel[102].setRotationPoint(8F, -19F, -1.5F); + + noseModel[103].addShapeBox(0F, 0F, 0F, 1, 5, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F); // Box 122 + noseModel[103].setRotationPoint(8F, -19F, 0.5F); + + noseModel[104].addShapeBox(0F, 0F, 0F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 123 + noseModel[104].setRotationPoint(8F, 16F, -1F); + + noseModel[105].addShapeBox(0F, 0F, 0F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 124 + noseModel[105].setRotationPoint(8F, 18F, -1F); + + noseModel[106].addShapeBox(0F, 0F, 0F, 6, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 125 + noseModel[106].setRotationPoint(8F, 14F, -1F); + + noseModel[107].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 126 + noseModel[107].setRotationPoint(11F, 17F, -0.5F); + + noseModel[108].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 127 + noseModel[108].setRotationPoint(11F, 17F, -0.5F); + noseModel[108].rotateAngleZ = 0.78539816F; + + noseModel[109].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 128 + noseModel[109].setRotationPoint(11F, 17F, -0.5F); + noseModel[109].rotateAngleZ = -0.78539816F; + + noseModel[110].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 129 + noseModel[110].setRotationPoint(11F, 17F, -0.5F); + noseModel[110].rotateAngleZ = -1.57079633F; + + noseModel[111].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 130 + noseModel[111].setRotationPoint(11F, 17F, -0.5F); + noseModel[111].rotateAngleZ = -2.35619449F; + + noseModel[112].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 131 + noseModel[112].setRotationPoint(-11F, 17F, -0.5F); + noseModel[112].rotateAngleZ = -2.35619449F; + + noseModel[113].addShapeBox(0F, 0F, 0F, 6, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 132 + noseModel[113].setRotationPoint(-14F, 14F, -1F); + + noseModel[114].addShapeBox(0F, 0F, 0F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 133 + noseModel[114].setRotationPoint(-14F, 16F, -1F); + + noseModel[115].addShapeBox(0F, 0F, 0F, 6, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 134 + noseModel[115].setRotationPoint(-14F, 18F, -1F); + + noseModel[116].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 135 + noseModel[116].setRotationPoint(-11F, 17F, -0.5F); + noseModel[116].rotateAngleZ = -3.14159265F; + + noseModel[117].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 136 + noseModel[117].setRotationPoint(-11F, 17F, -0.5F); + noseModel[117].rotateAngleZ = -3.92699082F; + + noseModel[118].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 137 + noseModel[118].setRotationPoint(-11F, 17F, -0.5F); + noseModel[118].rotateAngleZ = -0.78539816F; + + noseModel[119].addShapeBox(-4F, -0.5F, 0F, 3, 1, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 138 + noseModel[119].setRotationPoint(-11F, 17F, -0.5F); + noseModel[119].rotateAngleZ = -1.57079633F; + + noseModel[120].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 139 + noseModel[120].setRotationPoint(8F, -17.5F, -2.5F); + + noseModel[121].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 140 + noseModel[121].setRotationPoint(8F, -17.5F, 1.5F); + + noseModel[122].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 141 + noseModel[122].setRotationPoint(8F, -10.5F, 1.5F); + + noseModel[123].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 142 + noseModel[123].setRotationPoint(8F, -10.5F, -2.5F); + + noseModel[124].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 143 + noseModel[124].setRotationPoint(-9F, -17.5F, -2.5F); + + noseModel[125].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 144 + noseModel[125].setRotationPoint(-9F, -17.5F, 1.5F); + + noseModel[126].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 145 + noseModel[126].setRotationPoint(-9F, -10.5F, 1.5F); + + noseModel[127].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 146 + noseModel[127].setRotationPoint(-9F, -10.5F, -2.5F); + + noseModel[128].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 147 + noseModel[128].setRotationPoint(-9F, -2.5F, 1.5F); + + noseModel[129].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 148 + noseModel[129].setRotationPoint(-9F, -2.5F, -2.5F); + + noseModel[130].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 149 + noseModel[130].setRotationPoint(8F, -2.5F, -2.5F); + + noseModel[131].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 150 + noseModel[131].setRotationPoint(8F, -2.5F, 1.5F); + + noseModel[132].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 151 + noseModel[132].setRotationPoint(-9F, 4.5F, 1.5F); + + noseModel[133].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 152 + noseModel[133].setRotationPoint(-9F, 4.5F, -2.5F); + + noseModel[134].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 153 + noseModel[134].setRotationPoint(8F, 4.5F, -2.5F); + + noseModel[135].addShapeBox(0F, 0F, 0F, 1, 2, 1, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -0.5F, 0F, 0F, -0.5F, 0F); // Box 154 + noseModel[135].setRotationPoint(8F, 4.5F, 1.5F); + + noseModel[136].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 155 + noseModel[136].setRotationPoint(-13F, -12.5F, -2.5F); + + noseModel[137].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 156 + noseModel[137].setRotationPoint(-13F, -8.5F, -2.5F); + + noseModel[138].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 159 + noseModel[138].setRotationPoint(-13F, 3.5F, -2.5F); + + noseModel[139].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 160 + noseModel[139].setRotationPoint(-13F, 7.5F, -2.5F); + + noseModel[140].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 161 + noseModel[140].setRotationPoint(12F, 7.5F, -2.5F); + + noseModel[141].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 162 + noseModel[141].setRotationPoint(12F, 3.5F, -2.5F); + + noseModel[142].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 165 + noseModel[142].setRotationPoint(12F, -8.5F, -2.5F); + + noseModel[143].addShapeBox(0F, 0F, 0F, 1, 1, 5, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 166 + noseModel[143].setRotationPoint(12F, -12.5F, -2.5F); + + } + + + public void render(float f5) + { + render(noseModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT2.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT2.java new file mode 100644 index 000000000..77527ed2b --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT2.java @@ -0,0 +1,155 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLauncherRailT2 extends ModelBase +{ + // fields + ModelRenderer Shape11; + ModelRenderer Shape12; + ModelRenderer Shape13; + ModelRenderer Shape14; + ModelRenderer Shape15; + ModelRenderer Shape16; + ModelRenderer Shape20; + ModelRenderer Shape22; + ModelRenderer Shape23; + ModelRenderer Shape24; + ModelRenderer Shape25; + ModelRenderer Shape28; + ModelRenderer Shape29; + + public ModelLauncherRailT2() + { + textureWidth = 128; + textureHeight = 128; + + Shape11 = new ModelRenderer(this, 35, 52); + Shape11.addBox(0F, 0F, 0F, 1, 41, 4); + Shape11.setRotationPoint(-16F, -23F, -2F); + Shape11.setTextureSize(128, 128); + Shape11.mirror = true; + setRotation(Shape11, 0F, -0.7853982F, 0F); + Shape12 = new ModelRenderer(this, 46, 52); + Shape12.addBox(0F, 0F, 0F, 3, 19, 2); + Shape12.setRotationPoint(-18F, -1F, -3F); + Shape12.setTextureSize(128, 128); + Shape12.mirror = true; + setRotation(Shape12, 0F, -0.7853982F, 0F); + Shape13 = new ModelRenderer(this, 0, 20); + Shape13.addBox(0F, 0F, 0F, 2, 12, 2); + Shape13.setRotationPoint(-16F, 12F, -1F); + Shape13.setTextureSize(128, 128); + Shape13.mirror = true; + setRotation(Shape13, 0F, -0.7853982F, 0F); + Shape14 = new ModelRenderer(this, 0, 10); + Shape14.addBox(0F, 0F, 0F, 2, 4, 1); + Shape14.setRotationPoint(-16F, -27F, -2F); + Shape14.setTextureSize(128, 128); + Shape14.mirror = true; + setRotation(Shape14, 0F, -0.7853982F, 0F); + Shape15 = new ModelRenderer(this, 0, 0); + Shape15.addBox(0F, 0F, 0F, 16, 1, 8); + Shape15.setRotationPoint(-24F, 23F, 0F); + Shape15.setTextureSize(128, 128); + Shape15.mirror = true; + setRotation(Shape15, 0F, 0F, 0F); + Shape16 = new ModelRenderer(this, 57, 52); + Shape16.addBox(0F, 0F, 0F, 11, 6, 6); + Shape16.setRotationPoint(-20F, 18F, -8F); + Shape16.setTextureSize(128, 128); + Shape16.mirror = true; + setRotation(Shape16, 0F, -0.7853982F, 0F); + Shape20 = new ModelRenderer(this, 0, 10); + Shape20.addBox(0F, 0F, 0F, 2, 4, 1); + Shape20.setRotationPoint(-18F, -27F, 0F); + Shape20.setTextureSize(128, 128); + Shape20.mirror = true; + setRotation(Shape20, 0F, -0.7853982F, 0F); + Shape22 = new ModelRenderer(this, 8, 10); + Shape22.addBox(0F, 0F, 0F, 9, 1, 1); + Shape22.setRotationPoint(-17F, 5F, -1F); + Shape22.setTextureSize(128, 128); + Shape22.mirror = true; + setRotation(Shape22, 0F, 0F, 0F); + Shape23 = new ModelRenderer(this, 8, 10); + Shape23.addBox(0F, 0F, 0F, 9, 1, 1); + Shape23.setRotationPoint(-17F, -10F, -1F); + Shape23.setTextureSize(128, 128); + Shape23.mirror = true; + setRotation(Shape23, 0F, 0F, 0F); + Shape24 = new ModelRenderer(this, 15, 20); + Shape24.addBox(0F, 0F, 0F, 6, 1, 1); + Shape24.setRotationPoint(-21F, 5F, 6F); + Shape24.setTextureSize(128, 128); + Shape24.mirror = true; + setRotation(Shape24, 0F, 1.134464F, 0F); + Shape25 = new ModelRenderer(this, 15, 20); + Shape25.addBox(0F, 0F, 0F, 6, 1, 1); + Shape25.setRotationPoint(-20F, 5F, 6F); + Shape25.setTextureSize(128, 128); + Shape25.mirror = true; + setRotation(Shape25, 0F, -1.047198F, 0F); + Shape28 = new ModelRenderer(this, 15, 19); + Shape28.addBox(0F, 0F, 0F, 6, 1, 1); + Shape28.setRotationPoint(-20F, -10F, 6F); + Shape28.setTextureSize(128, 128); + Shape28.mirror = true; + setRotation(Shape28, 0F, -1.047198F, 0F); + Shape29 = new ModelRenderer(this, 15, 19); + Shape29.addBox(0F, 0F, 0F, 6, 1, 1); + Shape29.setRotationPoint(-21F, -10F, 6F); + Shape29.setTextureSize(128, 128); + Shape29.mirror = true; + setRotation(Shape29, 0F, 1.047198F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape11.render(f5); + Shape12.render(f5); + Shape13.render(f5); + Shape14.render(f5); + Shape15.render(f5); + Shape16.render(f5); + Shape20.render(f5); + Shape22.render(f5); + Shape23.render(f5); + Shape24.render(f5); + Shape25.render(f5); + Shape28.render(f5); + Shape29.render(f5); + } + + public void render(float f5) + { + Shape11.render(f5); + Shape12.render(f5); + Shape13.render(f5); + Shape14.render(f5); + Shape15.render(f5); + Shape16.render(f5); + Shape20.render(f5); + Shape22.render(f5); + Shape23.render(f5); + Shape24.render(f5); + Shape25.render(f5); + Shape28.render(f5); + Shape29.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT3.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT3.java new file mode 100644 index 000000000..1950c335b --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherRailT3.java @@ -0,0 +1,74 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLauncherRailT3 extends ModelBase +{ + // fields + ModelRenderer Shape9; + ModelRenderer Shape20; + ModelRenderer Shape21; + ModelRenderer Shape16; + + public ModelLauncherRailT3() + { + textureWidth = 256; + textureHeight = 256; + + Shape9 = new ModelRenderer(this, 170, 0); + Shape9.addBox(0F, 0F, 0F, 10, 37, 10); + Shape9.setRotationPoint(-22F, -19F, -5F); + Shape9.setTextureSize(256, 256); + Shape9.mirror = true; + setRotation(Shape9, 0F, 0F, 0F); + Shape20 = new ModelRenderer(this, 170, 50); + Shape20.addBox(0F, 0F, 0F, 1, 40, 2); + Shape20.setRotationPoint(-19F, -22F, -6F); + Shape20.setTextureSize(256, 256); + Shape20.mirror = true; + setRotation(Shape20, 0F, 0F, 0F); + Shape21 = new ModelRenderer(this, 100, 0); + Shape21.addBox(0F, 0F, 0F, 16, 6, 14); + Shape21.setRotationPoint(-25F, 18F, -7F); + Shape21.setTextureSize(256, 256); + Shape21.mirror = true; + setRotation(Shape21, 0F, 0F, 0F); + Shape16 = new ModelRenderer(this, 170, 50); + Shape16.addBox(0F, 0F, 0F, 1, 40, 2); + Shape16.setRotationPoint(-16F, -22F, -6F); + Shape16.setTextureSize(256, 256); + Shape16.mirror = true; + setRotation(Shape16, 0F, 0F, 0F); + } + + @Override + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + this.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape9.render(f5); + Shape20.render(f5); + Shape21.render(f5); + Shape16.render(f5); + } + + public void render(float f5) + { + Shape9.render(f5); + Shape20.render(f5); + Shape21.render(f5); + Shape16.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT1.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT1.java new file mode 100644 index 000000000..5c383d123 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT1.java @@ -0,0 +1,111 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.tmt.ModelRendererTurbo; + +@SideOnly(Side.CLIENT) +public class ModelLauncherScreenT1 extends ModelBase +{ + // fields + ModelRendererTurbo[] bodyModel; + + public ModelLauncherScreenT1() + { + int textureX = 512; + int textureY = 512; + + bodyModel = new ModelRendererTurbo[17]; + bodyModel[0] = new ModelRendererTurbo(this, 120, 0, textureX, textureY); // Box 0 + bodyModel[1] = new ModelRendererTurbo(this, 120, 26, textureX, textureY); // Box 1 + bodyModel[2] = new ModelRendererTurbo(this, 120, 26, textureX, textureY); // Box 2 + bodyModel[3] = new ModelRendererTurbo(this, 120, 33, textureX, textureY); // Box 3 + bodyModel[4] = new ModelRendererTurbo(this, 120, 40, textureX, textureY); // Box 4 + bodyModel[5] = new ModelRendererTurbo(this, 120, 55, textureX, textureY); // Box 5 + bodyModel[6] = new ModelRendererTurbo(this, 120, 71, textureX, textureY); // Box 6 + bodyModel[7] = new ModelRendererTurbo(this, 120, 80, textureX, textureY); // Box 7 + bodyModel[8] = new ModelRendererTurbo(this, 120, 80, textureX, textureY); // Box 8 + bodyModel[9] = new ModelRendererTurbo(this, 120, 80, textureX, textureY); // Box 9 + bodyModel[10] = new ModelRendererTurbo(this, 120, 80, textureX, textureY); // Box 10 + bodyModel[11] = new ModelRendererTurbo(this, 120, 92, textureX, textureY); // Box 11 + bodyModel[12] = new ModelRendererTurbo(this, 120, 118, textureX, textureY); // Box 12 + bodyModel[13] = new ModelRendererTurbo(this, 120, 131, textureX, textureY); // Box 13 + bodyModel[14] = new ModelRendererTurbo(this, 120, 138, textureX, textureY); // Box 14 + bodyModel[15] = new ModelRendererTurbo(this, 120, 154, textureX, textureY); // Box 15 + bodyModel[16] = new ModelRendererTurbo(this, 120, 164, textureX, textureY); // Box 16 + + bodyModel[0].addBox(0F, 0F, 0F, 16, 2, 12, 0F); // Box 0 + bodyModel[0].setRotationPoint(-8F, 22F, -6F); + + bodyModel[1].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 1 + bodyModel[1].setRotationPoint(-8F, 22F, 6F); + + bodyModel[2].addShapeBox(0F, 0F, 0F, 16, 2, 2, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 2 + bodyModel[2].setRotationPoint(-8F, 22F, -8F); + + bodyModel[3].addShapeBox(0F, 0F, 0F, 14, 2, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 3 + bodyModel[3].setRotationPoint(-7F, 20F, -6F); + + bodyModel[4].addShapeBox(0F, 0F, 0F, 2, 8, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 4 + bodyModel[4].setRotationPoint(5F, 11F, -6F); + + bodyModel[5].addShapeBox(0F, 0F, 0F, 2, 8, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 5 + bodyModel[5].setRotationPoint(-7F, 11F, -6F); + + bodyModel[6].addShapeBox(0F, 0F, 0F, 14, 2, 3, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 6 + bodyModel[6].setRotationPoint(-7F, 8F, -6F); + + bodyModel[7].addShapeBox(0F, 0F, 0F, 2, 1, 3, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 7 + bodyModel[7].setRotationPoint(-7F, 10F, -6F); + + bodyModel[8].addShapeBox(0F, 0F, 0F, 2, 1, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F); // Box 8 + bodyModel[8].setRotationPoint(-7F, 19F, -6F); + + bodyModel[9].addShapeBox(0F, 0F, 0F, 2, 1, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F); // Box 9 + bodyModel[9].setRotationPoint(5F, 19F, -6F); + + bodyModel[10].addShapeBox(0F, 0F, 0F, 2, 1, 3, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 10 + bodyModel[10].setRotationPoint(5F, 10F, -6F); + + bodyModel[11].addShapeBox(0F, 0F, 0F, 12, 12, 10, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, -5F, 0F, -2F, -5F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 11 + bodyModel[11].setRotationPoint(-6F, 9F, -3F); + + bodyModel[12].addShapeBox(0F, 0F, 0F, 12, 6, 3, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 12 + bodyModel[12].setRotationPoint(-6F, 16F, 0F); + + bodyModel[13].addShapeBox(0F, 0F, 0F, 12, 1, 3, 0F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, -1F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 13 + bodyModel[13].setRotationPoint(-6F, 15F, 0F); + + bodyModel[14].addShapeBox(0F, 0F, 0F, 6, 5, 7, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, -4F, 0F, -2F, -4F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -2F, 0F, 0F, -2F, 0F, 0F); // Box 14 + bodyModel[14].setRotationPoint(-3F, 9F, -1F); + + bodyModel[15].addShapeBox(0F, 0F, 0F, 6, 5, 2, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F); // Box 15 + bodyModel[15].setRotationPoint(-3F, 9F, -3F); + + bodyModel[16].addShapeBox(0F, 0F, 0F, 100, 100, 1, 0F, -90F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, 0F, -90F, 0F, 0F, -90F, -90F, 0F, 0F, -90F, 0F, 0F, -90F, 0F, -90F, -90F, 0F); // Box 16 + bodyModel[16].setRotationPoint(-95F, 10F, -5.8F); + + } + + public void render(float f5) + { + render(bodyModel, f5); + } + + private void render(ModelRendererTurbo[] models, float f) + { + for(ModelRendererTurbo model : models) + if(model != null) + model.render(f); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT2.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT2.java new file mode 100644 index 000000000..ad1cca20b --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT2.java @@ -0,0 +1,46 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLauncherScreenT2 extends ModelBase +{ + // fields + ModelRenderer Shape4; + ModelRenderer Shape5; + + public ModelLauncherScreenT2() + { + textureWidth = 128; + textureHeight = 128; + + Shape4 = new ModelRenderer(this, 0, 35); + Shape4.addBox(0F, 0F, 0F, 2, 8, 1); + Shape4.setRotationPoint(-1F, 16F, 0F); + Shape4.setTextureSize(128, 128); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 15, 30); + Shape5.addBox(0F, 0F, 0F, 10, 1, 5); + Shape5.setRotationPoint(-5F, 17F, -2F); + Shape5.setTextureSize(128, 128); + Shape5.mirror = true; + setRotation(Shape5, 0.5235988F, 0F, 0F); + } + + public void render(float f5) + { + Shape4.render(f5); + Shape5.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT3.java b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT3.java new file mode 100644 index 000000000..4472da2bd --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelLauncherScreenT3.java @@ -0,0 +1,63 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelLauncherScreenT3 extends ModelBase +{ + // fields + ModelRenderer Shape27; + ModelRenderer Shape29; + ModelRenderer Shape30; + ModelRenderer Shape31; + + public ModelLauncherScreenT3() + { + textureWidth = 256; + textureHeight = 256; + + Shape27 = new ModelRenderer(this, 0, 30); + Shape27.addBox(0F, 0F, 0F, 8, 9, 3); + Shape27.setRotationPoint(-4F, 15F, -2F); + Shape27.setTextureSize(256, 256); + Shape27.mirror = true; + setRotation(Shape27, 0F, 0F, 0F); + Shape29 = new ModelRenderer(this, 0, 19); + Shape29.addBox(0F, 0F, 0F, 10, 1, 8); + Shape29.setRotationPoint(-5F, 16F, -6F); + Shape29.setTextureSize(256, 256); + Shape29.mirror = true; + setRotation(Shape29, 0.3141593F, 0F, 0F); + Shape30 = new ModelRenderer(this, 0, 0); + Shape30.addBox(0F, 0F, 0F, 10, 8, 1); + Shape30.setRotationPoint(-5F, 6F, 5F); + Shape30.setTextureSize(256, 256); + Shape30.mirror = true; + setRotation(Shape30, -0.4363323F, 0F, 0F); + Shape31 = new ModelRenderer(this, 25, 0); + Shape31.addBox(0F, 0F, 0F, 2, 10, 1); + Shape31.setRotationPoint(-1F, 10F, 4F); + Shape31.setTextureSize(256, 256); + Shape31.mirror = true; + setRotation(Shape31, -0.4363323F, 0F, 0F); + } + + public void render(float f5) + { + Shape27.render(f5); + Shape29.render(f5); + Shape30.render(f5); + Shape31.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelRadarStation.java b/src/main/java/mekanism/defense/client/model/tile/ModelRadarStation.java new file mode 100644 index 000000000..cf1e5758b --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelRadarStation.java @@ -0,0 +1,252 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; + +public class ModelRadarStation extends ModelBase +{ + // fields + ModelRenderer Base; + ModelRenderer Battery; + ModelRenderer BatRing1; + ModelRenderer BatRing2; + ModelRenderer BatRing3; + ModelRenderer BatRing4; + ModelRenderer LeftPlate; + ModelRenderer RightPlate; + ModelRenderer Panel; + ModelRenderer SignalPole; + ModelRenderer SignalRec; + ModelRenderer SignalRing1; + ModelRenderer SignalRing2; + ModelRenderer Strut1; + ModelRenderer Strut2; + ModelRenderer LeftPlateEnd; + ModelRenderer RightPlateEnd; + ModelRenderer BaseBump1; + ModelRenderer BaseBump2; + ModelRenderer FrontWireTop; + ModelRenderer BackWireTop; + ModelRenderer FrontWireBottom; + ModelRenderer BackWireBottom; + ModelRenderer BatteryPole; + ModelRenderer PistonHead; + ModelRenderer PistonPole; + ModelRenderer PistonBody; + + public ModelRadarStation() + { + textureWidth = 128; + textureHeight = 128; + + Base = new ModelRenderer(this, 0, 0); + Base.addBox(0F, 0F, 0F, 11, 4, 14); + Base.setRotationPoint(-7F, 20F, -7F); + Base.setTextureSize(128, 128); + Base.mirror = true; + setRotation(Base, 0F, 0F, 0F); + Battery = new ModelRenderer(this, 51, 0); + Battery.addBox(0F, 0F, 0F, 3, 3, 7); + Battery.setRotationPoint(4F, 21F, -0.5F); + Battery.setTextureSize(128, 128); + Battery.mirror = true; + setRotation(Battery, 0F, 0F, 0F); + BatRing1 = new ModelRenderer(this, 51, 11); + BatRing1.addBox(0F, 0F, 0F, 3, 3, 1); + BatRing1.setRotationPoint(4F, 21F, -2F); + BatRing1.setTextureSize(128, 128); + BatRing1.mirror = true; + setRotation(BatRing1, 0F, 0F, 0F); + BatRing2 = new ModelRenderer(this, 51, 16); + BatRing2.addBox(0F, 0F, 0F, 3, 3, 1); + BatRing2.setRotationPoint(4F, 21F, -3.5F); + BatRing2.setTextureSize(128, 128); + BatRing2.mirror = true; + setRotation(BatRing2, 0F, 0F, 0F); + BatRing3 = new ModelRenderer(this, 51, 21); + BatRing3.addBox(0F, 0F, 0F, 3, 3, 1); + BatRing3.setRotationPoint(4F, 21F, -5F); + BatRing3.setTextureSize(128, 128); + BatRing3.mirror = true; + setRotation(BatRing3, 0F, 0F, 0F); + BatRing4 = new ModelRenderer(this, 51, 26); + BatRing4.addBox(0F, 0F, 0F, 3, 3, 1); + BatRing4.setRotationPoint(4F, 21F, -6.5F); + BatRing4.setTextureSize(128, 128); + BatRing4.mirror = true; + setRotation(BatRing4, 0F, 0F, 0F); + LeftPlate = new ModelRenderer(this, 0, 19); + LeftPlate.addBox(0F, 0F, 0F, 1, 3, 9); + LeftPlate.setRotationPoint(-7F, 17F, -2F); + LeftPlate.setTextureSize(128, 128); + LeftPlate.mirror = true; + setRotation(LeftPlate, 0F, 0F, 0F); + RightPlate = new ModelRenderer(this, 21, 19); + RightPlate.addBox(0F, 0F, 0F, 1, 3, 9); + RightPlate.setRotationPoint(3F, 17F, -2F); + RightPlate.setTextureSize(128, 128); + RightPlate.mirror = true; + setRotation(RightPlate, 0F, 0F, 0F); + Panel = new ModelRenderer(this, 0, 32); + Panel.addBox(0F, 0F, 0F, 8, 7, 1); + Panel.setRotationPoint(-5.5F, 11F, 5F); + Panel.setTextureSize(128, 128); + Panel.mirror = true; + setRotation(Panel, -0.6108652F, 0F, 0F); + SignalPole = new ModelRenderer(this, 60, 11); + SignalPole.addBox(-0.5F, 0F, -0.5F, 1, 14, 1); + SignalPole.setRotationPoint(4.5F, 10F, 6.5F); + SignalPole.setTextureSize(128, 128); + SignalPole.mirror = true; + setRotation(SignalPole, 0F, 0F, 0F); + SignalRec = new ModelRenderer(this, 60, 27); + SignalRec.addBox(-1F, -1F, -1F, 2, 2, 2); + SignalRec.setRotationPoint(4.5F, 10F, 6.5F); + SignalRec.setTextureSize(128, 128); + SignalRec.mirror = true; + setRotation(SignalRec, 0F, 0F, 0F); + SignalRing1 = new ModelRenderer(this, 65, 11); + SignalRing1.addBox(-1F, 0F, -1F, 2, 1, 2); + SignalRing1.setRotationPoint(4.5F, 11.5F, 6.5F); + SignalRing1.setTextureSize(128, 128); + SignalRing1.mirror = true; + setRotation(SignalRing1, 0F, 0F, 0F); + SignalRing2 = new ModelRenderer(this, 65, 15); + SignalRing2.addBox(-1F, -0.5F, -1F, 2, 1, 2); + SignalRing2.setRotationPoint(4.5F, 13.5F, 6.5F); + SignalRing2.setTextureSize(128, 128); + SignalRing2.mirror = true; + setRotation(SignalRing2, 0F, 0F, 0F); + Strut1 = new ModelRenderer(this, 42, 19); + Strut1.addBox(0F, 0F, 0F, 2, 3, 2); + Strut1.setRotationPoint(-2.5F, 16F, 2F); + Strut1.setTextureSize(128, 128); + Strut1.mirror = true; + setRotation(Strut1, 0.8412487F, 0F, 0F); + Strut2 = new ModelRenderer(this, 19, 32); + Strut2.addBox(0F, 0F, 0F, 3, 4, 2); + Strut2.setRotationPoint(-3F, 16.5F, 4F); + Strut2.setTextureSize(128, 128); + Strut2.mirror = true; + setRotation(Strut2, 0F, 0F, 0F); + LeftPlateEnd = new ModelRenderer(this, 42, 25); + LeftPlateEnd.addBox(0F, 0F, 0F, 1, 2, 1); + LeftPlateEnd.setRotationPoint(-7F, 18F, -3F); + LeftPlateEnd.setTextureSize(128, 128); + LeftPlateEnd.mirror = true; + setRotation(LeftPlateEnd, 0F, 0F, 0F); + RightPlateEnd = new ModelRenderer(this, 42, 29); + RightPlateEnd.addBox(0F, 0F, 0F, 1, 2, 1); + RightPlateEnd.setRotationPoint(3F, 18F, -3F); + RightPlateEnd.setTextureSize(128, 128); + RightPlateEnd.mirror = true; + setRotation(RightPlateEnd, 0F, 0F, 0F); + BaseBump1 = new ModelRenderer(this, 0, 41); + BaseBump1.addBox(0F, 0F, 0F, 9, 1, 1); + BaseBump1.setRotationPoint(-6F, 19F, -2F); + BaseBump1.setTextureSize(128, 128); + BaseBump1.mirror = true; + setRotation(BaseBump1, 0F, 0F, 0F); + BaseBump2 = new ModelRenderer(this, 0, 44); + BaseBump2.addBox(0F, 0F, 0F, 10, 1, 1); + BaseBump2.setRotationPoint(-6.5F, 19.5F, -3.5F); + BaseBump2.setTextureSize(128, 128); + BaseBump2.mirror = true; + setRotation(BaseBump2, 0F, 0F, 0F); + FrontWireTop = new ModelRenderer(this, 30, 32); + FrontWireTop.addBox(0F, 0F, 0F, 2, 1, 1); + FrontWireTop.setRotationPoint(4F, 19F, 1F); + FrontWireTop.setTextureSize(128, 128); + FrontWireTop.mirror = true; + setRotation(FrontWireTop, 0F, 0F, 0F); + BackWireTop = new ModelRenderer(this, 30, 35); + BackWireTop.addBox(0F, 0F, 0F, 2, 1, 1); + BackWireTop.setRotationPoint(4F, 19F, 4F); + BackWireTop.setTextureSize(128, 128); + BackWireTop.mirror = true; + setRotation(BackWireTop, 0F, 0F, 0F); + FrontWireBottom = new ModelRenderer(this, 42, 33); + FrontWireBottom.addBox(0F, 0F, 0F, 1, 1, 1); + FrontWireBottom.setRotationPoint(5F, 20F, 1F); + FrontWireBottom.setTextureSize(128, 128); + FrontWireBottom.mirror = true; + setRotation(FrontWireBottom, 0F, 0F, 0F); + BackWireBottom = new ModelRenderer(this, 42, 36); + BackWireBottom.addBox(0F, 0F, 0F, 1, 1, 1); + BackWireBottom.setRotationPoint(5F, 20F, 4F); + BackWireBottom.setTextureSize(128, 128); + BackWireBottom.mirror = true; + setRotation(BackWireBottom, 0F, 0F, 0F); + BatteryPole = new ModelRenderer(this, 65, 19); + BatteryPole.addBox(0F, 0F, 0F, 1, 1, 6); + BatteryPole.setRotationPoint(5F, 22F, -6F); + BatteryPole.setTextureSize(128, 128); + BatteryPole.mirror = true; + setRotation(BatteryPole, 0F, 0F, 0F); + PistonHead = new ModelRenderer(this, 51, 31); + PistonHead.addBox(0F, 0F, 0F, 1, 1, 2); + PistonHead.setRotationPoint(-2F, 19F, -6.2F); + PistonHead.setTextureSize(128, 128); + PistonHead.mirror = true; + setRotation(PistonHead, 0F, 0F, 0F); + PistonPole = new ModelRenderer(this, 51, 35); + PistonPole.addBox(0F, 0F, 0F, 3, 1, 1); + PistonPole.setRotationPoint(-1F, 19.25F, -5.7F); + PistonPole.setTextureSize(128, 128); + PistonPole.mirror = true; + setRotation(PistonPole, 0F, 0F, 0F); + PistonBody = new ModelRenderer(this, 51, 38); + PistonBody.addBox(0F, 0F, 0F, 3, 1, 2); + PistonBody.setRotationPoint(0F, 19F, -6.2F); + PistonBody.setTextureSize(128, 128); + PistonBody.mirror = true; + setRotation(PistonBody, 0F, 0F, 0F); + } + + public void render(float f5, float rotationScreen, float rotationRod) + { + Base.render(f5); + Battery.render(f5); + BatRing1.render(f5); + BatRing2.render(f5); + BatRing3.render(f5); + BatRing4.render(f5); + LeftPlate.render(f5); + RightPlate.render(f5); + + Panel.rotateAngleX = -0.6108652F + rotationScreen; + Panel.render(f5); + + SignalPole.rotateAngleY = rotationRod; + SignalPole.render(f5); + SignalRec.rotateAngleY = rotationRod; + SignalRec.render(f5); + SignalRing1.rotateAngleY = rotationRod; + SignalRing1.render(f5); + SignalRing2.rotateAngleY = rotationRod; + SignalRing2.render(f5); + + Strut1.render(f5); + Strut2.render(f5); + LeftPlateEnd.render(f5); + RightPlateEnd.render(f5); + BaseBump1.render(f5); + BaseBump2.render(f5); + FrontWireTop.render(f5); + BackWireTop.render(f5); + FrontWireBottom.render(f5); + BackWireBottom.render(f5); + BatteryPole.render(f5); + PistonHead.render(f5); + PistonPole.render(f5); + PistonBody.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/model/tile/ModelSMine.java b/src/main/java/mekanism/defense/client/model/tile/ModelSMine.java new file mode 100644 index 000000000..279ed0b94 --- /dev/null +++ b/src/main/java/mekanism/defense/client/model/tile/ModelSMine.java @@ -0,0 +1,70 @@ +package defense.client.model.tile; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; +import defense.common.Reference; + +@SideOnly(Side.CLIENT) +public class ModelSMine extends ModelMissileBase +{ + public static final ModelSMine INSTANCE = new ModelSMine(); + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "s-mine.png"); + + // fields + ModelRenderer A; + ModelRenderer B; + ModelRenderer C; + + public ModelSMine() + { + textureWidth = 45; + textureHeight = 26; + + A = new ModelRenderer(this, 0, 0); + A.addBox(-5F, 0F, -5F, 10, 2, 10); + A.setRotationPoint(0F, 22F, 0F); + A.setTextureSize(45, 26); + A.mirror = true; + setRotation(A, 0F, 0.7853982F, 0F); + B = new ModelRenderer(this, 0, 14); + B.addBox(-8F, 0F, -2F, 16, 1, 4); + B.setRotationPoint(0F, 23F, 0F); + B.setTextureSize(45, 26); + B.mirror = true; + setRotation(B, 0F, 0.7853982F, 0F); + C = new ModelRenderer(this, 0, 14); + C.addBox(-8F, 0F, -2F, 16, 1, 4); + C.setRotationPoint(0F, 23F, 0F); + C.setTextureSize(45, 26); + C.mirror = true; + setRotation(C, 0F, 2.356194F, 0F); + } + + @Override + public void render(float f5) + { + A.render(f5); + B.render(f5); + C.render(f5); + } + + @Override + public void render(Entity entity, float x, float y, float z, float f1, float f2, float f3) + { + super.render(entity, x, y, z, f1, f2, f3); + this.setRotationAngles(x, y, z, f1, f2, f3, entity); + this.render(f3); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/mekanism/defense/client/render/EmptyRenderer.java b/src/main/java/mekanism/defense/client/render/EmptyRenderer.java new file mode 100644 index 000000000..ce322448e --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/EmptyRenderer.java @@ -0,0 +1,23 @@ +package defense.client.render; + +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +/** Renders nothing for the fake entity. + * + * @author Calclavia */ +public class EmptyRenderer extends Render +{ + @Override + public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) + { + + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } +} diff --git a/src/main/java/mekanism/defense/client/render/RenderUtils.java b/src/main/java/mekanism/defense/client/render/RenderUtils.java new file mode 100644 index 000000000..698cd70bb --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/RenderUtils.java @@ -0,0 +1,114 @@ +package defense.client.render; + +import static org.lwjgl.opengl.GL11.GL_BLEND; +import static org.lwjgl.opengl.GL11.GL_FLAT; +import static org.lwjgl.opengl.GL11.GL_LINE_SMOOTH; +import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA; +import static org.lwjgl.opengl.GL11.GL_POLYGON_SMOOTH; +import static org.lwjgl.opengl.GL11.GL_SMOOTH; +import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA; +import static org.lwjgl.opengl.GL11.glBlendFunc; +import static org.lwjgl.opengl.GL11.glDisable; +import static org.lwjgl.opengl.GL11.glEnable; +import static org.lwjgl.opengl.GL11.glRotatef; +import static org.lwjgl.opengl.GL11.glShadeModel; +import static org.lwjgl.opengl.GL11.glTranslatef; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.client.FMLClientHandler; + +public class RenderUtils +{ + public static final ResourceLocation PARTICLE_RESOURCE = new ResourceLocation("textures/particle/particles.png"); + + public static void setTerrainTexture() + { + setSpriteTexture(0); + } + + public static void setSpriteTexture(ItemStack itemStack) + { + setSpriteTexture(itemStack.getItemSpriteNumber()); + } + + public static void setSpriteTexture(int sprite) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(getSpriteTexture(sprite)); + } + + public static ResourceLocation getSpriteTexture(int sprite) + { + return FMLClientHandler.instance().getClient().renderEngine.getResourceLocation(sprite); + } + + /** Enables blending. */ + public static void enableBlending() + { + glShadeModel(GL_SMOOTH); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + /** Disables blending. */ + public static void disableBlending() + { + glShadeModel(GL_FLAT); + glDisable(GL_LINE_SMOOTH); + glDisable(GL_POLYGON_SMOOTH); + glDisable(GL_BLEND); + } + + public static void enableLighting() + { + RenderHelper.enableStandardItemLighting(); + } + + /** Disables lighting and turns glow on. */ + public static void disableLighting() + { + RenderHelper.disableStandardItemLighting(); + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F); + } + + public static void renderNormalBlockAsItem(Block block, int metadata, RenderBlocks renderer) + { + Tessellator tessellator = Tessellator.instance; + + block.setBlockBoundsForItemRender(); + renderer.setRenderBoundsFromBlock(block); + glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + glTranslatef(0.5F, 0.5F, 0.5F); + } +} diff --git a/src/main/java/mekanism/defense/client/render/block/BlockRenderingHandler.java b/src/main/java/mekanism/defense/client/render/block/BlockRenderingHandler.java new file mode 100644 index 000000000..c1d48e4d7 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/block/BlockRenderingHandler.java @@ -0,0 +1,42 @@ +package defense.client.render.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.block.BlockMachine.MachineData; + +@SideOnly(Side.CLIENT) +public class BlockRenderingHandler implements ISimpleBlockRenderingHandler +{ + public static final int ID = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} + + @Override + public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) + { + return true; + } + + @Override + public int getRenderId() + { + return ID; + } + +} diff --git a/src/main/java/mekanism/defense/client/render/entity/RenderEntityExplosive.java b/src/main/java/mekanism/defense/client/render/entity/RenderEntityExplosive.java new file mode 100644 index 000000000..57ddffc20 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/entity/RenderEntityExplosive.java @@ -0,0 +1,82 @@ +package defense.client.render.entity; + +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; +import defense.common.DefenseTechBlocks; +import defense.common.entity.EntityExplosive; + +@SideOnly(Side.CLIENT) +public class RenderEntityExplosive extends Render +{ + private RenderBlocks blockRenderer = new RenderBlocks(); + + public RenderEntityExplosive() + { + this.shadowSize = 0.5F; + } + + @Override + public void doRender(Entity par1Entity, double x, double y, double z, float par8, float par9) + { + EntityExplosive entityExplosive = (EntityExplosive) par1Entity; + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y, (float) z); + float f2; + + if (entityExplosive.fuse - par9 + 1.0F < 10.0F) + { + f2 = 1.0F - (entityExplosive.fuse - par9 + 1.0F) / 10.0F; + + if (f2 < 0.0F) + { + f2 = 0.0F; + } + + if (f2 > 1.0F) + { + f2 = 1.0F; + } + + f2 *= f2; + f2 *= f2; + float f3 = 1.0F + f2 * 0.3F; + GL11.glScalef(f3, f3, f3); + } + + f2 = (1.0F - (entityExplosive.fuse - par9 + 1.0F) / 100.0F) * 0.8F; + RenderUtils.setTerrainTexture(); + this.blockRenderer.renderBlockAsItem(DefenseTechBlocks.blockExplosive, entityExplosive.explosiveID, entityExplosive.getBrightness(par9)); + + if (entityExplosive.fuse / 5 % 2 == 0) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); + GL11.glColor4f(1.0F, 1.0F, 1.0F, f2); + this.blockRenderer.renderBlockAsItem(DefenseTechBlocks.blockExplosive, entityExplosive.explosiveID, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + GL11.glPopMatrix(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } + +} diff --git a/src/main/java/mekanism/defense/client/render/entity/RenderExplosion.java b/src/main/java/mekanism/defense/client/render/entity/RenderExplosion.java new file mode 100644 index 000000000..6daf1b207 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/entity/RenderExplosion.java @@ -0,0 +1,191 @@ +package defense.client.render.entity; + +import java.util.Random; + +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.Sphere; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; +import defense.common.Reference; +import defense.common.entity.EntityExplosion; +import defense.common.explosive.blast.BlastRedmatter; + +@SideOnly(Side.CLIENT) +public class RenderExplosion extends Render +{ + public static final ResourceLocation TEXTURE_FILE = new ResourceLocation(Reference.DOMAIN, Reference.TEXTURE_PATH + "blackhole.png"); + + public Random random = new Random(); + + @Override + public void doRender(Entity entity, double x, double y, double z, float par8, float par9) + { + EntityExplosion eZhaPin = (EntityExplosion) entity; + + if (eZhaPin.blast != null) + { + // RedM atter Render + if (eZhaPin.blast instanceof BlastRedmatter) + { + Tessellator tessellator = Tessellator.instance; + + /** Draw Sphere */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y, (float) z); + + RenderUtils.enableBlending(); + RenderUtils.disableLighting(); + + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.9f); + + Sphere sphere = new Sphere(); + sphere.draw(5, 32, 32); + + // Enable Lighting/Glow Off + RenderUtils.enableLighting(); + + // Disable Blending + RenderUtils.disableBlending(); + GL11.glPopMatrix(); + + /** Draw Vortex + * + * GL11.glPushMatrix(); GL11.glDepthMask(false); + * + * CalclaviaRenderHelper.enableBlending(); CalclaviaRenderHelper.disableLighting(); + * + * GL11.glTranslated(x, y, z); GL11.glRotatef(-entity.ticksExisted, 0, 1, 0); + * + * float size = 10; float f10 = 1.0F; + * + * int textureSize = 50; float size4 = size * 5; float float_sizeMinus0_01 = + * textureSize - 0.01F; + * + * float x0 = (textureSize + 0.0F) / size4; float x1 = (textureSize + + * float_sizeMinus0_01) / size4; float x2 = (textureSize + 0.0F) / size4; float x3 = + * (textureSize + float_sizeMinus0_01) / size4; + * + * float renderX = (float) x; float renderY = (float) y; float renderZ = (float) z; + * + * this.bindTexture(TEXTURE_FILE); tessellator.startDrawingQuads(); + * tessellator.setBrightness(240); tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1F); + * tessellator.addVertexWithUV(-size, 0, -size, x1, x3); + * tessellator.addVertexWithUV(-size, 0, +size, x1, x2); + * tessellator.addVertexWithUV(+size, 0, +size, x0, x2); + * tessellator.addVertexWithUV(+size, 0, -size, x0, x3); tessellator.draw(); + * + * // Enable Lighting/Glow Off CalclaviaRenderHelper.enableLighting(); + * + * // Disable Blending CalclaviaRenderHelper.disableBlending(); + * + * GL11.glDepthMask(true); GL11.glPopMatrix(); */ + + /** Enderdragon Light */ + float par2 = (entity.ticksExisted); + + while (par2 > 200) + par2 -= 100; + + RenderHelper.disableStandardItemLighting(); + float var41 = (5 + par2) / 200.0F; + float var51 = 0.0F; + + if (var41 > 0.8F) + { + var51 = (var41 - 0.8F) / 0.2F; + } + + Random rand = new Random(432L); + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y, (float) z); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDepthMask(false); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -1.0F, -2.0F); + + for (int i1 = 0; i1 < (var41 + var41 * var41) / 2.0F * 60.0F; ++i1) + { + GL11.glRotatef(rand.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(rand.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(rand.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(rand.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(rand.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(rand.nextFloat() * 360.0F + var41 * 90.0F, 0.0F, 0.0F, 1.0F); + tessellator.startDrawing(6); + float var81 = rand.nextFloat() * 20.0F + 5.0F + var51 * 10.0F; + float var91 = rand.nextFloat() * 2.0F + 1.0F + var51 * 2.0F; + tessellator.setColorRGBA_I(16777215, (int) (255.0F * (1.0F - var51))); + tessellator.addVertex(0.0D, 0.0D, 0.0D); + tessellator.setColorRGBA_I(0, 0); + tessellator.addVertex(-0.866D * var91, var81, -0.5F * var91); + tessellator.addVertex(0.866D * var91, var81, -0.5F * var91); + tessellator.addVertex(0.0D, var81, 1.0F * var91); + tessellator.addVertex(-0.866D * var91, var81, -0.5F * var91); + tessellator.draw(); + } + + GL11.glPopMatrix(); + GL11.glDepthMask(true); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + } + else + { + if (eZhaPin.blast.getRenderModel() != null && eZhaPin.blast.getRenderResource() != null) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y + 1F, (float) z); + GL11.glRotatef(eZhaPin.rotationPitch, 0.0F, 0.0F, 1.0F); + this.bindTexture(eZhaPin.blast.getRenderResource()); + eZhaPin.blast.getRenderModel().render(eZhaPin, (float) x, (float) y, (float) z, par8, par9, 0.0625F); + GL11.glPopMatrix(); + } + } + } + } + + public void drawCircle(double x, double y, double radius, double accuracy) + { + GL11.glDisable(GL11.GL_TEXTURE_2D); + + double da = Math.min((2.0 * Math.asin(1.0 / radius) / accuracy), 10000); + + GL11.glBegin(GL11.GL_TRIANGLE_FAN); + GL11.glVertex2d(x, y); + + for (double a = 0.0; a <= 2 * Math.PI; a += da) + { + GL11.glVertex2d(x + Math.cos(a) * radius, y + Math.sin(a) * radius); + } + + GL11.glVertex2d(x + radius, y); + GL11.glEnd(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } + +} diff --git a/src/main/java/mekanism/defense/client/render/entity/RenderGrenade.java b/src/main/java/mekanism/defense/client/render/entity/RenderGrenade.java new file mode 100644 index 000000000..6d0ff1797 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/entity/RenderGrenade.java @@ -0,0 +1,64 @@ +package defense.client.render.entity; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; +import defense.common.DefenseTechItems; +import defense.common.entity.EntityGrenade; + +@SideOnly(Side.CLIENT) +public class RenderGrenade extends Render +{ + @Override + public void doRender(Entity entity, double x, double y, double z, float par8, float par9) + { + /** Renders the grenade based on the explosive ID. */ + IIcon icon = DefenseTechItems.itemGrenade.getIconFromDamage(((EntityGrenade) entity).explosiveID); + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y + 0.4f, (float) z); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glScalef(0.6F, 0.6F, 0.6F); + RenderUtils.setSpriteTexture(new ItemStack(DefenseTechItems.itemGrenade)); + Tessellator tessellator = Tessellator.instance; + this.renderIcon(tessellator, icon); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + + private void renderIcon(Tessellator par1Tessellator, IIcon icon) + { + float f = icon.getMinU(); + float f1 = icon.getMaxU(); + float f2 = icon.getMinV(); + float f3 = icon.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + par1Tessellator.startDrawingQuads(); + par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); + par1Tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); + par1Tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); + par1Tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); + par1Tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); + par1Tessellator.draw(); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } +} diff --git a/src/main/java/mekanism/defense/client/render/entity/RenderLightBeam.java b/src/main/java/mekanism/defense/client/render/entity/RenderLightBeam.java new file mode 100644 index 000000000..1cb0b8f3e --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/entity/RenderLightBeam.java @@ -0,0 +1,142 @@ +package defense.client.render.entity; + +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.entity.EntityLightBeam; + +@SideOnly(Side.CLIENT) +public class RenderLightBeam extends Render +{ + @Override + public void doRender(Entity par1Entity, double x, double y, double z, float f, float f1) + { + if (this.renderManager == null) + { + this.setRenderManager(RenderManager.instance); + } + + EntityLightBeam entity = ((EntityLightBeam) par1Entity); + + Tessellator tessellator = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(770, 1); + + double ad[] = new double[80]; // Previously + // both + // were 8 + double ad1[] = new double[80]; + double d3 = 0.0D; + double d4 = 0.0D; + + for (int j = 7; j >= 0; j--) + { + ad[j] = d3; + ad1[j] = d4; + } + + for (int i = 0; i < 4; i++) + { + for (int ii = 0; ii < 3; ii++) + { + int l = 7; + int i1 = 0; + + if (ii > 0) + { + l = 7 - ii; + } + if (ii > 0) + { + i1 = l - 2; + } + + double d5 = ad[l] - d3; + double d6 = ad1[l] - d4; + + for (int iii = l; iii >= i1; iii--) + { + double d7 = d5; + double d8 = d6; + + // Weird but cool effects + tessellator.startDrawing(5); + + float f2 = 0.5F; + + // Set color + tessellator.setColorRGBA_F(entity.red, entity.green, entity.blue, 10F); + + double d9 = 0.10000000000000001D + i * 0.20000000000000001D; + + if (ii == 0) + { + d9 *= iii * 0.10000000000000001D + 1.0D; + } + + double d10 = 0.10000000000000001D + i * 0.20000000000000001D; + + if (ii == 0) + { + d10 *= (iii - 1) * 0.10000000000000001D + 1.0D; + } + + for (int iiii = 0; iiii < 5; iiii++) + { + double d11 = (x + 0.5D) - d9; + double d12 = (z + 0.5D) - d9; + + if (iiii == 1 || iiii == 2) + { + d11 += d9 * 2D; + } + + if (iiii == 2 || iiii == 3) + { + d12 += d9 * 2D; + } + + double d13 = (x + 0.5D) - d10; + double d14 = (z + 0.5D) - d10; + + if (iiii == 1 || iiii == 2) + { + d13 += d10 * 2D; + } + if (iiii == 2 || iiii == 3) + { + d14 += d10 * 2D; + } + + tessellator.addVertex(d13 + d5, y + iii * 16, d14 + d6); + tessellator.addVertex(d11 + d7, y + (iii + 1) * 16, d12 + d8); + } + + tessellator.draw(); + } + + } + + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } + +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/render/entity/RenderMissile.java b/src/main/java/mekanism/defense/client/render/entity/RenderMissile.java new file mode 100644 index 000000000..216c31a38 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/entity/RenderMissile.java @@ -0,0 +1,72 @@ +package defense.client.render.entity; + +import java.util.HashMap; + +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IExplosive; +import defense.client.model.missile.ModelMissileBase; +import defense.common.entity.EntityMissile; +import defense.common.entity.EntityMissile.MissileType; +import defense.common.explosion.Explosion; + +@SideOnly(Side.CLIENT) +/** @author Calclavia */ +public class RenderMissile extends Render +{ + public static final HashMap cache = new HashMap(); + + public RenderMissile(float f) + { + this.shadowSize = f; + } + + @Override + public void doRender(Entity entity, double x, double y, double z, float f, float partial) + { + EntityMissile entityMissile = (EntityMissile) entity; + IExplosive e = entityMissile.getExplosiveType(); + + if (e instanceof Explosion) + { + Explosion missile = (Explosion) e; + + GL11.glPushMatrix(); + GL11.glTranslated(x + (entityMissile.motionX * partial), y + (entityMissile.motionY * partial), z + (entityMissile.motionZ * partial)); + GL11.glRotatef(entityMissile.prevRotationYaw + (entityMissile.rotationYaw - entityMissile.prevRotationYaw) * partial - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(entityMissile.prevRotationPitch + (entityMissile.rotationPitch - entityMissile.prevRotationPitch) * partial + 90.0F, 0.0F, 0.0F, 1.0F); + + if (entityMissile.missileType == MissileType.CruiseMissile) + { + GL11.glScalef(0.5f, 0.5f, 0.5f); + } + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(missile.getMissileResource()); + + synchronized (cache) + { + if (!RenderMissile.cache.containsKey(missile)) + { + RenderMissile.cache.put(missile, missile.getMissileModel()); + } + + RenderMissile.cache.get(missile).render(0.0625F); + } + + GL11.glPopMatrix(); + } + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) + { + return null; + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/render/item/RenderItemMachine.java b/src/main/java/mekanism/defense/client/render/item/RenderItemMachine.java new file mode 100644 index 000000000..511f2f027 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/item/RenderItemMachine.java @@ -0,0 +1,156 @@ +package defense.client.render.item; + +import mekanism.common.Tier.BaseTier; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.tile.RenderCruiseLauncher; +import defense.client.render.tile.RenderEmpTower; +import defense.client.render.tile.RenderLauncherBase; +import defense.client.render.tile.RenderLauncherFrame; +import defense.client.render.tile.RenderLauncherScreen; +import defense.client.render.tile.RenderRadarStation; +import defense.common.block.BlockMachine.MachineData; +import defense.common.item.ItemBlockMachine; + +@SideOnly(Side.CLIENT) +public class RenderItemMachine implements IItemRenderer +{ + private final RenderItem renderItem = (RenderItem)RenderManager.instance.getEntityClassRenderObject(EntityItem.class); + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return true; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return true; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + RenderBlocks renderBlocks = (RenderBlocks)data[0]; + int metadata = item.getItemDamage(); + + if(type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) + { + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + GL11.glPushMatrix(); + GL11.glDisable(GL11.GL_CULL_FACE); + + if (metadata == MachineData.LauncherBase.ordinal()) + { + BaseTier tier = ((ItemBlockMachine)item.getItem()).getBaseTier(item); + + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glScalef(0.4f, 0.4f, 0.4f); + + if (tier == BaseTier.BASIC) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherBase.TEXTURE_FILE_0); + RenderLauncherBase.modelBase0.render(0.0625F); + RenderLauncherBase.modelRail0.render(0.0625F); + } + else if (tier == BaseTier.ADVANCED) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherBase.TEXTURE_FILE_1); + + RenderLauncherBase.modelBase1.render(0.0625F); + RenderLauncherBase.modelRail1.render(0.0625F); + GL11.glRotatef(180F, 0F, 180F, 1.0F); + RenderLauncherBase.modelRail1.render(0.0625F); + } + else if (tier == BaseTier.ELITE) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherBase.TEXTURE_FILE_2); + RenderLauncherBase.modelBase2.render(0.0625F); + RenderLauncherBase.modelRail2.render(0.0625F); + GL11.glRotatef(180F, 0F, 180F, 1.0F); + RenderLauncherBase.modelRail2.render(0.0625F); + } + } + else if (metadata == MachineData.LauncherScreen.ordinal()) + { + BaseTier tier = ((ItemBlockMachine)item.getItem()).getBaseTier(item); + GL11.glTranslatef(0f, 0.9f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glRotatef(180f, 0f, 180f, 1f); + + if (tier == BaseTier.BASIC) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherScreen.TEXTURE_FILE_0); + RenderLauncherScreen.model0.render(0.0625F); + } + else if (tier == BaseTier.ADVANCED) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherScreen.TEXTURE_FILE_1); + RenderLauncherScreen.model1.render(0.0625F); + } + else if (tier == BaseTier.ELITE) + { + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherScreen.TEXTURE_FILE_2); + RenderLauncherScreen.model2.render(0.0625F); + } + } + else if (metadata == MachineData.LauncherFrame.ordinal()) + { + BaseTier tier = ((ItemBlockMachine)item.getItem()).getBaseTier(item); + GL11.glTranslatef(0f, -0.1f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glScalef(0.8f, 0.4f, 0.8f); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderLauncherFrame.TEXTURE_FILE); + + RenderLauncherFrame.MODEL.render(0.0625F); + } + else if (metadata == MachineData.RadarStation.ordinal()) + { + GL11.glTranslatef(0f, 1f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glRotatef(180f, 0, 1, 0); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderRadarStation.TEXTURE_FILE); + + RenderRadarStation.MODEL.render(0.0625f, 0, 1.2f); + } + else if (metadata == MachineData.EmpTower.ordinal()) + { + GL11.glTranslatef(0f, 0.3f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glScalef(0.6f, 0.6f, 0.6f); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderEmpTower.TEXTURE_FILE); + + RenderEmpTower.MODEL.render(0, 0.0625F); + } + else if (metadata == MachineData.CruiseLauncher.ordinal()) + { + GL11.glTranslatef(0f, 0.4f, 0f); + GL11.glRotatef(180f, 0f, 0f, 1f); + GL11.glScalef(0.55f, 0.5f, 0.55f); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderCruiseLauncher.TEXTURE_FILE); + + RenderCruiseLauncher.MODEL0.render(0.0625F); + RenderCruiseLauncher.MODEL1.render(0.0625F); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/mekanism/defense/client/render/item/RenderItemMissile.java b/src/main/java/mekanism/defense/client/render/item/RenderItemMissile.java new file mode 100644 index 000000000..be6cc57a2 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/item/RenderItemMissile.java @@ -0,0 +1,99 @@ +package defense.client.render.item; + +import java.util.HashMap; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.IItemRenderer; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; +import defense.client.render.entity.RenderMissile; +import defense.common.explosion.Explosion; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.item.ItemMissile; + +@SideOnly(Side.CLIENT) +public class RenderItemMissile implements IItemRenderer +{ + HashMap cache = new HashMap(); + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return this.shouldUseRenderHelper(type, item, null); + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return item.getItem() instanceof ItemMissile; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + if (this.shouldUseRenderHelper(type, item, null)) + { + Explosion missile = (Explosion) ExplosiveRegistry.get(item.getItemDamage()); + + float scale = 0.7f; + float right = 0f; + + if (type == ItemRenderType.INVENTORY) + { + scale = 0.4f; + right = 0.15f; + + if (missile.getTier() == 2 || !missile.hasBlockForm()) + { + scale = scale / 1.5f; + } + else if (missile.getTier() == 3) + { + scale = scale / 1.7f; + right = 0.5f; + } + else if (missile.getTier() == 4) + { + scale = scale / 1.4f; + right = 0.2f; + } + + GL11.glTranslatef(right, 0f, 0f); + } + + if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) + { + GL11.glTranslatef(1.15f, 1f, 0.5f); + GL11.glRotatef(180, 0, 0, 1f); + } + else + { + GL11.glRotatef(-90, 0, 0, 1f); + } + + if (type == ItemRenderType.ENTITY) + { + scale = scale / 1.5f; + } + + GL11.glScalef(scale, scale, scale); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(missile.getMissileResource()); + + synchronized (RenderMissile.cache) + { + if (!RenderMissile.cache.containsKey(missile)) + { + RenderMissile.cache.put(missile, missile.getMissileModel()); + } + + RenderMissile.cache.get(missile).render(0.0625F); + } + } + } +} diff --git a/src/main/java/mekanism/defense/client/render/item/RenderRocketLauncher.java b/src/main/java/mekanism/defense/client/render/item/RenderRocketLauncher.java new file mode 100644 index 000000000..a65a5b805 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/item/RenderRocketLauncher.java @@ -0,0 +1,72 @@ +package defense.client.render.item; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.model.AdvancedModelLoader; +import net.minecraftforge.client.model.IModelCustom; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.DefenseTechItems; +import defense.common.Reference; + +@SideOnly(Side.CLIENT) +public class RenderRocketLauncher implements IItemRenderer +{ + private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PREFIX + "rocketLauncher.png"); + private static final IModelCustom MODEL = AdvancedModelLoader.loadModel(new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PREFIX + "rocketLauncher.obj")); + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) + { + return item.getItem() == DefenseTechItems.itemRocketLauncher; + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) + { + return item.getItem() == DefenseTechItems.itemRocketLauncher; + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) + { + GL11.glPushMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + + if (type == ItemRenderType.INVENTORY) + { + GL11.glTranslatef(-0.1f, 0.1f, 0f); + GL11.glRotatef(90, 0, 1, 0); + GL11.glScalef(0.75f, 0.75f, 0.75f); + } + else if (type == ItemRenderType.EQUIPPED) + { + GL11.glRotatef(-75, 1, 0, 0); + GL11.glRotatef(30, 0, 0, 1); + GL11.glRotatef(20, 0, 1, 0); + GL11.glTranslatef(0.2f, -0.8f, -0f); + GL11.glScalef(2, 2, 2); + } + else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) + { + GL11.glTranslatef(-0.4f, 0.5f, 1f); + GL11.glRotatef(-30, 0, 1, 0); + GL11.glRotatef(13, 1, 0, 0); + GL11.glScaled(1.8f, 1.8f, 1.8f); + } + else if (type == ItemRenderType.ENTITY) + { + GL11.glTranslatef(0, 0.3f, 0); + } + + MODEL.renderAll(); + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/mekanism/defense/client/render/particle/FXAntimatterPartical.java b/src/main/java/mekanism/defense/client/render/particle/FXAntimatterPartical.java new file mode 100644 index 000000000..9d6963ad5 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/particle/FXAntimatterPartical.java @@ -0,0 +1,109 @@ +package defense.client.render.particle; + +import mekanism.api.Pos3D; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; +import defense.common.Reference; + +@SideOnly(Side.CLIENT) +public class FXAntimatterPartical extends EntityFX +{ + public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.TEXTURE_PATH + "antimatter.png"); + + float antimatterParticleScale; + + public FXAntimatterPartical(World par1World, Pos3D position, double par8, double par10, double par12, double distance) + { + this(par1World, position, par8, par10, par12, 1.0F, distance); + } + + public FXAntimatterPartical(World par1World, Pos3D position, double par8, double par10, double par12, float par14, double distance) + { + super(par1World, position.xPos, position.yPos, position.zPos, 0.0D, 0.0D, 0.0D); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += par8; + this.motionY += par10; + this.motionZ += par12; + this.particleRed = this.particleGreen = this.particleBlue = (float) (Math.random() * 0.30000001192092896D); + this.particleScale *= 0.75F; + this.particleScale *= par14; + this.antimatterParticleScale = this.particleScale; + this.particleMaxAge = (int) (10D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int) (this.particleMaxAge * par14); + this.renderDistanceWeight = distance; + this.noClip = false; + } + + @Override + public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + float agescale = 0.0F; + agescale = this.particleAge / (this.particleMaxAge / 2); + if (agescale > 1.0F) + agescale = 2.0F - agescale; + + this.particleScale = (this.antimatterParticleScale * agescale); + + tessellator.draw(); + GL11.glPushMatrix(); + + GL11.glDepthMask(false); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 1); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.75F); + + float f10 = 0.5F * this.particleScale; + float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - interpPosX); + float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - interpPosY); + float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - interpPosZ); + + tessellator.startDrawingQuads(); + + tessellator.setBrightness(240); + + tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 0.5F); + tessellator.addVertexWithUV(f11 - par3 * f10 - par5 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, 0.0D, 1.0D); + tessellator.addVertexWithUV(f11 - par3 * f10 + par5 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, 1.0D, 1.0D); + tessellator.addVertexWithUV(f11 + par3 * f10 + par5 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, 1.0D, 0.0D); + tessellator.addVertexWithUV(f11 + par3 * f10 - par5 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, 0.0D, 0.0D); + + tessellator.draw(); + + GL11.glDisable(3042); + GL11.glDepthMask(true); + + GL11.glPopMatrix(); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderUtils.PARTICLE_RESOURCE); + + tessellator.startDrawingQuads(); + } + + /** Called to update the entity's position/logic. */ + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + return; + } + } +} diff --git a/src/main/java/mekanism/defense/client/render/particle/FXElectricBolt.java b/src/main/java/mekanism/defense/client/render/particle/FXElectricBolt.java new file mode 100644 index 000000000..bf7388e8e --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/particle/FXElectricBolt.java @@ -0,0 +1,490 @@ +package defense.client.render.particle; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Random; + +import mekanism.api.Pos3D; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; +import defense.common.Reference; + +/** An effect that renders a electrical bolt from one position to another. Inspired by Azanor's + * lightning wand. + * + * @author Calclavia */ +@SideOnly(Side.CLIENT) +public class FXElectricBolt extends EntityFX +{ + private static final ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.TEXTURE_PATH + "fadedSphere.png"); + + /** The width of the electrical bolt. */ + private float boltWidth = 0.05f; + /** Electric Bolt's start and end positions; */ + private Pos3D start; + private Pos3D end; + /** An array of the segments of the bolt. */ + private ArrayList segments = new ArrayList(); + private HashMap splitparents = new HashMap(); + /** Determines how complex the bolt is. */ + public float complexity; + /** The maximum length of the bolt */ + public double length; + public int segmentCount; + private int maxSplitID = 0; + private Random rand; + /** Are the segments calculated? */ + private boolean isCalculated; + + public FXElectricBolt(World world, Pos3D startVec, Pos3D targetVec, long seed) + { + super(world, startVec.xPos, startVec.yPos, startVec.zPos, 0.0D, 0.0D, 0.0D); + + if (seed == 0) + { + this.rand = new Random(); + } + else + { + this.rand = new Random(seed); + } + + this.start = startVec; + this.end = targetVec; + /** By default, we do an electrical color */ + this.particleAge = (3 + this.rand.nextInt(3) - 1); + this.particleRed = 0.55f + (this.rand.nextFloat() * 0.1f); + this.particleGreen = 0.7f + (this.rand.nextFloat() * 0.1f); + this.particleBlue = 1f; + this.segmentCount = 1; + this.length = this.start.distance(this.end); + this.particleMaxAge = (3 + this.rand.nextInt(3) - 1); + this.complexity = 2f; + + /** Calculate all required segments of the entire bolt. */ + this.segments.add(new BoltSegment(this.start, this.end)); + this.recalculateDifferences(); + this.split(2, this.length * this.complexity / 8.0F, 0.7F, 0.1F, 45.0F); + this.split(2, this.length * this.complexity / 12.0F, 0.5F, 0.1F, 50.0F); + this.split(2, this.length * this.complexity / 17.0F, 0.5F, 0.1F, 55.0F); + this.split(2, this.length * this.complexity / 23.0F, 0.5F, 0.1F, 60.0F); + this.split(2, this.length * this.complexity / 30.0F, 0.0F, 0.0F, 0.0F); + this.split(2, this.length * this.complexity / 34.0F, 0.0F, 0.0F, 0.0F); + this.split(2, this.length * this.complexity / 40.0F, 0.0F, 0.0F, 0.0F); + this.finalizeBolt(); + } + + public FXElectricBolt setMultiplier(float m) + { + this.complexity = m; + return this; + } + + public FXElectricBolt setWidth(float m) + { + this.boltWidth = m; + return this; + } + + public FXElectricBolt setColor(float r, float g, float b) + { + this.particleRed = r; + this.particleGreen = g; + this.particleBlue = b; + return this; + } + + /** Slits a large segment into multiple smaller ones. + * + * @param splitAmount - The amount of splits + * @param offset - The multiplier scale for the offset. + * @param splitChance - The chance of creating a split. + * @param splitLength - The length of each split. + * @param splitAngle - The angle of the split. */ + public void split(int splitAmount, double offset, float splitChance, float splitLength, float splitAngle) + { + if (!this.isCalculated) + { + /** Temporarily store old segments in a new array */ + ArrayList oldSegments = this.segments; + this.segments = new ArrayList(); + /** Previous segment */ + BoltSegment prev = null; + + for (BoltSegment segment : oldSegments) + { + prev = segment.prevSegment; + Pos3D subSegment = segment.difference.clone().scale(1.0F / splitAmount); + + /** Creates an array of new bolt points. The first and last points of the bolts are + * the respected start and end points of the current segment. */ + BoltPoint[] newPoints = new BoltPoint[splitAmount + 1]; + Pos3D startPoint = segment.startBolt.point; + newPoints[0] = segment.startBolt; + newPoints[splitAmount] = segment.endBolt; + + for (int i = 1; i < splitAmount; i++) + { + Pos3D offsetVec = segment.difference.getPerpendicular().rotate(this.rand.nextFloat() * 360.0F, segment.difference).scale((this.rand.nextFloat() - 0.5F) * offset); + Pos3D basepoint = startPoint.clone().translate(subSegment.clone().scale(i)); + newPoints[i] = new BoltPoint(basepoint, offsetVec); + } + + for (int i = 0; i < splitAmount; i++) + { + BoltSegment next = new BoltSegment(newPoints[i], newPoints[(i + 1)], segment.weight, segment.segmentID * splitAmount + i, segment.splitID); + next.prevSegment = prev; + + if (prev != null) + { + prev.nextSegment = next; + } + + if ((i != 0) && (this.rand.nextFloat() < splitChance)) + { + Pos3D splitrot = next.difference.xCrossProduct().rotate(this.rand.nextFloat() * 360.0F, next.difference); + Pos3D diff = next.difference.clone().rotate((this.rand.nextFloat() * 0.66F + 0.33F) * splitAngle, splitrot).scale(splitLength); + this.maxSplitID += 1; + this.splitparents.put(this.maxSplitID, next.splitID); + BoltSegment split = new BoltSegment(newPoints[i], new BoltPoint(newPoints[(i + 1)].basePoint, newPoints[(i + 1)].offSet.clone().translate(diff)), segment.weight / 2.0F, next.segmentID, this.maxSplitID); + split.prevSegment = prev; + this.segments.add(split); + } + + prev = next; + this.segments.add(next); + } + + if (segment.nextSegment != null) + { + segment.nextSegment.prevSegment = prev; + } + } + + this.segmentCount *= splitAmount; + } + } + + public void finalizeBolt() + { + if (!this.isCalculated) + { + this.isCalculated = true; + recalculateDifferences(); + + Collections.sort(this.segments, new Comparator() + { + public int compare(BoltSegment o1, BoltSegment o2) + { + return Float.compare(o2.weight, o1.weight); + } + + @Override + public int compare(Object obj, Object obj1) + { + return compare((BoltSegment) obj, (BoltSegment) obj1); + } + }); + } + } + + private static Pos3D getRelativeViewVector(Pos3D pos) + { + EntityPlayer renderentity = Minecraft.getMinecraft().thePlayer; + return new Pos3D((float) renderentity.posX - pos.xPos, (float) renderentity.posY - pos.yPos, (float) renderentity.posZ - pos.zPos); + } + + private void recalculateDifferences() + { + HashMap lastActiveSegment = new HashMap(); + + Collections.sort(this.segments, new Comparator() + { + public int compare(BoltSegment o1, BoltSegment o2) + { + int comp = Integer.valueOf(o1.splitID).compareTo(Integer.valueOf(o2.splitID)); + if (comp == 0) + { + return Integer.valueOf(o1.segmentID).compareTo(Integer.valueOf(o2.segmentID)); + } + return comp; + } + + @Override + public int compare(Object obj, Object obj1) + { + return compare((BoltSegment) obj, (BoltSegment) obj1); + } + }); + + int lastSplitCalc = 0; + int lastActiveSeg = 0; + + for (BoltSegment segment : this.segments) + { + if (segment != null) + { + if (segment.splitID > lastSplitCalc) + { + lastActiveSegment.put(lastSplitCalc, lastActiveSeg); + lastSplitCalc = segment.splitID; + lastActiveSeg = lastActiveSegment.get(this.splitparents.get(segment.splitID)).intValue(); + } + + lastActiveSeg = segment.segmentID; + } + } + + lastActiveSegment.put(lastSplitCalc, lastActiveSeg); + lastSplitCalc = 0; + lastActiveSeg = lastActiveSegment.get(0).intValue(); + BoltSegment segment; + + for (Iterator iterator = this.segments.iterator(); iterator.hasNext(); segment.calculateEndDifferences()) + { + segment = iterator.next(); + + if (lastSplitCalc != segment.splitID) + { + lastSplitCalc = segment.splitID; + lastActiveSeg = lastActiveSegment.get(segment.splitID); + } + + if (segment.segmentID > lastActiveSeg) + { + iterator.remove(); + } + } + } + + /** Renders the bolts. */ + private void renderBolt(Tessellator tessellator, float partialframe, float cosyaw, float cospitch, float sinyaw, float cossinpitch, int pass) + { + Pos3D playerVector = new Pos3D(sinyaw * -cospitch, -cossinpitch / cosyaw, cosyaw * cospitch); + float voltage = this.particleAge >= 0 ? ((float) this.particleAge / (float) this.particleMaxAge) : 0.0F; + + float mainAlpha = 1.0F; + + if (pass == 0) + { + mainAlpha = (1.0F - voltage) * 0.4F; + } + else + { + mainAlpha = 1.0F - voltage * 0.5F; + } + + int renderlength = (int) ((this.particleAge + partialframe + (int) (this.length * 3.0F)) / (int) (this.length * 3.0F) * this.segmentCount); + + for (BoltSegment renderSegment : this.segments) + { + if (renderSegment != null && renderSegment.segmentID <= renderlength) + { + float width = (float) (this.boltWidth * (getRelativeViewVector(renderSegment.startBolt.point).getMagnitude() / 5.0F + 1.0F) * (1.0F + renderSegment.weight) * 0.5F); + Pos3D diff1 = playerVector.crossProduct(renderSegment.prevDiff).scale(width / renderSegment.sinPrev); + Pos3D diff2 = playerVector.crossProduct(renderSegment.nextDiff).scale(width / renderSegment.sinNext); + Pos3D startvec = renderSegment.startBolt.point; + Pos3D endvec = renderSegment.endBolt.point; + float rx1 = (float) (startvec.xPos - interpPosX); + float ry1 = (float) (startvec.yPos - interpPosY); + float rz1 = (float) (startvec.zPos - interpPosZ); + float rx2 = (float) (endvec.xPos - interpPosX); + float ry2 = (float) (endvec.yPos - interpPosY); + float rz2 = (float) (endvec.zPos - interpPosZ); + tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, mainAlpha * renderSegment.weight); + tessellator.addVertexWithUV(rx2 - diff2.xPos, ry2 - diff2.yPos, rz2 - diff2.zPos, 0.5D, 0.0D); + tessellator.addVertexWithUV(rx1 - diff1.xPos, ry1 - diff1.yPos, rz1 - diff1.zPos, 0.5D, 0.0D); + tessellator.addVertexWithUV(rx1 + diff1.xPos, ry1 + diff1.yPos, rz1 + diff1.zPos, 0.5D, 1.0D); + tessellator.addVertexWithUV(rx2 + diff2.xPos, ry2 + diff2.yPos, rz2 + diff2.zPos, 0.5D, 1.0D); + + if (renderSegment.nextSegment == null) + { + Pos3D roundend = renderSegment.endBolt.point.clone().translate(renderSegment.difference.clone().normalize().scale(width)); + float rx3 = (float) (roundend.xPos - interpPosX); + float ry3 = (float) (roundend.yPos - interpPosY); + float rz3 = (float) (roundend.zPos - interpPosZ); + tessellator.addVertexWithUV(rx3 - diff2.xPos, ry3 - diff2.yPos, rz3 - diff2.zPos, 0.0D, 0.0D); + tessellator.addVertexWithUV(rx2 - diff2.xPos, ry2 - diff2.yPos, rz2 - diff2.zPos, 0.5D, 0.0D); + tessellator.addVertexWithUV(rx2 + diff2.xPos, ry2 + diff2.yPos, rz2 + diff2.zPos, 0.5D, 1.0D); + tessellator.addVertexWithUV(rx3 + diff2.xPos, ry3 + diff2.yPos, rz3 + diff2.zPos, 0.0D, 1.0D); + } + + if (renderSegment.prevSegment == null) + { + Pos3D roundend = renderSegment.startBolt.point.clone().diff(renderSegment.difference.clone().normalize().scale(width)); + float rx3 = (float) (roundend.xPos - interpPosX); + float ry3 = (float) (roundend.yPos - interpPosY); + float rz3 = (float) (roundend.zPos - interpPosZ); + tessellator.addVertexWithUV(rx1 - diff1.xPos, ry1 - diff1.yPos, rz1 - diff1.zPos, 0.5D, 0.0D); + tessellator.addVertexWithUV(rx3 - diff1.xPos, ry3 - diff1.yPos, rz3 - diff1.zPos, 0.0D, 0.0D); + tessellator.addVertexWithUV(rx3 + diff1.xPos, ry3 + diff1.yPos, rz3 + diff1.zPos, 0.0D, 1.0D); + tessellator.addVertexWithUV(rx1 + diff1.xPos, ry1 + diff1.yPos, rz1 + diff1.zPos, 0.5D, 1.0D); + } + } + } + } + + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + } + + @Override + public void renderParticle(Tessellator tessellator, float partialframe, float cosYaw, float cosPitch, float sinYaw, float sinSinPitch, float cosSinPitch) + { + EntityPlayer renderentity = Minecraft.getMinecraft().thePlayer; + int visibleDistance = 100; + + if (!Minecraft.getMinecraft().gameSettings.fancyGraphics) + { + visibleDistance /= 2; + } + + if (renderentity.getDistance(this.posX, this.posY, this.posZ) > visibleDistance) + { + return; + } + + tessellator.draw(); + GL11.glPushMatrix(); + + GL11.glDepthMask(false); + GL11.glEnable(3042); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE); + /** Render the actual bolts. */ + tessellator.startDrawingQuads(); + tessellator.setBrightness(15728880); + this.renderBolt(tessellator, partialframe, cosYaw, cosPitch, sinYaw, cosSinPitch, 0); + tessellator.draw(); + + // GL11.glBlendFunc(770, 771); + + tessellator.startDrawingQuads(); + tessellator.setBrightness(15728880); + this.renderBolt(tessellator, partialframe, cosYaw, cosPitch, sinYaw, cosSinPitch, 1); + tessellator.draw(); + + GL11.glDisable(3042); + GL11.glDepthMask(true); + GL11.glPopMatrix(); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderUtils.PARTICLE_RESOURCE); + + tessellator.startDrawingQuads(); + } + + @Override + public boolean shouldRenderInPass(int pass) + { + return pass == 2; + } + + public class BoltPoint + { + Pos3D point; + Pos3D basePoint; + Pos3D offSet; + + public BoltPoint(Pos3D basePoint, Pos3D offSet) + { + this.point = basePoint.clone().translate(offSet); + this.basePoint = basePoint; + this.offSet = offSet; + } + } + + public class BoltSegment + { + public BoltPoint startBolt; + public BoltPoint endBolt; + public Pos3D difference; + public BoltSegment prevSegment; + public BoltSegment nextSegment; + public Pos3D nextDiff; + public Pos3D prevDiff; + public float sinPrev; + public float sinNext; + /** The order of important */ + public float weight; + public int segmentID; + public int splitID; + + public BoltSegment(BoltPoint startBolt, BoltPoint endBolt, float weight, int segmentID, int splitID) + { + this.startBolt = startBolt; + this.endBolt = endBolt; + this.weight = weight; + this.segmentID = segmentID; + this.splitID = splitID; + this.calculateDifference(); + } + + public BoltSegment(Pos3D start, Pos3D end) + { + this(new BoltPoint(start, new Pos3D(0.0D, 0.0D, 0.0D)), new BoltPoint(end, new Pos3D(0.0D, 0.0D, 0.0D)), 1.0F, 0, 0); + } + + public void calculateDifference() + { + this.difference = this.endBolt.point.clone().diff(this.startBolt.point); + } + + public void calculateEndDifferences() + { + if (this.prevSegment != null) + { + Pos3D prevdiffnorm = this.prevSegment.difference.clone().normalize(); + Pos3D thisdiffnorm = this.difference.clone().normalize(); + this.prevDiff = thisdiffnorm.translate(prevdiffnorm).normalize(); + this.sinPrev = ((float) Math.sin(Pos3D.anglePreNorm(thisdiffnorm, prevdiffnorm.scale(-1.0F)) / 2.0F)); + } + else + { + this.prevDiff = this.difference.clone().normalize(); + this.sinPrev = 1.0F; + } + if (this.nextSegment != null) + { + Pos3D nextdiffnorm = this.nextSegment.difference.clone().normalize(); + Pos3D thisdiffnorm = this.difference.clone().normalize(); + this.nextDiff = thisdiffnorm.translate(nextdiffnorm).normalize(); + this.sinNext = ((float) Math.sin(Pos3D.anglePreNorm(thisdiffnorm, nextdiffnorm.scale(-1.0F)) / 2.0F)); + } + else + { + this.nextDiff = this.difference.clone().normalize(); + this.sinNext = 1.0F; + } + } + + @Override + public String toString() + { + return this.startBolt.point.toString() + " " + this.endBolt.point.toString(); + } + } + +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/render/particle/FXElectricBoltSpawner.java b/src/main/java/mekanism/defense/client/render/particle/FXElectricBoltSpawner.java new file mode 100644 index 000000000..56221aa5b --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/particle/FXElectricBoltSpawner.java @@ -0,0 +1,44 @@ +package defense.client.render.particle; + +import java.util.Random; + +import mekanism.api.Pos3D; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.world.World; + +/** A spawner used to spawn in multiple electrical bolts for a specific duration. */ +public class FXElectricBoltSpawner extends EntityFX +{ + private Pos3D start; + private Pos3D end; + + public FXElectricBoltSpawner(World world, Pos3D startVec, Pos3D targetVec, long seed, int duration) + { + super(world, startVec.xPos, startVec.yPos, startVec.zPos, 0.0D, 0.0D, 0.0D); + + if (seed == 0) + { + this.rand = new Random(); + } + else + { + this.rand = new Random(seed); + } + + this.start = startVec; + this.end = targetVec; + this.particleMaxAge = duration; + } + + @Override + public void onUpdate() + { + Minecraft.getMinecraft().effectRenderer.addEffect(new FXElectricBolt(this.worldObj, this.start, this.end, 0)); + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + } + +} diff --git a/src/main/java/mekanism/defense/client/render/particle/FXEnderPortalPartical.java b/src/main/java/mekanism/defense/client/render/particle/FXEnderPortalPartical.java new file mode 100644 index 000000000..0b6d615eb --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/particle/FXEnderPortalPartical.java @@ -0,0 +1,29 @@ +package defense.client.render.particle; + +import mekanism.api.Pos3D; +import net.minecraft.client.particle.EntityPortalFX; +import net.minecraft.world.World; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class FXEnderPortalPartical extends EntityPortalFX +{ + public FXEnderPortalPartical(World par1World, Pos3D position, float red, float green, float blue, float scale, double distance) + { + super(par1World, position.xPos, position.yPos, position.zPos, 0, 0, 0); + this.particleScale = scale; + try + { + ReflectionHelper.setPrivateValue(EntityPortalFX.class, this, this.particleScale, 0); + } + catch (Exception e) + { + FMLLog.warning("Failed to correctly spawn portal effects."); + } + this.renderDistanceWeight = distance; + } + +} diff --git a/src/main/java/mekanism/defense/client/render/particle/FXShockWave.java b/src/main/java/mekanism/defense/client/render/particle/FXShockWave.java new file mode 100644 index 000000000..9659a554f --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/particle/FXShockWave.java @@ -0,0 +1,73 @@ +package defense.client.render.particle; + +import mekanism.api.Pos3D; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.Sphere; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; + +@SideOnly(Side.CLIENT) +public class FXShockWave extends EntityFX +{ + public FXShockWave(World par1World, Pos3D position, float par8, float par10, float par12, double distance) + { + this(par1World, position, par8, par10, par12, 1.0F, distance); + } + + public FXShockWave(World par1World, Pos3D position, float r, float g, float b, float size, double distance) + { + super(par1World, position.xPos, position.yPos, position.zPos, 0.0D, 0.0D, 0.0D); + this.particleRed = r; + this.particleGreen = g; + this.particleBlue = b; + this.particleScale = size; + this.particleMaxAge = (int) (10D / (Math.random() * 0.8D + 0.2D)); + this.particleMaxAge = (int) (this.particleMaxAge * size); + this.renderDistanceWeight = distance; + this.noClip = false; + } + + @Override + public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + GL11.glPushMatrix(); + GL11.glTranslated(this.posX, this.posY, this.posZ); + + RenderUtils.enableBlending(); + RenderUtils.disableLighting(); + + GL11.glColor4f(this.particleRed / 255, this.particleGreen / 255, this.particleBlue / 255, 0.5f); + + Sphere sphere = new Sphere(); + sphere.draw(this.particleScale, 32, 32); + + // Enable Lighting/Glow Off + RenderUtils.enableLighting(); + + // Disable Blending + RenderUtils.disableBlending(); + GL11.glPopMatrix(); + } + + /** Called to update the entity's position/logic. */ + @Override + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.particleScale++; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + return; + } + } +} diff --git a/src/main/java/mekanism/defense/client/render/particle/FXSmoke.java b/src/main/java/mekanism/defense/client/render/particle/FXSmoke.java new file mode 100644 index 000000000..191cf42a3 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/particle/FXSmoke.java @@ -0,0 +1,31 @@ +package defense.client.render.particle; + +import mekanism.api.Pos3D; +import net.minecraft.client.particle.EntitySmokeFX; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class FXSmoke extends EntitySmokeFX +{ + public FXSmoke(World par1World, Pos3D position, float red, float green, float blue, float scale, double distance) + { + super(par1World, position.xPos, position.yPos, position.zPos, 0, 0, 0, scale); + this.renderDistanceWeight = distance; + this.particleRed = red; + this.particleBlue = blue; + this.particleGreen = green; + + float colorVarient = (float) (Math.random() * 0.90000001192092896D); + this.particleRed *= colorVarient; + this.particleBlue *= colorVarient; + this.particleGreen *= colorVarient; + } + + public FXSmoke setAge(int age) + { + this.particleMaxAge = age; + return this; + } +} diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderBombBlock.java b/src/main/java/mekanism/defense/client/render/tile/RenderBombBlock.java new file mode 100644 index 000000000..3b5681a6e --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderBombBlock.java @@ -0,0 +1,109 @@ +package defense.client.render.tile; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelSMine; +import defense.client.render.RenderUtils; +import defense.common.DefenseTech; +import defense.common.Reference; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.tile.TileExplosive; + +@SideOnly(Side.CLIENT) +public class RenderBombBlock extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler +{ + public static final ResourceLocation TEXTURE_FILE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "s-mine.png"); + public static final int ID = RenderingRegistry.getNextAvailableRenderId(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) + { + if(modelID == ID) + { + if(metadata == Explosive.sMine.getID()) + { + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 1.5F, 0.0F); + GL11.glRotatef(180f, 0f, 0f, 1f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE); + ModelSMine.INSTANCE.render(0.0625F); + GL11.glPopMatrix(); + } + else { + try { + RenderUtils.renderNormalBlockAsItem(block, metadata, renderer); + } catch(Exception e) { + DefenseTech.LOGGER.severe("Explosive Rendering Crash with: " + block + " and metadata: " + metadata); + e.printStackTrace(); + } + } + } + } + + @Override + public boolean renderWorldBlock(IBlockAccess iBlockAccess, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) + { + if(modelID == ID) + { + TileEntity tileEntity = iBlockAccess.getTileEntity(x, y, z); + + if(tileEntity instanceof TileExplosive) + { + Explosive explosive = ExplosiveRegistry.get(((TileExplosive) tileEntity).explosiveID); + + if(!(explosive.getBlockModel() != null && explosive.getBlockResource() != null)) + { + renderer.renderStandardBlock(block, x, y, z); + return true; + } + } + } + + return false; + } + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) + { + if(tileEntity instanceof TileExplosive) + { + Explosive explosive = ExplosiveRegistry.get(((TileExplosive)tileEntity).explosiveID); + + if(explosive != null && explosive.getBlockModel() != null && explosive.getBlockResource() != null) + { + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5f, y + 1.5f, z + 0.5f); + GL11.glRotatef(180f, 0f, 0f, 1f); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(explosive.getBlockResource()); + explosive.getBlockModel().render(0.0625f); + RenderUtils.setTerrainTexture(); + GL11.glPopMatrix(); + } + } + } + + @Override + public boolean shouldRender3DInInventory(int modelId) + { + return true; + } + + @Override + public int getRenderId() + { + return ID; + } +} diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderCruiseLauncher.java b/src/main/java/mekanism/defense/client/render/tile/RenderCruiseLauncher.java new file mode 100644 index 000000000..d53f3c16c --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderCruiseLauncher.java @@ -0,0 +1,42 @@ +package defense.client.render.tile; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelCruiseLauncherBase; +import defense.client.model.tile.ModelCruiseLauncherTurret; +import defense.common.Reference; +import defense.common.tile.TileCruiseLauncher; + +@SideOnly(Side.CLIENT) +public class RenderCruiseLauncher extends TileEntitySpecialRenderer +{ + public static final ResourceLocation TEXTURE_FILE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "cruise_launcher.png"); + + public static final ModelCruiseLauncherBase MODEL0 = new ModelCruiseLauncherBase(); + public static final ModelCruiseLauncherTurret MODEL1 = new ModelCruiseLauncherTurret(); + + public void renderModelAt(TileCruiseLauncher tileEntity, double d, double d1, double d2, float f) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + this.bindTexture(TEXTURE_FILE); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + MODEL0.render(0.0625F); + GL11.glRotatef(tileEntity.rotationYaw + 90, 0F, 1F, 0F); + GL11.glRotatef(-tileEntity.rotationPitch, 1F, 0F, 0F); + MODEL1.render(0.0625F); + GL11.glPopMatrix(); + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) + { + renderModelAt((TileCruiseLauncher) tileentity, d, d1, d2, f); + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderEmpTower.java b/src/main/java/mekanism/defense/client/render/tile/RenderEmpTower.java new file mode 100644 index 000000000..4073a2554 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderEmpTower.java @@ -0,0 +1,33 @@ +package defense.client.render.tile; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelEmpTower; +import defense.common.Reference; +import defense.common.tile.TileEMPTower; + +@SideOnly(Side.CLIENT) +public class RenderEmpTower extends TileEntitySpecialRenderer +{ + public static final ResourceLocation TEXTURE_FILE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "emp_tower.png"); + + public static final ModelEmpTower MODEL = new ModelEmpTower(); + + @Override + public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) + { + TileEMPTower tileEntity = (TileEMPTower) t; + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + this.bindTexture(TEXTURE_FILE); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + MODEL.render(tileEntity.rotation, 0.0625F); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderLauncherBase.java b/src/main/java/mekanism/defense/client/render/tile/RenderLauncherBase.java new file mode 100644 index 000000000..4d1766d47 --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderLauncherBase.java @@ -0,0 +1,82 @@ +package defense.client.render.tile; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelLauncherBaseT1; +import defense.client.model.tile.ModelLauncherBaseT2; +import defense.client.model.tile.ModelLauncherBaseT3; +import defense.client.model.tile.ModelLauncherRailT1; +import defense.client.model.tile.ModelLauncherRailT2; +import defense.client.model.tile.ModelLauncherRailT3; +import defense.common.Reference; +import defense.common.tile.TileLauncherBase; + +@SideOnly(Side.CLIENT) +public class RenderLauncherBase extends TileEntitySpecialRenderer +{ + public static final ResourceLocation TEXTURE_FILE_0 = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_0.png"); + public static final ResourceLocation TEXTURE_FILE_1 = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_1.png"); + public static final ResourceLocation TEXTURE_FILE_2 = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_2.png"); + + public static final ModelLauncherBaseT1 modelBase0 = new ModelLauncherBaseT1(); + public static final ModelLauncherRailT1 modelRail0 = new ModelLauncherRailT1(); + + public static final ModelLauncherBaseT2 modelBase1 = new ModelLauncherBaseT2(); + public static final ModelLauncherRailT2 modelRail1 = new ModelLauncherRailT2(); + + public static final ModelLauncherBaseT3 modelBase2 = new ModelLauncherBaseT3(); + public static final ModelLauncherRailT3 modelRail2 = new ModelLauncherRailT3(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) + { + TileLauncherBase tileEntity = (TileLauncherBase) tileentity; + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + GL11.glDisable(GL11.GL_CULL_FACE); + + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + + ForgeDirection side = ForgeDirection.getOrientation(tileEntity.facing); + + if (side != ForgeDirection.NORTH && side != ForgeDirection.SOUTH) + { + GL11.glRotatef(90F, 0F, 180F, 1.0F); + } + + // The missile launcher screen + if (tileEntity.getTier() == 0) + { + this.bindTexture(TEXTURE_FILE_0); + modelBase0.render(0.0625F); + modelRail0.render(0.0625F); + } + else if (tileEntity.getTier() == 1) + { + this.bindTexture(TEXTURE_FILE_1); + modelBase1.render(0.0625F); + modelRail1.render(0.0625F); + GL11.glRotatef(180F, 0F, 180F, 1.0F); + modelRail1.render(0.0625F); + } + else if (tileEntity.getTier() == 2) + { + this.bindTexture(TEXTURE_FILE_2); + modelBase2.render(0.0625F); + modelRail2.render(0.0625F); + GL11.glRotatef(180F, 0F, 180F, 1.0F); + modelRail2.render(0.0625F); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderLauncherFrame.java b/src/main/java/mekanism/defense/client/render/tile/RenderLauncherFrame.java new file mode 100644 index 000000000..23f44c72a --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderLauncherFrame.java @@ -0,0 +1,51 @@ +package defense.client.render.tile; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelLauncherFrame; +import defense.common.Reference; +import defense.common.tile.TileLauncherFrame; + +@SideOnly(Side.CLIENT) +public class RenderLauncherFrame extends TileEntitySpecialRenderer +{ + public static final ModelLauncherFrame MODEL = new ModelLauncherFrame(); + public static final ResourceLocation TEXTURE_FILE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_0.png"); + + @Override + public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float var8) + { + TileLauncherFrame tileEntity = (TileLauncherFrame) var1; + + if (tileEntity != null && tileEntity.getWorldObj() != null) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.25F, (float) z + 0.5F); + GL11.glScalef(1f, 0.85f, 1f); + GL11.glDisable(GL11.GL_CULL_FACE); + + this.bindTexture(TEXTURE_FILE); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + + ForgeDirection side = ForgeDirection.getOrientation(tileEntity.facing); + + if (side != ForgeDirection.NORTH && side != ForgeDirection.SOUTH) + { + GL11.glRotatef(90F, 0.0F, 180F, 1.0F); + } + + MODEL.render(0.0625F); + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glPopMatrix(); + } + } + +} diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderLauncherScreen.java b/src/main/java/mekanism/defense/client/render/tile/RenderLauncherScreen.java new file mode 100644 index 000000000..e93392d9f --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderLauncherScreen.java @@ -0,0 +1,70 @@ +package defense.client.render.tile; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelLauncherScreenT1; +import defense.client.model.tile.ModelLauncherScreenT2; +import defense.client.model.tile.ModelLauncherScreenT3; +import defense.common.Reference; +import defense.common.tile.TileLauncherScreen; + +@SideOnly(Side.CLIENT) +public class RenderLauncherScreen extends TileEntitySpecialRenderer +{ + public static final ResourceLocation TEXTURE_FILE_0 = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_0.png"); + public static final ResourceLocation TEXTURE_FILE_1 = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_1.png"); + public static final ResourceLocation TEXTURE_FILE_2 = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "launcher_2.png"); + + public static final ModelLauncherScreenT1 model0 = new ModelLauncherScreenT1(); + public static final ModelLauncherScreenT2 model1 = new ModelLauncherScreenT2(); + public static final ModelLauncherScreenT3 model2 = new ModelLauncherScreenT3(); + + @Override + public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float var8) + { + TileLauncherScreen tileEntity = (TileLauncherScreen) var1; + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + + switch (tileEntity.facing) + { + case 3: + GL11.glRotatef(180F, 0.0F, 180F, 1.0F); + break; + case 4: + GL11.glRotatef(-90F, 0.0F, 180F, 1.0F); + break; + case 5: + GL11.glRotatef(90F, 0.0F, 180F, 1.0F); + break; + } + + switch (tileEntity.getTier()) + { + case 0: + this.bindTexture(TEXTURE_FILE_0); + model0.render(0.0625F); + break; + case 1: + this.bindTexture(TEXTURE_FILE_1); + model1.render(0.0625F); + break; + case 2: + this.bindTexture(TEXTURE_FILE_2); + model2.render(0.0625F); + break; + } + + GL11.glPopMatrix(); + } + +} diff --git a/src/main/java/mekanism/defense/client/render/tile/RenderRadarStation.java b/src/main/java/mekanism/defense/client/render/tile/RenderRadarStation.java new file mode 100644 index 000000000..bc00de41f --- /dev/null +++ b/src/main/java/mekanism/defense/client/render/tile/RenderRadarStation.java @@ -0,0 +1,60 @@ +package defense.client.render.tile; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.tile.ModelRadarStation; +import defense.common.Reference; +import defense.common.tile.TileRadarStation; + +@SideOnly(Side.CLIENT) +public class RenderRadarStation extends TileEntitySpecialRenderer +{ + public static final ResourceLocation TEXTURE_FILE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "radar.png"); + public static final ResourceLocation TEXTURE_FILE_OFF = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "radar_off.png"); + + public static final ModelRadarStation MODEL = new ModelRadarStation(); + + public void renderAModelAt(TileRadarStation tileEntity, double x, double y, double z, float f) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); + + if (tileEntity.getEnergy() >= tileEntity.ENERGY_USAGE) + { + this.bindTexture(TEXTURE_FILE); + } + else + { + this.bindTexture(TEXTURE_FILE_OFF); + } + + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + switch (tileEntity.facing) + { + case 3: + GL11.glRotatef(180F, 0.0F, 180F, 1.0F); + break; + case 4: + GL11.glRotatef(-90F, 0.0F, 180F, 1.0F); + break; + case 5: + GL11.glRotatef(90F, 0.0F, 180F, 1.0F); + break; + } + + MODEL.render(0.0625F, 0f, tileEntity.rotation); + GL11.glPopMatrix(); + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) + { + renderAModelAt((TileRadarStation) tileentity, d, d1, d2, f); + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/client/tmt/Angle3D.java b/src/main/java/mekanism/defense/client/tmt/Angle3D.java new file mode 100644 index 000000000..de7a22fde --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/Angle3D.java @@ -0,0 +1,99 @@ +package defense.client.tmt; + +/** + * This class handles angles. Basically all it does it store angles. You can + * directly alter the angles. + * @author GaryCXJk + * + */ +public class Angle3D +{ + /** + * The constructor to create a new Angle3D. + * @param x the x-rotation + * @param y the y-rotation + * @param z the z-rotation + */ + public Angle3D(float x, float y, float z) + { + angleX = x; + angleY = y; + angleZ = z; + } + + /** + * Adds the given angles to the current angles. + * @param x the x-rotation + * @param y the y-rotation + * @param z the z-rotation + */ + public void addAngles(float x, float y, float z) + { + angleX+= x; + angleY+= y; + angleZ+= z; + } + + /** + * Adds the angles of another Angle3D to the current angles. + * @param angles the Angle3D + */ + public void addAngles(Angle3D angles) + { + angleX+= angles.angleX; + angleY+= angles.angleY; + angleZ+= angles.angleZ; + } + + /** + * Multiplies the angles with the given angles. + * @param x the x-rotation + * @param y the y-rotation + * @param z the z-rotation + */ + public void multiplyAngles(float x, float y, float z) + { + angleX*= x; + angleY*= y; + angleZ*= z; + } + + /** + * Multiplies the angles with a given Angle3D. + * @param angles the Angle3D + */ + public void multiplyAngles(Angle3D angles) + { + angleX*= angles.angleX; + angleY*= angles.angleY; + angleZ*= angles.angleZ; + } + + /** + * Gets the center angle between two angles. + * @param angles1 the first Angle3D + * @param angles2 the second Angle3D + * @return the center Angle3D + */ + public static Angle3D getCenter(Angle3D angles1, Angle3D angles2) + { + Angle3D angles = new Angle3D(0, 0, 0); + angles.addAngles(angles1); + angles.addAngles(angles2); + angles.multiplyAngles(0.5F, 0.5F, 0.5F); + return angles; + } + + /** + * Copies the current Angle3D over to a new Angle3D instance. + * @return a copy of the Angle3D instance + */ + public Angle3D copy() + { + return new Angle3D(angleX, angleY, angleZ); + } + + public float angleX; + public float angleY; + public float angleZ; +} diff --git a/src/main/java/mekanism/defense/client/tmt/Bone.java b/src/main/java/mekanism/defense/client/tmt/Bone.java new file mode 100644 index 000000000..f286e83c5 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/Bone.java @@ -0,0 +1,546 @@ +package defense.client.tmt; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +/** + * The Bone class makes it possible to create skeletons, which should help you out in + * animating your mobs a little bit more easy. However, since you won't work with a + * graphical interface, creating bones will be different from what you are probably + * used to. + *

+ * First, you will need to instantiate every Bone in the constructor of your model + * file. The default orientation, when all angles are set to zero, will be in the + * vector (0, 0, length), meaning it will always point backwards on a regular model. + * You can also set what its parent node is. If a Bone does not have a parent node, + * it is assumed it is the root node. Each Bone can only have one parent, but several + * children. Also, all children will inherit the offset position of the root node. + *

+ * The neutral position basically defines in what direction the Bone normally faces + * when in rest. This will not affect the rotation of any model currently attached + * to it or the rotation of the child nodes, but will affect the position of the + * child nodes when recalculating their positions. The length always defines how far + * each child Bone will be placed, since child Bones are always placed at the end of + * their parent Bone. + *

+ * Once you're ready to render, you can call the prepareDraw method. You only need + * to apply it to one Bone, since it will always search for the root node to execute + * the code there. It will then automatically rotate every child Bone and places + * them at the right position. Finally, use the setAnglesToModels method to rotate + * each model and place them at the correct spot. Note that if you also apply custom + * rotation for the individual models that you should apply that after you've run + * setAnglesToModels, since this will override the settings the model originally had. + * The best way to solve this is to make a separate method to rotate the Bones. + *

+ * The following would be an example of a biped with a skeleton. It takes ModelBiped + * as an example and extends it with a skeleton. First, we have the part that goes + * in the constructor. + *
+ * // First, the origin will be placed. This is where the rest is attached to.
+ * skeletonOrigin = new Bone(0, 0, 0, 0);
+ * 
+ * // Next, the entire skeleton is built up.
+ * skeletonHead = new Bone(-3.141593F / 2, 0, 0, 0, skeletonOrigin);
+ * skeletonBody = new Bone(3.141593F / 2, 0, 0, 12, skeletonOrigin);
+ * skeletonShoulderRight = new Bone(0, -3.141593F / 2, 0, 5, skeletonOrigin);
+ * skeletonShoulderLeft = new Bone(0, 3.141593F / 2, 0, 5, skeletonOrigin);
+ * skeletonArmRight = new Bone(3.141593F / 2, 0, 0, 12, skeletonShoulderRight);
+ * skeletonArmLeft = new Bone(3.141593F / 2, 0, 0, 12, skeletonShoulderLeft);
+ * skeletonPelvisRight = new Bone(0, -3.141593F / 2, 0, 2, skeletonBody);
+ * skeletonPelvisLeft = new Bone(0, 3.141593F / 2, 0, 2, skeletonBody);
+ * skeletonLegRight = new Bone(3.141593F / 2, 0, 0, 12, skeletonPelvisRight);
+ * skeletonLegLeft = new Bone(3.141593F / 2, 0, 0, 12, skeletonPelvisLeft);
+ * 
+ * // Finally, all models will be attached to the skeletons.
+ * skeletonHead.addModel(bipedHead);
+ * skeletonHead.addModel(bipedHeadwear);
+ * skeletonBody.addModel(bipedBody);
+ * skeletonArmRight.addModel(bipedRightArm);
+ * skeletonArmLeft.addModel(bipedLeftArm);
+ * skeletonLegRight.addModel(bipedRightLeg);
+ * skeletonLegLeft.addModel(bipedRightLeg);
+ * 
+ *

+ * After that, you could replace anything in the setRotationAngles method with + * the following code. It's not a complete code, but you'll get the basics. + *

+ *
+ * skeletonHead.relativeAngles.angleY = f3 / 57.29578F;
+ * skeletonHead.relativeAngles.angleX = f4 / 57.29578F;
+ * skeletonArmRight.relativeAngles.angleX = MathHelper.cos(f * 0.6662F + 3.141593F) * 2.0F * f1 * 0.5F;
+ * skeletonArmRight.relativeAngles.angleZ = 0.0F;
+ * skeletonArmLeft.relativeAngles.angleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
+ * skeletonArmLeft.relativeAngles.angleZ = 0.0F;
+ * skeletonLegRight.relativeAngles.angleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
+ * skeletonLegRight.relativeAngles.angleY = 0.0F;
+ * skeletonLegLeft.relativeAngles.angleX = MathHelper.cos(f * 0.6662F + 3.141593F) * 1.4F * f1;
+ * skeletonLegLeft.relativeAngles.angleY = 0.0F;
+ * 
+ *

+ * Finally, in the render method, you could use the following code. + *

+ *
+ * setRotationAngles(f, f1, f2, f3, f4, f5);
+ * skeletonOrigin.prepareDraw();
+ * skeletonOrigin.setAnglesToModels();
+ * 
+ *

+ * This should generate the same animation of the regular biped. Don't forget to add + * the individual render methods for each model though, as it won't automatically + * render them. + *

+ * @author GaryCXJk + * + */ +public class Bone +{ + /** + * Constructor to create a bone. + * @param x the x-rotation of the bone + * @param y the y-rotation of the bone + * @param z the z-rotation of the bone + * @param l the length of the bone + */ + public Bone(float x, float y, float z, float l) + { + neutralAngles = new Angle3D(x, y, z); + relativeAngles = new Angle3D(0, 0, 0); + absoluteAngles = new Angle3D(0, 0, 0); + positionVector = Vec3.createVectorHelper(0, 0, 0); + length = l; + childNodes = new ArrayList(); + models = new ArrayList(); + modelBaseRot = new HashMap(); + parentNode = null; + offsetX = 0; + offsetY = 0; + offsetZ = 0; + positionVector = Vec3.createVectorHelper(0, 0, 0); + } + + /** + * Constructor to create a bone. + * @param xOrig the x-offset of the origin + * @param yOrig the y-offset of the origin + * @param zOrig the z-offset of the origin + * @param xRot the x-rotation of the bone + * @param yRot the y-rotation of the bone + * @param zRot the z-rotation of the bone + * @param l the length of the bone + */ + public Bone(float xOrig, float yOrig, float zOrig, float xRot, float yRot, float zRot, float l) + { + this(xRot, yRot, zRot, l); + positionVector = setOffset(xOrig, yOrig, zOrig); + } + + /** + * Constructor to create a bone. This attaches the bone to a parent bone, and will + * calculate its current position relative to the origin. + * @param x the x-rotation of the bone + * @param y the y-rotation of the bone + * @param z the z-rotation of the bone + * @param l the length of the bone + * @param parent the parent Bone node this Bone is attached to + */ + public Bone(float x, float y, float z, float l, Bone parent) + { + this(x, y, z, l); + attachBone(parent); + } + + /** + * Detaches the bone from its parent. + */ + public void detachBone() + { + parentNode.childNodes.remove(this); + parentNode = null; + } + + /** + * Attaches the bone to a parent. If the parent is already set, detaches the bone + * from the previous parent. + * @param parent the parent Bone node this Bone is attached to + */ + public void attachBone(Bone parent) + { + if(parentNode != null) + detachBone(); + parentNode = parent; + parent.addChildBone(this); + offsetX = parent.offsetX; + offsetY = parent.offsetY; + offsetZ = parent.offsetZ; + resetOffset(); + } + + /** + * Sets the current offset of the parent root Bone. Note that this will + * always set the parent root Bone, not the current Bone, as its offset + * is determined by the offset, rotation and length of its parent. + * @param x the x-position + * @param y the y-position + * @param z the z-position + * @return a Vec3 with the new coordinates of the current bone + */ + public Vec3 setOffset(float x, float y, float z) + { + if(parentNode != null) + { + Vec3 vector = parentNode.setOffset(x, y, z); + offsetX = (float)vector.xCoord; + offsetY = (float)vector.yCoord; + offsetZ = (float)vector.zCoord; + return vector; + } + offsetX = x; + offsetY = y; + offsetZ = z; + resetOffset(true); + return Vec3.createVectorHelper(x, y, z); + } + + /** + * Resets the offset. + */ + public void resetOffset() + { + resetOffset(false); + } + + /** + * Resets the offset. + * @param doRecursive + */ + public void resetOffset(boolean doRecursive) + { + if(parentNode != null) + { + positionVector = Vec3.createVectorHelper(0, 0, parentNode.length); + parentNode.setVectorRotations(positionVector); + positionVector.xCoord += parentNode.positionVector.xCoord; + positionVector.yCoord += parentNode.positionVector.yCoord; + positionVector.zCoord += parentNode.positionVector.zCoord; + } + if(doRecursive && !childNodes.isEmpty()) + { + for (Bone childNode : childNodes) { + childNode.resetOffset(doRecursive); + } + } + } + + /** + * Sets the current neutral rotation of the bone. This is the same rotation as in + * the constructor. + * @param x the x-rotation of the bone + * @param y the y-rotation of the bone + * @param z the z-rotation of the bone + */ + public void setNeutralRotation(float x, float y, float z) + { + neutralAngles.angleX = x; + neutralAngles.angleY = y; + neutralAngles.angleZ = z; + } + + /** + * Gets the root parent bone. + * @return the root parent Bone. + */ + public Bone getRootParent() + { + if(parentNode == null) + return this; + else + return parentNode.getRootParent(); + } + + /** + * Attaches a model to the bone. Its base rotation will be set to the neutral + * rotation of the model. + * @param model the model to attach + */ + public void addModel(ModelRenderer model) + { + addModel(model, false); + } + + /** + * Attaches a model to the bone. If inherit is true, it sets the base rotation + * to the neutral rotation of the Bone, otherwise it's set to the neutral + * rotation of the model. + * @param model the model to attach + * @param inherit whether the model should inherit the Bone's base rotations + */ + public void addModel(ModelRenderer model, boolean inherit) + { + addModel(model, 0F, 0F, 0F, inherit); + } + + /** + * Attaches a model to the bone. If inherit is true, it sets the base rotation + * to the neutral rotation of the Bone, otherwise it's set to the neutral + * rotation of the model. When isUpright is set, the model will be rotated + * (-PI / 2, 0, 0). + * @param model the model to attach + * @param inherit whether the model should inherit the Bone's base rotations + * @param isUpright whether the model is modeled in the upright position + */ + public void addModel(ModelRenderer model, boolean inherit, boolean isUpright) + { + addModel(model, 0F, 0F, 0F, inherit, isUpright); + } + + /** + * Attaches a model to the bone with a given base rotation. + * @param model the model to attach + * @param x the base x-rotation + * @param y the base y-rotation + * @param z the base z-rotation + */ + public void addModel(ModelRenderer model, float x, float y, float z) + { + addModel(model, x, y, z, false); + } + + /** + * Attaches a model to the bone with a given base rotation. When inherit is + * true, it will add the Bone's neutral rotation to the given angles. + * @param model the model to attach + * @param x the base x-rotation + * @param y the base y-rotation + * @param z the base z-rotation + * @param inherit whether the model should inherit the Bone's base rotations + */ + public void addModel(ModelRenderer model, float x, float y, float z, boolean inherit) + { + addModel(model, x, y, z, inherit, false); + } + + /** + * Attaches a model to the bone with a given base rotation. When inherit is + * true, it will add the Bone's neutral rotation to the given angles. + * When isUpright is set, the model will be rotated (-PI / 2, 0, 0). + * @param model the model to attach + * @param x the base x-rotation + * @param y the base y-rotation + * @param z the base z-rotation + * @param inherit whether the model should inherit the Bone's base rotations + * @param isUpright whether the model is modeled in the upright position + */ + public void addModel(ModelRenderer model, float x, float y, float z, boolean inherit, boolean isUpright) + { + if(inherit) + { + x += neutralAngles.angleX + (isUpright ? (float)Math.PI / 2 : 0); + y += neutralAngles.angleY; + z += neutralAngles.angleZ; + } + models.add(model); + modelBaseRot.put(model, new Angle3D(x, y, z)); + } + + /** + * Removes the given model from the Bone. Always detach the model before adding + * it to another Bone. The best thing however is to just keep the model to one + * bone. + * @param model the model to remove from the bone + */ + public void removeModel(ModelRenderer model) + { + models.remove(model); + modelBaseRot.remove(model); + } + + /** + * Gets the current absolute angles. The absolute angle is calculated by getting + * the sum of all parent Bones' relative angles plus the current relative angle. + * This must be called after using the prepareDraw method. + * @return an Angle3D object which holds the current angles of the current node. + */ + public Angle3D getAbsoluteAngle() + { + return new Angle3D(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); + } + + /** + * Gets the current position of the bone. You should call this after all rotations + * and positions are applied, e.g. after prepareDraw has been called. + * @return a vector containing the current position relative to the origin. + */ + public Vec3 getPosition() + { + return Vec3.createVectorHelper(positionVector.xCoord, positionVector.yCoord, positionVector.zCoord); + } + + protected void addChildBone(Bone bone) + { + childNodes.add(bone); + } + + /** + * Prepares the bones for rendering. This will automatically take the root Bone + * if it isn't. + */ + public void prepareDraw() + { + if(parentNode != null) + parentNode.prepareDraw(); + else + { + setAbsoluteRotations(); + setVectors(); + } + } + + /** + * Sets the current rotation of the Bone, not calculating any parent bones in. + * @param x + * @param y + * @param z + */ + public void setRotations(float x, float y, float z) + { + relativeAngles.angleX = x; + relativeAngles.angleY = y; + relativeAngles.angleZ = z; + } + + protected void setAbsoluteRotations() + { + absoluteAngles.angleX = relativeAngles.angleX; + absoluteAngles.angleY = relativeAngles.angleY; + absoluteAngles.angleZ = relativeAngles.angleZ; + for (Bone childNode : childNodes) { + childNode.setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); + } + } + + protected void setAbsoluteRotations(float x, float y, float z) + { + absoluteAngles.angleX = relativeAngles.angleX + x; + absoluteAngles.angleY = relativeAngles.angleY + y; + absoluteAngles.angleZ = relativeAngles.angleZ + z; + for (Bone childNode : childNodes) { + childNode.setAbsoluteRotations(absoluteAngles.angleX, absoluteAngles.angleY, absoluteAngles.angleZ); + } + + } + + protected void setVectorRotations(Vec3 vector) + { + float x = neutralAngles.angleX + absoluteAngles.angleX; + float y = neutralAngles.angleY + absoluteAngles.angleY; + float z = neutralAngles.angleZ + absoluteAngles.angleZ; + setVectorRotations(vector, x, y, z); + } + + protected void setVectorRotations(Vec3 vector, float xRot, float yRot, float zRot) + { + float x = xRot; + float y = yRot; + float z = zRot; + float xC = MathHelper.cos(x); + float xS = MathHelper.sin(x); + float yC = MathHelper.cos(y); + float yS = MathHelper.sin(y); + float zC = MathHelper.cos(z); + float zS = MathHelper.sin(z); + + double xVec = vector.xCoord; + double yVec = vector.yCoord; + double zVec = vector.zCoord; + + // rotation around x + double xy = xC*yVec - xS*zVec; + double xz = xC*zVec + xS*yVec; + // rotation around y + double yz = yC*xz - yS*xVec; + double yx = yC*xVec + yS*xz; + // rotation around z + double zx = zC*yx - zS*xy; + double zy = zC*xy + zS*yx; + + xVec = zx; + yVec = zy; + zVec = yz; + + vector.xCoord = xVec; + vector.yCoord = yVec; + vector.zCoord = zVec; + } + + public void setParent(Bone parent){ + attachBone(parent); + } + + protected void addVector(Vec3 destVec, Vec3 srcVec) + { + destVec.xCoord += srcVec.xCoord; + destVec.yCoord += srcVec.yCoord; + destVec.zCoord += srcVec.zCoord; + } + + protected void setVectors() + { + Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); + positionVector = Vec3.createVectorHelper(offsetX, offsetY, offsetZ); + addVector(tempVec, positionVector); + setVectorRotations(tempVec); + for (Bone childNode : childNodes) { + childNode.setVectors(tempVec); + } + } + + protected void setVectors(Vec3 vector) + { + positionVector = vector; + Vec3 tempVec = Vec3.createVectorHelper(0, 0, length); + setVectorRotations(tempVec); + addVector(tempVec, vector); + for (Bone childNode : childNodes) { + childNode.setVectors(tempVec); + } + + } + + /** + * Sets the current angles of the Bone to the models attached to it. + */ + public void setAnglesToModels() + { + for (ModelRenderer currentModel : models) { + Angle3D baseAngles = modelBaseRot.get(currentModel); + currentModel.rotateAngleX = baseAngles.angleX + absoluteAngles.angleX; + currentModel.rotateAngleY = baseAngles.angleY + absoluteAngles.angleY; + currentModel.rotateAngleZ = baseAngles.angleZ + absoluteAngles.angleZ; + currentModel.rotationPointX = (float) positionVector.xCoord; + currentModel.rotationPointY = (float) positionVector.yCoord; + currentModel.rotationPointZ = (float) positionVector.zCoord; + } + + for (Bone childNode : childNodes) { + childNode.setAnglesToModels(); + } + } + + protected Angle3D neutralAngles; + public Angle3D relativeAngles; + protected Angle3D absoluteAngles; + private Vec3 positionVector; + private float length; + private Bone parentNode; + protected ArrayList childNodes; + private ArrayList models; + private Map modelBaseRot; + private float offsetX; + private float offsetY; + private float offsetZ; +} diff --git a/src/main/java/mekanism/defense/client/tmt/Coord2D.java b/src/main/java/mekanism/defense/client/tmt/Coord2D.java new file mode 100644 index 000000000..915a683a7 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/Coord2D.java @@ -0,0 +1,31 @@ +package defense.client.tmt; + +/** + * This class represents a coordinate space and its UV coordinates. This allows for + * easier flat shape planning. + * @author GaryCXJk + * + */ +public class Coord2D +{ + public Coord2D(double x, double y) + { + xCoord = x; + yCoord = y; + uCoord = (int)Math.floor(x); + vCoord = (int)Math.floor(y); + } + + + public Coord2D(double x, double y, int u, int v) + { + this(x, y); + uCoord = u; + vCoord = v; + } + + public double xCoord; + public double yCoord; + public int uCoord; + public int vCoord; +} diff --git a/src/main/java/mekanism/defense/client/tmt/ModelPool.java b/src/main/java/mekanism/defense/client/tmt/ModelPool.java new file mode 100644 index 000000000..dbddfd90b --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/ModelPool.java @@ -0,0 +1,61 @@ +package defense.client.tmt; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import cpw.mods.fml.common.Loader; + +public class ModelPool +{ + public static ModelPoolEntry addFile(String file, Class modelClass, Map group, Map textureGroup) + { + ModelPoolEntry entry = null; + if(modelMap.containsKey(file)) + { + entry = modelMap.get(file); + entry.applyGroups(group, textureGroup); + return entry; + } + try + { + entry = (ModelPoolEntry)modelClass.newInstance(); + } + catch(Exception e) + { + System.out.println("A new " + entry.getClass().getName() + " could not be initialized."); + System.out.println(e.getMessage()); + return null; + } + File modelFile = null; + for(int i = 0; i < resourceDir.length && (modelFile == null || !modelFile.exists()); i++) + { + String absPath = new File(Loader.instance().getConfigDir().getParent(), resourceDir[i]).getAbsolutePath(); + if(!absPath.endsWith("/") || !absPath.endsWith("\\")) + absPath+= "/"; + modelFile = entry.checkValidPath(absPath + file); + } + if(modelFile == null || !modelFile.exists()) + { + System.out.println("The model with the name " + file + " does not exist."); + return null; + } + entry.groups = new HashMap(); + entry.textures = new HashMap(); + entry.name = file; + entry.setGroup("0"); + entry.setTextureGroup("0"); + entry.getModel(modelFile); + entry.applyGroups(group, textureGroup); + modelMap.put(file, entry); + return entry; + } + + private static Map modelMap = new HashMap(); + private static String[] resourceDir = new String[] { + "/resources/models/", + "/resources/mod/models/", + "/Flan/" + }; + public static final Class OBJ = ModelPoolObjEntry.class; +} diff --git a/src/main/java/mekanism/defense/client/tmt/ModelPoolEntry.java b/src/main/java/mekanism/defense/client/tmt/ModelPoolEntry.java new file mode 100644 index 000000000..272b3b1d8 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/ModelPoolEntry.java @@ -0,0 +1,118 @@ +package defense.client.tmt; + +import java.io.File; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +public abstract class ModelPoolEntry +{ + public File checkValidPath(String path) + { + File file = null; + + for(int index = 0; index < fileExtensions.length && (file == null || !file.exists()); index++) + { + String absPath = path; + + if(!path.endsWith("." + fileExtensions[index])) + absPath+= "." + fileExtensions[index]; + + file = new File(absPath); + } + if(file == null || !file.exists()) + return null; + return file; + } + + public abstract void getModel(File file); + + /** + * Sets the current transformation group. The transformation group is used + * to allow for vertex transformation. If a transformation group does not exist, + * a new one will be created. + * @param groupName the name of the transformation group you want to switch to + */ + protected void setGroup(String groupName) + { + setGroup(groupName, new Bone(0, 0, 0, 0), 1D); + } + + /** + * Sets the current transformation group. The transformation group is used + * to allow for vertex transformation. If a transformation group does not exist, + * a new one will be created. + * @param groupName the name of the transformation group you want to switch to + * @param bone the Bone this transformation group is attached to + * @param weight the weight of the transformation group + */ + protected void setGroup(String groupName, Bone bone, double weight) + { + if(groups.size() == 0 || !groups.containsKey(groupName)) + groups.put(groupName, new TransformGroupBone(bone, weight)); + group = groups.get(groupName); + } + + /** + * Sets the current texture group, which is used to switch the + * textures on a per-model base. Do note that any model that is + * rendered afterwards will use the same texture. To counter it, + * set a default texture, either at initialization or before + * rendering. + * @param groupName The name of the texture group. If the texture + * group doesn't exist, it creates a new group automatically. + */ + protected void setTextureGroup(String groupName) + { + if(textures.size() == 0 || !textures.containsKey(groupName)) + { + textures.put(groupName, new TextureGroup()); + } + texture = textures.get(groupName); + } + + protected void applyGroups(Map groupsMap, Map texturesMap) + { + Set groupsCol = groups.keySet(); + Collection texturesCol = textures.keySet(); + + Iterator groupsItr = groupsCol.iterator(); + Iterator texturesItr = texturesCol.iterator(); + + while(groupsItr.hasNext()) + { + int nameIdx = 0; + String groupKey = groupsItr.next(); + String currentGroup = name + "_" + nameIdx + ":" + groupKey; + while(groupsMap.size() > 0 && groupsMap.containsKey(currentGroup)) + { + nameIdx++; + currentGroup = name + "_" + nameIdx + ":" + groupKey; + } + groupsMap.put(currentGroup, groups.get(groupKey)); + } + + while(texturesItr.hasNext()) + { + int nameIdx = 0; + String groupKey = texturesItr.next(); + String currentGroup = name + "_" + nameIdx + ":" + groupKey; + while(groupsMap.size() > 0 && texturesMap.containsKey(currentGroup)) + { + nameIdx++; + currentGroup = name + "_" + nameIdx + ":" + groupKey; + } + texturesMap.put(currentGroup, textures.get(groupKey)); + } + } + + public String name; + public PositionTransformVertex[] vertices; + public TexturedPolygon[] faces; + public Map groups; + public Map textures; + protected TransformGroupBone group; + protected TextureGroup texture; + protected String[] fileExtensions; +} diff --git a/src/main/java/mekanism/defense/client/tmt/ModelPoolObjEntry.java b/src/main/java/mekanism/defense/client/tmt/ModelPoolObjEntry.java new file mode 100644 index 000000000..85420f112 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/ModelPoolObjEntry.java @@ -0,0 +1,222 @@ +package defense.client.tmt; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.util.ArrayList; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class ModelPoolObjEntry extends ModelPoolEntry +{ + public ModelPoolObjEntry() + { + fileExtensions = new String[] {"obj"}; + } + + @Override + public void getModel(File file) + { + try + { + BufferedReader in = new BufferedReader(new FileReader(file)); + + String s; + + ArrayList verts = new ArrayList(); + ArrayList uvs = new ArrayList(); + ArrayList normals = new ArrayList(); + ArrayList face = new ArrayList(); + + while((s = in.readLine()) != null) + { + if(s.contains("#")) + { + s = s.substring(0, s.indexOf("#")); + } + + s = s.trim(); + + if(s.equals("")) + continue; + + if(s.startsWith("g ")) + { + setTextureGroup(s.substring(s.indexOf(" ") + 1).trim()); + continue; + } + if(s.startsWith("v ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + float[] v = new float[3]; + for(int i = 0; i < 3; i++) + { + int ind = s.indexOf(" "); + if(ind > -1) + v[i] = Float.parseFloat(s.substring(0, ind)); + else + v[i] = Float.parseFloat(s.substring(0)); + s = s.substring(s.indexOf(" ") + 1).trim(); + } + + float flt = v[2]; + v[2] = -v[1]; + v[1] = flt; + + verts.add(new PositionTransformVertex(v[0], v[1], v[2], 0, 0)); + continue; + } + if(s.startsWith("vt ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + float[] v = new float[2]; + for(int i = 0; i < 2; i++) + { + int ind = s.indexOf(" "); + if(ind > -1) + v[i] = Float.parseFloat(s.substring(0, ind)); + else + v[i] = Float.parseFloat(s.substring(0)); + s = s.substring(s.indexOf(" ") + 1).trim(); + } + + uvs.add(new float[] {v[0], 1F - v[1]}); + continue; + } + if(s.startsWith("vn ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + float[] v = new float[3]; + for(int i = 0; i < 3; i++) + { + int ind = s.indexOf(" "); + if(ind > -1) + v[i] = Float.parseFloat(s.substring(0, ind)); + else + v[i] = Float.parseFloat(s.substring(0)); + s = s.substring(s.indexOf(" ") + 1).trim(); + } + + float flt = v[2]; + v[2] = v[1]; + v[1] = flt; + + normals.add(new float[] {v[0], v[1], v[2]}); + continue; + } + if(s.startsWith("f ")) + { + s = s.substring(s.indexOf(" ") + 1).trim(); + ArrayList v = new ArrayList(); + String s1; + int finalPhase = 0; + float[] normal = new float[] {0F, 0F, 0F}; + ArrayList iNormal = new ArrayList(); + do + { + int vInt; + float[] curUV; + float[] curNormals; + int ind = s.indexOf(" "); + s1 = s; + if(ind > -1) + s1 = s.substring(0, ind); + if(s1.contains("/")) + { + String[] f = s1.split("/"); + vInt = Integer.parseInt(f[0]) - 1; + if(f[1].equals("")) + f[1] = f[0]; + int vtInt = Integer.parseInt(f[1]) - 1; + if(uvs.size() > vtInt) + curUV = uvs.get(vtInt); + else + curUV = new float[] {0, 0}; + int vnInt = 0; + if(f.length == 3) + { + if(f[2].equals("")) + f[2] = f[0]; + vnInt = Integer.parseInt(f[2]) - 1; + } + else + vnInt = Integer.parseInt(f[0]) - 1; + if(normals.size() > vnInt) + curNormals = normals.get(vnInt); + else + curNormals = new float[] {0, 0, 0}; + } + else + { + vInt = Integer.parseInt(s1) - 1; + if(uvs.size() > vInt) + curUV = uvs.get(vInt); + else + curUV = new float[] {0, 0}; + if(normals.size() > vInt) + curNormals = normals.get(vInt); + else + curNormals = new float[] {0, 0, 0}; + } + + iNormal.add(Vec3.createVectorHelper(curNormals[0], curNormals[1], curNormals[2])); + + normal[0]+= curNormals[0]; + normal[1]+= curNormals[1]; + normal[2]+= curNormals[2]; + + if(vInt < verts.size()) + { + v.add(verts.get(vInt).setTexturePosition(curUV[0], curUV[1])); + if(verts.get(vInt) instanceof PositionTransformVertex) + { + verts.get(vInt).addGroup(group); + } + } + if(ind > -1) + s = s.substring(s.indexOf(" ") + 1).trim(); + else + finalPhase++; + } while(finalPhase < 1); + + float d = MathHelper.sqrt_double(normal[0] * normal[0] + normal[1] * normal[1] + normal[2] * normal[2]); + + normal[0]/= d; + normal[1]/= d; + normal[2]/= d; + + PositionTextureVertex[] vToArr = new PositionTextureVertex[v.size()]; + + for(int i = 0; i < v.size(); i++) + { + vToArr[i] = v.get(i); + } + + TexturedPolygon poly = new TexturedPolygon(vToArr); + poly.setNormals(normal[0], normal[1], normal[2]); + poly.setNormals(iNormal); + + face.add(poly); + texture.addPoly(poly); + } + } + + vertices = new PositionTransformVertex[verts.size()]; + for(int i = 0; i < verts.size(); i++) + { + vertices[i] = verts.get(i); + } + faces = new TexturedPolygon[face.size()]; + for(int i = 0; i < face.size(); i++) + { + faces[i] = face.get(i); + } + in.close(); + } + catch(Throwable ignored) + { + + } + } +} diff --git a/src/main/java/mekanism/defense/client/tmt/ModelRendererTurbo.java b/src/main/java/mekanism/defense/client/tmt/ModelRendererTurbo.java new file mode 100644 index 000000000..e245f0fd9 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/ModelRendererTurbo.java @@ -0,0 +1,2295 @@ +package defense.client.tmt; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.TexturedQuad; +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +/** + * An extension to the ModelRenderer class. It basically is a copy to ModelRenderer, + * however, it contains various new methods to make your models. + *

+ * Since the ModelRendererTurbo class gets loaded during startup, the models made + * can be very complex. This is why I can afford to add, for example, Wavefont OBJ + * support or have the addSprite method, methods that add a lot of vertices and + * polygons. + * @author GaryCXJk + * + */ +public class ModelRendererTurbo extends ModelRenderer +{ + public ModelRendererTurbo(ModelBase modelbase, String s) + { + super(modelbase, s); + flip = false; + compiled = false; + displayList = 0; + mirror = false; + showModel = true; + field_1402_i = false; + vertices = new PositionTextureVertex[0]; + faces = new TexturedPolygon[0]; + forcedRecompile = false; + transformGroup = new HashMap(); + transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D)); + textureGroup = new HashMap(); + textureGroup.put("0", new TextureGroup()); + currentTextureGroup = textureGroup.get("0"); + boxName = s; + + defaultTexture = ""; + + useLegacyCompiler = false; + } + + public ModelRendererTurbo(ModelBase modelbase) + { + this(modelbase, null); + } + + /** + * Creates a new ModelRenderTurbo object. It requires the coordinates of the + * position of the texture. + * @param modelbase + * @param textureX the x-coordinate on the texture + * @param textureY the y-coordinate on the texture + */ + public ModelRendererTurbo(ModelBase modelbase, int textureX, int textureY) + { + this(modelbase, textureX, textureY, 64, 32); + } + + /** + * Creates a new ModelRenderTurbo object. It requires the coordinates of the + * position of the texture, but also allows you to specify the width and height + * of the texture, allowing you to use bigger textures instead. + * @param modelbase + * @param textureX + * @param textureY + * @param textureU + * @param textureV + */ + public ModelRendererTurbo(ModelBase modelbase, int textureX, int textureY, int textureU, int textureV) + { + this(modelbase); + textureOffsetX = textureX; + textureOffsetY = textureY; + textureWidth = textureU; + textureHeight = textureV; + } + + /** + * Creates a new polygon. + * @param verts an array of vertices + */ + public void addPolygon(PositionTextureVertex[] verts) + { + copyTo(verts, new TexturedPolygon[] {new TexturedPolygon(verts)}); + } + + /** + * Creates a new polygon, and adds UV mapping to it. + * @param verts an array of vertices + * @param uv an array of UV coordinates + */ + public void addPolygon(PositionTextureVertex[] verts, int[][] uv) + { + try + { + for(int i = 0; i < verts.length; i++) + { + verts[i] = verts[i].setTexturePosition(uv[i][0] / textureWidth, uv[i][1] / textureHeight); + } + } + finally + { + addPolygon(verts); + } + } + + /** + * Creates a new polygon with a given UV. + * @param verts an array of vertices + * @param u1 + * @param v1 + * @param u2 + * @param v2 + */ + public void addPolygon(PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) + { + copyTo(verts, new TexturedPolygon[] {addPolygonReturn(verts, u1, v1, u2, v2)}); + } + + private TexturedPolygon addPolygonReturn(PositionTextureVertex[] verts, int u1, int v1, int u2, int v2, float q1, float q2, float q3, float q4) + { + if(verts.length < 3) + return null; + float uOffs = 1.0F / (textureWidth * 10.0F); + float vOffs = 1.0F / (textureHeight * 10.0F); + if(verts.length < 4) + { + float xMin = -1; + float yMin = -1; + float xMax = 0; + float yMax = 0; + + for (PositionTextureVertex vert : verts) { + float xPos = vert.texturePositionX; + float yPos = vert.texturePositionY; + xMax = Math.max(xMax, xPos); + xMin = (xMin < -1 ? xPos : Math.min(xMin, xPos)); + yMax = Math.max(yMax, yPos); + yMin = (yMin < -1 ? yPos : Math.min(yMin, yPos)); + } + float uMin = u1 / textureWidth + uOffs; + float vMin = v1 / textureHeight + vOffs; + float uSize = (u2 - u1) / textureWidth - uOffs * 2; + float vSize = (v2 - v1) / textureHeight - vOffs * 2; + + float xSize = xMax - xMin; + float ySize = yMax - yMin; + for(int i = 0; i < verts.length; i++) + { + float xPos = verts[i].texturePositionX; + float yPos = verts[i].texturePositionY; + xPos = (xPos - xMin) / xSize; + yPos = (yPos - yMin) / ySize; + verts[i] = verts[i].setTexturePosition(uMin + (xPos * uSize), vMin + (yPos * vSize)); + } + } + else + { + verts[0] = verts[0].setTexturePosition((u2 / textureWidth - uOffs)*q1, (v1 / textureHeight + vOffs)*q1, q1); + verts[1] = verts[1].setTexturePosition((u1 / textureWidth + uOffs)*q2, (v1 / textureHeight + vOffs)*q2, q2); + verts[2] = verts[2].setTexturePosition((u1 / textureWidth + uOffs)*q3, (v2 / textureHeight - vOffs)*q3, q3); + verts[3] = verts[3].setTexturePosition((u2 / textureWidth - uOffs)*q4, (v2 / textureHeight - vOffs)*q4, q4); + } + return new TexturedPolygon(verts); + } + + private TexturedPolygon addPolygonReturn(PositionTextureVertex[] verts, int u1, int v1, int u2, int v2) + { + if(verts.length < 3) + return null; + float uOffs = 1.0F / (textureWidth * 10.0F); + float vOffs = 1.0F / (textureHeight * 10.0F); + if(verts.length < 4) + { + float xMin = -1; + float yMin = -1; + float xMax = 0; + float yMax = 0; + + for (PositionTextureVertex vert : verts) { + float xPos = vert.texturePositionX; + float yPos = vert.texturePositionY; + xMax = Math.max(xMax, xPos); + xMin = (xMin < -1 ? xPos : Math.min(xMin, xPos)); + yMax = Math.max(yMax, yPos); + yMin = (yMin < -1 ? yPos : Math.min(yMin, yPos)); + } + float uMin = u1 / textureWidth + uOffs; + float vMin = v1 / textureHeight + vOffs; + float uSize = (u2 - u1) / textureWidth - uOffs * 2; + float vSize = (v2 - v1) / textureHeight - vOffs * 2; + + float xSize = xMax - xMin; + float ySize = yMax - yMin; + for(int i = 0; i < verts.length; i++) + { + float xPos = verts[i].texturePositionX; + float yPos = verts[i].texturePositionY; + xPos = (xPos - xMin) / xSize; + yPos = (yPos - yMin) / ySize; + verts[i] = verts[i].setTexturePosition(uMin + (xPos * uSize), vMin + (yPos * vSize)); + } + } + else + { + verts[0] = verts[0].setTexturePosition(u2 / textureWidth - uOffs, v1 / textureHeight + vOffs); + verts[1] = verts[1].setTexturePosition(u1 / textureWidth + uOffs, v1 / textureHeight + vOffs); + verts[2] = verts[2].setTexturePosition(u1 / textureWidth + uOffs, v2 / textureHeight - vOffs); + verts[3] = verts[3].setTexturePosition(u2 / textureWidth - uOffs, v2 / textureHeight - vOffs); + } + return new TexturedPolygon(verts); + } + + /** + * Adds a rectangular shape. Basically, you can make any eight-pointed shape you want, + * as the method requires eight vector coordinates. + * @param v a float array with three values, the x, y and z coordinates of the vertex + * @param v1 a float array with three values, the x, y and z coordinates of the vertex + * @param v2 a float array with three values, the x, y and z coordinates of the vertex + * @param v3 a float array with three values, the x, y and z coordinates of the vertex + * @param v4 a float array with three values, the x, y and z coordinates of the vertex + * @param v5 a float array with three values, the x, y and z coordinates of the vertex + * @param v6 a float array with three values, the x, y and z coordinates of the vertex + * @param v7 a float array with three values, the x, y and z coordinates of the vertex + * @param w the width of the shape, used in determining the texture + * @param h the height of the shape, used in determining the texture + * @param d the depth of the shape, used in determining the texture + */ + public void addRectShape(float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d) + { + float[] var1 = new float[] {1,1,1,1,1,1,1,1,1,1,1,1}; + addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d, var1); + } + + /** + * Adds a rectangular shape. Basically, you can make any eight-pointed shape you want, + * as the method requires eight vector coordinates. Also does some special texture mapping. + * @param v a float array with three values, the x, y and z coordinates of the vertex + * @param v1 a float array with three values, the x, y and z coordinates of the vertex + * @param v2 a float array with three values, the x, y and z coordinates of the vertex + * @param v3 a float array with three values, the x, y and z coordinates of the vertex + * @param v4 a float array with three values, the x, y and z coordinates of the vertex + * @param v5 a float array with three values, the x, y and z coordinates of the vertex + * @param v6 a float array with three values, the x, y and z coordinates of the vertex + * @param v7 a float array with three values, the x, y and z coordinates of the vertex + * @param w the width of the shape, used in determining the texture + * @param h the height of the shape, used in determining the texture + * @param d the depth of the shape, used in determining the texture + * @param qParam Array containing the q parameters in the order xBack, xBottom, xFront, xTop, yBack, yFront, yLeft, yRight, zBottom, zLeft, zRight, zTop + */ + public void addRectShape(float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d, float[] qParam) + { + PositionTextureVertex[] verts = new PositionTextureVertex[8]; + TexturedPolygon[] poly = new TexturedPolygon[6]; + PositionTextureVertex positionTexturevertex = new PositionTextureVertex(v[0], v[1], v[2], 0.0F, 0.0F); + PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(v1[0], v1[1], v1[2], 0.0F, 8F); + PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(v2[0], v2[1], v2[2], 8F, 8F); + PositionTextureVertex positionTexturevertex3 = new PositionTextureVertex(v3[0], v3[1], v3[2], 8F, 0.0F); + PositionTextureVertex positionTexturevertex4 = new PositionTextureVertex(v4[0], v4[1], v4[2], 0.0F, 0.0F); + PositionTextureVertex positionTexturevertex5 = new PositionTextureVertex(v5[0], v5[1], v5[2], 0.0F, 8F); + PositionTextureVertex positionTexturevertex6 = new PositionTextureVertex(v6[0], v6[1], v6[2], 8F, 8F); + PositionTextureVertex positionTexturevertex7 = new PositionTextureVertex(v7[0], v7[1], v7[2], 8F, 0.0F); + verts[0] = positionTexturevertex; + verts[1] = positionTexturevertex1; + verts[2] = positionTexturevertex2; + verts[3] = positionTexturevertex3; + verts[4] = positionTexturevertex4; + verts[5] = positionTexturevertex5; + verts[6] = positionTexturevertex6; + verts[7] = positionTexturevertex7; + poly[0] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 + }, textureOffsetX + d + w, textureOffsetY + d, textureOffsetX + d + w + d, textureOffsetY + d + h, + 1F, qParam[7], qParam[10]*qParam[7], qParam[10]); + poly[1] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 + }, textureOffsetX, textureOffsetY + d, textureOffsetX + d, textureOffsetY + d + h, + qParam[9]*qParam[6], qParam[9], 1F, qParam[6]); + poly[2] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 + }, textureOffsetX + d, textureOffsetY, textureOffsetX + d + w, textureOffsetY + d, + 1F, qParam[8], qParam[1]*qParam[8], qParam[1]); + poly[3] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 + }, textureOffsetX + d + w, textureOffsetY, textureOffsetX + d + w + w, textureOffsetY + d, + qParam[3], qParam[3]*qParam[11], qParam[11], 1F); + poly[4] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 + }, textureOffsetX + d, textureOffsetY + d, textureOffsetX + d + w, textureOffsetY + d + h, + qParam[0], qParam[0]*qParam[4], qParam[4], 1F); + poly[5] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 + }, textureOffsetX + d + w + d, textureOffsetY + d, textureOffsetX + d + w + d + w, textureOffsetY + d + h, + qParam[2]*qParam[5], qParam[2], 1F, qParam[5]); + if(mirror ^ flip) + { + for (TexturedPolygon aPoly : poly) { + aPoly.flipFace(); + } + + } + + copyTo(verts, poly); + } + + /** + * Adds a new box to the model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + */ + @Override + public ModelRendererTurbo addBox(float x, float y, float z, int w, int h, int d) + { + addBox(x, y, z, w, h, d, 0.0F); + return this; + } + + /** + * Adds a new box to the model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + * @param expansion the expansion of the box. It increases the size in each direction by that many. + */ + @Override + public void addBox(float x, float y, float z, int w, int h, int d, float expansion) + { + addBox(x, y, z, w, h, d, expansion, 1F); + } + + /** + * Adds a new box to the model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + * @param expansion the expansion of the box. It increases the size in each direction by that many. It's independent from the scale. + * @param scale + */ + public void addBox(float x, float y, float z, int w, int h, int d, float expansion, float scale) + { + float scaleX = w * scale; + float scaleY = h * scale; + float scaleZ = d * scale; + + float x1 = x + scaleX; + float y1 = y + scaleY; + float z1 = z + scaleZ; + + float expX = expansion + scaleX - w; + float expY = expansion + scaleY - h; + float expZ = expansion + scaleZ - d; + + x -= expX; + y -= expY; + z -= expZ; + x1 += expansion; + y1 += expansion; + z1 += expansion; + if(mirror) + { + float xTemp = x1; + x1 = x; + x = xTemp; + } + + float[] v = {x, y, z}; + float[] v1 = {x1, y, z}; + float[] v2 = {x1, y1, z}; + float[] v3 = {x, y1, z}; + float[] v4 = {x, y, z1}; + float[] v5 = {x1, y, z1}; + float[] v6 = {x1, y1, z1}; + float[] v7 = {x, y1, z1}; + addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); + } + + /** + * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. + * You can use the static variables MR_RIGHT, MR_LEFT, + * MR_FRONT, MR_BACK, MR_TOP and + * MR_BOTTOM. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + * @param scale the "scale" of the box. It only increases the size in each direction by that many. + * @param bottomScale the "scale" of the bottom + * @param dir the side the scaling is applied to + */ + public void addTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir) + { + float f4 = x + w; + float f5 = y + h; + float f6 = z + d; + x -= scale; + y -= scale; + z -= scale; + f4 += scale; + f5 += scale; + f6 += scale; + + int m = (mirror ? -1 : 1); + if(mirror) + { + float f7 = f4; + f4 = x; + x = f7; + } + + float[] v = {x, y, z}; + float[] v1 = {f4, y, z}; + float[] v2 = {f4, f5, z}; + float[] v3 = {x, f5, z}; + float[] v4 = {x, y, f6}; + float[] v5 = {f4, y, f6}; + float[] v6 = {f4, f5, f6}; + float[] v7 = {x, f5, f6}; + + switch(dir) + { + case MR_RIGHT: + v[1] -= bottomScale; + v[2] -= bottomScale; + v3[1] += bottomScale; + v3[2] -= bottomScale; + v4[1] -= bottomScale; + v4[2] += bottomScale; + v7[1] += bottomScale; + v7[2] += bottomScale; + break; + case MR_LEFT: + v1[1] -= bottomScale; + v1[2] -= bottomScale; + v2[1] += bottomScale; + v2[2] -= bottomScale; + v5[1] -= bottomScale; + v5[2] += bottomScale; + v6[1] += bottomScale; + v6[2] += bottomScale; + break; + case MR_FRONT: + v[0] -= m * bottomScale; + v[1] -= bottomScale; + v1[0] += m * bottomScale; + v1[1] -= bottomScale; + v2[0] += m * bottomScale; + v2[1] += bottomScale; + v3[0] -= m * bottomScale; + v3[1] += bottomScale; + break; + case MR_BACK: + v4[0] -= m * bottomScale; + v4[1] -= bottomScale; + v5[0] += m * bottomScale; + v5[1] -= bottomScale; + v6[0] += m * bottomScale; + v6[1] += bottomScale; + v7[0] -= m * bottomScale; + v7[1] += bottomScale; + break; + case MR_TOP: + v[0] -= m * bottomScale; + v[2] -= bottomScale; + v1[0] += m * bottomScale; + v1[2] -= bottomScale; + v4[0] -= m * bottomScale; + v4[2] += bottomScale; + v5[0] += m * bottomScale; + v5[2] += bottomScale; + break; + case MR_BOTTOM: + v2[0] += m * bottomScale; + v2[2] -= bottomScale; + v3[0] -= m * bottomScale; + v3[2] -= bottomScale; + v6[0] += m * bottomScale; + v6[2] += bottomScale; + v7[0] -= m * bottomScale; + v7[2] += bottomScale; + break; + } + + float[] qValues = new float[] { + Math.abs((v[0] - v1[0])/(v3[0]-v2[0])), + Math.abs((v[0] - v1[0])/(v4[0]-v5[0])), + Math.abs((v4[0] - v5[0])/(v7[0]-v6[0])), + Math.abs((v3[0] - v2[0])/(v7[0]-v6[0])), + + Math.abs((v[1] - v3[1])/(v1[1]-v2[1])), + Math.abs((v4[1] - v7[1])/(v5[1]-v6[1])), + Math.abs((v[1] - v3[1])/(v4[1]-v7[1])), + Math.abs((v1[1] - v2[1])/(v5[1]-v6[1])), + + Math.abs((v[2] - v4[2])/(v1[2]-v5[2])), + Math.abs((v[2] - v4[2])/(v3[2]-v7[2])), + Math.abs((v1[2] - v5[2])/(v2[2]-v6[2])), + Math.abs((v3[2] - v7[2])/(v2[2]-v6[2])) + }; + + addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); + } + + /** + * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. + * You can use the static variables MR_RIGHT, MR_LEFT, + * MR_FRONT, MR_BACK, MR_TOP and + * MR_BOTTOM. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + * @param scale the "scale" of the box. It only increases the size in each direction by that many. + * @param bScale1 the "scale" of the bottom - Top + * @param bScale2 the "scale" of the bottom - Bottom + * @param bScale3 the "scale" of the bottom - Left + * @param bScale4 the "scale" of the bottom - Right + * @param dir the side the scaling is applied to + */ + public void addFlexBox(float x, float y, float z, int w, int h, int d, float scale, float bScale1, float bScale2, float bScale3, float bScale4, int dir) + { + float f4 = x + w; + float f5 = y + h; + float f6 = z + d; + x -= scale; + y -= scale; + z -= scale; + f4 += scale; + f5 += scale; + f6 += scale; + + int m = (mirror ? -1 : 1); + if(mirror) + { + float f7 = f4; + f4 = x; + x = f7; + } + + float[] v = {x, y, z}; + float[] v1 = {f4, y, z}; + float[] v2 = {f4, f5, z}; + float[] v3 = {x, f5, z}; + float[] v4 = {x, y, f6}; + float[] v5 = {f4, y, f6}; + float[] v6 = {f4, f5, f6}; + float[] v7 = {x, f5, f6}; + + switch(dir) + { + case MR_RIGHT: + v[1] -= bScale1; + v[2] -= bScale3; + v3[1] += bScale2; + v3[2] -= bScale3; + v4[1] -= bScale1; + v4[2] += bScale4; + v7[1] += bScale2; + v7[2] += bScale4; + break; + case MR_LEFT: + v1[1] -= bScale1; + v1[2] -= bScale3; + v2[1] += bScale2; + v2[2] -= bScale3; + v5[1] -= bScale1; + v5[2] += bScale4; + v6[1] += bScale2; + v6[2] += bScale4; + break; + case MR_FRONT: + v[0] -= m * bScale4; + v[1] -= bScale1; + v1[0] += m * bScale3; + v1[1] -= bScale1; + v2[0] += m * bScale3; + v2[1] += bScale2; + v3[0] -= m * bScale4; + v3[1] += bScale2; + break; + case MR_BACK: + v4[0] -= m * bScale4; + v4[1] -= bScale1; + v5[0] += m * bScale3; + v5[1] -= bScale1; + v6[0] += m * bScale3; + v6[1] += bScale2; + v7[0] -= m * bScale4; + v7[1] += bScale2; + break; + case MR_TOP: + v[0] -= m * bScale1; + v[2] -= bScale3; + v1[0] += m * bScale2; + v1[2] -= bScale3; + v4[0] -= m * bScale1; + v4[2] += bScale4; + v5[0] += m * bScale2; + v5[2] += bScale4; + break; + case MR_BOTTOM: + v2[0] += m * bScale2; + v2[2] -= bScale3; + v3[0] -= m * bScale1; + v3[2] -= bScale3; + v6[0] += m * bScale2; + v6[2] += bScale4; + v7[0] -= m * bScale1; + v7[2] += bScale4; + break; + } + + float[] qValues = new float[] { + Math.abs((v[0] - v1[0])/(v3[0]-v2[0])), + Math.abs((v[0] - v1[0])/(v4[0]-v5[0])), + Math.abs((v4[0] - v5[0])/(v7[0]-v6[0])), + Math.abs((v3[0] - v2[0])/(v7[0]-v6[0])), + + Math.abs((v[1] - v3[1])/(v1[1]-v2[1])), + Math.abs((v4[1] - v7[1])/(v5[1]-v6[1])), + Math.abs((v[1] - v3[1])/(v4[1]-v7[1])), + Math.abs((v1[1] - v2[1])/(v5[1]-v6[1])), + + Math.abs((v[2] - v4[2])/(v1[2]-v5[2])), + Math.abs((v[2] - v4[2])/(v3[2]-v7[2])), + Math.abs((v1[2] - v5[2])/(v2[2]-v6[2])), + Math.abs((v3[2] - v7[2])/(v2[2]-v6[2])) + }; + + addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); + } + + /** + * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. + * You can use the static variables MR_RIGHT, MR_LEFT, + * MR_FRONT, MR_BACK, MR_TOP and + * MR_BOTTOM. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + * @param scale the "scale" of the box. It only increases the size in each direction by that many. + * @param bScale1 the "scale" of the bottom - Top + * @param bScale2 the "scale" of the bottom - Bottom + * @param bScale3 the "scale" of the bottom - Left + * @param bScale4 the "scale" of the bottom - Right + * @param fScale1 the "scale" of the top - Left + * @param fScale2 the "scale" of the top - Right + * @param dir the side the scaling is applied to + */ + public void addFlexTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bScale1, float bScale2, float bScale3, float bScale4, float fScale1, float fScale2, int dir) + { + float f4 = x + w; + float f5 = y + h; + float f6 = z + d; + x -= scale; + y -= scale; + z -= scale; + f4 += scale; + f5 += scale; + f6 += scale; + + int m = (mirror ? -1 : 1); + if(mirror) + { + float f7 = f4; + f4 = x; + x = f7; + } + + float[] v = {x, y, z}; + float[] v1 = {f4, y, z}; + float[] v2 = {f4, f5, z}; + float[] v3 = {x, f5, z}; + float[] v4 = {x, y, f6}; + float[] v5 = {f4, y, f6}; + float[] v6 = {f4, f5, f6}; + float[] v7 = {x, f5, f6}; + + + switch(dir) + { + case MR_RIGHT: + v[2] -= fScale1; + v1[2] -= fScale1; + v4[2] += fScale2; + v5[2] += fScale2; + + v[1] -= bScale1; + v[2] -= bScale3; + v3[1] += bScale2; + v3[2] -= bScale3; + v4[1] -= bScale1; + v4[2] += bScale4; + v7[1] += bScale2; + v7[2] += bScale4; + break; + case MR_LEFT: + v[2] -= fScale1; + v1[2] -= fScale1; + v4[2] += fScale2; + v5[2] += fScale2; + + v1[1] -= bScale1; + v1[2] -= bScale3; + v2[1] += bScale2; + v2[2] -= bScale3; + v5[1] -= bScale1; + v5[2] += bScale4; + v6[1] += bScale2; + v6[2] += bScale4; + break; + case MR_FRONT: + v1[1] -= fScale1; + v5[1] -= fScale1; + v2[1] += fScale2; + v6[1] += fScale2; + + v[0] -= m * bScale4; + v[1] -= bScale1; + v1[0] += m * bScale3; + v1[1] -= bScale1; + v2[0] += m * bScale3; + v2[1] += bScale2; + v3[0] -= m * bScale4; + v3[1] += bScale2; + break; + case MR_BACK: + v1[1] -= fScale1; + v5[1] -= fScale1; + v2[1] += fScale2; + v6[1] += fScale2; + + v4[0] -= m * bScale4; + v4[1] -= bScale1; + v5[0] += m * bScale3; + v5[1] -= bScale1; + v6[0] += m * bScale3; + v6[1] += bScale2; + v7[0] -= m * bScale4; + v7[1] += bScale2; + break; + case MR_TOP: + v1[2] -= fScale1; + v2[2] -= fScale1; + v5[2] += fScale2; + v6[2] += fScale2; + + v[0] -= m * bScale1; + v[2] -= bScale3; + v1[0] += m * bScale2; + v1[2] -= bScale3; + v4[0] -= m * bScale1; + v4[2] += bScale4; + v5[0] += m * bScale2; + v5[2] += bScale4; + break; + case MR_BOTTOM: + v1[2] -= fScale1; + v2[2] -= fScale1; + v5[2] += fScale2; + v6[2] += fScale2; + + v2[0] += m * bScale2; + v2[2] -= bScale3; + v3[0] -= m * bScale1; + v3[2] -= bScale3; + v6[0] += m * bScale2; + v6[2] += bScale4; + v7[0] -= m * bScale1; + v7[2] += bScale4; + break; + } + + float[] qValues = new float[] { + Math.abs((v[0] - v1[0])/(v3[0]-v2[0])), + Math.abs((v[0] - v1[0])/(v4[0]-v5[0])), + Math.abs((v4[0] - v5[0])/(v7[0]-v6[0])), + Math.abs((v3[0] - v2[0])/(v7[0]-v6[0])), + + Math.abs((v[1] - v3[1])/(v1[1]-v2[1])), + Math.abs((v4[1] - v7[1])/(v5[1]-v6[1])), + Math.abs((v[1] - v3[1])/(v4[1]-v7[1])), + Math.abs((v1[1] - v2[1])/(v5[1]-v6[1])), + + Math.abs((v[2] - v4[2])/(v1[2]-v5[2])), + Math.abs((v[2] - v4[2])/(v3[2]-v7[2])), + Math.abs((v1[2] - v5[2])/(v2[2]-v6[2])), + Math.abs((v3[2] - v7[2])/(v2[2]-v6[2])) + }; + + addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); + } + + /** + * Adds a box with float width, height and depth. Who knows what it will do to the texture. + * @param x the starting x-positions + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + */ + public void addBox(float x, float y, float z, float w, float h, float d) + { + int rw = MathHelper.ceiling_float_int(w); + int rh = MathHelper.ceiling_float_int(h); + int rd = MathHelper.ceiling_float_int(d); + w -= rw; + h -= rh; + d -= rd; + addShapeBox(x, y, z, rw, rh, rd, 0F, + 0F, 0F, 0F, + w, 0F, 0F, + w, 0F, d, + 0F, 0F, d, + 0F, h, 0F, + w, h, 0F, + w, h, d, + 0F, h, d); + } + + /** + * Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. + * You can use the static variables MR_RIGHT, MR_LEFT, + * MR_FRONT, MR_BACK, MR_TOP and + * MR_BOTTOM. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width (over the x-direction) + * @param h the height (over the y-direction) + * @param d the depth (over the z-direction) + * @param scale the "scale" of the box. It only increases the size in each direction by that many. + * @param x0,y0,z0 - x7,y7,z7 the modifiers of the box corners. each corner can changed seperat by x/y/z values + */ + public void addShapeBox(float x, float y, float z, int w, int h, int d, float scale, float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, float x5, float y5, float z5, float x6, float y6, float z6, float x7, float y7, float z7) + { + float f4 = x + w; + float f5 = y + h; + float f6 = z + d; + x -= scale; + y -= scale; + z -= scale; + f4 += scale; + f5 += scale; + f6 += scale; + + int m = (mirror ? -1 : 1); + if(mirror) + { + float f7 = f4; + f4 = x; + x = f7; + } + + float[] v = {x - x0, y - y0, z - z0}; + float[] v1 = {f4 + x1, y - y1, z - z1}; + float[] v2 = {f4 + x5, f5 + y5, z - z5}; + float[] v3 = {x - x4, f5 + y4, z - z4}; + float[] v4 = {x - x3, y - y3, f6 + z3}; + float[] v5 = {f4 + x2, y - y2, f6 + z2}; + float[] v6 = {f4 + x6, f5 + y6, f6 + z6}; + float[] v7 = {x - x7, f5 + y7, f6 + z7}; + + float[] qValues = new float[] { + Math.abs((v[0] - v1[0])/(v3[0]-v2[0])), + Math.abs((v[0] - v1[0])/(v4[0]-v5[0])), + Math.abs((v4[0] - v5[0])/(v7[0]-v6[0])), + Math.abs((v3[0] - v2[0])/(v7[0]-v6[0])), + + Math.abs((v[1] - v3[1])/(v1[1]-v2[1])), + Math.abs((v4[1] - v7[1])/(v5[1]-v6[1])), + Math.abs((v[1] - v3[1])/(v4[1]-v7[1])), + Math.abs((v1[1] - v2[1])/(v5[1]-v6[1])), + + Math.abs((v[2] - v4[2])/(v1[2]-v5[2])), + Math.abs((v[2] - v4[2])/(v3[2]-v7[2])), + Math.abs((v1[2] - v5[2])/(v2[2]-v6[2])), + Math.abs((v3[2] - v7[2])/(v2[2]-v6[2])) + }; + + addRectShape(v, v1, v2, v3, v4, v5, v6, v7, w, h, d); + } + + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param coordinates an array of coordinates that form the shape + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param direction the direction the starting point of the shape is facing + */ + public void addShape3D(float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) + { + addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); + } + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param coordinates an array of coordinates that form the shape + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param direction the direction the starting point of the shape is facing + * @param faceLengths An array with the length of each face. Used to set + * the texture width of each face on the side manually. + */ + public void addShape3D(float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths) + { + addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); + } + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param coordinates an ArrayList of coordinates that form the shape + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param direction the direction the starting point of the shape is facing + */ + public void addShape3D(float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) + { + addShape3D(x, y, z, coordinates, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); + } + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param coordinates an ArrayList of coordinates that form the shape + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param direction the direction the starting point of the shape is facing + * @param faceLengths An array with the length of each face. Used to set + * the texture width of each face on the side manually. + */ + public void addShape3D(float x, float y, float z, ArrayList coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths) + { + addShape3D(x, y, z, new Shape2D(coordinates), depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, faceLengths); + } + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param shape a Shape2D which contains the coordinates of the shape points + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param direction the direction the starting point of the shape is facing + */ + public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction) + { + addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, direction, null); + } + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param shape a Shape2D which contains the coordinates of the shape points + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param direction the direction the starting point of the shape is facing + * @param faceLengths An array with the length of each face. Used to set + * the texture width of each face on the side manually. + */ + public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths) + { + float rotX = 0; + float rotY = 0; + float rotZ = 0; + switch(direction) + { + case MR_LEFT: + rotY = pi / 2; + break; + case MR_RIGHT: + rotY = -pi / 2; + break; + case MR_TOP: + rotX = pi / 2; + break; + case MR_BOTTOM: + rotX = -pi / 2; + break; + case MR_FRONT: + rotY = pi; + break; + case MR_BACK: + break; + } + addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, faceLengths); + } + + /** + * Creates a shape from a 2D vector shape. + * @param x the starting x position + * @param y the starting y position + * @param z the starting z position + * @param shape a Shape2D which contains the coordinates of the shape points + * @param depth the depth of the shape + * @param shapeTextureWidth the width of the texture of one side of the shape + * @param shapeTextureHeight the height of the texture the shape + * @param sideTextureWidth the width of the texture of the side of the shape + * @param sideTextureHeight the height of the texture of the side of the shape + * @param rotX the rotation around the x-axis + * @param rotY the rotation around the y-axis + * @param rotZ the rotation around the z-axis + */ + public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, float rotZ) + { + addShape3D(x, y, z, shape, depth, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, rotX, rotY, rotZ, null); + } + + public void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, float rotZ, float[] faceLengths) + { + Shape3D shape3D = shape.extrude(x, y, z, rotX, rotY, rotZ, depth, textureOffsetX, textureOffsetY, textureWidth, textureHeight, shapeTextureWidth, shapeTextureHeight, sideTextureWidth, sideTextureHeight, faceLengths); + + if(flip) + { + for(int idx = 0; idx < shape3D.faces.length; idx++) + { + shape3D.faces[idx].flipFace(); + } + } + + copyTo(shape3D.vertices, shape3D.faces); + } + + /** + * Adds a cube the size of one pixel. It will take a pixel from the texture and + * uses that as the texture of said cube. The accurate name would actually be + * "addVoxel". This method has been added to make it more compatible with Techne, + * and allows for easy single-colored boxes. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param width the width of the box + * @param height the height of the box + * @param length the length of the box + */ + public void addPixel(float x, float y, float z, float width, float height, float length) + { + addPixel(x, y, z, new float[] {width, height, length}, textureOffsetX, textureOffsetY); + } + + /** + * Adds a cube the size of one pixel. It will take a pixel from the texture and + * uses that as the texture of said cube. The accurate name would actually be + * "addVoxel". It will not overwrite the model data, but rather, it will add to + * the model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param scale the "scale" of the cube, where scale is a float integer consisting of three values + * @param w the x-coordinate on the texture + * @param h the y-coordinate on the texture + */ + public void addPixel(float x, float y, float z, float[] scale, int w, int h) + { + PositionTextureVertex[] verts = new PositionTextureVertex[8]; + TexturedPolygon[] poly = new TexturedPolygon[6]; + + float x1 = x + scale[0]; + float y1 = y + scale[1]; + float z1 = z + scale[2]; + + float[] f = {x, y, z}; + float[] f1 = {x1, y, z}; + float[] f2 = {x1, y1, z}; + float[] f3 = {x, y1, z}; + float[] f4 = {x, y, z1}; + float[] f5 = {x1, y, z1}; + float[] f6 = {x1, y1, z1}; + float[] f7 = {x, y1, z1}; + PositionTextureVertex positionTexturevertex = new PositionTextureVertex(f[0], f[1], f[2], 0.0F, 0.0F); + PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(f1[0], f1[1], f1[2], 0.0F, 8F); + PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(f2[0], f2[1], f2[2], 8F, 8F); + PositionTextureVertex positionTexturevertex3 = new PositionTextureVertex(f3[0], f3[1], f3[2], 8F, 0.0F); + PositionTextureVertex positionTexturevertex4 = new PositionTextureVertex(f4[0], f4[1], f4[2], 0.0F, 0.0F); + PositionTextureVertex positionTexturevertex5 = new PositionTextureVertex(f5[0], f5[1], f5[2], 0.0F, 8F); + PositionTextureVertex positionTexturevertex6 = new PositionTextureVertex(f6[0], f6[1], f6[2], 8F, 8F); + PositionTextureVertex positionTexturevertex7 = new PositionTextureVertex(f7[0], f7[1], f7[2], 8F, 0.0F); + + verts[0] = positionTexturevertex; + verts[1] = positionTexturevertex1; + verts[2] = positionTexturevertex2; + verts[3] = positionTexturevertex3; + verts[4] = positionTexturevertex4; + verts[5] = positionTexturevertex5; + verts[6] = positionTexturevertex6; + verts[7] = positionTexturevertex7; + + poly[0] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 + }, w, h, w + 1, h + 1); + poly[1] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 + }, w, h, w + 1, h + 1); + poly[2] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 + }, w, h, w + 1, h + 1); + poly[3] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 + }, w, h, w + 1, h + 1); + poly[4] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 + }, w, h, w + 1, h + 1); + poly[5] = addPolygonReturn(new PositionTextureVertex[] { + positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 + }, w, h, w + 1, h + 1); + + copyTo(verts, poly); + } + + /** + * Creates a model shaped like the exact image on the texture. Note that this method will + * increase the amount of quads on your model, which could effectively slow down your + * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this + * method to create your model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width of the sprite + * @param h the height of the sprite + * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. + */ + public void addSprite(float x, float y, float z, int w, int h, float expansion) + { + addSprite(x, y, z, w, h, 1, false, false, false, false, false, expansion); + } + + /** + * Creates a model shaped like the exact image on the texture. Note that this method will + * increase the amount of quads on your model, which could effectively slow down your + * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this + * method to create your model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width of the sprite + * @param h the height of the sprite + * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis + * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis + * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis + * @param mirrorX a boolean to define if the sprite should be mirrored + * @param mirrorY a boolean to define if the sprite should be flipped + * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. + */ + public void addSprite(float x, float y, float z, int w, int h, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + { + addSprite(x, y, z, w, h, 1, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); + } + + /** + * Creates a model shaped like the exact image on the texture. Note that this method will + * increase the amount of quads on your model, which could effectively slow down your + * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this + * method to create your model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width of the sprite + * @param h the height of the sprite + * @param d the depth of the shape itself + * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis + * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis + * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis + * @param mirrorX a boolean to define if the sprite should be mirrored + * @param mirrorY a boolean to define if the sprite should be flipped + * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. + */ + public void addSprite(float x, float y, float z, int w, int h, int d, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + { + addSprite(x, y, z, w, h, d, 1.0F, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); + } + + /** + * Creates a model shaped like the exact image on the texture. Note that this method will + * increase the amount of quads on your model, which could effectively slow down your + * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this + * method to create your model. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param w the width of the sprite + * @param h the height of the sprite + * @param d the depth of the shape itself + * @param pixelScale the scale of each individual pixel + * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis + * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis + * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis + * @param mirrorX a boolean to define if the sprite should be mirrored + * @param mirrorY a boolean to define if the sprite should be flipped + * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. + */ + public void addSprite(float x, float y, float z, int w, int h, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + { + String[] mask = new String[h]; + char[] str = new char[w]; + Arrays.fill(str, '1'); + Arrays.fill(mask, new String(str)); + + addSprite(x, y, z, mask, d, pixelScale, rotX, rotY, rotZ, mirrorX, mirrorY, expansion); + } + + /** + * Creates a model shaped like the exact image on the texture. Note that this method will + * increase the amount of quads on your model, which could effectively slow down your + * PC, so unless it is really a necessity to use it, I'd suggest you avoid using this + * method to create your model. + *

+ * This method uses a mask string. This way you can reduce the amount of quads used. To + * use this, create a String array, where you use a 1 to signify that the pixel will be + * drawn. Any other character will cause that pixel to not be drawn. + * @param x the starting x-position + * @param y the starting y-position + * @param z the starting z-position + * @param mask an array with the mask string + * @param d the depth of the shape itself + * @param pixelScale the scale of each individual pixel + * @param rotX a boolean to define if it rotates 90 degrees around its yaw-axis + * @param rotY a boolean to define if it rotates 90 degrees around its pitch-axis + * @param rotZ a boolean to define if it rotates 90 degrees around its roll-axis + * @param mirrorX a boolean to define if the sprite should be mirrored + * @param mirrorY a boolean to define if the sprite should be flipped + * @param expansion the expansion of the sprite. It only increases the size in each direction by that many. + */ + public void addSprite(float x, float y, float z, String[] mask, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion) + { + int w = mask[0].length(); + int h = mask.length; + + float x1 = x - expansion; + float y1 = y - expansion; + float z1 = z - expansion; + + int wDir = 0; + int hDir = 0; + int dDir = 0; + + float wScale = 1F + (expansion / (w * pixelScale)); + float hScale = 1F + (expansion / (h * pixelScale)); + + if(!rotX) + { + if(!rotY) + { + if(!rotZ) + { + wDir = 0; + hDir = 1; + dDir = 2; + } + else + { + wDir = 1; + hDir = 0; + dDir = 2; + } + } + else + { + if(!rotZ) + { + wDir = 2; + hDir = 1; + dDir = 0; + } + else + { + wDir = 2; + hDir = 0; + dDir = 1; + } + } + } + else + { + if(!rotY) + { + if(!rotZ) + { + wDir = 0; + hDir = 2; + dDir = 1; + } + else + { + wDir = 1; + hDir = 2; + dDir = 0; + } + } + else + { + if(!rotZ) + { + wDir = 2; + hDir = 0; + dDir = 1; + } + else + { + wDir = 2; + hDir = 1; + dDir = 0; + } + } + } + + int texStartX = textureOffsetX + (mirrorX ? w - 1 : 0); + int texStartY = textureOffsetY + (mirrorY ? h - 1 : 0); + int texDirX = (mirrorX ? -1 : 1); + int texDirY = (mirrorY ? -1 : 1); + + float wVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, wDir, 1, 1); + float hVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, hDir, 1, 1); + float dVoxSize = getPixelSize(wScale, hScale, d * pixelScale + expansion * 2, 0, 1, dDir, 1, 1); + + for(int i = 0; i < w; i++) + { + for(int j = 0; j < h; j++) + { + if(mask[j].charAt(i) == '1') + { + addPixel(x1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 0, i, j), + y1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 1, i, j), + z1 + getPixelSize(wScale, hScale, 0, wDir, hDir, 2, i, j), + new float[] {wVoxSize, hVoxSize, dVoxSize}, texStartX + texDirX * i, texStartY + texDirY * j); + } + } + } + } + + private float getPixelSize(float wScale, float hScale, float dScale, int wDir, int hDir, int checkDir, int texPosX, int texPosY) + { + return (wDir == checkDir ? wScale * texPosX : (hDir == checkDir ? hScale * texPosY : dScale)); + } + + /** + * Adds a spherical shape. + * @param x + * @param y + * @param z + * @param r + * @param segs + * @param rings + * @param textureW + * @param textureH + */ + public void addSphere(float x, float y, float z, float r, int segs, int rings, int textureW, int textureH) + { + if(segs < 3) + segs = 3; + rings++; + PositionTextureVertex[] tempVerts = new PositionTextureVertex[segs * (rings - 1) + 2]; + TexturedPolygon[] poly = new TexturedPolygon[segs * rings]; + + tempVerts[0] = new PositionTextureVertex(x, y - r, z, 0, 0); + tempVerts[tempVerts.length - 1] = new PositionTextureVertex(x, y + r, z, 0, 0); + + float uOffs = 1.0F / (textureWidth * 10.0F); + float vOffs = 1.0F / (textureHeight * 10.0F); + float texW = textureW / textureWidth - 2F * uOffs; + float texH = textureH / textureHeight - 2F * vOffs; + float segW = texW / segs; + float segH = texH / rings; + float startU = textureOffsetX / textureWidth; + float startV = textureOffsetY / textureHeight; + + int currentFace = 0; + + for(int j = 1; j < rings; j++) + { + for(int i = 0; i < segs; i++) + { + float yWidth = MathHelper.cos(-pi / 2 + (pi / rings) * j); + float yHeight = MathHelper.sin(-pi / 2 + (pi / rings) * j); + float xSize = MathHelper.sin((pi / segs) * i * 2F + pi) * yWidth; + float zSize = -MathHelper.cos((pi / segs) * i * 2F + pi) * yWidth; + int curVert = 1 + i + segs * (j - 1); + tempVerts[curVert] = new PositionTextureVertex(x + xSize * r, y + yHeight * r, z + zSize * r, 0, 0); + if(i > 0) + { + PositionTextureVertex[] verts; + if(j == 1) + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); + verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); + verts[2] = tempVerts[0].setTexturePosition(startU + segW * (i - 1), startV); + verts[3] = tempVerts[0].setTexturePosition(startU + segW + segW * i, startV); + } + else + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[curVert].setTexturePosition(startU + segW * i, startV + segH * j); + verts[1] = tempVerts[curVert - 1].setTexturePosition(startU + segW * (i - 1), startV + segH * j); + verts[2] = tempVerts[curVert - 1 - segs].setTexturePosition(startU + segW * (i - 1), startV + segH * (j - 1)); + verts[3] = tempVerts[curVert - segs].setTexturePosition(startU + segW * i, startV + segH * (j - 1)); + } + poly[currentFace] = new TexturedPolygon(verts); + currentFace++; + } + } + PositionTextureVertex[] verts; + if(j == 1) + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[1].setTexturePosition(startU + segW * segs, startV + segH * j); + verts[1] = tempVerts[segs].setTexturePosition(startU + segW * (segs - 1), startV + segH * j); + verts[2] = tempVerts[0].setTexturePosition(startU + segW * (segs - 1), startV); + verts[3] = tempVerts[0].setTexturePosition(startU + segW * segs, startV); + } + else + { + verts = new PositionTextureVertex[4]; + verts[0] = tempVerts[1 + segs * (j - 1)].setTexturePosition(startU + texW, startV + segH * j); + verts[1] = tempVerts[segs * (j - 1) + segs].setTexturePosition(startU + texW - segW, startV + segH * j); + verts[2] = tempVerts[segs * (j - 1)].setTexturePosition(startU + texW - segW, startV + segH * (j - 1)); + verts[3] = tempVerts[1 + segs * (j - 1) - segs].setTexturePosition(startU + texW, startV + segH * (j - 1)); + } + poly[currentFace] = new TexturedPolygon(verts); + currentFace++; + } + for(int i = 0; i < segs; i++) + { + PositionTextureVertex[] verts = new PositionTextureVertex[3]; + int curVert = tempVerts.length - (segs + 1); + verts[0] = tempVerts[tempVerts.length - 1].setTexturePosition(startU + segW * (i + 0.5F), startV + texH); + verts[1] = tempVerts[curVert + i].setTexturePosition(startU + segW * i, startV + texH - segH); + verts[2] = tempVerts[curVert + ((i + 1) % segs)].setTexturePosition(startU + segW * (i + 1), startV + texH - segH); + poly[currentFace] = new TexturedPolygon(verts); + currentFace++; + } + + copyTo(tempVerts, poly); + } + + /** + * Adds a cone. + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + */ + public void addCone(float x, float y, float z, float radius, float length, int segments) + { + addCone(x, y, z, radius, length, segments, 1F); + } + + /** + * Adds a cone. + * + * baseScale cannot be zero. If it is, it will automatically be set to 1F. + * + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + * @param baseScale the scaling of the base. Can be negative. + */ + public void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale) + { + addCone(x, y, z, radius, length, segments, baseScale, MR_TOP); + } + + /** + * Adds a cone. + * + * baseScale cannot be zero. If it is, it will automatically be set to 1F. + * + * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in + * the top being placed at the (x,y,z). + * + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + * @param baseScale the scaling of the base. Can be negative. + * @param baseDirection the direction it faces + */ + public void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection) + { + addCone(x, y, z, radius, length, segments, baseScale, baseDirection, (int)Math.floor(radius * 2F), (int)Math.floor(radius * 2F)); + } + + /** + * Adds a cone. + * + * baseScale cannot be zero. If it is, it will automatically be set to 1F. + * + * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in + * the top being placed at the (x,y,z). + * + * The textures for the sides are placed next to each other. + * + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + * @param baseScale the scaling of the base. Can be negative. + * @param baseDirection the direction it faces + * @param textureCircleDiameterW the diameter width of the circle on the texture + * @param textureCircleDiameterH the diameter height of the circle on the texture + */ + public void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH) + { + addCylinder(x, y, z, radius, length, segments, baseScale, 0.0F, baseDirection, textureCircleDiameterW, textureCircleDiameterH, 1); + } + + /** + * Adds a cylinder. + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + */ + public void addCylinder(float x, float y, float z, float radius, float length, int segments) + { + addCylinder(x, y, z, radius, length, segments, 1F, 1F); + } + + /** + * Adds a cylinder. + * + * You can make cones by either setting baseScale or topScale to zero. Setting both + * to zero will set the baseScale to 1F. + * + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + * @param baseScale the scaling of the base. Can be negative. + * @param topScale the scaling of the top. Can be negative. + */ + public void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale) + { + addCylinder(x, y, z, radius, length, segments, baseScale, topScale, MR_TOP); + } + + /** + * Adds a cylinder. + * + * You can make cones by either setting baseScale or topScale to zero. Setting both + * to zero will set the baseScale to 1F. + * + * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in + * the top being placed at the (x,y,z). + * + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + * @param baseScale the scaling of the base. Can be negative. + * @param topScale the scaling of the top. Can be negative. + * @param baseDirection the direction it faces + */ + public void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection) + { + addCylinder(x, y, z, radius, length, segments, baseScale, topScale, baseDirection, (int)Math.floor(radius * 2F), (int)Math.floor(radius * 2F), (int)Math.floor(length)); + } + + /** + * Adds a cylinder. + * + * You can make cones by either setting baseScale or topScale to zero. Setting both + * to zero will set the baseScale to 1F. + * + * Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in + * the top being placed at the (x,y,z). + * + * The textures for the base and top are placed next to each other, while the body + * will be placed below the circles. + * + * @param x the x-position of the base + * @param y the y-position of the base + * @param z the z-position of the base + * @param radius the radius of the cylinder + * @param length the length of the cylinder + * @param segments the amount of segments the cylinder is made of + * @param baseScale the scaling of the base. Can be negative. + * @param topScale the scaling of the top. Can be negative. + * @param baseDirection the direction it faces + * @param textureCircleDiameterW the diameter width of the circle on the texture + * @param textureCircleDiameterH the diameter height of the circle on the texture + * @param textureH the height of the texture of the body + */ + public void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH, int textureH) + { + boolean dirTop = (baseDirection == MR_TOP || baseDirection == MR_BOTTOM); + boolean dirSide = (baseDirection == MR_RIGHT || baseDirection == MR_LEFT); + boolean dirFront = (baseDirection == MR_FRONT || baseDirection == MR_BACK); + boolean dirMirror = (baseDirection == MR_LEFT || baseDirection == MR_BOTTOM || baseDirection == MR_BACK); + + boolean coneBase = (baseScale == 0); + boolean coneTop = (topScale == 0); + + if(coneBase && coneTop) + { + baseScale = 1F; + coneBase = false; + } + + PositionTextureVertex[] tempVerts = new PositionTextureVertex[segments * (coneBase || coneTop ? 1 : 2) + 2]; + TexturedPolygon[] poly = new TexturedPolygon[segments * (coneBase || coneTop ? 2 : 3)]; + + float xLength = (dirSide ? length : 0); + float yLength = (dirTop ? length : 0); + float zLength = (dirFront ? length : 0); + + float xStart = (dirMirror ? x + xLength : x); + float yStart = (dirMirror ? y + yLength : y); + float zStart = (dirMirror ? z + zLength : z); + float xEnd = (!dirMirror ? x + xLength : x); + float yEnd = (!dirMirror ? y + yLength : y); + float zEnd = (!dirMirror ? z + zLength : z); + + tempVerts[0] = new PositionTextureVertex(xStart, yStart, zStart, 0, 0); + tempVerts[tempVerts.length - 1] = new PositionTextureVertex(xEnd, yEnd, zEnd, 0, 0); + + float xCur = xStart; + float yCur = yStart; + float zCur = zStart; + float sCur = (coneBase ? topScale : baseScale); + for(int repeat = 0; repeat < (coneBase || coneTop ? 1 : 2); repeat++) + { + for(int index = 0; index < segments; index++) + { + float xSize = (mirror ^ dirMirror ? -1 : 1) * MathHelper.sin((pi / segments) * index * 2F + pi) * radius * sCur; + float zSize = -MathHelper.cos((pi / segments) * index * 2F + pi) * radius * sCur; + + float xPlace = xCur + (!dirSide ? xSize : 0); + float yPlace = yCur + (!dirTop ? zSize : 0); + float zPlace = zCur + (dirSide ? xSize : (dirTop ? zSize : 0)); + + tempVerts[1 + index + repeat * segments] = new PositionTextureVertex(xPlace, yPlace, zPlace, 0, 0 ); + } + xCur = xEnd; + yCur = yEnd; + zCur = zEnd; + sCur = topScale; + } + + float uScale = 1.0F / textureWidth; + float vScale = 1.0F / textureHeight; + float uOffset = uScale / 20.0F; + float vOffset = vScale / 20.0F; + float uCircle = textureCircleDiameterW * uScale; + float vCircle = textureCircleDiameterH * vScale; + float uWidth = (uCircle * 2F - uOffset * 2F) / segments; + float vHeight = textureH * vScale - uOffset * 2f; + float uStart = textureOffsetX * uScale; + float vStart = textureOffsetY * vScale; + + PositionTextureVertex[] vert; + for(int index = 0; index < segments; index++) + { + int index2 = (index + 1) % segments; + float uSize = MathHelper.sin((pi / segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); + float vSize = MathHelper.cos((pi / segments) * index * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); + float uSize1 = MathHelper.sin((pi / segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * uCircle - 2F * uOffset); + float vSize1 = MathHelper.cos((pi / segments) * index2 * 2F + (!dirTop ? 0 : pi)) * (0.5F * vCircle - 2F * vOffset); + vert = new PositionTextureVertex[3]; + + vert[0] = tempVerts[0].setTexturePosition(uStart + 0.5F * uCircle, vStart + 0.5F * vCircle); + vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + 0.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); + vert[2] = tempVerts[1 + index].setTexturePosition(uStart + 0.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); + + poly[index] = new TexturedPolygon(vert); + if(mirror ^ flip) + poly[index].flipFace(); + + if(!coneBase && !coneTop) + { + vert = new PositionTextureVertex[4]; + + vert[0] = tempVerts[1 + index].setTexturePosition(uStart + uOffset + uWidth * index, vStart + vOffset + vCircle); + vert[1] = tempVerts[1 + index2].setTexturePosition(uStart + uOffset + uWidth * (index + 1), vStart + vOffset + vCircle); + vert[2] = tempVerts[1 + segments + index2].setTexturePosition(uStart + uOffset + uWidth * (index + 1), vStart + vOffset + vCircle + vHeight); + vert[3] = tempVerts[1 + segments + index].setTexturePosition(uStart + uOffset + uWidth * index, vStart + vOffset + vCircle + vHeight); + poly[index + segments] = new TexturedPolygon(vert); + if(mirror ^ flip) + poly[index + segments].flipFace(); + } + + vert = new PositionTextureVertex[3]; + + vert[0] = tempVerts[tempVerts.length - 1].setTexturePosition(uStart + 1.5F * uCircle, vStart + 0.5F * vCircle); + vert[1] = tempVerts[tempVerts.length - 2 - index].setTexturePosition(uStart + 1.5F * uCircle + uSize1, vStart + 0.5F * vCircle + vSize1); + vert[2] = tempVerts[tempVerts.length - (1 + segments) + ((segments - index) % segments)].setTexturePosition(uStart + 1.5F * uCircle + uSize, vStart + 0.5F * vCircle + vSize); + + poly[poly.length - segments + index] = new TexturedPolygon(vert); + if(mirror ^ flip) + poly[poly.length - segments + index].flipFace(); + } + copyTo(tempVerts, poly); + } + + /** + * Adds a Waveform .obj file as a model. Model files use the entire texture file. + * @param file the location of the .obj file. The location is relative to the base directories, + * which are either resources/models or resources/mods/models. + */ + public void addObj(String file) + { + addModel(file, ModelPool.OBJ); + } + + /** + * Adds model format support. Model files use the entire texture file. + * @param file the location of the model file. The location is relative to the base directories, + * which are either resources/models or resources/mods/models. + * @param modelFormat the class of the model format interpreter + */ + public void addModel(String file, Class modelFormat) + { + ModelPoolEntry entry = ModelPool.addFile(file, modelFormat, transformGroup, textureGroup); + if(entry == null) + return; + PositionTextureVertex[] verts = Arrays.copyOf(entry.vertices, entry.vertices.length); + TexturedPolygon[] poly = Arrays.copyOf(entry.faces, entry.faces.length); + if(flip) + { + for (TexturedPolygon face : faces) { + face.flipFace(); + } + } + + copyTo(verts, poly, false); + } + + /** + * Sets a new position for the texture offset. + * @param x the x-coordinate of the texture start + * @param y the y-coordinate of the texture start + */ + @Override + public ModelRendererTurbo setTextureOffset(int x, int y) + { + textureOffsetX = x; + textureOffsetY = y; + return this; + } + + /** + * Sets the position of the shape, relative to the model's origins. Note that changing + * the offsets will not change the pivot of the model. + * @param x the x-position of the shape + * @param y the y-position of the shape + * @param z the z-position of the shape + */ + public void setPosition(float x, float y, float z) + { + rotationPointX = x; + rotationPointY = y; + rotationPointZ = z; + } + + /** + * Mirrors the model in any direction. + * @param x whether the model should be mirrored in the x-direction + * @param y whether the model should be mirrored in the y-direction + * @param z whether the model should be mirrored in the z-direction + */ + public void doMirror(boolean x, boolean y, boolean z) + { + for (TexturedPolygon face : faces) { + PositionTextureVertex[] verts = face.vertexPositions; + for (int j = 0; j < verts.length; j++) { + verts[j].vector3D.xCoord *= (x ? -1 : 1); + verts[j].vector3D.yCoord *= (y ? -1 : 1); + verts[j].vector3D.zCoord *= (z ? -1 : 1); + } + if (x ^ y ^ z) + face.flipFace(); + } + } + + /** + * Sets whether the shape is mirrored or not. This has effect on the way the textures + * get displayed. When working with addSprite, addPixel and addObj, it will be ignored. + * @param isMirrored a boolean to define whether the shape is mirrored + */ + public void setMirrored(boolean isMirrored) + { + mirror = isMirrored; + } + + /** + * Sets whether the shape's faces are flipped or not. When GL_CULL_FACE is enabled, + * it won't render the back faces, effectively giving you the possibility to make + * "hollow" shapes. When working with addSprite and addPixel, it will be ignored. + * @param isFlipped a boolean to define whether the shape is flipped + */ + public void setFlipped(boolean isFlipped) + { + flip = isFlipped; + } + + /** + * Clears the current shape. Since all shapes are stacked into one shape, you can't + * just replace a shape by overwriting the shape with another one. In this case you + * would need to clear the shape first. + */ + public void clear() + { + vertices = new PositionTextureVertex[0]; + faces = new TexturedPolygon[0]; + transformGroup.clear(); + transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D)); + currentGroup = transformGroup.get("0"); + } + + /** + * Copies an array of vertices and polygons to the current shape. This mainly is + * used to copy each shape to the main class, but you can just use it to copy + * your own shapes, for example from other classes, into the current class. + * @param verts the array of vertices you want to copy + * @param poly the array of polygons you want to copy + */ + public void copyTo(PositionTextureVertex[] verts, TexturedPolygon[] poly) + { + copyTo(verts, poly, true); + } + + public void copyTo(PositionTextureVertex[] verts, TexturedPolygon[] poly, boolean copyGroup) + { + vertices = Arrays.copyOf(vertices, vertices.length + verts.length); + faces = Arrays.copyOf(faces, faces.length + poly.length); + + for(int idx = 0; idx < verts.length; idx++) + { + vertices[vertices.length - verts.length + idx] = verts[idx]; + if(copyGroup && verts[idx] instanceof PositionTransformVertex) + ((PositionTransformVertex)verts[idx]).addGroup(currentGroup); + } + + for(int idx = 0; idx < poly.length; idx++) + { + faces[faces.length - poly.length + idx] = poly[idx]; + if(copyGroup) + currentTextureGroup.addPoly(poly[idx]); + } + } + + /** + * Copies an array of vertices and quads to the current shape. This method + * converts quads to polygons and then calls the main copyTo method. + * @param verts the array of vertices you want to copy + * @param quad the array of quads you want to copy + */ + public void copyTo(PositionTextureVertex[] verts, TexturedQuad[] quad) + { + TexturedPolygon[] poly = new TexturedPolygon[quad.length]; + for(int idx = 0; idx < quad.length; idx++) + { + poly[idx] = new TexturedPolygon((PositionTextureVertex[])quad[idx].vertexPositions); + } + + copyTo(verts, poly); + } + + /** + * Sets the current transformation group. The transformation group is used + * to allow for vertex transformation. If a transformation group does not exist, + * a new one will be created. + * @param groupName the name of the transformation group you want to switch to + */ + public void setGroup(String groupName) + { + setGroup(groupName, new Bone(0, 0, 0, 0), 1D); + } + + /** + * Sets the current transformation group. The transformation group is used + * to allow for vertex transformation. If a transformation group does not exist, + * a new one will be created. + * @param groupName the name of the transformation group you want to switch to + * @param bone the Bone this transformation group is attached to + * @param weight the weight of the transformation group + */ + public void setGroup(String groupName, Bone bone, double weight) + { + if(!transformGroup.containsKey(groupName)) + transformGroup.put(groupName, new TransformGroupBone(bone, weight)); + currentGroup = transformGroup.get(groupName); + } + + /** + * Gets the current transformation group. + * @return the current PositionTransformGroup. + */ + public TransformGroup getGroup() + { + return currentGroup; + } + + /** + * Gets the transformation group with a given group name. + * @return the current PositionTransformGroup. + */ + public TransformGroup getGroup(String groupName) + { + if(!transformGroup.containsKey(groupName)) + return null; + return transformGroup.get(groupName); + } + + /** + * Sets the current texture group, which is used to switch the + * textures on a per-model base. Do note that any model that is + * rendered afterwards will use the same texture. To counter it, + * set a default texture, either at initialization or before + * rendering. + * @param groupName The name of the texture group. If the texture + * group doesn't exist, it creates a new group automatically. + */ + public void setTextureGroup(String groupName) + { + if(!textureGroup.containsKey(groupName)) + { + textureGroup.put(groupName, new TextureGroup()); + } + currentTextureGroup = textureGroup.get(groupName); + } + + /** + * Gets the current texture group. + * @return a TextureGroup object. + */ + public TextureGroup getTextureGroup() + { + return currentTextureGroup; + } + + /** + * Gets the texture group with the given name. + * @param groupName the name of the texture group to return + * @return a TextureGroup object. + */ + public TextureGroup getTextureGroup(String groupName) + { + if(!textureGroup.containsKey(groupName)) + return null; + return textureGroup.get(groupName); + } + + /** + * Sets the texture of the current texture group. + * @param s the filename + */ + public void setGroupTexture(String s) + { + currentTextureGroup.texture = s; + } + + /** + * Sets the default texture. When left as an empty string, + * it will use the texture that has been set previously. + * Note that this will also move on to other rendered models + * of the same entity. + * @param s the filename + */ + public void setDefaultTexture(String s) + { + defaultTexture = s; + } + + /** + * Renders the shape. + * @param worldScale the scale of the shape. Usually is 0.0625. + */ + @Override + public void render(float worldScale) + { + render(worldScale, false); + } + + + /** + * Renders the shape + * @param worldScale The scale of the shape + * @param oldRotateOrder Whether to use the old rotate order (ZYX) instead of the new one (YZX) + */ + public void render(float worldScale, boolean oldRotateOrder) + { + if(field_1402_i) + { + return; + } + if(!showModel) + { + return; + } + if(!compiled || forcedRecompile) + { + compileDisplayList(worldScale); + } + if(rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) + { + GL11.glPushMatrix(); + GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale); + if(!oldRotateOrder && rotateAngleY != 0.0F) + { + GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); + } + if(rotateAngleZ != 0.0F) + { + GL11.glRotatef((oldRotateOrder ? -1 : 1) * rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); + } + if(oldRotateOrder && rotateAngleY != 0.0F) + { + GL11.glRotatef(-rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); + } + if(rotateAngleX != 0.0F) + { + GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); + } + + callDisplayList(); + if(childModels != null) + { + for (Object childModel : childModels) { + ((ModelRenderer) childModel).render(worldScale); + } + + } + GL11.glPopMatrix(); + } else + if(rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) + { + GL11.glTranslatef(rotationPointX * worldScale, rotationPointY * worldScale, rotationPointZ * worldScale); + callDisplayList(); + if(childModels != null) + { + for (Object childModel : childModels) { + ((ModelRenderer) childModel).render(worldScale); + } + + } + GL11.glTranslatef(-rotationPointX * worldScale, -rotationPointY * worldScale, -rotationPointZ * worldScale); + } else + { + callDisplayList(); + if(childModels != null) + { + for (Object childModel : childModels) { + ((ModelRenderer) childModel).render(worldScale); + } + + } + } + } + + @Override + public void renderWithRotation(float f) + { + if(field_1402_i) + { + return; + } + if(!showModel) + { + return; + } + if(!compiled) + { + compileDisplayList(f); + } + GL11.glPushMatrix(); + GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); + if(rotateAngleY != 0.0F) + { + GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); + } + if(rotateAngleX != 0.0F) + { + GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); + } + if(rotateAngleZ != 0.0F) + { + GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); + } + callDisplayList(); + GL11.glPopMatrix(); + } + + @Override + public void postRender(float f) + { + if(field_1402_i) + { + return; + } + if(!showModel) + { + return; + } + if(!compiled || forcedRecompile) + { + compileDisplayList(f); + } + if(rotateAngleX != 0.0F || rotateAngleY != 0.0F || rotateAngleZ != 0.0F) + { + GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); + if(rotateAngleZ != 0.0F) + { + GL11.glRotatef(rotateAngleZ * 57.29578F, 0.0F, 0.0F, 1.0F); + } + if(rotateAngleY != 0.0F) + { + GL11.glRotatef(rotateAngleY * 57.29578F, 0.0F, 1.0F, 0.0F); + } + if(rotateAngleX != 0.0F) + { + GL11.glRotatef(rotateAngleX * 57.29578F, 1.0F, 0.0F, 0.0F); + } + } else + if(rotationPointX != 0.0F || rotationPointY != 0.0F || rotationPointZ != 0.0F) + { + GL11.glTranslatef(rotationPointX * f, rotationPointY * f, rotationPointZ * f); + } + } + + private void callDisplayList() + { + if(useLegacyCompiler) + GL11.glCallList(displayList); + else + { + TextureManager renderEngine = RenderManager.instance.renderEngine; + + Collection textures = textureGroup.values(); + + Iterator itr = textures.iterator(); + for(int i = 0; itr.hasNext(); i++) + { + TextureGroup curTexGroup = itr.next(); + curTexGroup.loadTexture(); + GL11.glCallList(displayListArray[i]); + if(!defaultTexture.equals("")) + renderEngine.bindTexture(new ResourceLocation("", defaultTexture)); //TODO : Check. Not sure about this one + } + } + } + + private void compileDisplayList(float worldScale) + { + if(useLegacyCompiler) + compileLegacyDisplayList(worldScale); + else + { + Collection textures = textureGroup.values(); + + Iterator itr = textures.iterator(); + displayListArray = new int[textureGroup.size()]; + for(int i = 0; itr.hasNext(); i++) + { + displayListArray[i] = GLAllocation.generateDisplayLists(1); + GL11.glNewList(displayListArray[i], GL11.GL_COMPILE); + TmtTessellator tessellator = TmtTessellator.instance; + + TextureGroup usedGroup = itr.next(); + for(int j = 0; j < usedGroup.poly.size(); j++) + { + usedGroup.poly.get(j).draw(tessellator, worldScale); + } + + GL11.glEndList(); + } + } + + compiled = true; + } + + private void compileLegacyDisplayList(float worldScale) + { + displayList = GLAllocation.generateDisplayLists(1); + GL11.glNewList(displayList, GL11.GL_COMPILE); + TmtTessellator tessellator = TmtTessellator.instance; + for (TexturedPolygon face : faces) { + face.draw(tessellator, worldScale); + } + + GL11.glEndList(); + } + + private PositionTextureVertex vertices[]; + private TexturedPolygon faces[]; + private int textureOffsetX; + private int textureOffsetY; + private boolean compiled; + private int displayList; + private int displayListArray[]; + private Map transformGroup; + private Map textureGroup; + private TransformGroup currentGroup; + private TextureGroup currentTextureGroup; + public boolean mirror; + public boolean flip; + public boolean showModel; + public boolean field_1402_i; + public boolean forcedRecompile; + public boolean useLegacyCompiler; + public List cubeList; + public List childModels; + public final String boxName; + + private String defaultTexture; + + public static final int MR_FRONT = 0; + public static final int MR_BACK = 1; + public static final int MR_LEFT = 2; + public static final int MR_RIGHT = 3; + public static final int MR_TOP = 4; + public static final int MR_BOTTOM = 5; + + private static final float pi = (float) Math.PI; +} diff --git a/src/main/java/mekanism/defense/client/tmt/PositionTextureVertex.java b/src/main/java/mekanism/defense/client/tmt/PositionTextureVertex.java new file mode 100644 index 000000000..725bb091c --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/PositionTextureVertex.java @@ -0,0 +1,51 @@ +package defense.client.tmt; + +import net.minecraft.util.Vec3; + +public class PositionTextureVertex extends net.minecraft.client.model.PositionTextureVertex +{ + public float texturePositionW = 1F; + + public PositionTextureVertex(float par1, float par2, float par3, float par4, float par5) + { + this(par1, par2, par3, par4, par5, 1F); + } + + public PositionTextureVertex(float par1, float par2, float par3, float par4, float par5, float par6) + { + this(Vec3.createVectorHelper(par1, par2, par3), par4, par5); + } + + @Override + public PositionTextureVertex setTexturePosition(float par1, float par2) + { + return new PositionTextureVertex(this, par1, par2, 1F); + } + + public PositionTextureVertex setTexturePosition(float par1, float par2, float q) + { + return new PositionTextureVertex(this, par1, par2, q); + } + + public PositionTextureVertex(PositionTextureVertex par1PositionTextureVertex, float par2, float par3) + { + this(par1PositionTextureVertex, par2, par3, 1F); + } + + public PositionTextureVertex(PositionTextureVertex par1PositionTextureVertex, float par2, float par3, float q) + { + super(par1PositionTextureVertex, par2, par3); + this.texturePositionW = q; + } + + public PositionTextureVertex(Vec3 par1Vec3, float par2, float par3) + { + this(par1Vec3, par2, par3, 1F); + } + + public PositionTextureVertex(Vec3 par1Vec3, float par2, float par3, float par4) + { + super(par1Vec3, par2, par3); + this.texturePositionW = par4; + } +} diff --git a/src/main/java/mekanism/defense/client/tmt/PositionTransformVertex.java b/src/main/java/mekanism/defense/client/tmt/PositionTransformVertex.java new file mode 100644 index 000000000..106927b87 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/PositionTransformVertex.java @@ -0,0 +1,74 @@ +package defense.client.tmt; + +import java.util.ArrayList; + +import net.minecraft.util.Vec3; + +public class PositionTransformVertex extends PositionTextureVertex +{ + public PositionTransformVertex(float x, float y, float z, float u, float v) + { + this(Vec3.createVectorHelper(x, y, z), u, v); + } + + public PositionTransformVertex(PositionTextureVertex vertex, float u, float v) + { + super(vertex, u, v); + if(vertex instanceof PositionTransformVertex) + neutralVector = ((PositionTransformVertex)vertex).neutralVector; + else + neutralVector = Vec3.createVectorHelper(vertex.vector3D.xCoord, vertex.vector3D.yCoord, vertex.vector3D.zCoord); + } + + public PositionTransformVertex(PositionTextureVertex vertex) + { + this(vertex, vertex.texturePositionX, vertex.texturePositionY); + } + + public PositionTransformVertex(Vec3 vector, float u, float v) + { + super(vector, u, v); + neutralVector = Vec3.createVectorHelper(vector.xCoord, vector.yCoord, vector.zCoord); + } + + public void setTransformation() + { + if(transformGroups.size() == 0) + { + vector3D.xCoord = neutralVector.xCoord; + vector3D.yCoord = neutralVector.yCoord; + vector3D.zCoord = neutralVector.zCoord; + return; + } + double weight = 0D; + for (TransformGroup transformGroup : transformGroups) { + weight += transformGroup.getWeight(); + } + vector3D.xCoord = 0; + vector3D.yCoord = 0; + vector3D.zCoord = 0; + + for (TransformGroup group : transformGroups) { + double cWeight = group.getWeight() / weight; + Vec3 vector = group.doTransformation(this); + + vector3D.xCoord += cWeight * vector.xCoord; + vector3D.yCoord += cWeight * vector.yCoord; + vector3D.zCoord += cWeight * vector.zCoord; + } + } + + public void addGroup(TransformGroup group) + { + transformGroups.add(group); + } + + public void removeGroup(TransformGroup group) + { + transformGroups.remove(group); + } + + public Vec3 neutralVector; + public ArrayList transformGroups = new ArrayList(); + +} diff --git a/src/main/java/mekanism/defense/client/tmt/Shape2D.java b/src/main/java/mekanism/defense/client/tmt/Shape2D.java new file mode 100644 index 000000000..568b09f6e --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/Shape2D.java @@ -0,0 +1,149 @@ +package defense.client.tmt; + +import java.util.ArrayList; +import java.util.Collections; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +public class Shape2D +{ + public Shape2D() + { + coords = new ArrayList(); + } + + public Shape2D(Coord2D[] coordArray) + { + coords = new ArrayList(); + + Collections.addAll(coords, coordArray); + } + + public Shape2D(ArrayList coordList) + { + coords = coordList; + } + + public Coord2D[] getCoordArray() + { + return (Coord2D[]) coords.toArray(); + } + + public Shape3D extrude(float x, float y, float z, float rotX, float rotY, float rotZ, float depth, int u, int v, float textureWidth, float textureHeight, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float[] faceLengths) + { + PositionTransformVertex[] verts = new PositionTransformVertex[coords.size() * 2]; + PositionTransformVertex[] vertsTop = new PositionTransformVertex[coords.size()]; + PositionTransformVertex[] vertsBottom = new PositionTransformVertex[coords.size()]; + TexturedPolygon[] poly = new TexturedPolygon[coords.size() + 2]; + + Vec3 extrudeVector = Vec3.createVectorHelper(0, 0, depth); + + setVectorRotations(extrudeVector, rotX, rotY, rotZ); + + if(faceLengths != null && faceLengths.length < coords.size()) + faceLengths = null; + + float totalLength = 0; + + for(int idx = 0; idx < coords.size(); idx++) + { + Coord2D curCoord = coords.get(idx); + Coord2D nextCoord = coords.get((idx + 1) % coords.size()); + float texU1 = ((curCoord.uCoord + u) / textureWidth); + float texU2 = ((shapeTextureWidth * 2 - curCoord.uCoord + u) / textureWidth); + float texV = ((curCoord.vCoord + v) / textureHeight); + + Vec3 vecCoord = Vec3.createVectorHelper(curCoord.xCoord, curCoord.yCoord, 0); + + setVectorRotations(vecCoord, rotX, rotY, rotZ); + + verts[idx] = new PositionTransformVertex( + x + (float)vecCoord.xCoord, + y + (float)vecCoord.yCoord, + z + (float)vecCoord.zCoord, texU1, texV); + verts[idx + coords.size()] = new PositionTransformVertex( + x + (float)vecCoord.xCoord - (float)extrudeVector.xCoord, + y + (float)vecCoord.yCoord - (float)extrudeVector.yCoord, + z + (float)vecCoord.zCoord - (float)extrudeVector.zCoord, texU2, texV); + + vertsTop[idx] = new PositionTransformVertex(verts[idx]); + vertsBottom[coords.size() - idx - 1] = new PositionTransformVertex(verts[idx + coords.size()]); + + if(faceLengths != null) + totalLength+= faceLengths[idx]; + else + totalLength+= Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); + } + + poly[coords.size()] = new TexturedPolygon(vertsTop); + poly[coords.size() + 1] = new TexturedPolygon(vertsBottom); + + float currentLengthPosition = totalLength; + + for(int idx = 0; idx < coords.size(); idx++) + { + Coord2D curCoord = coords.get(idx); + Coord2D nextCoord = coords.get((idx + 1) % coords.size()); + float currentLength = (float)Math.sqrt(Math.pow(curCoord.xCoord - nextCoord.xCoord, 2) + Math.pow(curCoord.yCoord - nextCoord.yCoord, 2)); + if(faceLengths != null) + currentLength = faceLengths[faceLengths.length - idx - 1]; + float ratioPosition = currentLengthPosition / totalLength; + float ratioLength = (currentLengthPosition - currentLength) / totalLength; + + float texU1 = ((ratioLength * sideTextureWidth + u) / textureWidth); + float texU2 = ((ratioPosition * sideTextureWidth + u) / textureWidth); + float texV1 = (((float)v + (float)shapeTextureHeight) / textureHeight); + float texV2 = (((float)v + (float)shapeTextureHeight + sideTextureHeight) / textureHeight); + + PositionTransformVertex[] polySide = new PositionTransformVertex[4]; + + polySide[0] = new PositionTransformVertex(verts[idx], texU2, texV1); + polySide[1] = new PositionTransformVertex(verts[coords.size() + idx], texU2, texV2); + polySide[2] = new PositionTransformVertex(verts[coords.size() + ((idx + 1) % coords.size())], texU1, texV2); + polySide[3] = new PositionTransformVertex(verts[(idx + 1) % coords.size()], texU1, texV1); + + poly[idx] = new TexturedPolygon(polySide); + currentLengthPosition -= currentLength; + } + + return new Shape3D(verts, poly); + } + + protected void setVectorRotations(Vec3 vector, float xRot, float yRot, float zRot) + { + float x = xRot; + float y = yRot; + float z = zRot; + float xC = MathHelper.cos(x); + float xS = MathHelper.sin(x); + float yC = MathHelper.cos(y); + float yS = MathHelper.sin(y); + float zC = MathHelper.cos(z); + float zS = MathHelper.sin(z); + + double xVec = vector.xCoord; + double yVec = vector.yCoord; + double zVec = vector.zCoord; + + // rotation around x + double xy = xC*yVec - xS*zVec; + double xz = xC*zVec + xS*yVec; + // rotation around y + double yz = yC*xz - yS*xVec; + double yx = yC*xVec + yS*xz; + // rotation around z + double zx = zC*yx - zS*xy; + double zy = zC*xy + zS*yx; + + xVec = zx; + yVec = zy; + zVec = yz; + + vector.xCoord = xVec; + vector.yCoord = yVec; + vector.zCoord = zVec; + } + + public ArrayList coords; +} diff --git a/src/main/java/mekanism/defense/client/tmt/Shape3D.java b/src/main/java/mekanism/defense/client/tmt/Shape3D.java new file mode 100644 index 000000000..3c1847608 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/Shape3D.java @@ -0,0 +1,12 @@ +package defense.client.tmt; + +public class Shape3D +{ + public Shape3D(PositionTransformVertex[] verts, TexturedPolygon[] poly) + { + vertices = verts; + faces = poly; + } + public PositionTransformVertex[] vertices; + public TexturedPolygon[] faces; +} diff --git a/src/main/java/mekanism/defense/client/tmt/TextureGroup.java b/src/main/java/mekanism/defense/client/tmt/TextureGroup.java new file mode 100644 index 000000000..ead964bf4 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/TextureGroup.java @@ -0,0 +1,42 @@ +package defense.client.tmt; + +import java.util.ArrayList; + +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.util.ResourceLocation; + +public class TextureGroup +{ + public TextureGroup() + { + poly = new ArrayList(); + texture = ""; + } + + public void addPoly(TexturedPolygon polygon) + { + poly.add(polygon); + } + + public void loadTexture() + { + loadTexture(-1); + } + + public void loadTexture(int defaultTexture) + { + if(!texture.equals("")) + { + TextureManager renderengine = RenderManager.instance.renderEngine; + renderengine.bindTexture(new ResourceLocation("", texture)); //TODO : Check. Not sure about this one + } + else if(defaultTexture > -1) + { + RenderManager.instance.renderEngine.bindTexture(new ResourceLocation("", "")); + } + } + + public ArrayList poly; + public String texture; +} diff --git a/src/main/java/mekanism/defense/client/tmt/TexturedPolygon.java b/src/main/java/mekanism/defense/client/tmt/TexturedPolygon.java new file mode 100644 index 000000000..b148e14d7 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/TexturedPolygon.java @@ -0,0 +1,126 @@ +package defense.client.tmt; + +import java.util.ArrayList; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.util.Vec3; + +public class TexturedPolygon +{ + public TexturedPolygon(PositionTextureVertex[] apositionTexturevertex) + { + this.invertNormal = false; + this.vertexPositions = apositionTexturevertex; + this.nVertices = apositionTexturevertex.length; + this.iNormals = new ArrayList(); + this.normals = new float[0]; + } + + public TexturedPolygon(PositionTextureVertex[] apositionTexturevertex, int par2, int par3, int par4, int par5, float par6, float par7) + { + this(apositionTexturevertex); + float var8 = 0.0F / par6; + float var9 = 0.0F / par7; + apositionTexturevertex[0] = apositionTexturevertex[0].setTexturePosition(par4 / par6 - var8, par3 / par7 + var9); + apositionTexturevertex[1] = apositionTexturevertex[1].setTexturePosition(par2 / par6 + var8, par3 / par7 + var9); + apositionTexturevertex[2] = apositionTexturevertex[2].setTexturePosition(par2 / par6 + var8, par5 / par7 - var9); + apositionTexturevertex[3] = apositionTexturevertex[3].setTexturePosition(par4 / par6 - var8, par5 / par7 - var9); + } + + public void setInvertNormal(boolean isSet) + { + invertNormal = isSet; + } + + public void setNormals(float x, float y, float z) + { + normals = new float[] {x, y, z}; + } + + public void flipFace() + { + PositionTextureVertex[] var1 = new PositionTextureVertex[this.vertexPositions.length]; + + for (int var2 = 0; var2 < this.vertexPositions.length; ++var2) + { + var1[var2] = this.vertexPositions[this.vertexPositions.length - var2 - 1]; + } + + this.vertexPositions = var1; + } + + public void setNormals(ArrayList vec) + { + iNormals = vec; + } + + public void draw(TmtTessellator tessellator, float f) + { + + if(nVertices == 3) + tessellator.startDrawing(GL11.GL_TRIANGLES); + else if (nVertices == 4) + tessellator.startDrawingQuads(); + else + tessellator.startDrawing(GL11.GL_POLYGON); + + if(iNormals.size() == 0) + { + if(normals.length == 3) + { + if(invertNormal) + { + tessellator.setNormal(-normals[0], -normals[1], -normals[2]); + } else + { + tessellator.setNormal(normals[0], normals[1], normals[2]); + } + } else + if(vertexPositions.length >= 3) + { + Vec3 Vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D); + Vec3 Vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D); + Vec3 Vec32 = Vec31.crossProduct(Vec3).normalize(); + + if(invertNormal) + { + tessellator.setNormal(-(float)Vec32.xCoord, -(float)Vec32.yCoord, -(float)Vec32.zCoord); + } else + { + tessellator.setNormal((float)Vec32.xCoord, (float)Vec32.yCoord, (float)Vec32.zCoord); + } + } + else + { + return; + } + } + for(int i = 0; i < nVertices; i++) + { + PositionTextureVertex positionTexturevertex = vertexPositions[i]; + if(positionTexturevertex instanceof PositionTransformVertex) + ((PositionTransformVertex)positionTexturevertex).setTransformation(); + if(i < iNormals.size()) + { + if(invertNormal) + { + tessellator.setNormal(-(float)iNormals.get(i).xCoord, -(float)iNormals.get(i).yCoord, -(float)iNormals.get(i).zCoord); + } + else + { + tessellator.setNormal((float)iNormals.get(i).xCoord, (float)iNormals.get(i).yCoord, (float)iNormals.get(i).zCoord); + } + } + tessellator.addVertexWithUVW((float)positionTexturevertex.vector3D.xCoord * f, (float)positionTexturevertex.vector3D.yCoord * f, (float)positionTexturevertex.vector3D.zCoord * f, positionTexturevertex.texturePositionX, positionTexturevertex.texturePositionY, positionTexturevertex.texturePositionW); + } + + tessellator.draw(); + } + + public PositionTextureVertex[] vertexPositions; + public int nVertices; + private boolean invertNormal; + private float[] normals; + private ArrayList iNormals; +} diff --git a/src/main/java/mekanism/defense/client/tmt/TmtTessellator.java b/src/main/java/mekanism/defense/client/tmt/TmtTessellator.java new file mode 100644 index 000000000..a9f29e963 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/TmtTessellator.java @@ -0,0 +1,655 @@ +package defense.client.tmt; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; +import java.util.Arrays; + +import org.lwjgl.opengl.ARBBufferObject; +import org.lwjgl.opengl.ARBVertexBufferObject; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; + +import net.minecraft.client.renderer.GLAllocation; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class TmtTessellator extends Tessellator +{ + private static int nativeBufferSize = 0x200000; + private static int trivertsInBuffer = (nativeBufferSize / 48) * 6; + public static boolean renderingWorldRenderer = false; + public boolean defaultTexture = false; + private int rawBufferSize = 0; + public int textureID = 0; + /** + * Boolean used to check whether quads should be drawn as two triangles. Initialized to false and never changed. + */ + private static boolean convertQuadsToTriangles = false; + + /** + * Boolean used to check if we should use vertex buffers. Initialized to false and never changed. + */ + private static boolean tryVBO = false; + + /** The byte buffer used for GL allocation. */ + private static ByteBuffer byteBuffer = GLAllocation.createDirectByteBuffer(nativeBufferSize * 4); + + /** The same memory as byteBuffer, but referenced as an integer buffer. */ + private static IntBuffer intBuffer = byteBuffer.asIntBuffer(); + + /** The same memory as byteBuffer, but referenced as an float buffer. */ + private static FloatBuffer floatBuffer = byteBuffer.asFloatBuffer(); + + /** Short buffer */ + private static ShortBuffer shortBuffer = byteBuffer.asShortBuffer(); + + /** Raw integer array. */ + private int[] rawBuffer; + + /** + * The number of vertices to be drawn in the next draw call. Reset to 0 between draw calls. + */ + private int vertexCount = 0; + + /** The first coordinate to be used for the texture. */ + private double textureU; + + /** The second coordinate to be used for the texture. */ + private double textureV; + + /** The fourth coordinate to be used for the texture. */ + private double textureW; + private int brightness; + + /** The color (RGBA) value to be used for the following draw call. */ + private int color; + + /** + * Whether the current draw object for this tessellator has color values. + */ + private boolean hasColor = false; + + /** + * Whether the current draw object for this tessellator has texture coordinates. + */ + private boolean hasTexture = false; + private boolean hasBrightness = false; + + /** + * Whether the current draw object for this tessellator has normal values. + */ + private boolean hasNormals = false; + + /** The index into the raw buffer to be used for the next data. */ + private int rawBufferIndex = 0; + + /** + * The number of vertices manually added to the given draw call. This differs from vertexCount because it adds extra + * vertices when converting quads to triangles. + */ + private int addedVertices = 0; + + /** Disables all color information for the following draw call. */ + private boolean isColorDisabled = false; + + /** The draw mode currently being used by the tessellator. */ + public int drawMode; + + /** + * An offset to be applied along the x-axis for all vertices in this draw call. + */ + public double xOffset; + + /** + * An offset to be applied along the y-axis for all vertices in this draw call. + */ + public double yOffset; + + /** + * An offset to be applied along the z-axis for all vertices in this draw call. + */ + public double zOffset; + + /** The normal to be applied to the face being drawn. */ + private int normal; + + /** The static instance of the Tessellator. */ + public static TmtTessellator instance = new TmtTessellator(2097152); + + /** Whether this tessellator is currently in draw mode. */ + public boolean isDrawing = false; + + /** Whether we are currently using VBO or not. */ + private static boolean useVBO = false; + + /** An IntBuffer used to store the indices of vertex buffer objects. */ + private static IntBuffer vertexBuffers; + + /** + * The index of the last VBO used. This is used in round-robin fashion, sequentially, through the vboCount vertex + * buffers. + */ + private int vboIndex = 0; + + /** Number of vertex buffer objects allocated for use. */ + private static int vboCount = 10; + + /** The size of the buffers used (in integers). */ + private int bufferSize; + + private TmtTessellator(int par1) + { + } + + public TmtTessellator() + { + } + + static + { + instance.defaultTexture = true; + useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; + + if (useVBO) + { + vertexBuffers = GLAllocation.createDirectIntBuffer(vboCount); + ARBBufferObject.glGenBuffersARB(vertexBuffers); + } + } + + /** + * Draws the data set up in this tessellator and resets the state to prepare for new drawing. + */ + @Override + public int draw() + { + if (!this.isDrawing) + { + throw new IllegalStateException("Not tesselating!"); + } + else + { + this.isDrawing = false; + + int offs = 0; + while (offs < vertexCount) + { + int vtc = 0; + if (drawMode == 7 && convertQuadsToTriangles) + { + vtc = Math.min(vertexCount - offs, trivertsInBuffer); + } + else + { + vtc = Math.min(vertexCount - offs, nativeBufferSize >> 5); + } + TmtTessellator.intBuffer.clear(); + TmtTessellator.intBuffer.put(this.rawBuffer, offs * 10, vtc * 10); + TmtTessellator.byteBuffer.position(0); + TmtTessellator.byteBuffer.limit(vtc * 40); + offs += vtc; + + if (TmtTessellator.useVBO) + { + this.vboIndex = (this.vboIndex + 1) % TmtTessellator.vboCount; + ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, TmtTessellator.vertexBuffers.get(this.vboIndex)); + ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, TmtTessellator.byteBuffer, ARBBufferObject.GL_STREAM_DRAW_ARB); + } + + if (this.hasTexture) + { + if (TmtTessellator.useVBO) + { + GL11.glTexCoordPointer(4, GL11.GL_FLOAT, 40, 12L); + } + else + { + TmtTessellator.floatBuffer.position(3); + GL11.glTexCoordPointer(4, 40, TmtTessellator.floatBuffer); + } + + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) + { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + + if (TmtTessellator.useVBO) + { + GL11.glTexCoordPointer(2, GL11.GL_SHORT, 40, 36L); + } + else + { + TmtTessellator.shortBuffer.position(18); + GL11.glTexCoordPointer(2, 40, TmtTessellator.shortBuffer); + } + + GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) + { + if (TmtTessellator.useVBO) + { + GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 40, 28L); + } + else + { + TmtTessellator.byteBuffer.position(28); + GL11.glColorPointer(4, true, 40, TmtTessellator.byteBuffer); + } + + GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) + { + if (TmtTessellator.useVBO) + { + GL11.glNormalPointer(GL11.GL_UNSIGNED_BYTE, 40, 32L); + } + else + { + TmtTessellator.byteBuffer.position(32); + GL11.glNormalPointer(40, TmtTessellator.byteBuffer); + } + + GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); + } + + if (TmtTessellator.useVBO) + { + GL11.glVertexPointer(3, GL11.GL_FLOAT, 40, 0L); + } + else + { + TmtTessellator.floatBuffer.position(0); + GL11.glVertexPointer(3, 40, TmtTessellator.floatBuffer); + } + + GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); + + if (this.drawMode == 7 && convertQuadsToTriangles) + { + GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, vtc); + } + else + { + GL11.glDrawArrays(this.drawMode, 0, vtc); + } + + GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); + + if (this.hasTexture) + { + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + } + + if (this.hasBrightness) + { + OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); + OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); + } + + if (this.hasColor) + { + GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); + } + + if (this.hasNormals) + { + GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); + } + } + + if (rawBufferSize > 0x20000 && rawBufferIndex < (rawBufferSize << 3)) + { + rawBufferSize = 0; + rawBuffer = null; + } + + int var1 = this.rawBufferIndex * 4; + this.reset(); + return var1; + } + } + + /** + * Clears the tessellator state in preparation for new drawing. + */ + private void reset() + { + this.vertexCount = 0; + TmtTessellator.byteBuffer.clear(); + this.rawBufferIndex = 0; + this.addedVertices = 0; + } + + /** + * Sets draw mode in the tessellator to draw quads. + */ + @Override + public void startDrawingQuads() + { + this.startDrawing(7); + } + + /** + * Resets tessellator state and prepares for drawing (with the specified draw mode). + */ + @Override + public void startDrawing(int par1) + { + if (this.isDrawing) + { + throw new IllegalStateException("Already tesselating!"); + } + else + { + this.isDrawing = true; + this.reset(); + this.drawMode = par1; + this.hasNormals = false; + this.hasColor = false; + this.hasTexture = false; + this.hasBrightness = false; + this.isColorDisabled = false; + } + } + + /** + * Sets the texture coordinates. + */ + @Override + public void setTextureUV(double par1, double par3) + { + this.hasTexture = true; + this.textureU = par1; + this.textureV = par3; + this.textureW = 1.0D; + } + + /** + * Sets the texture coordinates. + */ + public void setTextureUVW(double par1, double par3, double par4) + { + this.hasTexture = true; + this.textureU = par1; + this.textureV = par3; + this.textureW = par4; + } + + @Override + public void setBrightness(int par1) + { + this.hasBrightness = true; + this.brightness = par1; + } + + /** + * Sets the RGB values as specified, converting from floats between 0 and 1 to integers from 0-255. + */ + @Override + public void setColorOpaque_F(float par1, float par2, float par3) + { + this.setColorOpaque((int)(par1 * 255.0F), (int)(par2 * 255.0F), (int)(par3 * 255.0F)); + } + + /** + * Sets the RGBA values for the color, converting from floats between 0 and 1 to integers from 0-255. + */ + @Override + public void setColorRGBA_F(float par1, float par2, float par3, float par4) + { + this.setColorRGBA((int)(par1 * 255.0F), (int)(par2 * 255.0F), (int)(par3 * 255.0F), (int)(par4 * 255.0F)); + } + + /** + * Sets the RGB values as specified, and sets alpha to opaque. + */ + @Override + public void setColorOpaque(int par1, int par2, int par3) + { + this.setColorRGBA(par1, par2, par3, 255); + } + + /** + * Sets the RGBA values for the color. Also clamps them to 0-255. + */ + @Override + public void setColorRGBA(int par1, int par2, int par3, int par4) + { + if (!this.isColorDisabled) + { + if (par1 > 255) + { + par1 = 255; + } + + if (par2 > 255) + { + par2 = 255; + } + + if (par3 > 255) + { + par3 = 255; + } + + if (par4 > 255) + { + par4 = 255; + } + + if (par1 < 0) + { + par1 = 0; + } + + if (par2 < 0) + { + par2 = 0; + } + + if (par3 < 0) + { + par3 = 0; + } + + if (par4 < 0) + { + par4 = 0; + } + + this.hasColor = true; + + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) + { + this.color = par4 << 24 | par3 << 16 | par2 << 8 | par1; + } + else + { + this.color = par1 << 24 | par2 << 16 | par3 << 8 | par4; + } + } + } + + /** + * Adds a vertex specifying both x,y,z and the texture u,v for it. + */ + @Override + public void addVertexWithUV(double par1, double par3, double par5, double par7, double par9) + { + this.setTextureUV(par7, par9); + this.addVertex(par1, par3, par5); + } + + public void addVertexWithUVW(double par1, double par3, double par5, double par7, double par9, double par10) + { + this.setTextureUVW(par7, par9, par10); + this.addVertex(par1, par3, par5); + } + + /** + * Adds a vertex with the specified x,y,z to the current draw call. It will trigger a draw() if the buffer gets + * full. + */ + @Override + public void addVertex(double par1, double par3, double par5) + { + if (rawBufferIndex >= rawBufferSize - 40) + { + if (rawBufferSize == 0) + { + rawBufferSize = 0x10000; + rawBuffer = new int[rawBufferSize]; + } + else + { + rawBufferSize *= 2; + rawBuffer = Arrays.copyOf(rawBuffer, rawBufferSize); + } + } + ++this.addedVertices; + + if (this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0) + { + for (int var7 = 0; var7 < 2; ++var7) + { + int var8 = 10 * (3 - var7); + + if (this.hasTexture) + { + this.rawBuffer[this.rawBufferIndex + 3] = this.rawBuffer[this.rawBufferIndex - var8 + 3]; + this.rawBuffer[this.rawBufferIndex + 4] = this.rawBuffer[this.rawBufferIndex - var8 + 4]; + this.rawBuffer[this.rawBufferIndex + 5] = this.rawBuffer[this.rawBufferIndex - var8 + 5]; + this.rawBuffer[this.rawBufferIndex + 6] = this.rawBuffer[this.rawBufferIndex - var8 + 6]; + } + + if (this.hasBrightness) + { + this.rawBuffer[this.rawBufferIndex + 9] = this.rawBuffer[this.rawBufferIndex - var8 + 9]; + } + + if (this.hasColor) + { + this.rawBuffer[this.rawBufferIndex + 7] = this.rawBuffer[this.rawBufferIndex - var8 + 7]; + } + + this.rawBuffer[this.rawBufferIndex] = this.rawBuffer[(this.rawBufferIndex - var8)]; + this.rawBuffer[this.rawBufferIndex + 1] = this.rawBuffer[this.rawBufferIndex - var8 + 1]; + this.rawBuffer[this.rawBufferIndex + 2] = this.rawBuffer[this.rawBufferIndex - var8 + 2]; + ++this.vertexCount; + this.rawBufferIndex += 10; + } + } + + if (this.hasTexture) + { + this.rawBuffer[this.rawBufferIndex + 3] = Float.floatToRawIntBits((float)this.textureU); + this.rawBuffer[this.rawBufferIndex + 4] = Float.floatToRawIntBits((float)this.textureV); + this.rawBuffer[this.rawBufferIndex + 5] = Float.floatToRawIntBits(0.0F); + this.rawBuffer[this.rawBufferIndex + 6] = Float.floatToRawIntBits((float)this.textureW); + } + + if (this.hasBrightness) + { + this.rawBuffer[this.rawBufferIndex + 9] = this.brightness; + } + + if (this.hasColor) + { + this.rawBuffer[this.rawBufferIndex + 7] = this.color; + } + + if (this.hasNormals) + { + this.rawBuffer[this.rawBufferIndex + 8] = this.normal; + } + + this.rawBuffer[this.rawBufferIndex] = Float.floatToRawIntBits((float)(par1 + this.xOffset)); + this.rawBuffer[this.rawBufferIndex + 1] = Float.floatToRawIntBits((float)(par3 + this.yOffset)); + this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); + this.rawBufferIndex += 10; + ++this.vertexCount; + } + + /** + * Sets the color to the given opaque value (stored as byte values packed in an integer). + */ + @Override + public void setColorOpaque_I(int par1) + { + int j = par1 >> 16 & 255; + int k = par1 >> 8 & 255; + int l = par1 & 255; + this.setColorOpaque(j, k, l); + } + + /** + * Sets the color to the given color (packed as bytes in integer) and alpha values. + */ + @Override + public void setColorRGBA_I(int par1, int par2) + { + int k = par1 >> 16 & 255; + int l = par1 >> 8 & 255; + int i1 = par1 & 255; + this.setColorRGBA(k, l, i1, par2); + } + + /** + * Disables colors for the current draw call. + */ + @Override + public void disableColor() + { + this.isColorDisabled = true; + } + + /** + * Sets the normal for the current draw call. + */ + @Override + public void setNormal(float par1, float par2, float par3) + { + this.hasNormals = true; + byte b0 = (byte)((int)(par1 * 127.0F)); + byte b1 = (byte)((int)(par2 * 127.0F)); + byte b2 = (byte)((int)(par3 * 127.0F)); + this.normal = b0 & 255 | (b1 & 255) << 8 | (b2 & 255) << 16; + } + + /** + * Sets the translation for all vertices in the current draw call. + */ + @Override + public void setTranslation(double par1, double par3, double par5) + { + this.xOffset = par1; + this.yOffset = par3; + this.zOffset = par5; + } + + /** + * Offsets the translation for all vertices in the current draw call. + */ + @Override + public void addTranslation(float par1, float par2, float par3) + { + this.xOffset += par1; + this.yOffset += par2; + this.zOffset += par3; + } +} diff --git a/src/main/java/mekanism/defense/client/tmt/TransformGroup.java b/src/main/java/mekanism/defense/client/tmt/TransformGroup.java new file mode 100644 index 000000000..f988cd351 --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/TransformGroup.java @@ -0,0 +1,9 @@ +package defense.client.tmt; + +import net.minecraft.util.Vec3; + +public abstract class TransformGroup +{ + public abstract double getWeight(); + public abstract Vec3 doTransformation(PositionTransformVertex vertex); +} diff --git a/src/main/java/mekanism/defense/client/tmt/TransformGroupBone.java b/src/main/java/mekanism/defense/client/tmt/TransformGroupBone.java new file mode 100644 index 000000000..9c26070ff --- /dev/null +++ b/src/main/java/mekanism/defense/client/tmt/TransformGroupBone.java @@ -0,0 +1,113 @@ +package defense.client.tmt; + +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; + +/** + * The PositionTransformGroup class adds a class which allows for vertex transformations. + * @author GaryCXJk + * + */ +public class TransformGroupBone extends TransformGroup +{ + public TransformGroupBone(Bone bone, double wght) + { + baseVector = bone.getPosition(); + baseAngles = bone.getAbsoluteAngle(); + attachedBone = bone; + weight = wght; + } + + public Angle3D getBaseAngles() + { + return baseAngles.copy(); + } + + public Angle3D getTransformAngle() + { + Angle3D returnAngle = attachedBone.getAbsoluteAngle().copy(); + returnAngle.angleX-= baseAngles.angleX; + returnAngle.angleY-= baseAngles.angleY; + returnAngle.angleZ-= baseAngles.angleZ; + return returnAngle; + } + + public Vec3 getBaseVector() + { + return Vec3.createVectorHelper(baseVector.xCoord, baseVector.yCoord, baseVector.zCoord); + } + + public Vec3 getTransformVector() + { + return baseVector.subtract(attachedBone.getPosition()); + } + + public Vec3 getCurrentVector() + { + return attachedBone.getPosition(); + } + + @Override + public double getWeight() + { + return weight; + } + + public void attachBone(Bone bone) + { + baseVector = bone.getPosition(); + baseAngles = bone.getAbsoluteAngle(); + attachedBone = bone; + } + + @Override + public Vec3 doTransformation(PositionTransformVertex vertex) + { + Vec3 vector = Vec3.createVectorHelper(vertex.neutralVector.xCoord, vertex.neutralVector.yCoord, vertex.neutralVector.zCoord); + vector = getBaseVector().subtract(vector); + Angle3D angle = getTransformAngle(); + setVectorRotations(vector, angle.angleX, angle.angleY, angle.angleZ); + + return vector; + } + + protected void setVectorRotations(Vec3 vector, float xRot, float yRot, float zRot) + { + float x = xRot; + float y = yRot; + float z = zRot; + float xC = MathHelper.cos(x); + float xS = MathHelper.sin(x); + float yC = MathHelper.cos(y); + float yS = MathHelper.sin(y); + float zC = MathHelper.cos(z); + float zS = MathHelper.sin(z); + + double xVec = vector.xCoord; + double yVec = vector.yCoord; + double zVec = vector.zCoord; + + // rotation around x + double xy = xC*yVec - xS*zVec; + double xz = xC*zVec + xS*yVec; + // rotation around y + double yz = yC*xz - yS*xVec; + double yx = yC*xVec + yS*xz; + // rotation around z + double zx = zC*yx - zS*xy; + double zy = zC*xy + zS*yx; + + xVec = zx; + yVec = zy; + zVec = yz; + + vector.xCoord = xVec; + vector.yCoord = yVec; + vector.zCoord = zVec; + } + + protected Angle3D baseAngles; + protected Vec3 baseVector; + protected Bone attachedBone; + protected double weight; +} diff --git a/src/main/java/mekanism/defense/common/CommandHandler.java b/src/main/java/mekanism/defense/common/CommandHandler.java new file mode 100644 index 000000000..ae341a579 --- /dev/null +++ b/src/main/java/mekanism/defense/common/CommandHandler.java @@ -0,0 +1,185 @@ +package defense.common; + +import java.util.List; + +import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.command.WrongUsageException; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import defense.common.entity.EntityExplosion; +import defense.common.entity.EntityFlyingBlock; +import defense.common.entity.EntityMissile; +import defense.common.explosive.blast.BlastEMP; + +public class CommandHandler extends CommandBase +{ + @Override + public String getCommandName() + { + return Reference.DOMAIN; + } + + @Override + public String getCommandUsage(ICommandSender par1ICommandSender) + { + return "/" + Reference.DOMAIN + " help"; + } + + @Override + public void processCommand(ICommandSender sender, String[] args) + { + try { + EntityPlayer entityPlayer = (EntityPlayer)sender; + int dimension = entityPlayer.worldObj.provider.dimensionId; + + if(args == null || args.length == 0 || args[0].equalsIgnoreCase("help")) + { + sender.addChatMessage(new ChatComponentText("/" + Reference.DOMAIN + " help")); + sender.addChatMessage(new ChatComponentText("/" + Reference.DOMAIN + " lag ")); + sender.addChatMessage(new ChatComponentText("/" + Reference.DOMAIN + " remove ")); + sender.addChatMessage(new ChatComponentText("/" + Reference.DOMAIN + " emp ")); + + return; + } + else if(args.length >= 2 && args[0].equalsIgnoreCase("lag")) + { + int radius = parseInt(sender, args[1]); + + if(radius > 0) + { + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(entityPlayer.posX - radius, entityPlayer.posY - radius, entityPlayer.posZ - radius, entityPlayer.posX + radius, entityPlayer.posY + radius, entityPlayer.posZ + radius); + List entitiesNearby = entityPlayer.worldObj.getEntitiesWithinAABB(Entity.class, bounds); + + for(Entity entity : entitiesNearby) + { + if(entity instanceof EntityFlyingBlock) + { + ((EntityFlyingBlock) entity).setBlock(); + } + else if(entity instanceof EntityMissile) + { + entity.setDead(); + } + else if(entity instanceof EntityExplosion) + { + entity.setDead(); + } + } + + sender.addChatMessage(new ChatComponentText("Removed all mod-related lag sources within " + radius + " radius.")); + + return; + } + else { + throw new WrongUsageException("Radius needs to be higher than zero"); + } + } + else if(args.length >= 3 && args[0].equalsIgnoreCase("remove")) + { + int radius = parseInt(sender, args[2]); + boolean all = args[1].equalsIgnoreCase("all"); + boolean missile = args[1].equalsIgnoreCase("missiles"); + boolean explosion = args[1].equalsIgnoreCase("explosion"); + String str = "entities"; + + if(missile) + { + str = "missiles"; + } + else if(explosion) + { + str = "explosions"; + } + + if(radius > 0) + { + EntityPlayer player = (EntityPlayer)sender; + + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(player.posX - radius, player.posY - radius, player.posZ - radius, player.posX + radius, player.posY + radius, player.posZ + radius); + List entitiesNearby = player.worldObj.getEntitiesWithinAABB(Entity.class, bounds); + + for(Entity entity : entitiesNearby) + { + if((all || explosion) && entity instanceof EntityFlyingBlock) + { + ((EntityFlyingBlock) entity).setBlock(); + } + else if((all || missile) && entity instanceof EntityMissile) + { + entity.setDead(); + } + else if((all || explosion) && entity instanceof EntityExplosion) + { + entity.setDead(); + } + } + + sender.addChatMessage(new ChatComponentText("Removed all mod-related " + str + " within " + radius + " radius.")); + + return; + } + else { + throw new WrongUsageException("Radius needs to be higher than zero"); + } + } + else if(args.length >= 2 && args[0].equalsIgnoreCase("emp")) + { + int radius = parseInt(sender, args[1]); + + if(radius > 0) + { + new BlastEMP(entityPlayer.worldObj, null, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, radius).setEffectBlocks().setEffectEntities().doExplode(); + + switch(entityPlayer.worldObj.rand.nextInt(20)) + { + case 0: + sender.addChatMessage(new ChatComponentText("Did you pay the power bill?")); + return; + case 1: + sender.addChatMessage(new ChatComponentText("See them power their toys now!")); + return; + case 2: + sender.addChatMessage(new ChatComponentText("Hey who turned the lights out.")); + return; + case 3: + sender.addChatMessage(new ChatComponentText("Ha! I run on steam power!")); + return; + case 4: + sender.addChatMessage(new ChatComponentText("The power of lighting at my finger tips!")); + return; + default: + sender.addChatMessage(new ChatComponentText("Zap!")); + return; + } + } + else { + throw new WrongUsageException("Radius needs to be higher than zero"); + } + } + } catch(Exception e) {} + + throw new WrongUsageException(getCommandUsage(sender)); + } + + @Override + public int getRequiredPermissionLevel() + { + return 2; + } + + @Override + public List addTabCompletionOptions(ICommandSender sender, String[] args) + { + return args.length == 1 ? getListOfStringsMatchingLastWord(args, new String[] {"lag"}) : null; + } + + @Override + public int compareTo(Object par1Obj) + { + return compareTo((ICommand)par1Obj); + } +} diff --git a/src/main/java/mekanism/defense/common/CommonProxy.java b/src/main/java/mekanism/defense/common/CommonProxy.java new file mode 100644 index 000000000..171bafa90 --- /dev/null +++ b/src/main/java/mekanism/defense/common/CommonProxy.java @@ -0,0 +1,116 @@ +package defense.common; + +import java.util.List; + +import mekanism.api.Pos3D; +import mekanism.common.inventory.container.ContainerNull; +import mekanism.common.tile.TileEntityContainerBlock; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.registry.GameRegistry; +import defense.api.IItemFrequency; +import defense.common.entity.EntityMissile; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.inventory.container.ContainerCruiseLauncher; +import defense.common.tile.TileCruiseLauncher; +import defense.common.tile.TileEMPTower; +import defense.common.tile.TileExplosive; +import defense.common.tile.TileLauncherBase; +import defense.common.tile.TileLauncherFrame; +import defense.common.tile.TileLauncherScreen; +import defense.common.tile.TileRadarStation; + +public class CommonProxy implements IGuiHandler +{ + public void preInit() {} + + public void init() + { + GameRegistry.registerTileEntity(TileCruiseLauncher.class, "CruiseLauncher"); + GameRegistry.registerTileEntity(TileLauncherBase.class, "LauncherBase"); + GameRegistry.registerTileEntity(TileLauncherScreen.class, "LauncherScreen"); + GameRegistry.registerTileEntity(TileLauncherFrame.class, "LauncherFrame"); + GameRegistry.registerTileEntity(TileRadarStation.class, "RadarStation"); + GameRegistry.registerTileEntity(TileEMPTower.class, "EMPTower"); + GameRegistry.registerTileEntity(TileExplosive.class, "Explosive"); + } + + public void loadConfiguration() + { + Settings.initiate(); + + for(Explosive explosive : ExplosiveRegistry.getExplosives()) + { + explosive.isDisabled = !Settings.CONFIGURATION.get("explosives", explosive.getUnlocalizedName(), true).getBoolean(true); + } + + if(Settings.CONFIGURATION.hasChanged()) + { + Settings.CONFIGURATION.save(); + } + } + + @Override + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + return null; + } + + @Override + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof IItemFrequency) + { + return new ContainerNull(player, null); + } + else if(tileEntity instanceof TileCruiseLauncher) + { + return new ContainerCruiseLauncher(player.inventory, (TileCruiseLauncher)tileEntity); + } + else if(tileEntity instanceof TileLauncherScreen || tileEntity instanceof TileRadarStation || tileEntity instanceof TileEMPTower || tileEntity instanceof TileLauncherBase) + { + return new ContainerNull(player, (TileEntityContainerBlock)tileEntity); + } + + return null; + } + + public boolean isFancyGraphicsEnabled() + { + return false; + } + + public void spawnParticle(String name, World world, Pos3D position, float scale, double distance) + { + spawnParticle(name, world, position, 0, 0, 0, scale, distance); + } + + public void spawnParticle(String name, World world, Pos3D position, double motionX, double motionY, double motionZ, float scale, double distance) + { + spawnParticle(name, world, position, motionX, motionY, motionZ, 1, 1, 1, scale, distance); + } + + public void spawnParticle(String name, World world, Pos3D position, double motionX, double motionY, double motionZ, float red, float green, float blue, float scale, double distance) {} + + public void playSound(EntityMissile missile) {} + + public int getParticleSetting() + { + return -1; + } + + public List getEntityFXs() + { + return null; + } + + public void spawnShock(World world, Pos3D position, Pos3D target) {} + + public void spawnShock(World world, Pos3D startVec, Pos3D targetVec, int duration) {} +} diff --git a/src/main/java/mekanism/defense/common/CreativeTabHandler.java b/src/main/java/mekanism/defense/common/CreativeTabHandler.java new file mode 100644 index 000000000..25e69b863 --- /dev/null +++ b/src/main/java/mekanism/defense/common/CreativeTabHandler.java @@ -0,0 +1,35 @@ +package defense.common; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class CreativeTabHandler extends CreativeTabs +{ + public static final CreativeTabHandler INSTANCE = new CreativeTabHandler(); + + public static ItemStack itemStack; + + public CreativeTabHandler() + { + super(CreativeTabs.getNextID(), Reference.NAME); + } + + @Override + public ItemStack getIconItemStack() + { + if(itemStack == null) + { + itemStack = new ItemStack(Blocks.tnt); + } + + return itemStack; + } + + @Override + public Item getTabIconItem() + { + return getIconItemStack().getItem(); + } +} diff --git a/src/main/java/mekanism/defense/common/DamageUtility.java b/src/main/java/mekanism/defense/common/DamageUtility.java new file mode 100644 index 000000000..41e596d0b --- /dev/null +++ b/src/main/java/mekanism/defense/common/DamageUtility.java @@ -0,0 +1,76 @@ +package defense.common; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; +import defense.api.IMissile; + +/** Utility that handles how damage is applied to entities + * + * @author DarkGuardsman */ +public class DamageUtility +{ + /** Can a damage source harm the entity in question. + * + * @param entity - entity being attacked + * @param source - damage source/type + * @param damage - amount of damage + * @return true if the damage can be applied */ + public static boolean canHarm(Entity entity, DamageSource source, float damage) + { + if(canDamage(entity)) + { + if(isMachine(entity)) + { + if(source.isFireDamage()) + { + return false; + } + else if(source.isMagicDamage()) + { + return false; + } + } + + return source != null && damage > 0; + } + + return false; + } + + /** Can damage be applied at all to the entity + * + * @param entity - entity being attacked + * @return true if the entity can be damaged */ + public static boolean canDamage(Entity entity) + { + if(entity != null) + { + if(!entity.isEntityInvulnerable() && entity.isEntityAlive()) + { + if(entity instanceof EntityPlayer) + { + if(((EntityPlayer) entity).capabilities.isCreativeMode) + { + return false; + } + } + + return true; + } + } + + return false; + } + + /** Checks if the entity is an entity made of metal, or is a machine in nature. */ + public static boolean isMachine(Entity entity) + { + if(entity instanceof IMissile) + { + return true; + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/DefenseTech.java b/src/main/java/mekanism/defense/common/DefenseTech.java new file mode 100644 index 000000000..a03166c9f --- /dev/null +++ b/src/main/java/mekanism/defense/common/DefenseTech.java @@ -0,0 +1,421 @@ +package defense.common; + +import java.util.List; +import java.util.logging.Logger; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import mekanism.common.MekanismBlocks; +import mekanism.common.MekanismItems; +import mekanism.common.Tier.BaseTier; +import mekanism.common.Tier.EnergyCubeTier; +import mekanism.common.Version; +import mekanism.common.item.ItemEnergized; +import mekanism.common.recipe.ShapedMekanismRecipe; +import mekanism.common.util.MekanismUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockDispenser; +import net.minecraft.block.BlockRailBase; +import net.minecraft.command.ICommandManager; +import net.minecraft.command.ServerCommandManager; +import net.minecraft.dispenser.BehaviorDefaultDispenseItem; +import net.minecraft.dispenser.IBehaviorDispenseItem; +import net.minecraft.dispenser.IBlockSource; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumFacing; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeChunkManager; +import net.minecraftforge.common.ForgeChunkManager.LoadingCallback; +import net.minecraftforge.common.ForgeChunkManager.Ticket; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.EntityEvent.EnteringChunk; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import cpw.mods.fml.client.event.ConfigChangedEvent; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.Mod.Instance; +import cpw.mods.fml.common.Mod.Metadata; +import cpw.mods.fml.common.ModMetadata; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import cpw.mods.fml.common.registry.EntityRegistry; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import defense.api.FrequencyGrid; +import defense.common.base.IChunkLoadHandler; +import defense.common.block.BlockMachine.MachineData; +import defense.common.entity.EntityBombCart; +import defense.common.entity.EntityExplosion; +import defense.common.entity.EntityExplosive; +import defense.common.entity.EntityFlyingBlock; +import defense.common.entity.EntityFragments; +import defense.common.entity.EntityGrenade; +import defense.common.entity.EntityLightBeam; +import defense.common.entity.EntityMissile; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.network.PacketItem; +import defense.common.network.PacketItem.ItemMessage; +import defense.common.potion.ContagiousPoison; +import defense.common.potion.PoisonContagion; +import defense.common.potion.PoisonFrostBite; +import defense.common.potion.PoisonToxin; +import defense.common.potion.PotionUtility; + +@Mod(modid = Reference.NAME, name = Reference.NAME, version = "GRADLE_MODVERSION", guiFactory = "defense.client.gui.ConfigGuiFactory", dependencies = "required-after:Mekanism") +public final class DefenseTech +{ + @Instance(Reference.NAME) + public static DefenseTech INSTANCE; + + @Metadata(Reference.NAME) + public static ModMetadata metadata; + + @SidedProxy(clientSide = Reference.DOMAIN + ".client.ClientProxy", serverSide = Reference.DOMAIN + ".common.CommonProxy") + public static CommonProxy proxy; + + public static final ContagiousPoison poisonous_potion = new ContagiousPoison("Chemical", 1, false); + public static final ContagiousPoison contagios_potion = new ContagiousPoison("Contagious", 1, true); + + public static Version versionNumber = new Version(GRADLE_VERSIONMOD); + + public static String latestVersionNumber; + public static String recentNews; + + public static final Logger LOGGER = Logger.getLogger(Reference.NAME); + + public static SimpleNetworkWrapper netHandler = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.CHANNEL); + + @EventHandler + public void preInit(FMLPreInitializationEvent event) + { + NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy); + FMLCommonHandler.instance().bus().register(INSTANCE); + MinecraftForge.EVENT_BUS.register(INSTANCE); + MinecraftForge.EVENT_BUS.register(proxy); + + Explosive.register(); + + proxy.loadConfiguration(); + + DefenseTechItems.register(); + DefenseTechBlocks.register(); + + PotionUtility.resizePotionArray(); + + /** Decrease Obsidian Resistance */ + Blocks.obsidian.setResistance((float)Settings.REDUCE_OBSIDIAN_RESISTANCE); + LOGGER.fine("Changed obsidian explosive resistance to: " + Blocks.obsidian.getExplosionResistance(null)); + + /** Potion Effects */ + PoisonToxin.INSTANCE = new PoisonToxin(PotionUtility.getNextOptimalPotId(), true, 5149489, "toxin"); + PoisonContagion.INSTANCE = new PoisonContagion(PotionUtility.getNextOptimalPotId(), false, 5149489, "virus"); + PoisonFrostBite.INSTANCE = new PoisonFrostBite(PotionUtility.getNextOptimalPotId(), false, 5149489, "frostBite"); + + CreativeTabHandler.itemStack = new ItemStack(DefenseTechBlocks.blockExplosive); + + /** Dispenser Handler */ + BlockDispenser.dispenseBehaviorRegistry.putObject(DefenseTechItems.itemGrenade, new IBehaviorDispenseItem() { + @Override + public ItemStack dispense(IBlockSource blockSource, ItemStack itemStack) + { + World world = blockSource.getWorld(); + + if(!world.isRemote) + { + int x = blockSource.getXInt(); + int y = blockSource.getYInt(); + int z = blockSource.getZInt(); + EnumFacing enumFacing = EnumFacing.getFront(blockSource.getBlockMetadata()); + + EntityGrenade entity = new EntityGrenade(world, new Pos3D(x, y, z), itemStack.getItemDamage()); + entity.setThrowableHeading(enumFacing.getFrontOffsetX(), 0.1D, enumFacing.getFrontOffsetZ(), 0.5F, 1.0F); + world.spawnEntityInWorld(entity); + } + + itemStack.stackSize--; + + return itemStack; + } + }); + + BlockDispenser.dispenseBehaviorRegistry.putObject(DefenseTechItems.itemBombCart, new IBehaviorDispenseItem() { + private final BehaviorDefaultDispenseItem defaultItemDispenseBehavior = new BehaviorDefaultDispenseItem(); + + @Override + public ItemStack dispense(IBlockSource blockSource, ItemStack itemStack) + { + World world = blockSource.getWorld(); + + if(!world.isRemote) + { + int x = blockSource.getXInt(); + int y = blockSource.getYInt(); + int z = blockSource.getZInt(); + + EnumFacing var3 = EnumFacing.getFront(blockSource.getBlockMetadata()); + World var4 = blockSource.getWorld(); + double var5 = blockSource.getX() + var3.getFrontOffsetX() * 1.125F; + double var7 = blockSource.getY(); + double var9 = blockSource.getZ() + var3.getFrontOffsetZ() * 1.125F; + int var11 = blockSource.getXInt() + var3.getFrontOffsetX(); + int var12 = blockSource.getYInt(); + int var13 = blockSource.getZInt() + var3.getFrontOffsetZ(); + Block var14 = var4.getBlock(var11, var12, var13); + double var15; + + if(BlockRailBase.func_150051_a(var14)) + { + var15 = 0.0D; + } + else { + if(var14 != null || !BlockRailBase.func_150051_a(var4.getBlock(var11, var12 - 1, var13))) + { + return defaultItemDispenseBehavior.dispense(blockSource, itemStack); + } + + var15 = -1.0D; + } + + EntityBombCart var22 = new EntityBombCart(world, var5, var7 + var15, var9, itemStack.getItemDamage()); + world.spawnEntityInWorld(var22); + world.playAuxSFX(1000, x, y, z, 0); + } + + itemStack.stackSize--; + + return itemStack; + } + }); + + /** Chunk loading handler. */ + ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallback() { + @Override + public void ticketsLoaded(List tickets, World world) + { + for(Ticket ticket : tickets) + { + if(ticket.getEntity() instanceof IChunkLoadHandler) + { + ((IChunkLoadHandler)ticket.getEntity()).chunkLoaderInit(ticket); + } + else { + if(ticket.getModData() != null) + { + Coord4D position = Coord4D.read(ticket.getModData()); + + TileEntity tileEntity = position.getTileEntity(ticket.world); + + if(tileEntity instanceof IChunkLoadHandler) + { + ((IChunkLoadHandler)tileEntity).chunkLoaderInit(ticket); + } + } + } + } + } + }); + + proxy.preInit(); + } + + @EventHandler + public void init(FMLInitializationEvent event) + { + EntityRegistry.registerGlobalEntityID(EntityFlyingBlock.class, Reference.ENTITY_PREFIX + "GravityBlock", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityFragments.class, Reference.ENTITY_PREFIX + "Fragments", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityExplosive.class, Reference.ENTITY_PREFIX + "Explosive", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityMissile.class, Reference.ENTITY_PREFIX + "Missile", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityExplosion.class, Reference.ENTITY_PREFIX + "ProceduralExplosion", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityLightBeam.class, Reference.ENTITY_PREFIX + "LightBeam", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityGrenade.class, Reference.ENTITY_PREFIX + "Grenade", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerGlobalEntityID(EntityBombCart.class, Reference.ENTITY_PREFIX + "BombCart", EntityRegistry.findGlobalUniqueEntityId()); + + EntityRegistry.registerModEntity(EntityFlyingBlock.class, Reference.ENTITY_PREFIX + "GravityBlock", 0, this, 50, 15, true); + EntityRegistry.registerModEntity(EntityFragments.class, Reference.ENTITY_PREFIX + "Fragments", 1, this, 40, 8, true); + EntityRegistry.registerModEntity(EntityExplosive.class, Reference.ENTITY_PREFIX + "Explosive", 2, this, 50, 5, true); + EntityRegistry.registerModEntity(EntityMissile.class, Reference.ENTITY_PREFIX + "Missile", 3, this, 500, 1, true); + EntityRegistry.registerModEntity(EntityExplosion.class, Reference.ENTITY_PREFIX + "ProceduralExplosion", 4, this, 100, 5, true); + EntityRegistry.registerModEntity(EntityLightBeam.class, Reference.ENTITY_PREFIX + "LightBeam", 5, this, 80, 5, true); + EntityRegistry.registerModEntity(EntityGrenade.class, Reference.ENTITY_PREFIX + "Grenade", 6, this, 50, 5, true); + EntityRegistry.registerModEntity(EntityBombCart.class, Reference.ENTITY_PREFIX + "BombCart", 7, this, 50, 4, true); + + netHandler.registerMessage(PacketItem.class, ItemMessage.class, 0, Side.SERVER); + + //Get data from server + new ThreadGetData(); + + proxy.init(); + } + + @EventHandler + public void postInit(FMLPostInitializationEvent event) + { + GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.tnt, new Object[] { "@@@", "@R@", "@@@", '@', Items.gunpowder, 'R', Items.redstone })); + + // Poison Powder + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(DefenseTechItems.itemPoisonPowder, 3), new Object[] { Items.spider_eye, Items.rotten_flesh })); + /** Add all Recipes */ + // Tracker + GameRegistry.addRecipe(new ShapedOreRecipe(((ItemEnergized)DefenseTechItems.itemTracker).getUnchargedItem(), new Object[] { " Z ", "SBS", "SCS", 'Z', Items.compass, 'C', "circuitBasic", 'B', MekanismItems.EnergyTablet.getUnchargedItem(), 'S', Items.iron_ingot })); + GameRegistry.addRecipe(new ShapedOreRecipe(((ItemEnergized)DefenseTechItems.itemTracker).getUnchargedItem(), new Object[] { " Z ", "SBS", "SCS", 'Z', Items.compass, 'C', "circuitBasic", 'B', Items.ender_pearl, 'S', Items.iron_ingot })); + // Signal Disrupter + GameRegistry.addRecipe(new ShapedOreRecipe(((ItemEnergized)DefenseTechItems.itemSignalDisrupter).getUnchargedItem(), new Object[] { "WWW", "SCS", "SSS", 'S', Items.iron_ingot, 'C', "circuitBasic", 'W', new ItemStack(MekanismItems.PartTransmitter, 1, 0) })); + + // Antidote + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(DefenseTechItems.itemAntidote, 6), new Object[] { "@@@", "@@@", "@@@", '@', Items.pumpkin_seeds })); + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(DefenseTechItems.itemAntidote), new Object[] { "@@@", "@@@", "@@@", '@', Items.wheat_seeds })); + + /** Add all Recipes */ + // Rocket Launcher + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(((ItemEnergized)DefenseTechItems.itemRocketLauncher).getUnchargedItem(), new Object[] { "SCR", "SB ", 'R', ((ItemEnergized)DefenseTechItems.itemRadarGun).getUnchargedItem(), 'C', new ItemStack(DefenseTechBlocks.blockMachine, 1, MachineData.CruiseLauncher.ordinal()), 'B', Blocks.stone_button, 'S', "ingotSteel" })); + // Radar Gun + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(((ItemEnergized)DefenseTechItems.itemRadarGun).getUnchargedItem(), new Object[] { "@#!", " $!", " !", '@', "blockGlass", '!', "ingotSteel", '#', "circuitBasic", '$', Blocks.stone_button })); + // Remote + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(((ItemEnergized)DefenseTechItems.itemRemoteDetonator).getUnchargedItem(), new Object[] { "?@@", "@#$", "@@@", '@', "ingotSteel", '?', Items.redstone, '#', "circuitAdvanced", '$', Blocks.stone_button })); + // Laser Designator + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(((ItemEnergized)DefenseTechItems.itemLaserDesignator).getUnchargedItem(), new Object[] { "! ", " ? ", " @", '@', ((ItemEnergized)DefenseTechItems.itemRemoteDetonator).getUnchargedItem(), '?', "circuitElite", '!', ((ItemEnergized)DefenseTechItems.itemRadarGun).getUnchargedItem() })); + // Defuser + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(((ItemEnergized)DefenseTechItems.itemDefuser).getUnchargedItem(), new Object[] { "I ", " W ", " C", 'C', "circuitAdvanced", 'W', MekanismItems.Configurator.getUnchargedItem(), 'I', new ItemStack(MekanismItems.PartTransmitter, 1, 0) })); + // Missile Launcher Platform + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherBase(BaseTier.BASIC), new Object[] { "! !", "!C!", "!!!", '!', "ingotIron", 'C', "circuitBasic" })); + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherBase(BaseTier.ADVANCED), new Object[] { "! !", "!C!", "!@!", '@', DefenseUtils.getLauncherBase(BaseTier.BASIC), '!', "ingotOsmium", 'C', "circuitAdvanced" })); + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherBase(BaseTier.ELITE), new Object[] { "! !", "!C!", "!@!", '@', DefenseUtils.getLauncherBase(BaseTier.ADVANCED), '!', "ingotGold", 'C', "circuitElite" })); + // Missile Launcher Panel + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherScreen(BaseTier.BASIC), new Object[] { "!!!", "!#!", "!?!", '#', "circuitBasic", '!', "blockGlass", '?', new ItemStack(MekanismItems.PartTransmitter, 1, 0) })); + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherScreen(BaseTier.ADVANCED), new Object[] { "!$!", "!#!", "!?!", '#', "circuitAdvanced", '!', "ingotOsmium", '?', new ItemStack(MekanismItems.PartTransmitter, 1, 0), '$', DefenseUtils.getLauncherScreen(BaseTier.BASIC) })); + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherScreen(BaseTier.ELITE), new Object[] { "!$!", "!#!", "!?!", '#', "circuitElite", '!', "ingotGold", '?', new ItemStack(MekanismItems.PartTransmitter, 1, 0), '$', DefenseUtils.getLauncherScreen(BaseTier.ADVANCED) })); + // Missile Launcher Support Frame + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherFrame(BaseTier.BASIC), new Object[] { "! !", "!!!", "! !", '!', "ingotIron" })); + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherFrame(BaseTier.ADVANCED), new Object[] { "! !", "!@!", "! !", '!', "ingotOsmium", '@', DefenseUtils.getLauncherFrame(BaseTier.BASIC) })); + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(DefenseUtils.getLauncherFrame(BaseTier.ELITE), new Object[] { "! !", "!@!", "! !", '!', "ingotGold", '@', DefenseUtils.getLauncherFrame(BaseTier.ADVANCED) })); + // Radar Station + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechBlocks.blockMachine, 1, 3), new Object[] { "?@?", " ! ", "!#!", '@', ((ItemEnergized)DefenseTechItems.itemRadarGun).getUnchargedItem(), '!', "alloyAdvanced", '#', "circuitBasic", '?', "ingotGold" })); + // EMP Tower + GameRegistry.addRecipe(new ShapedMekanismRecipe(new ItemStack(DefenseTechBlocks.blockMachine, 1, 4), new Object[] { "?W?", "@!@", "?#?", '?', "alloyElite", '!', "circuitElite", '@', MekanismUtils.getEnergyCube(EnergyCubeTier.BASIC), '#', new ItemStack(MekanismBlocks.BasicBlock, 1, 8), 'W', new ItemStack(MekanismItems.PartTransmitter, 1, 0) })); + // Cruise Launcher + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechBlocks.blockMachine, 1, 5), new Object[] { "?! ", "@@@", '@', "alloyAdvanced", '!', new ItemStack(DefenseTechBlocks.blockMachine, 1, 2), '?', new ItemStack(DefenseTechBlocks.blockMachine, 1, 8) })); + // Missile module + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.missileModule.getID()), new Object[] { " @ ", "@#@", "@?@", '@', "ingotSteel", '?', Items.flint_and_steel, '#', "circuitBasic" })); + // Homing + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.homing.getID()), new Object[] { " B ", " C ", "BMB", 'M', new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.missileModule.getID()), 'C', "circuitBasic", 'B', "ingotBronze" })); + // Anti-ballistic + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.antiBallistic.getID()), new Object[] { "!", "?", "@", '@', new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.missileModule.getID()), '?', new ItemStack(DefenseTechBlocks.blockExplosive, 1, 0), '!', "circuitBasic" })); + // Cluster + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.cluster.getID()), new Object[] { " ! ", " ? ", "!@!", '@', new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.missileModule.getID()), '?', Explosive.fragmentation.getItemStack(), '!', new ItemStack(DefenseTechItems.itemMissile, 1, 0) })); + // Nuclear Cluster + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.nuclearCluster.getID()), new Object[] { " N ", "NCN", 'C', new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.cluster.getID()), 'N', Explosive.nuclear.getItemStack() })); + + // Add all explosive recipes. + if(!Loader.isModLoaded("ResonantInduction|Atomic")) //TODO wither skull? what? + { + OreDictionary.registerOre("strangeMatter", new ItemStack(Items.skull, 1, 1)); + } + + for(Explosive explosive : ExplosiveRegistry.getExplosives()) + { + explosive.init(); + // Missile + + if(explosive.hasBlockForm()) + { + CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(DefenseTechItems.itemMissile, 1, explosive.getID()), new Object[] { new ItemStack(DefenseTechItems.itemMissile, 1, Explosive.missileModule.getID()), new ItemStack(DefenseTechBlocks.blockExplosive, 1, explosive.getID()) })); + } + + if(explosive.getTier() < 2) + { + // Grenade + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemGrenade, 1, explosive.getID()), new Object[] { "?", "@", '@', new ItemStack(DefenseTechBlocks.blockExplosive, 1, explosive.getID()), '?', Items.string })); + } + + if(explosive.getTier() < 3) + { + // Minecart + CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(DefenseTechItems.itemBombCart, 1, explosive.getID()), new Object[] { "?", "@", '?', new ItemStack(DefenseTechBlocks.blockExplosive, 1, explosive.getID()), '@', Items.minecart })); + } + } + } + + @EventHandler + public void serverStarting(FMLServerStartingEvent evt) + { + FrequencyGrid.reinitiate(); + + // Setup command + ICommandManager commandManager = FMLCommonHandler.instance().getMinecraftServerInstance().getCommandManager(); + ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager); + serverCommandManager.registerCommand(new CommandHandler()); + } + + @SubscribeEvent + public void enteringChunk(EnteringChunk evt) + { + if(evt.entity instanceof EntityMissile) + { + ((EntityMissile)evt.entity).updateLoadChunk(evt.newChunkX, evt.newChunkZ); + } + } + + @SubscribeEvent + public void creeperDeathEvent(LivingDeathEvent evt) + { + if(evt.entityLiving instanceof EntityCreeper) + { + if(Settings.CREEPER_BLOW_UP_IN_FIRE) + { + if(evt.source == DamageSource.onFire || evt.source == DamageSource.inFire) + { + evt.setCanceled(true); + boolean flag = evt.entityLiving.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); + + if(((EntityCreeper)evt.entityLiving).getPowered()) + { + evt.entityLiving.worldObj.createExplosion(evt.entityLiving, evt.entityLiving.posX, evt.entityLiving.posY, evt.entityLiving.posZ, 6f, flag); + } + else { + evt.entityLiving.worldObj.createExplosion(evt.entityLiving, evt.entityLiving.posX, evt.entityLiving.posY, evt.entityLiving.posZ, 3f, flag); + } + } + } + } + } + + @SubscribeEvent + public void creeperDropEvent(LivingDropsEvent evt) + { + if(evt.entityLiving instanceof EntityCreeper) + { + if(Settings.CREEPER_DROP_SULFUR) + { + evt.entityLiving.entityDropItem(new ItemStack(MekanismItems.OtherDust, 1 + evt.entityLiving.worldObj.rand.nextInt(6), 3), 0.0F); + } + } + } + + @SubscribeEvent + public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) + { + if(event.modID.equals(Reference.NAME)) + { + proxy.loadConfiguration(); + } + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/DefenseTechBlocks.java b/src/main/java/mekanism/defense/common/DefenseTechBlocks.java new file mode 100644 index 000000000..ce50b3c98 --- /dev/null +++ b/src/main/java/mekanism/defense/common/DefenseTechBlocks.java @@ -0,0 +1,36 @@ +package defense.common; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; +import defense.common.block.BlockExplosive; +import defense.common.block.BlockMachine; +import defense.common.item.ItemBlockExplosive; +import defense.common.item.ItemBlockMachine; + +@ObjectHolder(Reference.NAME) +public class DefenseTechBlocks +{ + public static Block blockExplosive = new BlockExplosive(); + public static Block blockMachine = new BlockMachine(); + + public static Block blockRadioactive; + + public static void register() + { + GameRegistry.registerBlock(blockExplosive, ItemBlockExplosive.class, "explosives"); + GameRegistry.registerBlock(blockMachine, ItemBlockMachine.class, "machine"); + + /** Check for existence of radioactive Blocks. If it does not exist, then create it. */ + if(OreDictionary.getOres("blockRadioactive").size() > 0) + { + blockRadioactive = Block.getBlockFromItem(OreDictionary.getOres("blockRadioactive").get(0).getItem()); + DefenseTech.LOGGER.fine("Detected radioative block from another mod, utilizing it."); + } + else { + blockRadioactive = Blocks.mycelium; + } + } +} diff --git a/src/main/java/mekanism/defense/common/DefenseTechItems.java b/src/main/java/mekanism/defense/common/DefenseTechItems.java new file mode 100644 index 000000000..567a9c653 --- /dev/null +++ b/src/main/java/mekanism/defense/common/DefenseTechItems.java @@ -0,0 +1,54 @@ +package defense.common; + +import net.minecraft.item.Item; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder; +import defense.common.item.ItemAntidote; +import defense.common.item.ItemBombCart; +import defense.common.item.ItemDefuser; +import defense.common.item.ItemGrenade; +import defense.common.item.ItemLaserDesignator; +import defense.common.item.ItemMissile; +import defense.common.item.ItemPoisonPowder; +import defense.common.item.ItemRadarGun; +import defense.common.item.ItemRemoteDetonator; +import defense.common.item.ItemRocketLauncher; +import defense.common.item.ItemSignalDisrupter; +import defense.common.item.ItemSulfurDust; +import defense.common.item.ItemTracker; + +@ObjectHolder(Reference.NAME) +public class DefenseTechItems +{ + public static Item itemAntidote = new ItemAntidote(); + public static Item itemSignalDisrupter = new ItemSignalDisrupter(); + public static Item itemTracker = new ItemTracker(); + + public static Item itemPoisonPowder = new ItemPoisonPowder(); + + public static Item itemMissile = new ItemMissile(); + public static Item itemDefuser = new ItemDefuser(); + public static Item itemRadarGun = new ItemRadarGun(); + public static Item itemRemoteDetonator = new ItemRemoteDetonator(); + public static Item itemLaserDesignator = new ItemLaserDesignator(); + public static Item itemRocketLauncher = new ItemRocketLauncher(); + public static Item itemGrenade = new ItemGrenade(); + public static Item itemBombCart = new ItemBombCart(); + + public static void register() + { + GameRegistry.registerItem(itemPoisonPowder, "poisonPowder"); + GameRegistry.registerItem(itemAntidote, "antidote"); + GameRegistry.registerItem(itemSignalDisrupter, "signalDisrupter"); + GameRegistry.registerItem(itemTracker, "tracker"); + + GameRegistry.registerItem(itemMissile, "missile"); + GameRegistry.registerItem(itemDefuser, "defuser"); + GameRegistry.registerItem(itemRadarGun, "radarGun"); + GameRegistry.registerItem(itemRemoteDetonator, "remoteDetonator"); + GameRegistry.registerItem(itemLaserDesignator, "laserDesignator"); + GameRegistry.registerItem(itemRocketLauncher, "rocketLauncher"); + GameRegistry.registerItem(itemGrenade, "grenade"); + GameRegistry.registerItem(itemBombCart, "minecart"); + } +} diff --git a/src/main/java/mekanism/defense/common/DefenseUtils.java b/src/main/java/mekanism/defense/common/DefenseUtils.java new file mode 100644 index 000000000..970552cbe --- /dev/null +++ b/src/main/java/mekanism/defense/common/DefenseUtils.java @@ -0,0 +1,58 @@ +package defense.common; + +import java.lang.ref.WeakReference; + +import mekanism.common.Mekanism; +import mekanism.common.Tier.BaseTier; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.BlockEvent; +import defense.common.item.ItemBlockMachine; + +public final class DefenseUtils +{ + public static ItemStack getLauncherBase(BaseTier tier) + { + ItemStack stack = new ItemStack(DefenseTechBlocks.blockMachine, 1, 0); + ItemBlockMachine itemMachine = (ItemBlockMachine)stack.getItem(); + itemMachine.setBaseTier(stack, tier); + + return stack; + } + + public static ItemStack getLauncherScreen(BaseTier tier) + { + ItemStack stack = new ItemStack(DefenseTechBlocks.blockMachine, 1, 1); + ItemBlockMachine itemMachine = (ItemBlockMachine)stack.getItem(); + itemMachine.setBaseTier(stack, tier); + + return stack; + } + + public static ItemStack getLauncherFrame(BaseTier tier) + { + ItemStack stack = new ItemStack(DefenseTechBlocks.blockMachine, 1, 2); + ItemBlockMachine itemMachine = (ItemBlockMachine)stack.getItem(); + itemMachine.setBaseTier(stack, tier); + + return stack; + } + + public static boolean canBreak(World world, Block block, double x, double y, double z) + { + if(world.isRemote) + { + return true; + } + + WeakReference playerRef = Mekanism.proxy.getDummyPlayer((WorldServer)world, x, y, z); + BlockEvent.BreakEvent evt = new BlockEvent.BreakEvent((int)x, (int)y, (int)z, world, block, world.getBlockMetadata((int)x, (int)y, (int)z), playerRef.get()); + MinecraftForge.EVENT_BUS.post(evt); + + return !evt.isCanceled(); + } +} diff --git a/src/main/java/mekanism/defense/common/ObfuscatedNames.java b/src/main/java/mekanism/defense/common/ObfuscatedNames.java new file mode 100644 index 000000000..c7127e575 --- /dev/null +++ b/src/main/java/mekanism/defense/common/ObfuscatedNames.java @@ -0,0 +1,3 @@ +package defense.common; + +public final class ObfuscatedNames {} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/Rectangle.java b/src/main/java/mekanism/defense/common/Rectangle.java new file mode 100644 index 000000000..42bc857f1 --- /dev/null +++ b/src/main/java/mekanism/defense/common/Rectangle.java @@ -0,0 +1,30 @@ +package defense.common; + +public class Rectangle +{ + public Vector2 min; + public Vector2 max; + + public Rectangle() + { + this(new Vector2(), new Vector2()); + } + + public Rectangle(Vector2 min, Vector2 max) + { + this.min = min; + this.max = max; + } + + /** Checks if a point is located inside a region */ + public boolean isIn(Vector2 point) + { + return (point.x > this.min.x && point.x < this.max.x) && (point.y > this.min.y && point.y < this.max.y); + } + + /** Returns whether the given region intersects with this one. */ + public boolean isIn(Rectangle region) + { + return region.max.x > this.min.x && region.min.x < this.max.x ? (region.max.y > this.min.y && region.min.y < this.max.y ? true : false) : false; + } +} diff --git a/src/main/java/mekanism/defense/common/Reference.java b/src/main/java/mekanism/defense/common/Reference.java new file mode 100644 index 000000000..a32a88f26 --- /dev/null +++ b/src/main/java/mekanism/defense/common/Reference.java @@ -0,0 +1,27 @@ +package defense.common; + +import mekanism.api.EnumColor; + +public class Reference +{ + /** Name of the channel and mod ID. */ + public static final String NAME = "DefenseTech"; + + public static final String VERSION = "1.0.1"; + + public static final String CHANNEL = "DEF"; + public static final String ENTITY_PREFIX = CHANNEL; + public static final String DOMAIN = "defense"; + public static final String PREFIX = DOMAIN + ":"; + public static final String ASSETS_PATH = "/assets/defense/"; + public static final String TEXTURE_PATH = "textures/"; + public static final String GUI_PATH = TEXTURE_PATH + "gui/"; + public static final String MODEL_PREFIX = "models/"; + public static final String MODEL_DIRECTORY = ASSETS_PATH + MODEL_PREFIX; + + public static final String MODEL_TEXTURE_PATH = TEXTURE_PATH + MODEL_PREFIX; + public static final String BLOCK_PATH = TEXTURE_PATH + "blocks/"; + public static final String ITEM_PATH = TEXTURE_PATH + "items/"; + + public static final String CHAT_DESC = EnumColor.ORANGE + "[" + NAME + "]"; +} diff --git a/src/main/java/mekanism/defense/common/Settings.java b/src/main/java/mekanism/defense/common/Settings.java new file mode 100644 index 000000000..8602ba808 --- /dev/null +++ b/src/main/java/mekanism/defense/common/Settings.java @@ -0,0 +1,48 @@ +package defense.common; + +import java.io.File; + +import net.minecraftforge.common.config.Configuration; +import cpw.mods.fml.common.Loader; + +/** Settings class for various configuration settings. + * + * @author Calclavia */ +public class Settings +{ + /** Configuration file */ + public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), Reference.NAME.replace(" ", "") + ".cfg")); + + public static boolean USE_FUEL = true; + public static boolean LOAD_CHUNKS = true; + public static int MAX_MISSILE_DISTANCE = 10000; + public static int ANTIMATTER_SIZE = 55; + public static boolean DESTROY_BEDROCK = true; + public static int MAX_ROCKET_LAUNCHER_TIER = 2; + public static boolean GENERATE_SULFUR = true; + public static int MAX_REDMATTER_LIFESPAN = 3600; + public static boolean DO_REDMATTER_DESPAWN = true; + public static boolean CREEPER_DROP_SULFUR = true; + public static boolean CREEPER_BLOW_UP_IN_FIRE = true; + public static boolean POLLUTIVE_NUCLEAR = true; + public static boolean CREATE_NETHERRACK = true; + public static double REDUCE_OBSIDIAN_RESISTANCE = 45F; + + public static void initiate() + { + USE_FUEL = CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Use Fuel", true).getBoolean(true); + LOAD_CHUNKS = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Allow Chunk Loading", true).getBoolean(true); + MAX_MISSILE_DISTANCE = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Max Missile Distance", 10000).getInt(10000); + ANTIMATTER_SIZE = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Antimatter Explosion Size", 55).getInt(55); + DESTROY_BEDROCK = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Antimatter Destroy Bedrock", true).getBoolean(true); + MAX_ROCKET_LAUNCHER_TIER = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Rocket Launcher Max Missile Tier", 2).getInt(2); + GENERATE_SULFUR = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Generate Sulfur Ore", true).getBoolean(true); + MAX_REDMATTER_LIFESPAN = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "RedMatter Life Span in ticks", 3600).getInt(3600); + DO_REDMATTER_DESPAWN = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "RedMatter despawn", true).getBoolean(true); + CREEPER_DROP_SULFUR = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Creepers Drop Sulfur", true).getBoolean(true); + CREEPER_BLOW_UP_IN_FIRE = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Creepers Blow up in Fire", true).getBoolean(true); + POLLUTIVE_NUCLEAR = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Pollutive Nuclear", true).getBoolean(true); + CREATE_NETHERRACK = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Exothermic Create Netherrack", true).getBoolean(true); + REDUCE_OBSIDIAN_RESISTANCE = Settings.CONFIGURATION.get(Configuration.CATEGORY_GENERAL, "Reduce Obsidian Resistance", 45F).getDouble(45F); + } +} diff --git a/src/main/java/mekanism/defense/common/Vector2.java b/src/main/java/mekanism/defense/common/Vector2.java new file mode 100644 index 000000000..b7d4cc0ee --- /dev/null +++ b/src/main/java/mekanism/defense/common/Vector2.java @@ -0,0 +1,202 @@ +package defense.common; + +import mekanism.api.Pos3D; +import net.minecraft.nbt.NBTTagCompound; + +import com.google.common.io.ByteArrayDataInput; + +/** Vector2 Class is used for defining objects in a 2D space. + * + * @author Calclavia */ + +public class Vector2 implements Cloneable +{ + public double x; + public double y; + + public Vector2() + { + this(0, 0); + } + + public Vector2(Pos3D pos) + { + this(pos.xPos, pos.zPos); + } + + public Vector2(double x, double y) + { + this.x = x; + this.y = y; + } + + public Vector2(Vector2 vec) + { + x = vec.x(); + y = vec.y(); + } + + public Vector2(ByteArrayDataInput data) + { + this(data.readDouble(), data.readDouble()); + } + + public Vector2(NBTTagCompound nbt) + { + this(nbt.getDouble("x"), nbt.getDouble("y")); + } + + public double x() + { + return x; + } + + public double y() + { + return y; + } + + /** Returns the integer floor value. + * + * @return */ + public int intX() + { + return (int) Math.floor(this.x); + } + + public int intY() + { + return (int) Math.floor(this.y); + } + + /** Makes a new copy of this Vector. Prevents variable referencing problems. */ + @Override + public Vector2 clone() + { + return new Vector2(this.x, this.y); + } + + /** ---------------------- MAGNITUDE FUNCTIONS ---------------------------- */ + public double getMagnitude() + { + return Math.sqrt(this.getMagnitudeSquared()); + } + + public double getMagnitudeSquared() + { + return this.x * this.x + this.y * this.y; + } + + public Vector2 normalize() + { + double d = this.getMagnitude(); + + if (d != 0) + { + this.scale(1 / d); + } + + return this; + } + + public static double distance(Vector2 point1, Vector2 point2) + { + return point1.clone().distance(point2); + } + + public static double slope(Vector2 point1, Vector2 point2) + { + double xDifference = point1.x - point2.x; + double yDiference = point1.y - point2.y; + return yDiference / xDifference; + } + + public Vector2 midPoint(Vector2 pos) + { + return new Vector2((x + pos.x) / 2, (y + pos.y) / 2); + } + + public double distance(Vector2 target) + { + Vector2 difference = this.clone().subtract(target); + return difference.getMagnitude(); + } + + public Vector2 add(Vector2 par1) + { + x += par1.x; + y += par1.y; + + return this; + } + + public Vector2 add(double par1) + { + x += par1; + y += par1; + + return this; + } + + public Vector2 subtract(Vector2 par1) + { + x -= par1.x; + y -= par1.y; + + return this; + } + + public Vector2 invert() + { + this.scale(-1); + return this; + } + + public Vector2 scale(double amount) + { + this.x *= amount; + this.y *= amount; + return this; + } + + public Vector2 round() + { + return new Vector2(Math.round(x), Math.round(y)); + } + + public Vector2 ceil() + { + return new Vector2(Math.ceil(x), Math.ceil(y)); + } + + public Vector2 floor() + { + return new Vector2(Math.floor(x), Math.floor(y)); + } + + @Override + public int hashCode() + { + long x = Double.doubleToLongBits(this.x); + long y = Double.doubleToLongBits(this.y); + return 31 * (int) (x ^ (x >>> 32)) + (int)(y ^ (y >>> 32)); + } + + @Override + public boolean equals(Object o) + { + if(o instanceof Vector2) + { + Vector2 vector = (Vector2) o; + return x == vector.x && y == vector.y; + } + + return false; + } + + @Override + public String toString() + { + return "Vector2 [" + x + "," + y + "]"; + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/base/IBlockActivate.java b/src/main/java/mekanism/defense/common/base/IBlockActivate.java new file mode 100644 index 000000000..b6a47850b --- /dev/null +++ b/src/main/java/mekanism/defense/common/base/IBlockActivate.java @@ -0,0 +1,12 @@ +package defense.common.base; + +import net.minecraft.entity.player.EntityPlayer; + +/** A general interface to be implemented by anything that needs it. + * + * @author Calclavia */ +public interface IBlockActivate +{ + /** Called when activated */ + public boolean onActivated(EntityPlayer entityPlayer); +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/base/IChunkLoadHandler.java b/src/main/java/mekanism/defense/common/base/IChunkLoadHandler.java new file mode 100644 index 000000000..0e01b9cb3 --- /dev/null +++ b/src/main/java/mekanism/defense/common/base/IChunkLoadHandler.java @@ -0,0 +1,8 @@ +package defense.common.base; + +import net.minecraftforge.common.ForgeChunkManager.Ticket; + +public interface IChunkLoadHandler +{ + public void chunkLoaderInit(Ticket ticket); +} diff --git a/src/main/java/mekanism/defense/common/base/IItemPacket.java b/src/main/java/mekanism/defense/common/base/IItemPacket.java new file mode 100644 index 000000000..74556e763 --- /dev/null +++ b/src/main/java/mekanism/defense/common/base/IItemPacket.java @@ -0,0 +1,9 @@ +package defense.common.base; + +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; + +public interface IItemPacket +{ + public void handlePacket(EntityPlayer player, ByteBuf dataStream); +} diff --git a/src/main/java/mekanism/defense/common/base/IRedstoneProvider.java b/src/main/java/mekanism/defense/common/base/IRedstoneProvider.java new file mode 100644 index 000000000..e4589382b --- /dev/null +++ b/src/main/java/mekanism/defense/common/base/IRedstoneProvider.java @@ -0,0 +1,10 @@ +package defense.common.base; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IRedstoneProvider +{ + public boolean isPoweringTo(ForgeDirection direction); + + public boolean isIndirectlyPoweringTo(ForgeDirection direction); +} diff --git a/src/main/java/mekanism/defense/common/block/BlockBase.java b/src/main/java/mekanism/defense/common/block/BlockBase.java new file mode 100644 index 000000000..5e542e07e --- /dev/null +++ b/src/main/java/mekanism/defense/common/block/BlockBase.java @@ -0,0 +1,259 @@ +package defense.common.block; + +import java.util.Random; + +import mekanism.common.util.MekanismUtils; +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.api.tools.IToolWrench; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.CreativeTabHandler; +import defense.common.Reference; +import defense.common.base.IRedstoneProvider; + +public class BlockBase extends Block implements ITileEntityProvider +{ + protected IIcon iconTop, iconSide, iconBottom; + protected boolean requireSidedTextures = false; + + public BlockBase(String name) + { + this(name, Material.iron); + } + + public BlockBase(String name, Material material) + { + super(material); + setBlockName(Reference.PREFIX + name); + setBlockTextureName(Reference.PREFIX + name); + setHardness(0.6F); + setCreativeTab(CreativeTabHandler.INSTANCE); + isBlockContainer = true; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + this.dropEntireInventory(world, x, y, z, par5, par6); + super.breakBlock(world, x, y, z, par5, par6); + world.removeTileEntity(x, y, z); + } + + /** Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it + * on to the tile entity at this location. Args: world, x, y, z, blockID, EventID, event + * parameter */ + @Override + public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) + { + super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); + TileEntity tileentity = par1World.getTileEntity(par2, par3, par4); + return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false; + } + + /** Override this if you don't need it. This will eject all items out of this machine if it has + * an inventory. */ + public void dropEntireInventory(World world, int x, int y, int z, Block par5, int par6) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity != null) + { + if (tileEntity instanceof IInventory) + { + IInventory inventory = (IInventory) tileEntity; + + for (int i = 0; i < inventory.getSizeInventory(); ++i) + { + ItemStack var7 = inventory.getStackInSlot(i); + + if (var7 != null) + { + Random random = new Random(); + float var8 = random.nextFloat() * 0.8F + 0.1F; + float var9 = random.nextFloat() * 0.8F + 0.1F; + float var10 = random.nextFloat() * 0.8F + 0.1F; + + while (var7.stackSize > 0) + { + int var11 = random.nextInt(21) + 10; + + if (var11 > var7.stackSize) + { + var11 = var7.stackSize; + } + + var7.stackSize -= var11; + EntityItem var12 = new EntityItem(world, (x + var8), (y + var9), (z + var10), new ItemStack(var7.getItem(), var11, var7.getItemDamage())); + + if (var7.hasTagCompound()) + { + var12.getEntityItem().setTagCompound((NBTTagCompound) var7.getTagCompound().copy()); + } + + float var13 = 0.05F; + var12.motionX = ((float) random.nextGaussian() * var13); + var12.motionY = ((float) random.nextGaussian() * var13 + 0.2F); + var12.motionZ = ((float) random.nextGaussian() * var13); + world.spawnEntityInWorld(var12); + + if (var7.stackSize <= 0) + { + inventory.setInventorySlotContents(i, null); + } + } + } + } + } + } + } + + /** DO NOT OVERRIDE THIS FUNCTION! Called when the block is right clicked by the player. This + * modified version detects electric items and wrench actions on your machine block. Do not + * override this function. Use onMachineActivated instead! (It does the same thing) + * + * @param world The World Object. + * @param x , y, z The coordinate of the block. + * @param side The side the player clicked on. + * @param hitX , hitY, hitZ The position the player clicked on relative to the block. */ + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + ItemStack tool = entityPlayer.inventory.getCurrentItem(); + int metadata = world.getBlockMetadata(x, y, z); + + /** Check if the player is holding a wrench or an electric item. If so, call the wrench + * event. */ + if (MekanismUtils.hasUsableWrench(entityPlayer, x, y, z)) + { + if(MekanismUtils.isBCWrench(tool.getItem())) + { + ((IToolWrench)tool.getItem()).wrenchUsed(entityPlayer, x, y, z); + } + + if (entityPlayer.isSneaking()) + { + if (this.onSneakUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)) + { + return true; + } + } + + if (this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)) + { + return true; + } + + return false; + } + + if (entityPlayer.isSneaking()) + { + if (this.onSneakMachineActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)) + { + return true; + } + } + + return this.onMachineActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); + } + + /** Called when the machine is right clicked by the player + * + * @return True if something happens */ + public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return false; + } + + /** Called when the machine is being wrenched by a player while sneaking. + * + * @return True if something happens */ + public boolean onSneakMachineActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return false; + } + + /** Called when a player uses a wrench on the machine + * + * @return True if some happens */ + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return false; + } + + /** Called when a player uses a wrench on the machine while sneaking. Only works with the UE + * wrench. + * + * @return True if some happens */ + public boolean onSneakUseWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) + { + return this.onUseWrench(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ); + } + + @Override + public int damageDropped(int metadata) + { + return metadata; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister iconRegister) + { + super.registerBlockIcons(iconRegister); + + if (this.requireSidedTextures) + { + this.iconTop = iconRegister.registerIcon(this.getUnlocalizedName().replace("tile.", "") + "_top"); + this.iconSide = iconRegister.registerIcon(this.getUnlocalizedName().replace("tile.", "") + "_side"); + this.iconBottom = iconRegister.registerIcon(this.getUnlocalizedName().replace("tile.", "") + "_bottom"); + } + } + + /** Is this block powering the block on the specified side */ + @Override + public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) + { + TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + + if (tileEntity instanceof IRedstoneProvider) + { + return ((IRedstoneProvider) tileEntity).isPoweringTo(ForgeDirection.getOrientation(side)) ? 15 : 0; + } + + return 0; + } + + /** Is this block indirectly powering the block on the specified side */ + @Override + public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) + { + TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + + if (tileEntity instanceof IRedstoneProvider) + { + return ((IRedstoneProvider) tileEntity).isIndirectlyPoweringTo(ForgeDirection.getOrientation(side)) ? 15 : 0; + } + + return 0; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) + { + return null; + } +} diff --git a/src/main/java/mekanism/defense/common/block/BlockExplosive.java b/src/main/java/mekanism/defense/common/block/BlockExplosive.java new file mode 100644 index 000000000..e64bc7dfb --- /dev/null +++ b/src/main/java/mekanism/defense/common/block/BlockExplosive.java @@ -0,0 +1,444 @@ +package defense.common.block; + +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.List; +import java.util.Random; + +import javax.imageio.ImageIO; + +import mekanism.api.Pos3D; +import mekanism.common.util.MekanismUtils; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.Explosion; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.client.render.tile.RenderBombBlock; +import defense.common.CreativeTabHandler; +import defense.common.Reference; +import defense.common.entity.EntityExplosive; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.tile.TileExplosive; + +public class BlockExplosive extends BlockBase +{ + public final IIcon[] ICON_TOP = new IIcon[100]; + public final IIcon[] ICON_SIDE = new IIcon[100]; + public final IIcon[] ICON_BOTTOM = new IIcon[100]; + + public BlockExplosive() + { + super("explosives", Material.tnt); + setHardness(0.0F); + setStepSound(soundTypeGrass); + setCreativeTab(CreativeTabHandler.INSTANCE); + } + + /** gets the way this piston should face for that entity that placed it. */ + private static byte determineOrientation(World world, int x, int y, int z, EntityLivingBase entityLiving) + { + if(entityLiving != null) + { + if(MathHelper.abs((float) entityLiving.posX - x) < 2.0F && MathHelper.abs((float) entityLiving.posZ - z) < 2.0F) + { + double var5 = entityLiving.posY + 1.82D - entityLiving.yOffset; + + if(var5 - y > 2.0D) + { + return 1; + } + + if(y - var5 > 0.0D) + { + return 0; + } + } + + int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + return (byte)(rotation == 0 ? 2 : (rotation == 1 ? 5 : (rotation == 2 ? 3 : (rotation == 3 ? 4 : 0)))); + } + + return 0; + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int x, int y, int z) + { + TileEntity tileEntity = par1IBlockAccess.getTileEntity(x, y, z); + + if(tileEntity != null) + { + if(tileEntity instanceof TileExplosive) + { + if(((TileExplosive)tileEntity).explosiveID == Explosive.sMine.getID()) + { + setBlockBounds(0, 0, 0, 1f, 0.2f, 1f); + return; + } + } + } + + setBlockBounds(0, 0, 0, 1f, 1f, 1f); + } + + @Override + public void setBlockBoundsForItemRender() + { + setBlockBounds(0, 0, 0, 1f, 1f, 1f); + } + + /** Returns a bounding box from the pool of bounding boxes (this means this box can change after + * the pool has been cleared to be reused) */ + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int x, int y, int z) + { + TileEntity tileEntity = par1World.getTileEntity(x, y, z); + + if(tileEntity != null) + { + if(tileEntity instanceof TileExplosive) + { + if(((TileExplosive)tileEntity).explosiveID == Explosive.sMine.getID()) + { + return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + 0.2, z + maxZ); + } + } + } + + return super.getCollisionBoundingBoxFromPool(par1World, x, y, z); + } + + /** Called when the block is placed in the world. */ + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack itemStack) + { + ((TileExplosive)world.getTileEntity(x, y, z)).explosiveID = itemStack.getItemDamage(); + int explosiveID = ((TileExplosive) world.getTileEntity(x, y, z)).explosiveID; + + if(!world.isRemote) + { + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(world, x, y, z, ExplosiveType.BLOCK, ExplosiveRegistry.get(explosiveID)); + MinecraftForge.EVENT_BUS.post(evt); + + if(evt.isCanceled()) + { + dropBlockAsItem(world, x, y, z, explosiveID, 0); + world.setBlockToAir(x, y, z); + return; + } + } + + world.setBlockMetadataWithNotify(x, y, z, MekanismUtils.getBaseOrientation(ForgeDirection.NORTH.ordinal(), determineOrientation(world, x, y, z, entityLiving)), 2); + + if(world.isBlockIndirectlyGettingPowered(x, y, z)) + { + BlockExplosive.detonate(world, x, y, z, explosiveID, 0); + } + + // Check to see if there is fire nearby. + // If so, then detonate. + for(byte i = 0; i < 6; i++) + { + Pos3D position = new Pos3D(x, y, z); + position.translate(ForgeDirection.getOrientation(i), 1); + + Block block = position.getCoord(world.provider.dimensionId).getBlock(world); + + if(block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) + { + BlockExplosive.detonate(world, x, y, z, explosiveID, 2); + } + } + + if(entityLiving != null) + { + FMLLog.fine(entityLiving.getCommandSenderName() + " placed " + ExplosiveRegistry.get(explosiveID).getExplosiveName() + " in: " + x + ", " + y + ", " + z + "."); + } + } + + /** Returns the block texture based on the side being looked at. Args: side */ + @Override + public IIcon getIcon(IBlockAccess par1IBlockAccess, int x, int y, int z, int side) + { + int explosiveID = ((TileExplosive)par1IBlockAccess.getTileEntity(x, y, z)).explosiveID; + return getIcon(side, explosiveID); + } + + @Override + public IIcon getIcon(int side, int explosiveID) + { + if(side == 0) + { + return ICON_BOTTOM[explosiveID]; + } + else if(side == 1) + { + return ICON_TOP[explosiveID]; + } + + return ICON_SIDE[explosiveID]; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerBlockIcons(IIconRegister iconRegister) + { + /** Register every single texture for all explosives. */ + for(Explosive zhaPin : ExplosiveRegistry.getExplosives()) + { + ICON_TOP[zhaPin.getID()] = getIcon(iconRegister, zhaPin, "_top"); + ICON_SIDE[zhaPin.getID()] = getIcon(iconRegister, zhaPin, "_side"); + ICON_BOTTOM[zhaPin.getID()] = getIcon(iconRegister, zhaPin, "_bottom"); + } + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IIconRegister iconRegister, Explosive zhaPin, String suffix) + { + String iconName = "explosive_" + zhaPin.getUnlocalizedName() + suffix; + + try { + ResourceLocation resourcelocation = new ResourceLocation(Reference.DOMAIN, Reference.BLOCK_PATH + iconName + ".png"); + InputStream inputstream = Minecraft.getMinecraft().getResourceManager().getResource(resourcelocation).getInputStream(); + BufferedImage bufferedimage = ImageIO.read(inputstream); + + if(bufferedimage != null) + { + return iconRegister.registerIcon(Reference.PREFIX + iconName); + } + } catch(Exception e) {} + + if(suffix.equals("_bottom")) + { + return iconRegister.registerIcon(Reference.PREFIX + "explosive_bottom_" + zhaPin.getTier()); + } + + return iconRegister.registerIcon(Reference.PREFIX + "explosive_base_" + zhaPin.getTier()); + } + + @Override + public void onBlockAdded(World par1World, int x, int y, int z) + { + super.onBlockAdded(par1World, x, y, z); + + par1World.func_147479_m(x, y, z); + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) + { + int explosiveID = ((TileExplosive) world.getTileEntity(x, y, z)).explosiveID; + + if (world.isBlockIndirectlyGettingPowered(x, y, z)) + { + BlockExplosive.detonate(world, x, y, z, explosiveID, 0); + } + else if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) + { + BlockExplosive.detonate(world, x, y, z, explosiveID, 2); + } + } + + /* + * Called to detonate the TNT. Args: world, x, y, z, metaData, CauseOfExplosion (0, intentional, + * 1, exploded, 2 burned) + */ + public static void detonate(World world, int x, int y, int z, int explosiveID, int causeOfExplosion) + { + if(!world.isRemote) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(tileEntity != null) + { + if(tileEntity instanceof TileExplosive) + { + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(world, x, y, z, ExplosiveType.BLOCK, ExplosiveRegistry.get(((TileExplosive) tileEntity).explosiveID)); + MinecraftForge.EVENT_BUS.post(evt); + + if(!evt.isCanceled()) + { + ((TileExplosive)tileEntity).exploding = true; + EntityExplosive eZhaDan = new EntityExplosive(world, new Pos3D(x, y, z).translate(0.5, 0.5, 0.5), ((TileExplosive)tileEntity).explosiveID, (byte)world.getBlockMetadata(x, y, z), ((TileExplosive)tileEntity).nbtData); + + switch(causeOfExplosion) + { + case 2: + eZhaDan.setFire(100); + break; + } + + world.spawnEntityInWorld(eZhaDan); + world.setBlockToAir(x, y, z); + } + } + } + } + } + + /** Called upon the block being destroyed by an explosion */ + @Override + public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) + { + if(world.getTileEntity(x, y, z) != null) + { + int explosiveID = ((TileExplosive) world.getTileEntity(x, y, z)).explosiveID; + BlockExplosive.detonate(world, x, y, z, explosiveID, 1); + } + + super.onBlockExploded(world, x, y, z, explosion); + } + + /** Called upon block activation (left or right click on the block.). The three integers + * represent x,y,z of the block. */ + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(entityPlayer.getCurrentEquippedItem() != null) + { + if(entityPlayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel) + { + int explosiveID = ((TileExplosive) tileEntity).explosiveID; + BlockExplosive.detonate(world, x, y, z, explosiveID, 0); + return true; + } + else if(MekanismUtils.hasUsableWrench(entityPlayer, x, y, z)) + { + byte change = 3; + + // Reorient the block + switch(world.getBlockMetadata(x, y, z)) + { + case 0: + change = 2; + break; + case 2: + change = 5; + break; + case 5: + change = 3; + break; + case 3: + change = 4; + break; + case 4: + change = 1; + break; + case 1: + change = 0; + break; + } + + world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.getOrientation(change).ordinal(), 3); + world.notifyBlockChange(x, y, z, this); + + return true; + } + } + + if(tileEntity instanceof TileExplosive) + { + return ExplosiveRegistry.get(((TileExplosive)tileEntity).explosiveID).onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9); + } + + return false; + } + + @SideOnly(Side.CLIENT) + @Override + public int getRenderType() + { + return RenderBombBlock.ID; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) + { + if(world.getTileEntity(x, y, z) != null) + { + int explosiveID = ((TileExplosive)world.getTileEntity(x, y, z)).explosiveID; + + return new ItemStack(this, 1, explosiveID); + } + + return null; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(tileEntity != null) + { + if(tileEntity instanceof TileExplosive) + { + if(!((TileExplosive)tileEntity).exploding) + { + int explosiveID = ((TileExplosive)tileEntity).explosiveID; + Item item = getItemDropped(world.getBlockMetadata(x, y, z), world.rand, 0); + + dropBlockAsItem(world, x, y, z, new ItemStack(item, 1, explosiveID)); + } + } + } + + super.breakBlock(world, x, y, z, par5, par6); + } + + @Override + public int quantityDropped(Random par1Random) + { + return 0; + } + + @Override + public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + for(Explosive explosive : ExplosiveRegistry.getExplosives()) + { + if(explosive.hasBlockForm()) + { + par3List.add(new ItemStack(par1, 1, explosive.getID())); + } + } + } + + @Override + public TileEntity createNewTileEntity(World var1, int meta) + { + return new TileExplosive(); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/block/BlockMachine.java b/src/main/java/mekanism/defense/common/block/BlockMachine.java new file mode 100644 index 000000000..98b8b1318 --- /dev/null +++ b/src/main/java/mekanism/defense/common/block/BlockMachine.java @@ -0,0 +1,353 @@ +package defense.common.block; + +import java.util.List; +import java.util.Random; + +import mekanism.common.Tier.BaseTier; +import mekanism.common.base.IBoundingBlock; +import mekanism.common.tile.TileEntityBasicBlock; +import mekanism.common.util.MekanismUtils; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.ITier; +import defense.client.render.block.BlockRenderingHandler; +import defense.common.DefenseTechBlocks; +import defense.common.DefenseTechItems; +import defense.common.base.IBlockActivate; +import defense.common.item.ItemBlockMachine; +import defense.common.tile.TileCruiseLauncher; +import defense.common.tile.TileEMPTower; +import defense.common.tile.TileLauncherBase; +import defense.common.tile.TileLauncherFrame; +import defense.common.tile.TileLauncherScreen; +import defense.common.tile.TileRadarStation; + +public class BlockMachine extends BlockBase +{ + public enum MachineData + { + LauncherBase("LauncherBase", TileLauncherBase.class, true), + LauncherScreen("LauncherScreen", TileLauncherScreen.class, true), + LauncherFrame("LauncherFrame", TileLauncherFrame.class, true), + RadarStation("RadarStation", TileRadarStation.class, false), + EmpTower("EmpTower", TileEMPTower.class, false), + CruiseLauncher("CruiseLauncher", TileCruiseLauncher.class, false); + + public String unlocalized; + public Class tileEntity; + public boolean hasTier; + + MachineData(String s, Class tile, boolean tier) + { + unlocalized = s; + tileEntity = tile; + hasTier = tier; + } + + public static MachineData get(int id) + { + if(id < MachineData.values().length && id >= 0) + { + return MachineData.values()[id]; + } + + return null; + } + } + + public BlockMachine() + { + super("machine", Material.iron); + } + + @Override + public boolean canProvidePower() + { + return true; + } + + @Override + public void onBlockAdded(World world, int x, int y, int z) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(!world.isRemote) + { + if(tileEntity instanceof TileEntityBasicBlock) + { + ((TileEntityBasicBlock)tileEntity).onAdded(); + } + } + } + + @Override + public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack itemStack) + { + TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z); + int side = MathHelper.floor_double((entityliving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + int height = Math.round(entityliving.rotationPitch); + int change = 3; + + if(tileEntity == null) + { + return; + } + + if(tileEntity.canSetFacing(0) && tileEntity.canSetFacing(1)) + { + if(height >= 65) + { + change = 1; + } + else if(height <= -65) + { + change = 0; + } + } + + if(change != 0 && change != 1) + { + switch(side) + { + case 0: change = 2; break; + case 1: change = 5; break; + case 2: change = 3; break; + case 3: change = 4; break; + } + } + + tileEntity.setFacing((short)change); + + if(tileEntity instanceof IBoundingBlock) + { + ((IBoundingBlock)tileEntity).onPlace(); + } + } + + public static boolean canBePlacedAt(World world, int x, int y, int z, int m, int side) + { + ForgeDirection d = MekanismUtils.getRight(side); + + if(m == MachineData.LauncherBase.ordinal()) + { + for(int yp = 0; yp <= 2; yp++) + { + Block b = world.getBlock(x + d.offsetX, y + yp, z + d.offsetZ); + + if(!b.isReplaceable(world, x + d.offsetX, y + yp, z + d.offsetZ)) + return false; + if(!b.isReplaceable(world, x - d.offsetX, y + yp, z - d.offsetZ)) + return false; + } + + return world.getBlock(x, y, z).isReplaceable(world, x, y, z); + } + else if(m == MachineData.LauncherFrame.ordinal()) + { + return world.getBlock(x, y - 1, z).getMaterial().isSolid() && world.isAirBlock(x, y, z) && world.isAirBlock(x, y + 1, z) && world.isAirBlock(x, y + 2, z); + } + else if(m == MachineData.EmpTower.ordinal()) + { + return world.isAirBlock(x, y, z) && world.isAirBlock(x, y + 1, z); + } + + return world.getBlock(x, y - 1, z).getMaterial().isSolid(); + } + + @Override + public boolean canBlockStay(World world, int x, int y, int z) + { + int direction = 0; + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (tileEntity instanceof TileEntityBasicBlock) + { + direction = ((TileEntityBasicBlock) tileEntity).facing; + } + + return canBePlacedAt(world, x, y, z, world.getBlockMetadata(x, y, z), direction); + } + + @Override + public void onNeighborBlockChange(World world, int x, int y, int z, Block block) + { + if(!world.isRemote) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(tileEntity instanceof TileEntityBasicBlock) + { + ((TileEntityBasicBlock)tileEntity).onNeighborChange(block); + } + } + } + + @Override + public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) + { + if(player.inventory.getCurrentItem() != null) + { + if(player.inventory.getCurrentItem().getItem() == DefenseTechItems.itemLaserDesignator) + { + return false; + } + else if(player.inventory.getCurrentItem().getItem() == DefenseTechItems.itemRadarGun) + { + return false; + } + } + + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if(tileEntity != null) + { + if(tileEntity instanceof IBlockActivate) + { + return ((IBlockActivate)tileEntity).onActivated(player); + } + } + + return false; + } + + @Override + public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) + { + return this.onMachineActivated(world, x, y, z, player, side, hitX, hitY, hitZ); + } + + @Override + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) + { + if(!player.capabilities.isCreativeMode && !world.isRemote && canHarvestBlock(player, world.getBlockMetadata(x, y, z))) + { + TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z); + + float motion = 0.7F; + double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D; + double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D; + double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D; + + EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z, player)); + + world.spawnEntityInWorld(entityItem); + } + + return world.setBlockToAir(x, y, z); + } + + /** If this block doesn't render as an ordinary block it will return False (examples: signs, + * buttons, stairs, etc) */ + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block block, int meta) + { + TileEntity tileEntity = (TileEntity)world.getTileEntity(x, y, z); + + if(tileEntity instanceof IBoundingBlock) + { + ((IBoundingBlock)tileEntity).onBreak(); + } + + super.breakBlock(world, x, y, z, block, meta); + } + + @Override + public TileEntity createTileEntity(World world, int metadata) + { + if(MachineData.get(metadata) != null) + { + try { + return MachineData.get(metadata).tileEntity.newInstance(); + } catch(Exception e) { + e.printStackTrace(); + } + } + + return null; + } + + @Override + public int quantityDropped(Random par1Random) + { + return 0; + } + + @SideOnly(Side.CLIENT) + @Override + public int getRenderType() + { + return BlockRenderingHandler.ID; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List par3List) + { + for(MachineData data : MachineData.values()) + { + ItemStack stack = new ItemStack(this, 1, data.ordinal()); + par3List.add(stack); + + if(data.hasTier) + { + ItemStack tier2 = stack.copy(); + ((ItemBlockMachine)tier2.getItem()).setBaseTier(tier2, BaseTier.ADVANCED); + par3List.add(tier2); + + ItemStack tier3 = stack.copy(); + ((ItemBlockMachine)tier3.getItem()).setBaseTier(tier3, BaseTier.ELITE); + par3List.add(tier3); + } + } + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) + { + TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z); + ItemStack stack = new ItemStack(DefenseTechBlocks.blockMachine, 1, world.getBlockMetadata(x, y, z)); + + if(tileEntity instanceof ITier) + { + ((ItemBlockMachine)stack.getItem()).setBaseTier(stack, BaseTier.values()[((ITier)tileEntity).getTier()]); + } + + return stack; + } + + @Override + public int damageDropped(int metadata) + { + return metadata; + } + + public static String getJiQiMing(TileEntity tileEntity) + { + ItemStack stack = tileEntity.getBlockType().getPickBlock(null, tileEntity.getWorldObj(), tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, null); + return stack.getDisplayName(); + } +} diff --git a/src/main/java/mekanism/defense/common/entity/EntityBombCart.java b/src/main/java/mekanism/defense/common/entity/EntityBombCart.java new file mode 100644 index 000000000..c0445be88 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityBombCart.java @@ -0,0 +1,143 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityMinecartTNT; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import defense.api.IExplosive; +import defense.api.IExplosiveContainer; +import defense.common.DefenseTechBlocks; +import defense.common.DefenseTechItems; +import defense.common.explosive.ExplosiveRegistry; + +public class EntityBombCart extends EntityMinecartTNT implements IExplosiveContainer, IEntityAdditionalSpawnData +{ + public int explosiveID = 0; + public NBTTagCompound nbtData = new NBTTagCompound(); + + public EntityBombCart(World par1World) + { + super(par1World); + } + + public EntityBombCart(World par1World, double x, double y, double z, int explosiveID) + { + super(par1World, x, y, z); + this.explosiveID = explosiveID; + } + + @Override + public void writeSpawnData(ByteBuf data) + { + data.writeInt(this.explosiveID); + } + + @Override + public void readSpawnData(ByteBuf data) + { + this.explosiveID = data.readInt(); + } + + @Override + protected void explodeCart(double par1) + { + // TODO add event + this.worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + this.getExplosiveType().createExplosion(this.worldObj, this.posX, this.posY, this.posZ, this); + this.setDead(); + } + + public boolean interact(EntityPlayer player) + { + if (player.getCurrentEquippedItem() != null) + { + if (player.getCurrentEquippedItem().getItem() == Items.flint_and_steel) + { + this.ignite(); + return true; + } + } + return false; + } + + @Override + public void killMinecart(DamageSource par1DamageSource) + { + this.setDead(); + ItemStack itemstack = new ItemStack(Items.minecart, 1); + + if (this.hasCustomInventoryName()) + { + itemstack.setStackDisplayName(this.getCommandSenderName()); + } + + this.entityDropItem(itemstack, 0.0F); + + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + + if (!par1DamageSource.isExplosion()) + { + this.entityDropItem(new ItemStack(DefenseTechBlocks.blockExplosive, 1, this.explosiveID), 0.0F); + } + + if (par1DamageSource.isFireDamage() || par1DamageSource.isExplosion() || d0 >= 0.01) + { + this.explodeCart(d0); + } + } + + @Override + public ItemStack getCartItem() + { + return new ItemStack(DefenseTechItems.itemBombCart, 1, this.explosiveID); + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + super.writeEntityToNBT(nbt); + nbt.setInteger("haoMa", this.explosiveID); + this.nbtData = nbt.getCompoundTag("data"); + + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + super.readEntityFromNBT(nbt); + this.explosiveID = nbt.getInteger("haoMa"); + nbt.setTag("data", this.nbtData); + + } + + @Override + public IExplosive getExplosiveType() + { + return ExplosiveRegistry.get(this.explosiveID); + } + + @Override + public Block func_145817_o() + { + return DefenseTechBlocks.blockExplosive; + } + + @Override + public int getDefaultDisplayTileData() + { + return this.explosiveID; + } + + @Override + public NBTTagCompound getTagCompound() + { + return this.nbtData; + } + +} diff --git a/src/main/java/mekanism/defense/common/entity/EntityBombSheep.java b/src/main/java/mekanism/defense/common/entity/EntityBombSheep.java new file mode 100644 index 000000000..f1d609ea9 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityBombSheep.java @@ -0,0 +1,23 @@ +package defense.common.entity; + +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.IMob; +import net.minecraft.world.World; + +/** Exploding sheep + * + * @author DarkGuardsman */ +public class EntityBombSheep extends EntityCreeper implements IMob +{ + String owner; + + public EntityBombSheep(World world) + { + super(world); + } + + public void setPlayer(String owner) + { + this.owner = owner; + } +} diff --git a/src/main/java/mekanism/defense/common/entity/EntityExplosion.java b/src/main/java/mekanism/defense/common/entity/EntityExplosion.java new file mode 100644 index 000000000..00b25b880 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityExplosion.java @@ -0,0 +1,181 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; + +import java.lang.reflect.Constructor; + +import mekanism.api.Pos3D; +import mekanism.common.PacketHandler; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import defense.api.IEntityExplosion; +import defense.common.DefenseTech; +import defense.common.explosive.blast.Blast; + +/** The Entity handler responsible for entity explosions. + * + * @author Calclavia */ +public class EntityExplosion extends Entity implements IEntityAdditionalSpawnData, IEntityExplosion +{ + public Blast blast; + + private boolean endExplosion = false; + + public EntityExplosion(World world) + { + super(world); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + this.renderDistanceWeight = 2f; + this.ignoreFrustumCheck = true; + this.ticksExisted = 0; + } + + public EntityExplosion(Blast blast) + { + this(blast.worldObj); + this.blast = blast; + this.setPosition(blast.position.xPos, blast.position.yPos, blast.position.zPos); + } + + @Override + public String getCommandSenderName() + { + return "Explosion"; + } + + @Override + public void writeSpawnData(ByteBuf data) + { + try + { + NBTTagCompound nbt = new NBTTagCompound(); + this.writeEntityToNBT(nbt); + PacketHandler.writeNBT(data, nbt); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + @Override + public void readSpawnData(ByteBuf data) + { + try + { + this.readEntityFromNBT(PacketHandler.readNBT(data)); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + @Override + protected void entityInit() + { + } + + /** returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for + * spiders and wolves to prevent them from trampling crops */ + @Override + protected boolean canTriggerWalking() + { + return false; + } + + /** Returns true if other Entities should be prevented from moving through this Entity. */ + @Override + public boolean canBeCollidedWith() + { + return false; + } + + /** Called to update the entity's position/logic. */ + @Override + public void onUpdate() + { + if (this.blast == null) + { + this.setDead(); + DefenseTech.LOGGER.severe("Procedural explosion ended due to null! This is a bug!"); + return; + } + + this.blast.controller = this; + this.blast.position = new Pos3D(posX, posY, posZ); + this.blast.worldObj = worldObj; + + if (this.blast.isMovable() && (this.motionX != 0 || this.motionY != 0 || this.motionZ != 0)) + { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + if (this.ticksExisted == 1) + { + this.blast.preExplode(); + } + else if (this.ticksExisted % this.blast.proceduralInterval() == 0) + { + if (!this.endExplosion) + { + this.blast.onExplode(); + } + else + { + this.blast.postExplode(); + this.setDead(); + } + } + } + + @Override + public void endExplosion() + { + this.endExplosion = true; + } + + /** (abstract) Protected helper method to read subclass entity data from NBT. */ + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + try + { + NBTTagCompound blastSave = nbt.getCompoundTag("blast"); + + if (this.blast == null) + { + Class clazz = Class.forName(blastSave.getString("class")); + Constructor constructor = clazz.getConstructor(World.class, Entity.class, double.class, double.class, double.class, float.class); + this.blast = (Blast) constructor.newInstance(this.worldObj, null, this.posX, this.posY, this.posZ, 0); + } + + this.blast.readFromNBT(blastSave); + } + catch (Exception e) + { + DefenseTech.LOGGER.severe("Error in loading an explosion!"); + e.printStackTrace(); + } + } + + /** (abstract) Protected helper method to write subclass entity data to NBT. */ + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + NBTTagCompound baoZhaNBT = new NBTTagCompound(); + baoZhaNBT.setString("class", this.blast.getClass().getCanonicalName()); + this.blast.writeToNBT(baoZhaNBT); + nbt.setTag("blast", baoZhaNBT); + } + + @Override + public float getShadowSize() + { + return 0F; + } +} diff --git a/src/main/java/mekanism/defense/common/entity/EntityExplosive.java b/src/main/java/mekanism/defense/common/entity/EntityExplosive.java new file mode 100644 index 000000000..e2cf3f093 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityExplosive.java @@ -0,0 +1,205 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.api.IExplosive; +import defense.api.IExplosiveContainer; +import defense.common.DefenseTechBlocks; +import defense.common.explosive.ExplosiveRegistry; + +public class EntityExplosive extends Entity implements IEntityAdditionalSpawnData, IExplosiveContainer +{ + // How long the fuse is (in ticks) + public int fuse = 90; + + // The ID of the explosive + public int explosiveID = 0; + + private byte orientation = 3; + + public NBTTagCompound nbtData = new NBTTagCompound(); + + public EntityExplosive(World par1World) + { + super(par1World); + this.fuse = 0; + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + } + + public EntityExplosive(World par1World, Pos3D position, byte orientation, int explosiveID) + { + this(par1World); + this.setPosition(position.xPos, position.yPos, position.zPos); + float var8 = (float) (Math.random() * Math.PI * 2.0D); + this.motionX = (-((float) Math.sin(var8)) * 0.02F); + this.motionY = 0.20000000298023224D; + this.motionZ = (-((float) Math.cos(var8)) * 0.02F); + this.prevPosX = position.xPos; + this.prevPosY = position.yPos; + this.prevPosZ = position.zPos; + this.explosiveID = explosiveID; + this.fuse = ExplosiveRegistry.get(explosiveID).getYinXin(); + this.orientation = orientation; + + ExplosiveRegistry.get(explosiveID).onPreDetonation(par1World, this); + } + + public EntityExplosive(World par1World, Pos3D position, int explosiveID, byte orientation, NBTTagCompound nbtData) + { + this(par1World, position, orientation, explosiveID); + this.nbtData = nbtData; + } + + @Override + public String getCommandSenderName() + { + return "Explosives"; + } + + /** Called to update the entity's position/logic. */ + @Override + public void onUpdate() + { + if (!this.worldObj.isRemote) + { + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(worldObj, posX, posY, posZ, ExplosiveType.BLOCK, ExplosiveRegistry.get(explosiveID)); + MinecraftForge.EVENT_BUS.post(evt); + + if (evt.isCanceled()) + { + DefenseTechBlocks.blockExplosive.dropBlockAsItem(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, this.explosiveID, 0); + this.setDead(); + return; + } + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + this.motionX *= 0.95; + this.motionY -= 0.045D; + this.motionZ *= 0.95; + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.fuse < 1) + { + this.explode(); + } + else + { + ExplosiveRegistry.get(this.explosiveID).onDetonation(this.worldObj, new Pos3D(this.posX, this.posY, this.posZ), this.fuse); + } + + this.fuse--; + + super.onUpdate(); + } + + public void explode() + { + this.worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + this.getExplosiveType().createExplosion(this.worldObj, this.posX, this.posY, this.posZ, this); + this.setDead(); + } + + /** (abstract) Protected helper method to read subclass entity data from NBT. */ + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + this.fuse = nbt.getByte("Fuse"); + this.explosiveID = nbt.getInteger("explosiveID"); + this.nbtData = nbt.getCompoundTag("data"); + } + + /** (abstract) Protected helper method to write subclass entity data to NBT. */ + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + nbt.setByte("Fuse", (byte) this.fuse); + nbt.setInteger("explosiveID", this.explosiveID); + nbt.setTag("data", this.nbtData); + } + + @Override + public float getShadowSize() + { + return 0.5F; + } + + @Override + protected void entityInit() + { + } + + /** returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for + * spiders and wolves to prevent them from trampling crops */ + @Override + protected boolean canTriggerWalking() + { + return true; + } + + /** Returns true if other Entities should be prevented from moving through this Entity. */ + @Override + public boolean canBeCollidedWith() + { + return true; + } + + /** Returns true if this entity should push and be pushed by other entities when colliding. */ + @Override + public boolean canBePushed() + { + return true; + } + + public ForgeDirection getDirection() + { + return ForgeDirection.getOrientation(this.orientation); + } + + public void setDirection(ForgeDirection facingDirection) + { + this.orientation = (byte) facingDirection.ordinal(); + } + + @Override + public void writeSpawnData(ByteBuf data) + { + data.writeInt(this.explosiveID); + data.writeInt(this.fuse); + data.writeByte(this.orientation); + } + + @Override + public void readSpawnData(ByteBuf data) + { + this.explosiveID = data.readInt(); + this.fuse = data.readInt(); + this.orientation = data.readByte(); + } + + @Override + public IExplosive getExplosiveType() + { + return ExplosiveRegistry.get(this.explosiveID); + } + + @Override + public NBTTagCompound getTagCompound() + { + return this.nbtData; + } +} diff --git a/src/main/java/mekanism/defense/common/entity/EntityFlyingBlock.java b/src/main/java/mekanism/defense/common/entity/EntityFlyingBlock.java new file mode 100644 index 000000000..ebaf83230 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityFlyingBlock.java @@ -0,0 +1,209 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; +import mekanism.api.Pos3D; +import mekanism.common.MekanismBlocks; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; + +/** @author Calclavia */ +public class EntityFlyingBlock extends Entity implements IEntityAdditionalSpawnData +{ + public Block block = null; + public int metadata = 0; + + public float yawChange = 0; + public float pitchChange = 0; + + public float gravity = 0.045f; + + public EntityFlyingBlock(World world) + { + super(world); + this.ticksExisted = 0; + this.preventEntitySpawning = true; + this.isImmuneToFire = true; + this.setSize(1F, 1F); + } + + public EntityFlyingBlock(World world, Pos3D position, Block b, int metadata) + { + super(world); + this.isImmuneToFire = true; + this.ticksExisted = 0; + setSize(0.98F, 0.98F); + yOffset = height / 2.0F; + setPosition(position.xPos + 0.5, position.yPos, position.zPos + 0.5); + motionX = 0D; + motionY = 0D; + motionZ = 0D; + this.block = b; + this.metadata = metadata; + } + + public EntityFlyingBlock(World world, Pos3D position, Block b, int metadata, float gravity) + { + this(world, position, b, metadata); + this.gravity = gravity; + } + + @Override + public String getCommandSenderName() + { + return "Flying Block"; + } + + @Override + public void writeSpawnData(ByteBuf data) + { + data.writeInt(Block.getIdFromBlock(block)); + data.writeInt(this.metadata); + data.writeFloat(this.gravity); + data.writeFloat(yawChange); + data.writeFloat(pitchChange); + } + + @Override + public void readSpawnData(ByteBuf data) + { + block = Block.getBlockById(data.readInt()); + metadata = data.readInt(); + gravity = data.readFloat(); + yawChange = data.readFloat(); + pitchChange = data.readFloat(); + } + + @Override + protected void entityInit() + { + } + + @Override + public void onUpdate() + { + if (block == null) + { + this.setDead(); + return; + } + + if (this.posY > 400 || block == null || this.block == MekanismBlocks.BoundingBlock || this.block == Blocks.piston_extension || this.block == Blocks.flowing_water || this.block == Blocks.flowing_lava) + { + this.setDead(); + return; + } + + this.motionY -= gravity; + + if (this.isCollided) + { + this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.yawChange > 0) + { + this.rotationYaw += this.yawChange; + this.yawChange -= 2; + } + + if (this.pitchChange > 0) + { + this.rotationPitch += this.pitchChange; + this.pitchChange -= 2; + } + + if ((this.onGround && this.ticksExisted > 20) || this.ticksExisted > 20 * 120) + { + this.setBlock(); + return; + } + + this.ticksExisted++; + } + + public void setBlock() + { + if (!this.worldObj.isRemote) + { + int i = MathHelper.floor_double(posX); + int j = MathHelper.floor_double(posY); + int k = MathHelper.floor_double(posZ); + + this.worldObj.setBlock(i, j, k, this.block, this.metadata, 2); + } + + this.setDead(); + } + + /** Checks to see if and entity is touching the missile. If so, blow up! */ + + @Override + public AxisAlignedBB getCollisionBox(Entity par1Entity) + { + // Make sure the entity is not an item + if (par1Entity instanceof EntityLiving) + { + if (block != null) + { + if (!(block instanceof BlockLiquid) && (this.motionX > 2 || this.motionY > 2 || this.motionZ > 2)) + { + int damage = (int) (1.2 * (Math.abs(this.motionX) + Math.abs(this.motionY) + Math.abs(this.motionZ))); + ((EntityLiving) par1Entity).attackEntityFrom(DamageSource.fallingBlock, damage); + } + } + } + + return null; + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbttagcompound) + { + nbttagcompound.setInteger("metadata", this.metadata); + nbttagcompound.setInteger("blockID", Block.getIdFromBlock(block)); + nbttagcompound.setFloat("gravity", this.gravity); + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbttagcompound) + { + this.metadata = nbttagcompound.getInteger("metadata"); + this.block = Block.getBlockById(nbttagcompound.getInteger("blockID")); + this.gravity = nbttagcompound.getFloat("gravity"); + } + + @Override + public float getShadowSize() + { + return 0.5F; + } + + @Override + public boolean canBePushed() + { + return true; + } + + @Override + protected boolean canTriggerWalking() + { + return true; + } + + @Override + public boolean canBeCollidedWith() + { + return true; + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/entity/EntityFragments.java b/src/main/java/mekanism/defense/common/entity/EntityFragments.java new file mode 100644 index 000000000..471a3a7ba --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityFragments.java @@ -0,0 +1,465 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + +import com.google.common.io.ByteArrayDataOutput; + +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; + +public class EntityFragments extends Entity implements IEntityAdditionalSpawnData +{ + private int xTile = -1; + private int yTile = -1; + private int zTile = -1; + private Block inTile = null; + private int inData = 0; + private boolean inGround = false; + public boolean doesArrowBelongToPlayer = false; + public boolean isExplosive; + public boolean isAnvil; + private boolean isExploding = false; + + /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake = 0; + + /** The owner of this arrow. */ + private int ticksInGround; + private int ticksInAir = 0; + private final int damage = 11; + private int knowBackStrength; + + /** Is this arrow a critical hit? (Controls particles and damage) */ + public boolean arrowCritical = false; + public float explosionSize = 1.5F; + + public EntityFragments(World par1World) + { + super(par1World); + this.setSize(0.5F, 0.5F); + } + + public EntityFragments(World par1World, double x, double y, double z, boolean isExplosive, boolean isAnvil) + { + super(par1World); + this.setPosition(x, y, z); + this.yOffset = 0.0F; + this.isExplosive = isExplosive; + this.isAnvil = isAnvil; + + if (this.isAnvil) + { + this.setSize(1, 1); + } + else + { + this.setSize(0.5f, 0.5f); + } + } + + @Override + public void writeSpawnData(ByteBuf data) + { + data.writeBoolean(this.isExplosive); + data.writeBoolean(this.isAnvil); + } + + @Override + public void readSpawnData(ByteBuf data) + { + this.isExplosive = data.readBoolean(); + this.isAnvil = data.readBoolean(); + } + + @Override + protected void entityInit() + { + } + + @Override + public String getCommandSenderName() + { + return "Fragments"; + } + + /** Uses the provided coordinates as a heading and determines the velocity from it with the set + * force and random variance. Args: x, y, z, force, forceVariation */ + public void setArrowHeading(double par1, double par3, double par5, float par7, float par8) + { + float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); + par1 /= var9; + par3 /= var9; + par5 /= var9; + par1 += this.rand.nextGaussian() * 0.007499999832361937D * par8; + par3 += this.rand.nextGaussian() * 0.007499999832361937D * par8; + par5 += this.rand.nextGaussian() * 0.007499999832361937D * par8; + par1 *= par7; + par3 *= par7; + par5 *= par7; + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + + /** Sets the velocity to the args. Args: x, y, z */ + @Override + public void setVelocity(double par1, double par3, double par5) + { + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } + } + + private void explode() + { + if (!this.isExploding && !this.worldObj.isRemote) + { + this.isExploding = true; + this.worldObj.createExplosion(this, this.xTile, this.yTile, this.zTile, this.explosionSize, true); + this.setDead(); + } + } + + /** Called to update the entity's position/logic. */ + @Override + public void onUpdate() + { + super.onUpdate(); + + if (this.isAnvil) + { + ArrayList entities = new ArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox)); + + Iterator var5 = entities.iterator(); + + while (var5.hasNext()) + { + Entity entity = (Entity) var5.next(); + entity.attackEntityFrom(DamageSource.anvil, 15); + } + } + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(this.motionY, var1) * 180.0D / Math.PI); + } + + Block block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + + if (!worldObj.isAirBlock(xTile, yTile, zTile)) + { + block.setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); + AxisAlignedBB var2 = block.getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); + + if (var2 != null && var2.isVecInside(Vec3.createVectorHelper(this.posX, this.posY, this.posZ))) + { + this.inGround = true; + } + } + + if (this.arrowShake > 0) + { + --this.arrowShake; + } + + if (this.inGround) + { + block = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + int var18 = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + + if (block == this.inTile && var18 == this.inData) + { + if (this.isExplosive) + { + explode(); + } + else + { + if (this.isAnvil && this.worldObj.rand.nextFloat() > 0.5f) + { + this.worldObj.playAuxSFX(1022, (int) this.posX, (int) this.posY, (int) this.posZ, 0); + } + + this.setDead(); + } + } + else + { + this.inGround = false; + this.motionX *= (this.rand.nextFloat() * 0.2F); + this.motionY *= (this.rand.nextFloat() * 0.2F); + this.motionZ *= (this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } + } + else + { + ++this.ticksInAir; + Vec3 var16 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + Vec3 var17 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + MovingObjectPosition movingObjPos = this.worldObj.func_147447_a(var16, var17, false, true, false); + var16 = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); + var17 = Vec3.createVectorHelper(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); + + if (movingObjPos != null) + { + var17 = Vec3.createVectorHelper(movingObjPos.hitVec.xCoord, movingObjPos.hitVec.yCoord, movingObjPos.hitVec.zCoord); + } + + Entity var4 = null; + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; + int var8; + float var10; + + for (var8 = 0; var8 < var5.size(); ++var8) + { + Entity var9 = (Entity) var5.get(var8); + + if (var9.canBeCollidedWith() && (this.ticksInAir >= 5)) + { + var10 = 0.3F; + AxisAlignedBB var11 = var9.boundingBox.expand(var10, var10, var10); + MovingObjectPosition var12 = var11.calculateIntercept(var16, var17); + + if (var12 != null) + { + double var13 = var16.distanceTo(var12.hitVec); + + if (var13 < var6 || var6 == 0.0D) + { + var4 = var9; + var6 = var13; + } + } + } + } + + if (var4 != null) + { + movingObjPos = new MovingObjectPosition(var4); + } + + float speed; + + if (movingObjPos != null) + { + if (movingObjPos.entityHit != null) + { + speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int damage = (int) Math.ceil(speed * this.damage); + + if (this.arrowCritical) + { + damage += this.rand.nextInt(damage / 2 + 2); + } + + DamageSource damageSource = (new EntityDamageSourceIndirect("arrow", this, this)).setProjectile(); + + if (this.isBurning()) + { + movingObjPos.entityHit.setFire(5); + } + + if (movingObjPos.entityHit.attackEntityFrom(damageSource, damage)) + { + if (movingObjPos.entityHit instanceof EntityLiving) + { + EntityLiving var24 = (EntityLiving) movingObjPos.entityHit; + + if (!this.worldObj.isRemote) + { + var24.setArrowCountInEntity(var24.getArrowCountInEntity() + 1); + } + + if (this.knowBackStrength > 0) + { + float var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); + + if (var21 > 0.0F) + { + movingObjPos.entityHit.addVelocity(this.motionX * this.knowBackStrength * 0.6000000238418579D / var21, 0.1D, this.motionZ * this.knowBackStrength * 0.6000000238418579D / var21); + } + } + } + + this.worldObj.playSoundAtEntity(this, "random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.setDead(); + } + else + { + this.motionX *= -0.10000000149011612D; + this.motionY *= -0.10000000149011612D; + this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; + } + } + else + { + this.xTile = movingObjPos.blockX; + this.yTile = movingObjPos.blockY; + this.zTile = movingObjPos.blockZ; + this.inTile = this.worldObj.getBlock(this.xTile, this.yTile, this.zTile); + this.inData = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); + this.motionX = ((float) (movingObjPos.hitVec.xCoord - this.posX)); + this.motionY = ((float) (movingObjPos.hitVec.yCoord - this.posY)); + this.motionZ = ((float) (movingObjPos.hitVec.zCoord - this.posZ)); + speed = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + this.posX -= this.motionX / speed * 0.05000000074505806D; + this.posY -= this.motionY / speed * 0.05000000074505806D; + this.posZ -= this.motionZ / speed * 0.05000000074505806D; + this.worldObj.playSoundAtEntity(this, "random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.arrowCritical = false; + } + } + + if (this.arrowCritical) + { + for (var8 = 0; var8 < 4; ++var8) + { + this.worldObj.spawnParticle("crit", this.posX + this.motionX * var8 / 4.0D, this.posY + this.motionY * var8 / 4.0D, this.posZ + this.motionZ * var8 / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); + } + } + + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; + speed = 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, speed) * 180.0D / Math.PI); 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; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var23 = 0.99F; + var10 = 0.05F; + + if (this.isInWater()) + { + for (int var25 = 0; var25 < 4; ++var25) + { + float var24 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * var24, this.posY - this.motionY * var24, this.posZ - this.motionZ * var24, this.motionX, this.motionY, this.motionZ); + } + + var23 = 0.8F; + } + + this.motionX *= var23; + this.motionY *= var23; + this.motionZ *= var23; + this.motionY -= var10; + this.setPosition(this.posX, this.posY, this.posZ); + } + } + + /** (abstract) Protected helper method to write subclass entity data to NBT. */ + @Override + public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setShort("xTile", (short) this.xTile); + par1NBTTagCompound.setShort("yTile", (short) this.yTile); + par1NBTTagCompound.setShort("zTile", (short) this.zTile); + par1NBTTagCompound.setInteger("inTile", Block.getIdFromBlock(this.inTile)); + par1NBTTagCompound.setByte("inData", (byte) this.inData); + par1NBTTagCompound.setByte("shake", (byte) this.arrowShake); + par1NBTTagCompound.setByte("inGround", (byte) (this.inGround ? 1 : 0)); + + par1NBTTagCompound.setBoolean("isExplosive", this.isExplosive); + } + + /** (abstract) Protected helper method to read subclass entity data from NBT. */ + @Override + public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + this.xTile = par1NBTTagCompound.getShort("xTile"); + this.yTile = par1NBTTagCompound.getShort("yTile"); + this.zTile = par1NBTTagCompound.getShort("zTile"); + this.inTile = Block.getBlockById(par1NBTTagCompound.getInteger("inTile")); + this.inData = par1NBTTagCompound.getByte("inData") & 255; + this.arrowShake = par1NBTTagCompound.getByte("shake") & 255; + this.inGround = par1NBTTagCompound.getByte("inGround") == 1; + + this.isExplosive = par1NBTTagCompound.getBoolean("isExplosive"); + } + + /** Called by a player entity when they collide with an entity */ + @Override + public void applyEntityCollision(Entity par1Entity) + { + super.applyEntityCollision(par1Entity); + + if (this.isExplosive && this.ticksExisted < 20 * 2) + { + this.explode(); + } + } + + @Override + public float getShadowSize() + { + return 0.0F; + } + + /** If returns false, the item will not inflict any damage against entities. */ + @Override + public boolean canAttackWithItem() + { + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/entity/EntityGrenade.java b/src/main/java/mekanism/defense/common/entity/EntityGrenade.java new file mode 100644 index 000000000..4d2d25576 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityGrenade.java @@ -0,0 +1,283 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; +import mekanism.api.Pos3D; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.api.IExplosive; +import defense.api.IExplosiveContainer; +import defense.common.DefenseTechItems; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; + +public class EntityGrenade extends Entity implements IExplosiveContainer, IEntityAdditionalSpawnData +{ + /** Is the entity that throws this 'thing' (snowball, ender pearl, eye of ender or potion) */ + protected EntityLivingBase thrower; + + public int explosiveID; + public NBTTagCompound nbtData = new NBTTagCompound(); + + public EntityGrenade(World par1World) + { + super(par1World); + this.setSize(0.3F, 0.3F); + this.renderDistanceWeight = 8; + } + + public EntityGrenade(World par1World, Pos3D position, int explosiveID) + { + this(par1World); + this.setPosition(position.xPos, position.yPos, position.zPos); + this.explosiveID = explosiveID; + } + + public EntityGrenade(World par1World, EntityLivingBase par2EntityLiving, int explosiveID, float nengLiang) + { + this(par1World); + this.thrower = par2EntityLiving; + this.setSize(0.25F, 0.25F); + this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY + par2EntityLiving.getEyeHeight(), par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); + this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.posY -= 0.10000000149011612D; + this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F; + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + float var3 = 0.4F; + this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI) * var3; + this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI) * var3; + this.motionY = -MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI) * var3; + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.8f * nengLiang, 1.0F); + this.explosiveID = explosiveID; + } + + @Override + public String getCommandSenderName() + { + if (ExplosiveRegistry.get(this.explosiveID) != null) + { + return ExplosiveRegistry.get(this.explosiveID).getGrenadeName(); + } + + return "Grenade"; + } + + @Override + public void writeSpawnData(ByteBuf data) + { + data.writeInt(this.explosiveID); + } + + @Override + public void readSpawnData(ByteBuf data) + { + this.explosiveID = data.readInt(); + } + + /** Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. */ + public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) + { + float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); + par1 /= var9; + par3 /= var9; + par5 /= var9; + par1 += this.rand.nextGaussian() * 0.007499999832361937D * par8; + par3 += this.rand.nextGaussian() * 0.007499999832361937D * par8; + par5 += this.rand.nextGaussian() * 0.007499999832361937D * par8; + par1 *= par7; + par3 *= par7; + par5 *= par7; + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, var10) * 180.0D / Math.PI); + } + + /** Sets the velocity to the args. Args: x, y, z */ + @Override + public void setVelocity(double par1, double par3, double par5) + { + this.motionX = par1; + this.motionY = par3; + this.motionZ = par5; + + if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) + { + float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); + this.prevRotationYaw = this.rotationYaw = (float) (Math.atan2(par1, par5) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch = (float) (Math.atan2(par3, var7) * 180.0D / Math.PI); + } + } + + /** returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for + * spiders and wolves to prevent them from trampling crops */ + @Override + protected boolean canTriggerWalking() + { + return false; + } + + @Override + protected void entityInit() + { + } + + /** Called to update the entity's position/logic. */ + @Override + public void onUpdate() + { + if (!this.worldObj.isRemote) + { + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(this.worldObj, this, ExplosiveType.ITEM, ExplosiveRegistry.get(this.explosiveID)); + MinecraftForge.EVENT_BUS.post(evt); + + if (evt.isCanceled()) + { + float var6 = 0.7F; + double var7 = this.worldObj.rand.nextFloat() * var6 + (1.0F - var6) * 0.5D; + double var9 = this.worldObj.rand.nextFloat() * var6 + (1.0F - var6) * 0.5D; + double var11 = this.worldObj.rand.nextFloat() * var6 + (1.0F - var6) * 0.5D; + EntityItem var13 = new EntityItem(this.worldObj, this.posX + var7, this.posY + var9, this.posZ + var11, new ItemStack(DefenseTechItems.itemGrenade, this.explosiveID, 1)); + var13.delayBeforeCanPickup = 10; + this.worldObj.spawnEntityInWorld(var13); + this.setDead(); + return; + } + } + + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var16 = 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, var16) * 180.0D / Math.PI); 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; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var17 = 0.98F; + float gravity = 0.03F; + + if (this.isInWater()) + { + for (int var7 = 0; var7 < 4; ++var7) + { + float var19 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * var19, this.posY - this.motionY * var19, this.posZ - this.motionZ * var19, this.motionX, this.motionY, this.motionZ); + } + + var17 = 0.8F; + } + + this.motionX *= var17; + this.motionY *= var17; + this.motionZ *= var17; + + if (this.onGround) + { + this.motionX *= 0.5; + this.motionZ *= 0.5; + this.motionY *= 0.5; + } + else + { + this.motionY -= gravity; + this.func_145771_j(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + } + + if (this.ticksExisted > Math.max(60, ((Explosive) this.getExplosiveType()).getYinXin())) + { + this.worldObj.spawnParticle("hugeexplosion", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + ((Explosive) this.getExplosiveType()).createExplosion(this.worldObj, this.posX, this.posY + 0.3f, this.posZ, this); + this.setDead(); + return; + } + else + { + ((Explosive) this.getExplosiveType()).onDetonation(this.worldObj, new Pos3D(this.posX, this.posY + 0.5, this.posZ), this.ticksExisted); + } + } + + /** Returns if this entity is in water and will end up adding the waters velocity to the entity */ + @Override + public boolean handleWaterMovement() + { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + + /** Returns true if other Entities should be prevented from moving through this Entity. */ + @Override + public boolean canBeCollidedWith() + { + return true; + } + + /** Returns true if this entity should push and be pushed by other entities when colliding. */ + @Override + public boolean canBePushed() + { + return true; + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + this.explosiveID = nbt.getInteger("haoMa"); + this.nbtData = nbt.getCompoundTag("data"); + + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + nbt.setInteger("haoMa", this.explosiveID); + nbt.setTag("data", this.nbtData); + + } + + @Override + public IExplosive getExplosiveType() + { + return ExplosiveRegistry.get(this.explosiveID); + } + + @Override + public NBTTagCompound getTagCompound() + { + return this.nbtData; + } + +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/entity/EntityLightBeam.java b/src/main/java/mekanism/defense/common/entity/EntityLightBeam.java new file mode 100644 index 000000000..00dfc6418 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityLightBeam.java @@ -0,0 +1,111 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; + +public class EntityLightBeam extends Entity implements IEntityAdditionalSpawnData +{ + private int life; + public float red, green, blue; + + public EntityLightBeam(World world) + { + super(world); + this.setSize(1F, 1F); + this.preventEntitySpawning = true; + this.ignoreFrustumCheck = true; + this.renderDistanceWeight = 3; + } + + public EntityLightBeam(World world, Pos3D position, int life, float red, float green, float blue) + { + super(world); + this.setPosition(position.xPos, position.yPos, position.zPos); + this.red = red; + this.green = green; + this.blue = blue; + this.life = life; + } + + @Override + public String getCommandSenderName() + { + return "Light Beam"; + } + + @Override + public void writeSpawnData(ByteBuf data) + { + data.writeInt(this.life); + data.writeFloat(this.red); + data.writeFloat(this.green); + data.writeFloat(this.blue); + } + + @Override + public void readSpawnData(ByteBuf data) + { + this.life = data.readInt(); + this.red = data.readFloat(); + this.green = data.readFloat(); + this.blue = data.readFloat(); + } + + @Override + protected void entityInit() + { + } + + @Override + public void onUpdate() + { + if (this.life > 0) + { + this.life--; + } + else + { + this.setDead(); + } + } + + @Override + public float getShadowSize() + { + return 0F; + } + + @Override + public boolean canBePushed() + { + return false; + } + + @Override + protected boolean canTriggerWalking() + { + return false; + } + + @Override + public boolean canBeCollidedWith() + { + return false; + } + + @Override + protected void readEntityFromNBT(NBTTagCompound var1) + { + + } + + @Override + protected void writeEntityToNBT(NBTTagCompound var1) + { + + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/entity/EntityMissile.java b/src/main/java/mekanism/defense/common/entity/EntityMissile.java new file mode 100644 index 000000000..829920f34 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/EntityMissile.java @@ -0,0 +1,831 @@ +package defense.common.entity; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Random; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +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; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.api.IExplosive; +import defense.api.IExplosiveContainer; +import defense.api.ILauncherContainer; +import defense.api.IMissile; +import defense.api.ITarget; +import defense.api.RadarRegistry; +import defense.common.DamageUtility; +import defense.common.DefenseTech; +import defense.common.DefenseTechItems; +import defense.common.Reference; +import defense.common.Settings; +import defense.common.Vector2; +import defense.common.base.IChunkLoadHandler; +import defense.common.explosion.Explosion; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.tile.TileCruiseLauncher; + +/** @Author - Calclavia */ +public class EntityMissile extends Entity implements IChunkLoadHandler, IExplosiveContainer, IEntityAdditionalSpawnData, IMissile, ITarget +{ + public enum MissileType + { + MISSILE, + CruiseMissile, + LAUNCHER + } + + public static final float SPEED = 0.012F; + + public boolean createdSound = false; + + public int explosiveID = 0; + public int maxHeight = 200; + public Pos3D targetVector = null; + public Pos3D startPos = null; + public Pos3D launcherPos = null; + public boolean isExpoding = false; + + public int targetHeight = 0; + public int airborneTicks = -1; + // Difference + public double deltaPathX; + public double deltaPathY; + public double deltaPathZ; + // Flat Distance + public double flatDistance; + // The flight time in ticks + public float missileFlightTime; + // Acceleration + public float acceleration; + // Hp + public float damage = 0; + public float max_damage = 10; + // Protection Time + public int protectionTime = 2; + + private Ticket chunkTicket; + + // For anti-ballistic missile + public Entity lockedTarget; + // Has this missile lock it's target before? + public boolean didTargetLockBefore = false; + // Tracking + public int trackingVar = -1; + // For cluster missile + public int missileCount = 0; + + public double daoDanGaoDu = 2; + + private boolean setExplode; + private boolean setNormalExplode; + + // Missile Type + public MissileType missileType = MissileType.MISSILE; + + public Pos3D xiaoDanMotion = new Pos3D(); + + private double lockHeight = 3; + + // Used for the rocket launcher preventing the players from killing themselves. + private final HashSet ignoreEntity = new HashSet(); + + public NBTTagCompound nbtData = new NBTTagCompound(); + + public EntityMissile(World world) + { + super(world); + + setSize(1F, 1F); + renderDistanceWeight = 3; + isImmuneToFire = true; + ignoreFrustumCheck = true; + } + + /** Spawns a traditional missile and cruise missiles + * + * @param explosiveId - Explosive ID + * @param start - Starting Position + * @param launcher - Missile Launcher Position */ + public EntityMissile(World world, Pos3D start, Pos3D launcher, int explosiveId) + { + this(world); + + explosiveID = explosiveId; + startPos = start; + launcherPos = launcher; + + setPosition(startPos.xPos, startPos.yPos, startPos.zPos); + setRotation(0, 90); + } + + /** For rocket launchers + * + * @param id - Explosive ID + * @param start - Starting Position + * @param yaw - The yaw of the missle + * @param pitch - the pitch of the missle */ + public EntityMissile(World world, Pos3D start, int id, float yaw, float pitch) + { + this(world); + + explosiveID = id; + launcherPos = startPos = start; + missileType = MissileType.LAUNCHER; + protectionTime = 0; + + setPosition(startPos.xPos, startPos.yPos, startPos.zPos); + setRotation(yaw, pitch); + } + + @Override + public String getCommandSenderName() + { + return ExplosiveRegistry.get(explosiveID).getMissileName(); + } + + @Override + public void writeSpawnData(ByteBuf data) + { + try { + data.writeInt(explosiveID); + data.writeInt(missileType.ordinal()); + + data.writeDouble(startPos.xPos); + data.writeDouble(startPos.yPos); + data.writeDouble(startPos.zPos); + + data.writeInt((int)launcherPos.xPos); + data.writeInt((int)launcherPos.yPos); + data.writeInt((int)launcherPos.zPos); + + data.writeFloat(rotationYaw); + data.writeFloat(rotationPitch); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void readSpawnData(ByteBuf data) + { + try { + explosiveID = data.readInt(); + missileType = MissileType.values()[data.readInt()]; + startPos = new Pos3D(data.readDouble(), data.readDouble(), data.readDouble()); + launcherPos = new Pos3D(data.readInt(), data.readInt(), data.readInt()); + + rotationYaw = data.readFloat(); + rotationPitch = data.readFloat(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void launch(Pos3D target) + { + startPos = new Pos3D(this); + targetVector = target; + targetHeight = (int)targetVector.yPos; + ((Explosion)ExplosiveRegistry.get(explosiveID)).launch(this); + airborneTicks = 0; + recalculatePath(); + worldObj.playSoundAtEntity(this, Reference.PREFIX + "missilelaunch", 4F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + // TODO add an event system here + RadarRegistry.register(this); + DefenseTech.LOGGER.info("Launching " + getCommandSenderName() + " (" + getEntityId() + ") from " + (int)startPos.xPos + ", " + (int)startPos.yPos + ", " + (int)startPos.zPos + " to " + (int)targetVector.xPos + ", " + (int)targetVector.yPos + ", " + (int)targetVector.zPos); + } + + @Override + public void launch(Pos3D target, int height) + { + lockHeight = height; + launch(target); + } + + public EntityMissile ignore(Entity entity) + { + ignoreEntity.add(entity); + return this; + } + + /** Recalculates required parabolic path for the missile Registry */ + public void recalculatePath() + { + if(targetVector != null) + { + // Calculate the distance difference of the missile + deltaPathX = targetVector.xPos - startPos.xPos; + deltaPathY = targetVector.yPos - startPos.yPos; + deltaPathZ = targetVector.zPos - startPos.zPos; + + // TODO: Calculate parabola and relative out the height. + // Calculate the power required to reach the target co-ordinates + // Ground Displacement + flatDistance = Vector2.distance(new Vector2(startPos), new Vector2(targetVector)); + // Parabolic Height + maxHeight = 160 + (int)(flatDistance * 3); + // Flight time + missileFlightTime = (float)Math.max(100, 2 * flatDistance) - airborneTicks; + // Acceleration + acceleration = (float)maxHeight * 2 / (missileFlightTime * missileFlightTime); + } + } + + @Override + public void entityInit() + { + dataWatcher.addObject(16, -1); + dataWatcher.addObject(17, 0); + chunkLoaderInit(ForgeChunkManager.requestTicket(DefenseTech.INSTANCE, worldObj, Type.ENTITY)); + } + + @Override + public void chunkLoaderInit(Ticket ticket) + { + if(!worldObj.isRemote) + { + if(ticket != null) + { + if(chunkTicket == null) + { + chunkTicket = ticket; + chunkTicket.bindEntity(this); + chunkTicket.getModData(); + } + + ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(chunkCoordX, chunkCoordZ)); + } + } + } + + final List loadedChunks = new ArrayList(); + + public void updateLoadChunk(int newChunkX, int newChunkZ) + { + if(!worldObj.isRemote && Settings.LOAD_CHUNKS && chunkTicket != null) + { + for(ChunkCoordIntPair chunk : loadedChunks) + { + ForgeChunkManager.unforceChunk(chunkTicket, chunk); + } + + loadedChunks.clear(); + loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX + 1, newChunkZ + 1)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX - 1, newChunkZ - 1)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX + 1, newChunkZ - 1)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX - 1, newChunkZ + 1)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX + 1, newChunkZ)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ + 1)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX - 1, newChunkZ)); + loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ - 1)); + + for(ChunkCoordIntPair chunk : loadedChunks) + { + ForgeChunkManager.forceChunk(chunkTicket, chunk); + } + } + } + + @Override + public boolean canBeCollidedWith() + { + return true; + } + + @Override + public void onUpdate() + { + if(!worldObj.isRemote) + { + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(worldObj, posX, posY, posZ, ExplosiveType.AIR, ExplosiveRegistry.get(explosiveID)); + MinecraftForge.EVENT_BUS.post(evt); + + if(evt.isCanceled()) + { + if(airborneTicks >= 0) + { + dropMissileAsItem(); + } + + setDead(); + return; + } + } + else { + if(!createdSound) + { + DefenseTech.proxy.playSound(this); + createdSound = true; + } + } + + try { + if(worldObj.isRemote) + { + airborneTicks = dataWatcher.getWatchableObjectInt(16); + int status = dataWatcher.getWatchableObjectInt(17); + + switch(status) + { + case 1: + setNormalExplode = true; + break; + case 2: + setExplode = true; + break; + } + } + else { + dataWatcher.updateObject(16, airborneTicks); + } + } catch(Exception e) { + e.printStackTrace(); + } + + if(setNormalExplode) + { + normalExplode(); + return; + } + + if(setExplode) + { + explode(); + return; + } + + if(airborneTicks >= 0) + { + RadarRegistry.register(this); + + if(!worldObj.isRemote) + { + if(missileType == MissileType.CruiseMissile || missileType == MissileType.LAUNCHER) + { + if(airborneTicks == 0 && xiaoDanMotion != null) + { + xiaoDanMotion = new Pos3D(deltaPathX / (missileFlightTime * 0.3), deltaPathY / (missileFlightTime * 0.3), deltaPathZ / (missileFlightTime * 0.3)); + motionX = xiaoDanMotion.xPos; + motionY = xiaoDanMotion.yPos; + motionZ = xiaoDanMotion.zPos; + } + + rotationPitch = (float)(Math.atan(motionY / (Math.sqrt(motionX * motionX + motionZ * motionZ))) * 180 / Math.PI); + + // Look at the next point + rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180 / Math.PI); + + ((Explosion)ExplosiveRegistry.get(explosiveID)).update(this); + + Block block = worldObj.getBlock((int)posX, (int)posY, (int)posZ); + + if(protectionTime <= 0 && ((!worldObj.isAirBlock((int)posX, (int)posY, (int)posZ) && !(block instanceof BlockLiquid)) || posY > 1000 || isCollided || airborneTicks > 20 * 1000 || (motionX == 0 && motionY == 0 && motionZ == 0))) + { + setExplode(); + return; + } + + moveEntity(motionX, motionY, motionZ); + } + else { + // Start the launch + if(lockHeight > 0) + { + motionY = SPEED * airborneTicks * (airborneTicks / 2); + motionX = 0; + motionZ = 0; + lockHeight -= motionY; + moveEntity(motionX, motionY, motionZ); + + if(lockHeight <= 0) + { + motionY = acceleration * (missileFlightTime / 2); + motionX = deltaPathX / missileFlightTime; + motionZ = deltaPathZ / missileFlightTime; + } + } + else { + motionY -= acceleration; + + rotationPitch = (float)(Math.atan(motionY / (Math.sqrt(motionX * motionX + motionZ * motionZ))) * 180 / Math.PI); + + // Look at the next point + rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180 / Math.PI); + + ((Explosion)ExplosiveRegistry.get(explosiveID)).update(this); + + moveEntity(motionX, motionY, motionZ); + + // If the missile contacts anything, it will explode. + if(isCollided) + { + explode(); + } + + // If the missile is commanded to explode before impact + if(targetHeight > 0 && motionY < 0) + { + if(!worldObj.isAirBlock((int)posX, (int)posY - targetHeight, (int)posZ)) + { + targetHeight = 0; + explode(); + } + } + } + } + } + else { + rotationPitch = (float)(Math.atan(motionY / (Math.sqrt(motionX * motionX + motionZ * motionZ))) * 180 / Math.PI); + // Look at the next point + rotationYaw = (float)(Math.atan2(motionX, motionZ) * 180 / Math.PI); + } + + lastTickPosX = posX; + lastTickPosY = posY; + lastTickPosZ = posZ; + + spawnMissileSmoke(); + protectionTime--; + airborneTicks++; + } + else if(missileType != MissileType.LAUNCHER) + { + // Check to find the launcher in which this missile belongs in. + ILauncherContainer launcher = getLauncher(); + + if(launcher != null) + { + launcher.setContainingMissile(this); + + /** Rotate the missile to the cruise launcher's rotation. */ + if(launcher instanceof TileCruiseLauncher) + { + missileType = MissileType.CruiseMissile; + noClip = true; + + if(worldObj.isRemote) + { + rotationYaw = -((TileCruiseLauncher)launcher).rotationYaw + 90; + rotationPitch = ((TileCruiseLauncher)launcher).rotationPitch; + } + + posY = ((TileCruiseLauncher)launcher).yCoord + 1; + } + } + else { + setDead(); + } + } + + List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.5, 0.5, 0.5)); + + for(Entity e : list) + { + entityBoundCheck(e); + } + + super.onUpdate(); + } + + @Override + public ILauncherContainer getLauncher() + { + if(launcherPos != null) + { + TileEntity tileEntity = worldObj.getTileEntity((int)launcherPos.xPos, (int)launcherPos.yPos, (int)launcherPos.zPos); + + if(tileEntity != null && tileEntity instanceof ILauncherContainer) + { + if(!tileEntity.isInvalid()) + { + return (ILauncherContainer) tileEntity; + } + } + } + + return null; + } + + @Override + public boolean interactFirst(EntityPlayer entityPlayer) + { + if(((Explosion)ExplosiveRegistry.get(explosiveID)) != null) + { + if(((Explosion)ExplosiveRegistry.get(explosiveID)).onInteract(this, entityPlayer)) + { + return true; + } + } + + if(!worldObj.isRemote && (riddenByEntity == null || riddenByEntity == entityPlayer)) + { + entityPlayer.mountEntity(this); + return true; + } + + return false; + } + + @Override + public double getMountedYOffset() + { + if(missileFlightTime <= 0 && missileType == MissileType.MISSILE) + { + return height; + } + else if(missileType == MissileType.CruiseMissile) + { + return height / 10; + } + + return height / 2 + motionY; + } + + private void spawnMissileSmoke() + { + if(worldObj.isRemote) + { + Pos3D position = new Pos3D(this); + // The distance of the smoke relative + // to the missile. + double distance = -daoDanGaoDu - 0.2f; + Pos3D delta = new Pos3D(); + // The delta Y of the smoke. + delta.yPos = Math.sin(Math.toRadians(rotationPitch)) * distance; + // The horizontal distance of the + // smoke. + double dH = Math.cos(Math.toRadians(rotationPitch)) * distance; + // The delta X and Z. + delta.xPos = Math.sin(Math.toRadians(rotationYaw)) * dH; + delta.zPos = Math.cos(Math.toRadians(rotationYaw)) * dH; + + position.translate(delta); + worldObj.spawnParticle("flame", position.xPos, position.yPos, position.zPos, 0, 0, 0); + DefenseTech.proxy.spawnParticle("missile_smoke", worldObj, position, 4, 2); + position.rotatePitch(this.rotationPitch); + position.rotateYaw(this.rotationYaw); + position.scale(1 - 0.001 * Math.random()); + DefenseTech.proxy.spawnParticle("missile_smoke", worldObj, position, 4, 2); + position.scale(1 - 0.001 * Math.random()); + DefenseTech.proxy.spawnParticle("missile_smoke", worldObj, position, 4, 2); + position.scale(1 - 0.001 * Math.random()); + DefenseTech.proxy.spawnParticle("missile_smoke", worldObj, position, 4, 2); + } + } + + public void entityBoundCheck(Entity entity) + { + if(ignoreEntity.contains(entity)) + { + return; + } + + // Make sure the entity is not an item + if(!(entity instanceof EntityItem) && entity != riddenByEntity && protectionTime <= 0) + { + if(entity instanceof EntityMissile) + { + ((EntityMissile)entity).setNormalExplode(); + } + + setExplode(); + } + } + + @Override + public Pos3D getPredictedPosition(int t) + { + Pos3D guJiDiDian = new Pos3D(this); + double tempMotionY = motionY; + + if(airborneTicks > 20) + { + for(int i = 0; i < t; i++) + { + if(missileType == MissileType.CruiseMissile || missileType == MissileType.LAUNCHER) + { + guJiDiDian.xPos += xiaoDanMotion.xPos; + guJiDiDian.yPos += xiaoDanMotion.yPos; + guJiDiDian.zPos += xiaoDanMotion.zPos; + } + else { + guJiDiDian.xPos += motionX; + guJiDiDian.yPos += tempMotionY; + guJiDiDian.zPos += motionZ; + + tempMotionY -= acceleration; + } + } + } + + return guJiDiDian; + } + + @Override + public void setNormalExplode() + { + setNormalExplode = true; + dataWatcher.updateObject(17, 1); + } + + @Override + public void setExplode() + { + setExplode = true; + dataWatcher.updateObject(17, 2); + } + + @Override + public void setDead() + { + RadarRegistry.unregister(this); + + if(chunkTicket != null) + { + ForgeChunkManager.releaseTicket(chunkTicket); + } + + super.setDead(); + } + + @Override + public void explode() + { + try { + // Make sure the missile is not already exploding + if(!isExpoding) + { + if(explosiveID == 0) + { + if(!worldObj.isRemote) + { + worldObj.createExplosion(this, posX, posY, posZ, 5F, true); + } + } + else { + ((Explosion)ExplosiveRegistry.get(explosiveID)).createExplosion(worldObj, posX, posY, posZ, this); + } + + isExpoding = true; + + DefenseTech.LOGGER.info(getCommandSenderName() + " (" + getEntityId() + ") exploded in " + (int)posX + ", " + (int)posY + ", " + (int)posZ); + } + + setDead(); + } catch(Exception e) { + DefenseTech.LOGGER.severe("Missile failed to explode properly. Report this to the developers."); + e.printStackTrace(); + } + } + + @Override + public void normalExplode() + { + if(!isExpoding) + { + isExpoding = true; + + if(!worldObj.isRemote) + { + worldObj.createExplosion(this, posX, posY, posZ, 5F, true); + } + + setDead(); + } + } + + @Override + public void dropMissileAsItem() + { + if(!isExpoding && !worldObj.isRemote) + { + EntityItem entityItem = new EntityItem(worldObj, posX, posY, posZ, new ItemStack(DefenseTechItems.itemMissile, 1, explosiveID)); + + float var13 = 0.05F; + Random random = new Random(); + entityItem.motionX = ((float) random.nextGaussian() * var13); + entityItem.motionY = ((float) random.nextGaussian() * var13 + 0.2F); + entityItem.motionZ = ((float) random.nextGaussian() * var13); + worldObj.spawnEntityInWorld(entityItem); + } + + setDead(); + } + + @Override + protected void readEntityFromNBT(NBTTagCompound nbt) + { + startPos = Pos3D.read(nbt.getCompoundTag("startPos")); + targetVector = Pos3D.read(nbt.getCompoundTag("targetVector")); + launcherPos = Pos3D.read(nbt.getCompoundTag("launcherPos")); + acceleration = nbt.getFloat("acceleration"); + targetHeight = nbt.getInteger("targetHeight"); + explosiveID = nbt.getInteger("explosiveID"); + airborneTicks = nbt.getInteger("airborneTicks"); + lockHeight = nbt.getDouble("lockHeight"); + missileType = MissileType.values()[nbt.getInteger("missileType")]; + nbtData = nbt.getCompoundTag("data"); + } + + @Override + protected void writeEntityToNBT(NBTTagCompound nbt) + { + if(startPos != null) + { + nbt.setTag("startPos", startPos.write(new NBTTagCompound())); + } + + if(targetVector != null) + { + nbt.setTag("targetVector", targetVector.write(new NBTTagCompound())); + } + + if(launcherPos != null) + { + nbt.setTag("launcherPos", launcherPos.write(new NBTTagCompound())); + } + + nbt.setFloat("acceleration", acceleration); + nbt.setInteger("explosiveID", explosiveID); + nbt.setInteger("targetHeight", targetHeight); + nbt.setInteger("airborneTicks", airborneTicks); + nbt.setDouble("lockHeight", lockHeight); + nbt.setInteger("missileType", missileType.ordinal()); + nbt.setTag("data", nbtData); + } + + @Override + public float getShadowSize() + { + return 1.0F; + } + + @Override + public int getTicksInAir() + { + return airborneTicks; + } + + @Override + public IExplosive getExplosiveType() + { + return ExplosiveRegistry.get(explosiveID); + } + + @Override + public boolean attackEntityFrom(DamageSource source, float damage) + { + if(DamageUtility.canHarm(this, source, damage)) + { + damage += damage; + + if(damage >= max_damage) + { + setDead(); + } + + return true; + } + + return false; + } + + @Override + public boolean canBeTargeted(Object turret) + { + return getTicksInAir() > 0; + } + + @Override + public TargetType getType() + { + return TargetType.MISSILE; + } + + @Override + public NBTTagCompound getTagCompound() + { + return nbtData; + } +} diff --git a/src/main/java/mekanism/defense/common/entity/RenderEntityBlock.java b/src/main/java/mekanism/defense/common/entity/RenderEntityBlock.java new file mode 100644 index 000000000..2006615e8 --- /dev/null +++ b/src/main/java/mekanism/defense/common/entity/RenderEntityBlock.java @@ -0,0 +1,111 @@ +package defense.common.entity; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.render.RenderUtils; + +@SideOnly(Side.CLIENT) +public class RenderEntityBlock extends Render +{ + private final RenderBlocks renderer = new RenderBlocks(); + + public RenderEntityBlock() + { + this.shadowSize = 0.5F; + } + + /** The actual render method that is used in doRender */ + public void doRenderGravityBlock(EntityFlyingBlock entity, double x, double y, double z, float par8, float par9) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float) x, (float) y, (float) z); + RenderUtils.setTerrainTexture(); + + Block block = entity.block; + World world = entity.worldObj; + GL11.glDisable(GL11.GL_LIGHTING); + + GL11.glRotatef(entity.rotationPitch, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(entity.rotationYaw, 0.0F, 1.0F, 0.0F); + + this.renderer.blockAccess = world; + this.renderer.setRenderBoundsFromBlock(block); + + if (block == Blocks.dragon_egg || block == Blocks.grass || block == Blocks.fence || block == Blocks.wheat || block == Blocks.leaves || block == Blocks.redstone_torch || block == Blocks.torch || block == Blocks.grass || block == Blocks.vine || block == Blocks.log || block == Blocks.bookshelf || block == Blocks.pumpkin) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setTranslation((-MathHelper.floor_double(entity.posX)) - 0.5F, (-MathHelper.floor_double(entity.posY)) - 0.5F, (-MathHelper.floor_double(entity.posZ)) - 0.5F); + this.renderer.renderBlockByRenderType(block, MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)); + tessellator.setTranslation(0.0D, 0.0D, 0.0D); + tessellator.draw(); + } + else + { + this.renderBlockGravity(block, entity.metadata, this.renderer); + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + public void renderBlockGravity(Block block, int metadata, RenderBlocks renderer) + { + float var6 = 0.5F; + float var7 = 1.0F; + float var8 = 0.8F; + float var9 = 0.6F; + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + + float var12 = 1.0F; + + tess.setColorOpaque_F(var6 * var12, var6 * var12, var6 * var12); + renderer.renderFaceYNeg(block, -0.5D, -0.5D, -0.5D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + + tess.setColorOpaque_F(var7 * var12, var7 * var12, var7 * var12); + renderer.renderFaceYPos(block, -0.5D, -0.5D, -0.5D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + + tess.setColorOpaque_F(var8 * var12, var8 * var12, var8 * var12); + renderer.renderFaceZNeg(block, -0.5D, -0.5D, -0.5D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + + tess.setColorOpaque_F(var8 * var12, var8 * var12, var8 * var12); + renderer.renderFaceZPos(block, -0.5D, -0.5D, -0.5D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + + tess.setColorOpaque_F(var9 * var12, var9 * var12, var9 * var12); + renderer.renderFaceXNeg(block, -0.5D, -0.5D, -0.5D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + + tess.setColorOpaque_F(var9 * var12, var9 * var12, var9 * var12); + renderer.renderFaceXPos(block, -0.5D, -0.5D, -0.5D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tess.draw(); + } + + /** Actually renders the given argument. This is a synthetic bridge method, always casting down + * its argument and then handing it off to a worker function which does the actual work. In all + * probabilty, the class Render is generic (Render 0.0F) + { + float var22 = -MathHelper.sin(var21 * 3.0F) * var21; + GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F); + } + + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(var20, var20, var20); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(var20, 0.0F, 0.0F); + var10.startDrawingQuads(); + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, var16, var18); + var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, var17, var18); + var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, var17, var19); + var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, var16, var19); + var10.draw(); + GL11.glNormal3f(-var20, 0.0F, 0.0F); + var10.startDrawingQuads(); + var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, var16, var18); + var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, var17, var18); + var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, var17, var19); + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, var16, var19); + var10.draw(); + + for (int var23 = 0; var23 < 4; ++var23) + { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, var20); + var10.startDrawingQuads(); + var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, var12, var14); + var10.addVertexWithUV(8.0D, -2.0D, 0.0D, var13, var14); + var10.addVertexWithUV(8.0D, 2.0D, 0.0D, var13, var15); + var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, var12, var15); + var10.draw(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + /** Actually renders the given argument. This is a synthetic bridge method, always casting down + * its argument and then handing it off to a worker function which does the actual work. In all + * probabilty, the class Render is generic (Render 0) + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "UUU", "UEU", "UUU", 'E', thermobaric.getItemStack(), 'U', "ingotUranium" })); + } + else + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "EEE", "EEE", "EEE", 'E', thermobaric.getItemStack() })); + + } + } + else + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "CIC", "IRI", "CIC", 'R', Explosive.repulsive.getItemStack(), 'C', Explosive.chemical.getItemStack(), 'I', Explosive.incendiary.getItemStack() })); + + } + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + if (this.getTier() == 3) + { + new BlastNuclear(world, entity, x, y, z, 50, 80).setNuclear().explode(); + } + else + { + new BlastNuclear(world, entity, x, y, z, 30, 45).explode(); + } + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/ExRedMatter.java b/src/main/java/mekanism/defense/common/explosion/ExRedMatter.java new file mode 100644 index 000000000..747b3d5a0 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/ExRedMatter.java @@ -0,0 +1,39 @@ +package defense.common.explosion; + +import mekanism.common.recipe.ShapedMekanismRecipe; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.missile.ModelRedMatterMissile; +import defense.common.explosive.blast.BlastRedmatter; + +public class ExRedMatter extends Explosion +{ + public ExRedMatter() + { + super("redMatter", 4); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return new ModelRedMatterMissile(); + } + + @Override + public void init() + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "AAA", "AEA", "AAA", 'E', antimatter.getItemStack(), 'A', "strangeMatter" })); + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastRedmatter(world, entity, x, y, z, 35).explode(); + } + +} diff --git a/src/main/java/mekanism/defense/common/explosion/ExRejuvenation.java b/src/main/java/mekanism/defense/common/explosion/ExRejuvenation.java new file mode 100644 index 000000000..926ad27b9 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/ExRejuvenation.java @@ -0,0 +1,40 @@ +package defense.common.explosion; + +import mekanism.common.recipe.ShapedMekanismRecipe; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.missile.ModelRegenMissile; +import defense.common.explosive.blast.BlastRegen; + +public class ExRejuvenation extends Explosion +{ + public ExRejuvenation() + { + super("rejuvenation", 2); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return new ModelRegenMissile(); + } + + @Override + public void init() + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "ICI", "CDC", "ICI", 'D', Blocks.diamond_block, 'C', Items.clock, 'I', Blocks.iron_block })); + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastRegen(world, entity, x, y, z, 16).doExplode(); + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/ExRepulsive.java b/src/main/java/mekanism/defense/common/explosion/ExRepulsive.java new file mode 100644 index 000000000..27119d1a5 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/ExRepulsive.java @@ -0,0 +1,62 @@ +package defense.common.explosion; + +import mekanism.common.recipe.ShapedMekanismRecipe; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelAttractiveMissile; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.missile.ModelRepulsiveMissile; +import defense.common.explosive.Explosive; +import defense.common.explosive.blast.BlastRepulsive; + +public class ExRepulsive extends Explosion +{ + public ExRepulsive(String name, int tier) + { + super(name, tier); + this.setFuseTime(120); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + if (getUnlocalizedName().equalsIgnoreCase("attractive")) + { + return new ModelAttractiveMissile(); + } + else + { + return new ModelRepulsiveMissile(); + } + } + + @Override + public void init() + { + if (this.getID() == Explosive.attractive.getID()) + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "YY", 'Y', Explosive.condensed.getItemStack() })); + } + else + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "Y", "Y", 'Y', Explosive.condensed.getItemStack() })); + } + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + if (this.getID() == Explosive.attractive.getID()) + { + new BlastRepulsive(world, entity, x, y, z, 2f).setDestroyItems().setPushType(1).explode(); + } + else + { + new BlastRepulsive(world, entity, x, y, z, 2f).setDestroyItems().setPushType(2).explode(); + } + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/ExSMine.java b/src/main/java/mekanism/defense/common/explosion/ExSMine.java new file mode 100644 index 000000000..99cf0caba --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/ExSMine.java @@ -0,0 +1,56 @@ +package defense.common.explosion; + +import mekanism.api.Pos3D; +import mekanism.common.recipe.ShapedMekanismRecipe; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.tile.ModelSMine; +import defense.common.explosive.Explosive; +import defense.common.explosive.blast.BlastMine; + +public class ExSMine extends Explosive +{ + public ExSMine(String mingZi, int tier) + { + super(mingZi, tier); + this.setFuseTime(20); + this.hasGrenade = false; + this.hasMinecart = false; + this.hasMissile = false; + } + + @Override + public void onDetonation(World worldObj, Pos3D position, int fuseTicks) {} + + @Override + public void init() + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "S", "L", "R", 'S', Explosive.fragmentation.getItemStack(), 'L', Explosive.attractive.getItemStack(), 'R', Explosive.repulsive.getItemStack() })); + } + + @SideOnly(Side.CLIENT) + @Override + public ModelMissileBase getBlockModel() + { + return ModelSMine.INSTANCE; + } + + @SideOnly(Side.CLIENT) + @Override + public ResourceLocation getBlockResource() + { + return ModelSMine.TEXTURE; + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastMine(world, entity, x, y, z, 5).explode(); + } + +} diff --git a/src/main/java/mekanism/defense/common/explosion/ExShrapnel.java b/src/main/java/mekanism/defense/common/explosion/ExShrapnel.java new file mode 100644 index 000000000..750d2247b --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/ExShrapnel.java @@ -0,0 +1,75 @@ +package defense.common.explosion; + +import mekanism.common.recipe.ShapedMekanismRecipe; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelAnvilMissile; +import defense.client.model.missile.ModelFragmentationMissile; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.missile.ModelShrapnelMissile; +import defense.common.explosive.Explosive; +import defense.common.explosive.blast.BlastShrapnel; + +public class ExShrapnel extends Explosion +{ + public ExShrapnel(String name, int tier) + { + super(name, tier); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + if (getUnlocalizedName().equalsIgnoreCase("shrapnel")) + { + return new ModelShrapnelMissile(); + } + else if (getUnlocalizedName().equalsIgnoreCase("anvil")) + { + return new ModelAnvilMissile(); + } + else { + return new ModelFragmentationMissile(); + } + } + + @Override + public void init() + { + if (this.getID() == Explosive.shrapnel.getID()) + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "???", "?@?", "???", '@', repulsive.getItemStack(), '?', Items.arrow })); + } + else if (this.getID() == Explosive.anvil.getID()) + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(10), new Object[] { "SSS", "SAS", "SSS", 'A', Blocks.anvil, 'S', Explosive.shrapnel.getItemStack() })); + } + else if (this.getID() == Explosive.fragmentation.getID()) + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { " @ ", "@?@", " @ ", '?', incendiary.getItemStack(), '@', Explosive.shrapnel.getItemStack() })); + } + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + if (this.getTier() == 2) + { + new BlastShrapnel(world, entity, x, y, z, 15, true, true, false).explode(); + } + else if (this.getID() == Explosive.anvil.getID()) + { + new BlastShrapnel(world, entity, x, y, z, 25, false, false, true).explode(); + } + else + { + new BlastShrapnel(world, entity, x, y, z, 30, true, false, false).explode(); + } + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/ExSonic.java b/src/main/java/mekanism/defense/common/explosion/ExSonic.java new file mode 100644 index 000000000..b935eeed2 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/ExSonic.java @@ -0,0 +1,63 @@ +package defense.common.explosion; + +import mekanism.common.recipe.ShapedMekanismRecipe; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelHypersonicMissile; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.missile.ModelSonicMissile; +import defense.common.explosive.Explosive; +import defense.common.explosive.blast.BlastSonic; + +public class ExSonic extends Explosion +{ + public ExSonic(String mingZi, int tier) + { + super(mingZi, tier); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + if (this.getTier() == 3) + { + return new ModelHypersonicMissile(); + } + else + { + return new ModelSonicMissile(); + } + } + + @Override + public void init() + { + if (this.getTier() == 3) + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { " S ", "S S", " S ", 'S', Explosive.sonic.getItemStack() })); + } + else + { + GameRegistry.addRecipe(new ShapedMekanismRecipe(this.getItemStack(), new Object[] { "@?@", "?R?", "@?@", 'R', Explosive.repulsive.getItemStack(), '?', Blocks.noteblock, '@', "ingotBronze" })); + } + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + if (this.getTier() == 3) + { + new BlastSonic(world, entity, x, y, z, 20, 35).setShockWave().explode(); + } + else + { + new BlastSonic(world, entity, x, y, z, 15, 30).explode(); + } + } + +} diff --git a/src/main/java/mekanism/defense/common/explosion/Explosion.java b/src/main/java/mekanism/defense/common/explosion/Explosion.java new file mode 100644 index 000000000..0d4134510 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/Explosion.java @@ -0,0 +1,50 @@ +package defense.common.explosion; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.Reference; +import defense.common.entity.EntityMissile; +import defense.common.explosive.Explosive; + +public abstract class Explosion extends Explosive +{ + @SideOnly(Side.CLIENT) + private ResourceLocation resourceLocation; + + public Explosion(String name, int tier) + { + super(name, tier); + } + + /** Called when launched. */ + public void launch(EntityMissile missileObj) {} + + /** Called every tick while flying. */ + public void update(EntityMissile missileObj) {} + + public boolean onInteract(EntityMissile missileObj, EntityPlayer entityPlayer) + { + return false; + } + + /** Is this missile compatible with the cruise launcher? + * + * @return */ + public boolean isCruise() + { + return true; + } + + @SideOnly(Side.CLIENT) + public ResourceLocation getMissileResource() + { + if(resourceLocation == null) + { + resourceLocation = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_TEXTURE_PATH + "missile_" + this.getUnlocalizedName() + ".png"); + } + + return resourceLocation; + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/Missile.java b/src/main/java/mekanism/defense/common/explosion/missile/Missile.java new file mode 100644 index 000000000..596d65e13 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/Missile.java @@ -0,0 +1,26 @@ +package defense.common.explosion.missile; + +import net.minecraft.item.ItemStack; +import defense.common.DefenseTechItems; +import defense.common.explosion.Explosion; + +/** Ex object that are only defined as missiles + * + * @author Calclavia */ +public abstract class Missile extends Explosion +{ + public Missile(String name, int tier) + { + super(name, tier); + + hasBlock = false; + hasGrenade = false; + hasMinecart = false; + } + + @Override + public ItemStack getItemStack() + { + return new ItemStack(DefenseTechItems.itemMissile, 1, getID()); + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/MissileAntiBallistic.java b/src/main/java/mekanism/defense/common/explosion/missile/MissileAntiBallistic.java new file mode 100644 index 000000000..dd5eaa68a --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/MissileAntiBallistic.java @@ -0,0 +1,100 @@ +package defense.common.explosion.missile; + +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.ITarget; +import defense.api.ITarget.TargetType; +import defense.client.model.missile.ModelAntiMissileMissile; +import defense.client.model.missile.ModelMissileBase; +import defense.common.Reference; +import defense.common.entity.EntityMissile; +import defense.common.explosive.blast.BlastRepulsive; + +/** Anti-Ballistic missile. + * + * @author Calclavia */ +public class MissileAntiBallistic extends Missile +{ + public static final int ABMRange = 30; + + public MissileAntiBallistic() + { + super("antiBallistic", 2); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return new ModelAntiMissileMissile(); + } + + @Override + public void update(EntityMissile missileObj) + { + if(missileObj.lockedTarget != null) + { + Pos3D target = new Pos3D(missileObj.lockedTarget); + + if(missileObj.lockedTarget.isDead) + { + missileObj.explode(); + return; + } + + if(missileObj.lockedTarget instanceof ITarget && ((ITarget)missileObj.lockedTarget).getType() == TargetType.MISSILE) + { + if(((ITarget)missileObj.lockedTarget).canBeTargeted(this)) + { + target = ((ITarget)missileObj.lockedTarget).getPredictedPosition(4); + } + } + + missileObj.motionX = (target.xPos - missileObj.posX) * (0.3F); + missileObj.motionY = (target.yPos - missileObj.posY) * (0.3F); + missileObj.motionZ = (target.zPos - missileObj.posZ) * (0.3F); + + return; + } + + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(missileObj.posX - ABMRange, missileObj.posY - ABMRange, missileObj.posZ - ABMRange, missileObj.posX + ABMRange, missileObj.posY + ABMRange, missileObj.posZ + ABMRange); + // TODO: Check if this works. + Entity nearestEntity = missileObj.worldObj.findNearestEntityWithinAABB(ITarget.class, bounds, missileObj); + + if(nearestEntity instanceof ITarget && ((ITarget) nearestEntity).getType() == TargetType.MISSILE) + { + if(((ITarget)nearestEntity).canBeTargeted(this)) + { + // Lock target onto missileObj missile + missileObj.lockedTarget = nearestEntity; + missileObj.didTargetLockBefore = true; + missileObj.worldObj.playSoundAtEntity(missileObj, Reference.PREFIX + "targetlocked", 5F, 0.9F); + } + } + else { + missileObj.motionX = missileObj.deltaPathX / missileObj.missileFlightTime; + missileObj.motionZ = missileObj.deltaPathZ / missileObj.missileFlightTime; + + if(missileObj.didTargetLockBefore == true) + { + missileObj.explode(); + } + } + } + + @Override + public boolean isCruise() + { + return true; + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastRepulsive(world, entity, x, y, z, 6).setDestroyItems().explode(); + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/MissileCluster.java b/src/main/java/mekanism/defense/common/explosion/missile/MissileCluster.java new file mode 100644 index 000000000..ab1af61cf --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/MissileCluster.java @@ -0,0 +1,90 @@ +package defense.common.explosion.missile; + +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelClusterMissile; +import defense.client.model.missile.ModelMissileBase; +import defense.common.entity.EntityMissile; +import defense.common.entity.EntityMissile.MissileType; +import defense.common.explosive.blast.BlastRepulsive; + +/** @author Calclavia */ +public class MissileCluster extends Missile +{ + public static final int MAX_CLUSTER = 12; + protected double spread = 20; + + public MissileCluster(String name, int tier) + { + super(name, tier); + this.hasBlock = false; + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return new ModelClusterMissile(); + } + + @Override + public void update(EntityMissile missileObj) + { + if (missileObj.motionY < -0.5) + { + if (missileObj.missileCount < MAX_CLUSTER) + { + if (!missileObj.worldObj.isRemote) + { + Pos3D position = new Pos3D(missileObj); + EntityMissile clusterMissile = new EntityMissile(missileObj.worldObj, position.clone(), position.clone(), 0); + + double radius = spread; + double theta = 0; + double x = 0; + double y = 0; + double z = 0; + //TODO make spread equal to a 30 degree angle from center point + + if (missileObj.missileCount > 0) + { + theta = (missileObj.missileCount / 12.0) * Math.PI * 2; + + x = radius * Math.cos(theta); + clusterMissile.posX += Math.cos(theta) * 5; + + z = radius * Math.sin(theta); + clusterMissile.posZ += Math.sin(theta) * 5; + } + + clusterMissile.missileType = MissileType.CruiseMissile; + clusterMissile.protectionTime = 20 + missileObj.targetHeight - 1; + + clusterMissile.launch(missileObj.targetVector.clone().translate(new Pos3D(x, y, z))); + missileObj.worldObj.spawnEntityInWorld(clusterMissile); + } + missileObj.protectionTime = 20; + missileObj.missileCount++; + } + else + { + missileObj.setDead(); + } + } + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastRepulsive(world, entity, x, y, z, 6).setDestroyItems().explode(); + } + + @Override + public boolean isCruise() + { + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/MissileHoming.java b/src/main/java/mekanism/defense/common/explosion/missile/MissileHoming.java new file mode 100644 index 000000000..53ca1a40b --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/MissileHoming.java @@ -0,0 +1,140 @@ +package defense.common.explosion.missile; + +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IItemTracker; +import defense.client.model.missile.ModelHomingMissile; +import defense.client.model.missile.ModelMissileBase; +import defense.common.Vector2; +import defense.common.entity.EntityMissile; +import defense.common.entity.EntityMissile.MissileType; +import defense.common.explosive.blast.BlastRepulsive; + +public class MissileHoming extends Missile +{ + public MissileHoming() + { + super("homing", 1); + this.hasBlock = false; + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return new ModelHomingMissile(); + } + + @Override + public void launch(EntityMissile missileObj) + { + if (!missileObj.worldObj.isRemote) + { + WorldServer worldServer = (WorldServer) missileObj.worldObj; + Entity trackingEntity = worldServer.getEntityByID(missileObj.trackingVar); + + if (trackingEntity != null) + { + if (trackingEntity == missileObj) + { + missileObj.setExplode(); + } + + missileObj.targetVector = new Pos3D(trackingEntity); + } + } + } + + @Override + public void update(EntityMissile missileObj) + { + if (missileObj.airborneTicks > missileObj.missileFlightTime / 2 && missileObj.missileType == MissileType.MISSILE) + { + WorldServer worldServer = (WorldServer) missileObj.worldObj; + Entity trackingEntity = worldServer.getEntityByID(missileObj.trackingVar); + + if (trackingEntity != null) + { + if (trackingEntity.equals(missileObj)) + { + missileObj.setExplode(); + } + + missileObj.targetVector = new Pos3D(trackingEntity); + + missileObj.missileType = MissileType.CruiseMissile; + + missileObj.deltaPathX = missileObj.targetVector.xPos - missileObj.posX; + missileObj.deltaPathY = missileObj.targetVector.yPos - missileObj.posY; + missileObj.deltaPathZ = missileObj.targetVector.zPos - missileObj.posZ; + + missileObj.flatDistance = Vector2.distance(new Vector2(missileObj.startPos), new Vector2(missileObj.targetVector)); + missileObj.maxHeight = 150 + (int) (missileObj.flatDistance * 1.8); + missileObj.missileFlightTime = (float) Math.max(100, 2.4 * missileObj.flatDistance); + missileObj.acceleration = (float) missileObj.maxHeight * 2 / (missileObj.missileFlightTime * missileObj.missileFlightTime); + + if (missileObj.xiaoDanMotion.equals(new Pos3D()) || missileObj.xiaoDanMotion == null) + { + float suDu = 0.3f; + missileObj.xiaoDanMotion = new Pos3D(); + missileObj.xiaoDanMotion.xPos = missileObj.deltaPathX / (missileObj.missileFlightTime * suDu); + missileObj.xiaoDanMotion.yPos = missileObj.deltaPathY / (missileObj.missileFlightTime * suDu); + missileObj.xiaoDanMotion.zPos = missileObj.deltaPathZ / (missileObj.missileFlightTime * suDu); + } + } + } + } + + @Override + public boolean onInteract(EntityMissile missileObj, EntityPlayer entityPlayer) + { + if (!missileObj.worldObj.isRemote && missileObj.airborneTicks <= 0) + { + if (entityPlayer.getCurrentEquippedItem() != null) + { + if (entityPlayer.getCurrentEquippedItem().getItem() instanceof IItemTracker) + { + Entity trackingEntity = ((IItemTracker) entityPlayer.getCurrentEquippedItem().getItem()).getTrackingEntity(missileObj.worldObj, entityPlayer.getCurrentEquippedItem()); + + if (trackingEntity != null) + { + if (missileObj.trackingVar != trackingEntity.getEntityId()) + { + missileObj.trackingVar = trackingEntity.getEntityId(); + entityPlayer.addChatMessage(new ChatComponentText("Missile target locked to: " + trackingEntity.getCommandSenderName())); + + if (missileObj.getLauncher() != null && missileObj.getLauncher().getController() != null) + { + Pos3D newTarget = new Pos3D(trackingEntity); + newTarget.yPos = 0; + missileObj.getLauncher().getController().setTarget(newTarget); + } + + return true; + } + } + } + } + } + + return false; + } + + @Override + public boolean isCruise() + { + return false; + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastRepulsive(world, entity, x, y, z, 4).setDestroyItems().explode(); + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/MissileModule.java b/src/main/java/mekanism/defense/common/explosion/missile/MissileModule.java new file mode 100644 index 000000000..a0adf3f4c --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/MissileModule.java @@ -0,0 +1,34 @@ +package defense.common.explosion.missile; + +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IMissile; +import defense.client.model.missile.ModelCondensedMissile; +import defense.client.model.missile.ModelMissileBase; + +public class MissileModule extends Missile +{ + public MissileModule() + { + super("missileModule", 1); + this.hasBlock = false; + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return new ModelCondensedMissile(); + } + + @Override + public void doCreateExplosion(World world, double x, double y, double z, Entity entity) + { + if (entity instanceof IMissile) + { + ((IMissile) entity).dropMissileAsItem(); + } + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/MissileMovingSound.java b/src/main/java/mekanism/defense/common/explosion/missile/MissileMovingSound.java new file mode 100644 index 000000000..dfaccc105 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/MissileMovingSound.java @@ -0,0 +1,53 @@ +package defense.common.explosion.missile; + +import net.minecraft.client.audio.MovingSound; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.Reference; +import defense.common.entity.EntityMissile; + +@SideOnly(Side.CLIENT) +public class MissileMovingSound extends MovingSound +{ + private final EntityMissile field_147670_k; + private float field_147669_l = 0.0F; + + public MissileMovingSound(EntityMissile p_i45105_1_) + { + super(new ResourceLocation(Reference.PREFIX + "missileinair")); + this.field_147670_k = p_i45105_1_; + this.repeat = true; + this.field_147665_h = 0; + } + + /** + * Updates the JList with a new model. + */ + public void update() + { + if (this.field_147670_k.isDead) + { + this.donePlaying = true; + } + else + { + this.xPosF = (float)this.field_147670_k.posX; + this.yPosF = (float)this.field_147670_k.posY; + this.zPosF = (float)this.field_147670_k.posZ; + float f = MathHelper.sqrt_double(this.field_147670_k.motionX * this.field_147670_k.motionX + this.field_147670_k.motionZ * this.field_147670_k.motionZ); + + if ((double)f >= 0.01D) + { + this.field_147669_l = MathHelper.clamp_float(this.field_147669_l + 0.0025F, 0.0F, 1.0F); + this.volume = 0.0F + MathHelper.clamp_float(f, 0.0F, 0.5F) * 0.7F; + } + else + { + this.field_147669_l = 0.0F; + this.volume = 0.0F; + } + } + } +} diff --git a/src/main/java/mekanism/defense/common/explosion/missile/MissileNuclearCluster.java b/src/main/java/mekanism/defense/common/explosion/missile/MissileNuclearCluster.java new file mode 100644 index 000000000..be380cef7 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosion/missile/MissileNuclearCluster.java @@ -0,0 +1,59 @@ +package defense.common.explosion.missile; + +import defense.common.entity.EntityMissile; +import defense.common.entity.EntityMissile.MissileType; +import defense.common.explosive.Explosive; +import defense.common.explosive.blast.BlastNuclear; +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +public class MissileNuclearCluster extends MissileCluster +{ + public MissileNuclearCluster() + { + super("nuclearCluster", 3); + this.hasBlock = false; + } + + public static final int MAX_CLUSTER = 4; + + @Override + public void update(EntityMissile missileObj) + { + if (missileObj.motionY < -0.5) + { + if (missileObj.missileCount < MAX_CLUSTER) + { + if (!missileObj.worldObj.isRemote) + { + Pos3D position = new Pos3D(missileObj); + EntityMissile clusterMissile = new EntityMissile(missileObj.worldObj, position, new Pos3D(missileObj), Explosive.nuclear.getID()); + missileObj.worldObj.spawnEntityInWorld(clusterMissile); + clusterMissile.missileType = MissileType.CruiseMissile; + clusterMissile.protectionTime = 20; + clusterMissile.launch(missileObj.targetVector.clone().translate(new Pos3D((missileObj.missileCount - MAX_CLUSTER / 2) * Math.random() * 30, (missileObj.missileCount - MAX_CLUSTER / 2) * Math.random() * 30, (missileObj.missileCount - MAX_CLUSTER / 2) * Math.random() * 30))); + } + + missileObj.protectionTime = 20; + missileObj.missileCount++; + } + else + { + missileObj.setDead(); + } + } + } + + @Override + public void createExplosion(World world, double x, double y, double z, Entity entity) + { + new BlastNuclear(world, entity, x, y, z, 30, 50).setNuclear().explode(); + } + + @Override + public boolean isCruise() + { + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/Explosive.java b/src/main/java/mekanism/defense/common/explosive/Explosive.java new file mode 100644 index 000000000..e61b41c99 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/Explosive.java @@ -0,0 +1,316 @@ +package defense.common.explosive; + +import mekanism.api.Pos3D; +import mekanism.common.util.LangUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IExplosive; +import defense.client.model.missile.ModelMissileBase; +import defense.common.DefenseTechBlocks; +import defense.common.explosion.ExAntiGravitational; +import defense.common.explosion.ExAntimatter; +import defense.common.explosion.ExBreaching; +import defense.common.explosion.ExChemical; +import defense.common.explosion.ExCondensed; +import defense.common.explosion.ExDebilitation; +import defense.common.explosion.ExEMP; +import defense.common.explosion.ExEndothermic; +import defense.common.explosion.ExExothermic; +import defense.common.explosion.ExIncendiary; +import defense.common.explosion.ExNuclear; +import defense.common.explosion.ExRedMatter; +import defense.common.explosion.ExRejuvenation; +import defense.common.explosion.ExRepulsive; +import defense.common.explosion.ExSMine; +import defense.common.explosion.ExShrapnel; +import defense.common.explosion.ExSonic; +import defense.common.explosion.Explosion; +import defense.common.explosion.missile.MissileAntiBallistic; +import defense.common.explosion.missile.MissileCluster; +import defense.common.explosion.missile.MissileHoming; +import defense.common.explosion.missile.MissileModule; +import defense.common.explosion.missile.MissileNuclearCluster; + +/** The explosive registry class. Used to register explosions. */ +public abstract class Explosive implements IExplosive +{ + /** Explosives */ + public static Explosive condensed; + public static Explosive shrapnel; + public static Explosive incendiary; + public static Explosive debilitation; + public static Explosive chemical; + public static Explosive anvil; + public static Explosive repulsive; + public static Explosive attractive; + + public static Explosive fragmentation; + public static Explosive contagious; + public static Explosive sonic; + public static Explosive breaching; + public static Explosive rejuvenation; + public static Explosive thermobaric; + public static Explosive sMine; + + public static Explosive nuclear; + public static Explosive emp; + public static Explosive exothermic; + public static Explosive endothermic; + public static Explosive antiGrav; + public static Explosive hypersonic; + + public static Explosive antimatter; + public static Explosive redMatter; + + /** Missiles */ + public static Explosion missileModule; + public static Explosion homing; + public static Explosion antiBallistic; + public static Explosion cluster; + public static Explosion nuclearCluster; + + public static boolean registered = false; + + public static void register() + { + if(!registered) + { + condensed = ExplosiveRegistry.register(new ExCondensed("condensed", 1)); + shrapnel = ExplosiveRegistry.register(new ExShrapnel("shrapnel", 1)); + incendiary = ExplosiveRegistry.register(new ExIncendiary("incendiary", 1)); + debilitation = ExplosiveRegistry.register(new ExDebilitation("debilitation", 1)); + chemical = ExplosiveRegistry.register(new ExChemical("chemical", 1)); + anvil = ExplosiveRegistry.register(new ExShrapnel("anvil", 1)); + repulsive = ExplosiveRegistry.register(new ExRepulsive("repulsive", 1)); + attractive = ExplosiveRegistry.register(new ExRepulsive("attractive", 1)); + + fragmentation = ExplosiveRegistry.register(new ExShrapnel("fragmentation", 2)); + contagious = ExplosiveRegistry.register(new ExChemical("contagious", 2)); + sonic = ExplosiveRegistry.register(new ExSonic("sonic", 2)); + breaching = ExplosiveRegistry.register(new ExBreaching()); + rejuvenation = ExplosiveRegistry.register(new ExRejuvenation()); + thermobaric = ExplosiveRegistry.register(new ExNuclear("thermobaric", 2)); + sMine = ExplosiveRegistry.register(new ExSMine("sMine", 2)); + + nuclear = ExplosiveRegistry.register(new ExNuclear("nuclear", 3)); + emp = ExplosiveRegistry.register(new ExEMP()); + exothermic = ExplosiveRegistry.register(new ExExothermic()); + endothermic = ExplosiveRegistry.register(new ExEndothermic()); + antiGrav = ExplosiveRegistry.register(new ExAntiGravitational()); + hypersonic = ExplosiveRegistry.register(new ExSonic("hypersonic", 3)); + + antimatter = ExplosiveRegistry.register(new ExAntimatter()); + redMatter = ExplosiveRegistry.register(new ExRedMatter()); + + /** Missiles */ + missileModule = (Explosion)ExplosiveRegistry.register(new MissileModule()); + homing = (Explosion)ExplosiveRegistry.register(new MissileHoming()); + antiBallistic = (Explosion)ExplosiveRegistry.register(new MissileAntiBallistic()); + cluster = (Explosion)ExplosiveRegistry.register(new MissileCluster("cluster", 2)); + nuclearCluster = (Explosion)ExplosiveRegistry.register(new MissileNuclearCluster()); + } + + registered = true; + } + + /** The unique identification name for this explosive. */ + private String nameID; + /** The tier of this explosive */ + private int tier; + /** The fuse of this explosive */ + private int fuseTime; + /** Is this explosive disabled? */ + public boolean isDisabled; + /** Is this explosive able to be pushed by other explosions? */ + protected boolean isMobile = false; + + protected boolean hasBlock; + protected boolean hasGrenade; + protected boolean hasMinecart; + protected boolean hasMissile; + + protected Explosive(String name, int t) + { + nameID = name; + tier = t; + fuseTime = 100; + + hasBlock = true; + hasMissile = true; + hasGrenade = tier <= 1; + hasMinecart = tier <= 2; + } + + @Override + public final int getID() + { + return ExplosiveRegistry.getID(getUnlocalizedName()); + } + + @Override + public String getUnlocalizedName() + { + return nameID; + } + + @Override + public String getExplosiveName() + { + return LangUtils.localize("explosive." + nameID + ".name"); + } + + @Override + public String getGrenadeName() + { + return LangUtils.localize("grenade." + nameID + ".name"); + } + + @Override + public String getMissileName() + { + return LangUtils.localize("missile." + nameID + ".name"); + } + + @Override + public String getMinecartName() + { + return LangUtils.localize("minecart." + nameID + ".name"); + } + + @Override + public int getTier() + { + return tier; + } + + @Override + public void setTier(int t) + { + tier = t; + } + + public Explosive setFuseTime(int fuse) + { + fuseTime = fuse; + return this; + } + + /** The fuse of the explosion + * + * @return The Fuse */ + public int getYinXin() + { + return fuseTime; + } + + /** Called at the before the explosive detonated as a block. + * + * @param world + * @param entity */ + public void onPreDetonation(World world, Entity entity) + { + world.playSoundAtEntity(entity, "game.tnt.primed", 1.0F, 1.0F); + } + + /** Called while the explosive is being detonated (fuse ticks) in block form. + * + * @param fuseTicks - The amount of ticks this explosive is on fuse */ + public void onDetonation(World world, Pos3D position, int fuseTicks) + { + world.spawnParticle("smoke", position.xPos, position.yPos + 0.5D, position.zPos, 0.0D, 0.0D, 0.0D); + } + + /** Called when the block for of this explosive is destroy by an explosion + * + * @return - Fuse left */ + public int onBlockExploded() + { + return (int)(fuseTime / 2 + Math.random() * fuseTime / 4); + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getBlockModel() + { + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public ResourceLocation getBlockResource() + { + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon() + { + return null; + } + + @Override + @SideOnly(Side.CLIENT) + public ModelMissileBase getMissileModel() + { + return null; + } + + public boolean hasGrenadeForm() + { + return hasGrenade; + } + + public boolean hasMissileForm() + { + return hasMissile; + } + + public boolean hasMinecartForm() + { + return hasMinecart; + } + + public boolean hasBlockForm() + { + return hasBlock; + } + + /** Called to add the recipe for this explosive */ + public void init() + { + + } + + public ItemStack getItemStack() + { + return getItemStack(1); + } + + public ItemStack getItemStack(int amount) + { + return new ItemStack(DefenseTechBlocks.blockExplosive, amount, getID()); + } + + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) + { + return false; + } + + @Override + public void createExplosion(World world, double x, double y, double z, Entity entity) + { + if(!isDisabled) + { + doCreateExplosion(world, x, y, z, entity); + } + } + + public abstract void doCreateExplosion(World world, double x, double y, double z, Entity entity); +} diff --git a/src/main/java/mekanism/defense/common/explosive/ExplosiveRegistry.java b/src/main/java/mekanism/defense/common/explosive/ExplosiveRegistry.java new file mode 100644 index 000000000..12a3e34d3 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/ExplosiveRegistry.java @@ -0,0 +1,86 @@ +package defense.common.explosive; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +import defense.common.explosion.Explosion; + +/** Registry for all missiles + * + * @author Calcalvia */ +public class ExplosiveRegistry +{ + private static int maxID = 0; + + private static final HashMap idToExplosiveMap = new HashMap(); + private static final BiMap idToNameMap = HashBiMap.create(); + + public static Explosive register(Explosive zhaPin) + { + if(!isRegistered(zhaPin)) + { + int nextID = maxID++; + + idToExplosiveMap.put(nextID, zhaPin); + idToNameMap.put(nextID, zhaPin.getUnlocalizedName()); + + return zhaPin; + } + + return null; + } + + public static boolean isRegistered(Explosive explosive) + { + return idToNameMap.containsKey(explosive.getUnlocalizedName()); + } + + public static int getID(String unlocalizedName) + { + return idToNameMap.inverse().get(unlocalizedName); + } + + public static Explosive get(String name) + { + return idToExplosiveMap.get(getID(name)); + } + + public static Explosive get(int haoMa) + { + return idToExplosiveMap.get(haoMa); + } + + public static String getName(int haoMa) + { + return idToNameMap.get(haoMa); + } + + public static Collection getExplosives() + { + return idToExplosiveMap.values(); + } + + public static Collection getAllMissles() + { + Collection missiles = new HashSet(); + + for(Explosive explosive : idToExplosiveMap.values()) + { + if(explosive instanceof Explosion) + { + missiles.add((Explosion)explosive); + } + } + + return missiles; + } + + public static HashMap getAll() + { + return idToExplosiveMap; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/Blast.java b/src/main/java/mekanism/defense/common/explosive/blast/Blast.java new file mode 100644 index 000000000..de363b43b --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/Blast.java @@ -0,0 +1,260 @@ +package defense.common.explosive.blast; + +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; +import net.minecraft.world.Explosion; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.ExplosionEvent.DoExplosionEvent; +import defense.api.ExplosionEvent.ExplosionConstructionEvent; +import defense.api.ExplosionEvent.PostExplosionEvent; +import defense.api.ExplosionEvent.PreExplosionEvent; +import defense.api.IExplosion; +import defense.client.model.missile.ModelMissileBase; +import defense.common.entity.EntityExplosion; +import defense.common.entity.EntityMissile; + +public abstract class Blast extends Explosion implements IExplosion +{ + public Pos3D position; + + public World worldObj; + + public EntityExplosion controller = null; + + /** The amount of times the explosion has been called */ + protected int callCount = 0; + + public Blast(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + + position = new Pos3D(x, y, z); + worldObj = world; + } + + public Blast(World world, Pos3D pos, Entity entity, float size) + { + super(world, entity, pos.xPos, pos.yPos, pos.zPos, size); + + position = pos; + worldObj = world; + } + + public Blast(Entity entity, float size) + { + super(entity.worldObj, entity, entity.posX, entity.posY, entity.posZ, size); + + position = new Pos3D(entity); + worldObj = entity.worldObj; + } + + protected void doPreExplode() {} + + /** Called before an explosion happens. */ + public final void preExplode() + { + PreExplosionEvent evt = new PreExplosionEvent(worldObj, this); + MinecraftForge.EVENT_BUS.post(evt); + + if(!evt.isCanceled()) + { + doPreExplode(); + } + } + + /** Called every tick when this explosive is being progressed. */ + protected abstract void doExplode(); + + public final void onExplode() + { + DoExplosionEvent evt = new DoExplosionEvent(worldObj, this); + MinecraftForge.EVENT_BUS.post(evt); + + if(!evt.isCanceled()) + { + doExplode(); + callCount++; + } + } + + protected void doPostExplode() {} + + /** Called after the explosion is completed. */ + public final void postExplode() + { + PostExplosionEvent evt = new PostExplosionEvent(worldObj, this); + MinecraftForge.EVENT_BUS.post(evt); + + if(!evt.isCanceled()) + { + this.doPostExplode(); + } + } + + /** Make the default functions useless. */ + @Override + public void doExplosionA() {} + + @Override + public void doExplosionB(boolean par1) {} + + /** All outside classes should call this. */ + @Override + public void explode() + { + ExplosionConstructionEvent evt = new ExplosionConstructionEvent(worldObj, this); + MinecraftForge.EVENT_BUS.post(evt); + + if(!evt.isCanceled()) + { + if(proceduralInterval() > 0) + { + if(!worldObj.isRemote) + { + worldObj.spawnEntityInWorld(new EntityExplosion(this)); + } + } + else { + doPreExplode(); + doExplode(); + doPostExplode(); + } + } + } + + public int countIncrement() + { + return 1; + } + + @Override + public float getRadius() + { + return explosionSize; + } + + @Override + public long getEnergy() + { + return 0; + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @param return - Return -1 if this explosive does not need procedural calls */ + public int proceduralInterval() + { + return -1; + } + + protected void doDamageEntities(float radius, float power) + { + this.doDamageEntities(radius, power, true); + } + + protected void doDamageEntities(float radius, float power, boolean destroyItem) + { + // Step 2: Damage all entities + Pos3D minCoord = position.clone(); + minCoord.translate(-radius - 1, -radius - 1, -radius - 1); + Pos3D maxCoord = position.clone(); + maxCoord.translate(radius + 1, radius + 1, radius + 1); + List allEntities = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(minCoord.xPos, minCoord.yPos, minCoord.zPos, maxCoord.xPos, maxCoord.yPos, maxCoord.zPos)); + Vec3 var31 = Vec3.createVectorHelper(position.xPos, position.yPos, position.zPos); + + for(int i = 0; i < allEntities.size(); ++i) + { + Entity entity = allEntities.get(i); + + if(onDamageEntity(entity)) + { + continue; + } + + if(entity instanceof EntityMissile) + { + ((EntityMissile)entity).setExplode(); + continue; + } + + if(entity instanceof EntityItem && !destroyItem) + { + continue; + } + + double distance = entity.getDistance(position.xPos, position.yPos, position.zPos) / radius; + + if(distance <= 1.0D) + { + double xDifference = entity.posX - position.xPos; + double yDifference = entity.posY - position.yPos; + double zDifference = entity.posZ - position.zPos; + double var35 = MathHelper.sqrt_double(xDifference * xDifference + yDifference * yDifference + zDifference * zDifference); + xDifference /= var35; + yDifference /= var35; + zDifference /= var35; + double var34 = worldObj.getBlockDensity(var31, entity.boundingBox); + double var36 = (1.0D - distance) * var34; + int damage = 0; + + damage = (int)((var36 * var36 + var36) / 2.0D * 8.0D * power + 1.0D); + + entity.attackEntityFrom(DamageSource.setExplosionSource(this), damage); + + entity.motionX += xDifference * var36; + entity.motionY += yDifference * var36; + entity.motionZ += zDifference * var36; + } + } + } + + /** Called by doDamageEntity on each entity being damaged. This function should be inherited if + * something special is to happen to a specific entity. + * + * @return True if something special happens to this specific entity. */ + protected boolean onDamageEntity(Entity entity) + { + return false; + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.callCount = nbt.getInteger("callCount"); + this.explosionSize = nbt.getFloat("explosionSize"); + } + + public void writeToNBT(NBTTagCompound nbt) + { + nbt.setInteger("callCount", this.callCount); + nbt.setFloat("explosionSize", this.explosionSize); + } + + public boolean isMovable() + { + return false; + } + + @SideOnly(Side.CLIENT) + public ModelMissileBase getRenderModel() + { + return null; + } + + @SideOnly(Side.CLIENT) + public ResourceLocation getRenderResource() + { + return null; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastAntiGravitational.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastAntiGravitational.java new file mode 100644 index 000000000..6fa6c9a27 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastAntiGravitational.java @@ -0,0 +1,133 @@ +package defense.common.explosive.blast; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.entity.EntityFlyingBlock; +import defense.common.explosive.thread.ThreadSmallExplosion; + +public class BlastAntiGravitational extends Blast +{ + protected ThreadSmallExplosion thread; + protected Set flyingBlocks = new HashSet(); + + public BlastAntiGravitational(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doPreExplode() + { + if(!worldObj.isRemote) + { + thread = new ThreadSmallExplosion(worldObj, this.position, (int) this.getRadius(), this.exploder); + thread.start(); + } + + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "antigravity", 6.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + + @Override + public void doExplode() + { + int r = callCount; + + if(!worldObj.isRemote && thread.isComplete) + { + int blocksToTake = 20; + + for(Pos3D targetPosition : thread.results) + { + double distance = targetPosition.distance(position); + + if(distance > r || distance < r - 2 || blocksToTake <= 0) + { + continue; + } + + Block block = worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos) || block.getBlockHardness(worldObj, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos) < 0) + { + continue; + } + + int metadata = worldObj.getBlockMetadata((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(distance < r - 1 || worldObj.rand.nextInt(3) > 0) + { + if(!DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + continue; + } + + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + targetPosition.translate(0.5D, 0.5D, 0.5D); + + if(worldObj.rand.nextFloat() < 0.3 * (this.getRadius() - r)) + { + EntityFlyingBlock entity = new EntityFlyingBlock(worldObj, targetPosition, block, metadata, 0); + worldObj.spawnEntityInWorld(entity); + flyingBlocks.add(entity); + entity.yawChange = 50 * worldObj.rand.nextFloat(); + entity.pitchChange = 100 * worldObj.rand.nextFloat(); + entity.motionY += Math.max(0.15 * worldObj.rand.nextFloat(), 0.1); + } + + blocksToTake--; + } + } + } + + int radius = (int)getRadius(); + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.xPos - radius, position.yPos - radius, position.zPos - radius, position.xPos + radius, 100, position.zPos + radius); + List allEntities = worldObj.getEntitiesWithinAABB(Entity.class, bounds); + + for(Entity entity : allEntities) + { + if(!(entity instanceof EntityFlyingBlock) && entity.posY < 100 + position.yPos) + { + if(entity.motionY < 0.4) + { + entity.motionY += 0.15; + } + } + } + + if(callCount > 20 * 120) + { + controller.endExplosion(); + } + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @return - Return -1 if this explosive does not need proceudral calls */ + @Override + public int proceduralInterval() + { + return 1; + } + + @Override + public float getRadius() + { + return 15; + } + + @Override + public long getEnergy() + { + return 10000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastAntimatter.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastAntimatter.java new file mode 100644 index 000000000..8955087dd --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastAntimatter.java @@ -0,0 +1,117 @@ +package defense.common.explosive.blast; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.entity.EntityExplosion; + +public class BlastAntimatter extends Blast +{ + private boolean destroyBedrock; + + public BlastAntimatter(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastAntimatter(World world, Entity entity, double x, double y, double z, float size, boolean destroyBedrock) + { + this(world, entity, x, y, z, size); + destroyBedrock = destroyBedrock; + } + + /** Called before an explosion happens */ + @Override + public void doPreExplode() + { + super.doPreExplode(); + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "antimatter", 7F, (float) (worldObj.rand.nextFloat() * 0.1 + 0.9F)); + doDamageEntities(getRadius(), Integer.MAX_VALUE); + } + + @Override + public void doExplode() + { + if(!worldObj.isRemote) + { + for(int x = (int)-getRadius(); x < getRadius(); x++) + { + for(int y = (int)-getRadius(); y < getRadius(); y++) + { + for(int z = (int)-getRadius(); z < getRadius(); z++) + { + Pos3D targetPosition = position.clone().translate(new Pos3D(x, y, z)); + + double dist = position.distance(targetPosition); + + if(dist < getRadius()) + { + Coord4D coord = targetPosition.getCoord(worldObj.provider.dimensionId); + + Block block = coord.getBlock(worldObj); + + if(!block.isAir(worldObj, coord.xCoord, coord.yCoord, coord.zCoord)) + { + if(!destroyBedrock && block.getBlockHardness(worldObj, coord.xCoord, coord.yCoord, coord.zCoord) < 0) + { + continue; + } + + if(dist < getRadius() - 1 || worldObj.rand.nextFloat() > 0.7) + { + if(DefenseUtils.canBreak(worldObj, block, coord.xCoord, coord.yCoord, coord.zCoord)) + { + worldObj.setBlockToAir(coord.xCoord, coord.yCoord, coord.zCoord); + } + } + } + } + } + } + } + } + + // TODO: Render antimatter shockwave + /* + * else if(ZhuYao.proxy.isGaoQing()) { for(int x = -getRadius(); x < + * getRadius(); x++) { for(int y = -getRadius(); y < getRadius(); y++) { for + * (int z = -getRadius(); z < getRadius(); z++) { Vector3 targetPosition = + * Vector3.add(position, new Vector3(x, y, z)); double distance = + * position.distanceTo(targetPosition); + * if(targetPosition.getBlockID(worldObj) == 0) { if(distance < getRadius() && + * distance > getRadius() - 1 && worldObj.rand.nextFloat() > 0.5) { + * ParticleSpawner.spawnParticle("antimatter", worldObj, targetPosition); } } } } } } + */ + } + + @Override + public void doPostExplode() + { + doDamageEntities(getRadius(), Integer.MAX_VALUE); + } + + @Override + protected boolean onDamageEntity(Entity entity) + { + if(entity instanceof EntityExplosion) + { + if(((EntityExplosion)entity).blast instanceof BlastRedmatter) + { + entity.setDead(); + return true; + } + } + + return false; + } + + @Override + public long getEnergy() + { + return 30000000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastBeam.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastBeam.java new file mode 100644 index 000000000..15255a970 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastBeam.java @@ -0,0 +1,156 @@ +package defense.common.explosive.blast; + +import java.util.HashSet; +import java.util.Set; + +import defense.common.entity.EntityFlyingBlock; +import defense.common.entity.EntityLightBeam; +import defense.common.explosive.thread.ThreadExplosion; +import defense.common.explosive.thread.ThreadSky; +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +/** Used by Exothermic and Endothermic explosions. + * + * @author Calclavia */ +public abstract class BlastBeam extends Blast +{ + protected ThreadExplosion thread; + protected Set feiBlocks = new HashSet(); + protected EntityLightBeam lightBeam; + protected float red, green, blue; + /** Radius in which the uplighting of blocks takes place */ + protected int radius = 5; + + public BlastBeam(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + /** Called before an explosion happens */ + @Override + public void doPreExplode() + { + if (!this.worldObj.isRemote) + { + this.worldObj.createExplosion(this.exploder, position.xPos, position.yPos, position.zPos, 4F, true); + + this.lightBeam = new EntityLightBeam(this.worldObj, position, 20 * 20, this.red, this.green, this.blue); + this.worldObj.spawnEntityInWorld(this.lightBeam); + + this.thread = new ThreadSky(worldObj, this.position, (int) this.getRadius(), 50, this.exploder); + this.thread.start(); + } + } + + @Override + public void doExplode() + { + if (!this.worldObj.isRemote) + { + if (this.callCount > 100 / this.proceduralInterval() && this.thread.isComplete) + { + this.controller.endExplosion(); + } + + if (this.canFocusBeam(this.worldObj, position)) + { + /*Coord4D currentPos; TODO this calculation is the slowest calculation I have ever encountered (aidancbrady) + Block block; + int metadata; + double dist; + + int r = radius; + + for (int x = -r; x < r; x++) + { + for (int y = -r; y < r; y++) + { + for (int z = -r; z < r; z++) + { + dist = MathHelper.sqrt_double((x * x + y * y + z * z)); + + if (dist > r || dist < r - 3) + { + continue; + } + + currentPos = new Coord4D((int)position.xPos + x, (int)position.yPos + y, (int)position.zPos + z); + block = currentPos.getBlock(worldObj); + + if (currentPos.isAirBlock(worldObj) || block.getBlockHardness(this.worldObj, currentPos.xCoord, currentPos.yCoord, currentPos.zCoord) < 0) + { + continue; + } + + metadata = currentPos.getMetadata(worldObj); + + if (this.worldObj.rand.nextInt(2) > 0) + { + this.worldObj.setBlockToAir(currentPos.xCoord, currentPos.yCoord, currentPos.zCoord); + + EntityFlyingBlock entity = new EntityFlyingBlock(this.worldObj, new Pos3D(currentPos).translate(0.5D, 0.5D, 0.5D), block, metadata); + this.worldObj.spawnEntityInWorld(entity); + this.feiBlocks.add(entity); + entity.pitchChange = 50 * this.worldObj.rand.nextFloat(); + } + } + } + }*/ + } + else { + this.controller.endExplosion(); + } + + for (EntityFlyingBlock entity : this.feiBlocks) + { + Pos3D entityPosition = new Pos3D(entity); + Pos3D centeredPosition = entityPosition.clone().translate(this.position.scale(-1)); + centeredPosition.rotateYaw(2); + Pos3D newPosition = this.position.clone().translate(centeredPosition); + entity.motionX /= 3; + entity.motionY /= 3; + entity.motionZ /= 3; + entity.addVelocity((newPosition.xPos - entityPosition.xPos) * 0.5 * this.proceduralInterval(), 0.09 * this.proceduralInterval(), (newPosition.zPos - entityPosition.zPos) * 0.5 * this.proceduralInterval()); + entity.yawChange += 3 * this.worldObj.rand.nextFloat(); + } + } + } + + @Override + public void doPostExplode() + { + if (!this.worldObj.isRemote) + { + if (this.lightBeam != null) + { + this.lightBeam.setDead(); + this.lightBeam = null; + } + } + } + + public boolean canFocusBeam(World worldObj, Pos3D position) + { + return worldObj.canBlockSeeTheSky((int)position.xPos, (int)position.yPos + 1, (int)position.zPos); + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @param return - Return -1 if this explosive does not need proceudral calls */ + @Override + public int proceduralInterval() + { + return 4; + } + + @Override + public long getEnergy() + { + return 10000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastBreech.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastBreech.java new file mode 100644 index 000000000..476d3addd --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastBreech.java @@ -0,0 +1,68 @@ +package defense.common.explosive.blast; + +import defense.common.entity.EntityExplosive; +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlastBreech extends BlastRepulsive +{ + private int depth; + + public BlastBreech(World world, Entity entity, double x, double y, double z, float size, int depth) + { + this(world, entity, x, y, z, size); + this.depth = depth; + } + + public BlastBreech(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + this.nengLiang = 13; + } + + @Override + public void doExplode() + { + if (!this.worldObj.isRemote) + { + final Pos3D difference = new Pos3D(); + + if (this.exploder instanceof EntityExplosive) + { + difference.translate(((EntityExplosive)this.exploder).getDirection(), 1); + } + else + { + difference.translate(ForgeDirection.DOWN, 1); + } + + this.worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, "random.explode", 5.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + + for (int i = 0; i < this.depth; i++) + { + Block block = position.getCoord(worldObj.provider.dimensionId).getBlock(worldObj); + + if (!worldObj.isAirBlock((int)position.xPos, (int)position.yPos, (int)position.zPos)) + { + if (block.getExplosionResistance(this.exploder, worldObj, (int)position.xPos, (int)position.yPos, (int)position.zPos, position.xPos, position.yPos, position.zPos) > Blocks.obsidian.getExplosionResistance(this.exploder)) + { + break; + } + } + + super.doExplode(); + this.position.translate(difference); + } + } + } + + @Override + public long getEnergy() + { + return (super.getEnergy() * this.depth) / 2; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastChemical.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastChemical.java new file mode 100644 index 000000000..fedb72d6c --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastChemical.java @@ -0,0 +1,184 @@ +package defense.common.explosive.blast; + +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import defense.common.DefenseTech; +import defense.common.Reference; +import defense.common.potion.CustomPotionEffect; + +public class BlastChemical extends Blast +{ + private static final int CHECK_BAN_JING = 16; + private static final float NENG_LIANG = 10F; + private int duration; + /** Color of particles */ + private float red = 1, green = 1, blue = 1; + private boolean playShortSoundFX; + private boolean isContagious, isPoisonous, isConfuse, isMutate; + + public BlastChemical(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastChemical(World world, Entity entity, double x, double y, double z, float size, int duration, boolean playShortSoundFX) + { + this(world, entity, x, y, z, size); + this.duration = duration / this.proceduralInterval(); + this.playShortSoundFX = playShortSoundFX; + } + + public BlastChemical setRGB(float r, float g, float b) + { + this.red = r; + this.green = g; + this.blue = b; + return this; + } + + public BlastChemical setConfuse() + { + this.isConfuse = true; + return this; + } + + public BlastChemical setPoison() + { + this.isPoisonous = true; + return this; + } + + public BlastChemical setContagious() + { + this.isContagious = true; + this.isMutate = true; + return this; + } + + @Override + public void doPreExplode() + { + super.doPreExplode(); + if (!this.playShortSoundFX) + { + this.worldObj.playSoundEffect(this.position.xPos, this.position.yPos, this.position.zPos, Reference.PREFIX + "debilitation", 4.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + } + + @Override + public void doExplode() + { + float radius = this.getRadius(); + + if (this.worldObj.isRemote) + { + for (int i = 0; i < 200; i++) + { + Pos3D diDian = new Pos3D(); + + diDian.xPos = Math.random() * radius / 2 - radius / 4; + diDian.yPos = Math.random() * radius / 2 - radius / 4; + diDian.zPos = Math.random() * radius / 2 - radius / 4; + diDian.scale(Math.min(radius, callCount) / 10); + + if (diDian.getMagnitude() <= radius) + { + diDian.translate(this.position); + DefenseTech.proxy.spawnParticle("smoke", this.worldObj, diDian, (Math.random() - 0.5) / 2, (Math.random() - 0.5) / 2, (Math.random() - 0.5) / 2, this.red, this.green, this.blue, 7.0F, 8); + } + } + } + + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.xPos - radius, position.yPos - radius, position.zPos - radius, position.xPos + radius, position.yPos + radius, position.zPos + radius); + List allEntities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, bounds); + + for (EntityLivingBase entity : allEntities) + { + if (this.isContagious) + { + DefenseTech.contagios_potion.poisonEntity(position, entity); + } + + if (this.isPoisonous) + { + DefenseTech.poisonous_potion.poisonEntity(position, entity); + } + + if (this.isConfuse) + { + entity.addPotionEffect(new CustomPotionEffect(Potion.confusion.id, 18 * 20, 0)); + entity.addPotionEffect(new CustomPotionEffect(Potion.digSlowdown.id, 20 * 60, 0)); + entity.addPotionEffect(new CustomPotionEffect(Potion.moveSlowdown.id, 20 * 60, 2)); + } + } + + if (this.isMutate) + { + new BlastMutation(worldObj, this.exploder, position.xPos, position.yPos, position.zPos, this.getRadius()).explode(); + } + + if (this.playShortSoundFX) + { + worldObj.playSoundEffect(position.xPos + 0.5D, position.yPos + 0.5D, position.zPos + 0.5D, Reference.PREFIX + "gasleak", 4.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 1F); + } + + if (this.callCount > this.duration) + { + this.controller.endExplosion(); + } + } + + @Override + public long getEnergy() + { + return 20; + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @return - Return -1 if this explosive does not need proceudral calls */ + @Override + public int proceduralInterval() + { + return 5; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.duration = nbt.getInteger("duration"); + this.isContagious = nbt.getBoolean("isContagious"); + this.isPoisonous = nbt.getBoolean("isPoisonous"); + this.isConfuse = nbt.getBoolean("isConfuse"); + this.isMutate = nbt.getBoolean("isMutate"); + this.red = nbt.getFloat("red"); + this.green = nbt.getFloat("green"); + this.blue = nbt.getFloat("blue"); + this.playShortSoundFX = nbt.getBoolean("playShortSoundFX"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("duration", this.duration); + nbt.setBoolean("isContagious", this.isContagious); + nbt.setBoolean("isPoisonous", this.isPoisonous); + nbt.setBoolean("isConfuse", this.isConfuse); + nbt.setBoolean("isMutate", this.isMutate); + nbt.setFloat("red", this.red); + nbt.setFloat("green", this.green); + nbt.setFloat("blue", this.blue); + nbt.setBoolean("playShortSoundFX", this.playShortSoundFX); + + } + +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastEMP.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastEMP.java new file mode 100644 index 000000000..2e31c2352 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastEMP.java @@ -0,0 +1,205 @@ +package defense.common.explosive.blast; + +import ic2.api.item.ISpecialElectricItem; +import ic2.api.tile.IEnergyStorage; + +import java.util.List; + +import mekanism.api.Pos3D; +import mekanism.api.energy.IEnergizedItem; +import mekanism.api.energy.IStrictEnergyStorage; +import mekanism.common.util.MekanismUtils; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import cofh.api.energy.IEnergyContainerItem; +import cofh.api.energy.IEnergyHandler; +import defense.api.IEMPBlock; +import defense.api.IEMPItem; +import defense.api.IMissile; +import defense.api.RadarRegistry; +import defense.common.DefenseTech; +import defense.common.Reference; +import defense.common.Vector2; +import defense.common.entity.EntityExplosive; + +public class BlastEMP extends Blast +{ + private boolean effectEntities = false; + private boolean effectBlocks = false; + + public BlastEMP(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastEMP setEffectBlocks() + { + effectBlocks = true; + return this; + } + + public BlastEMP setEffectEntities() + { + effectEntities = true; + return this; + } + + @Override + public void doExplode() + { + if(effectBlocks) + { + for(int x = (int)-getRadius(); x < (int)getRadius(); x++) + { + for(int y = (int)-getRadius(); y < (int)getRadius(); y++) + { + for(int z = (int)-getRadius(); z < (int)getRadius(); z++) + { + double dist = MathHelper.sqrt_double((x * x + y * y + z * z)); + + Pos3D searchPosition = position.clone().translate(new Pos3D(x, y, z)); + + if(dist > getRadius()) + { + continue; + } + + if(Math.round(position.xPos + y) == (int)position.yPos) + { + worldObj.spawnParticle("largesmoke", searchPosition.xPos, searchPosition.yPos, searchPosition.zPos, 0, 0, 0); + } + + Block block = searchPosition.getCoord(worldObj.provider.dimensionId).getBlock(worldObj); + TileEntity tileEntity = searchPosition.getCoord(worldObj.provider.dimensionId).getTileEntity(worldObj); + + if(!worldObj.isAirBlock((int)searchPosition.xPos, (int)searchPosition.yPos, (int)searchPosition.zPos)) + { + if(block instanceof IEMPBlock) + { + ((IEMPBlock)block).onEMP(worldObj, (int)searchPosition.xPos, (int)searchPosition.yPos, (int)searchPosition.zPos, this); + } + } + + if(tileEntity != null) + { + try { + if(tileEntity instanceof IStrictEnergyStorage) + { + ((IStrictEnergyStorage)tileEntity).setEnergy(0); + } + if(MekanismUtils.useIC2() && tileEntity instanceof IEnergyStorage) + { + ((IEnergyStorage)tileEntity).setStored(0); + } + else if(MekanismUtils.useRF() && tileEntity instanceof IEnergyHandler) + { + ((IEnergyHandler)tileEntity).extractEnergy(ForgeDirection.UNKNOWN, Integer.MAX_VALUE, false); + } + } catch(Exception e) {} + } + } + } + } + } + + if (effectEntities) + { + // Drop all missiles + List entitiesNearby = RadarRegistry.getEntitiesWithinRadius(new Vector2(position), (int) getRadius()); + + for(Entity entity : entitiesNearby) + { + if(entity instanceof IMissile && !entity.isEntityEqual(controller)) + { + if(((IMissile)entity).getTicksInAir() > -1) + { + ((IMissile)entity).dropMissileAsItem(); + } + } + } + + int maxFx = 10; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.xPos - getRadius(), position.yPos - getRadius(), position.zPos - getRadius(), position.xPos + getRadius(), position.yPos + getRadius(), position.zPos + getRadius()); + List entities = worldObj.getEntitiesWithinAABB(Entity.class, bounds); + + for(Entity entity : entities) + { + if(entity instanceof EntityLivingBase) + { + if(worldObj.isRemote && maxFx > 0) + { + DefenseTech.proxy.spawnShock(worldObj, position, new Pos3D(entity), 20); + maxFx--; + } + + if(entity instanceof EntityCreeper) + { + if(!worldObj.isRemote) + { + try { + ((EntityCreeper)entity).getDataWatcher().updateObject(17, (byte)1); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + if(entity instanceof EntityPlayer) + { + IInventory inventory = ((EntityPlayer) entity).inventory; + + for(int i = 0; i < inventory.getSizeInventory(); i++) + { + ItemStack itemStack = inventory.getStackInSlot(i); + + if(itemStack != null) + { + try { + if(itemStack.getItem() instanceof IEMPItem) + { + ((IEMPItem)itemStack.getItem()).onEMP(itemStack, entity, this); + } + else if(itemStack.getItem() instanceof IEnergizedItem) + { + ((IEnergizedItem)itemStack.getItem()).setEnergy(itemStack, 0); + } + else if(MekanismUtils.useRF() && itemStack.getItem() instanceof IEnergyContainerItem) + { + ((IEnergyContainerItem)itemStack.getItem()).extractEnergy(itemStack, ((IEnergyContainerItem)itemStack.getItem()).getEnergyStored(itemStack), false); + } + else if(MekanismUtils.useIC2() && itemStack.getItem() instanceof ISpecialElectricItem) + { + ((ISpecialElectricItem)itemStack.getItem()).getManager(itemStack).discharge(itemStack, ((ISpecialElectricItem)itemStack.getItem()).getMaxCharge(itemStack), 0, true, false, false); + } + } catch(Exception e) {} + } + } + } + } + else if(entity instanceof EntityExplosive) + { + entity.setDead(); + } + } + } + + DefenseTech.proxy.spawnParticle("shockwave", worldObj, position, 0, 0, 0, 0, 0, 255, 10, 3); + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "emp", 4.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + + @Override + public long getEnergy() + { + return 3000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastEndothermic.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastEndothermic.java new file mode 100644 index 000000000..0c3e85535 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastEndothermic.java @@ -0,0 +1,115 @@ +package defense.common.explosive.blast; + +import java.util.Iterator; +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.init.Blocks; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.potion.CustomPotionEffect; +import defense.common.potion.PoisonFrostBite; + +public class BlastEndothermic extends BlastBeam +{ + public BlastEndothermic(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + this.red = 0f; + this.green = 0.3f; + this.blue = 0.7f; + } + + @Override + public void doExplode() + { + super.doExplode(); + this.worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "redmatter", 4.0F, 0.8F); + } + + @Override + public void doPostExplode() + { + super.doPostExplode(); + + if (!this.worldObj.isRemote) + { + if (this.canFocusBeam(this.worldObj, position) && this.thread.isComplete) + { + /* + * Freeze all nearby entities. + */ + List livingEntities = worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(position.xPos - getRadius(), position.yPos - getRadius(), position.zPos - getRadius(), position.xPos + getRadius(), position.yPos + getRadius(), position.zPos + getRadius())); + + Iterator it = livingEntities.iterator(); + + while (it.hasNext()) + { + EntityLiving entity = it.next(); + entity.addPotionEffect(new CustomPotionEffect(PoisonFrostBite.INSTANCE.getId(), 60 * 20, 1, null)); + entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 10 * 20, 2)); + entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 120 * 20, 2)); + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 120 * 20, 4)); + } + + for (Pos3D targetPosition : this.thread.results) + { + double distanceFromCenter = position.distance(targetPosition); + + if (distanceFromCenter > this.getRadius()) + continue; + + /* + * Reduce the chance of setting blocks on fire based on distance from center. + */ + double chance = this.getRadius() - (Math.random() * distanceFromCenter); + + if (chance > distanceFromCenter * 0.55) + { + /* + * Place down ice blocks. + */ + Block block = this.worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava) + { + this.worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, Blocks.snow, 0, 2); + } + else if (worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos) && this.worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos - 1, (int)targetPosition.zPos) != Blocks.ice && !worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos - 1, (int)targetPosition.zPos)) + { + this.worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, Blocks.ice, 0, 2); + } + } + } + } + + this.worldObj.playSoundEffect(position.xPos + 0.5D, position.yPos + 0.5D, position.zPos + 0.5D, Reference.PREFIX + "redmatter", 6.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 1F); + } + + this.worldObj.setWorldTime(1200); + } + } + + @Override + public boolean canFocusBeam(World worldObj, Pos3D position) + { + long worldTime = worldObj.getWorldTime(); + + while (worldTime > 23999) + { + worldTime -= 23999; + } + + return worldTime > 12000 && super.canFocusBeam(worldObj, position); + } + +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastExothermic.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastExothermic.java new file mode 100644 index 000000000..a891c72ad --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastExothermic.java @@ -0,0 +1,117 @@ +package defense.common.explosive.blast; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.Settings; + +public class BlastExothermic extends BlastBeam +{ + public BlastExothermic(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + red = 0.7f; + green = 0.3f; + blue = 0; + } + + @Override + public void doExplode() + { + super.doExplode(); + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "beamcharging", 4.0F, 0.8F); + } + + @Override + public void doPostExplode() + { + super.doPostExplode(); + + if (!worldObj.isRemote) + { + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "powerdown", 4.0F, 0.8F); + + if (canFocusBeam(worldObj, position) && thread.isComplete) + { + for (Pos3D targetPosition : thread.results) + { + double distanceFromCenter = position.distance(targetPosition); + + if(distanceFromCenter > getRadius()) + { + continue; + } + + /* + * Reduce the chance of setting blocks on fire based on distance from center. + */ + double chance = getRadius() - (Math.random() * distanceFromCenter); + + if(chance > distanceFromCenter * 0.55) + { + /* + * Check to see if the block is an air block and there is a block below it + * to support the fire. + */ + Block block = worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + if(block == Blocks.water || block == Blocks.flowing_water || block == Blocks.ice) + { + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + + if((worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos) || block == Blocks.snow) && worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos - 1, (int)targetPosition.zPos).getMaterial().isSolid()) + { + if(worldObj.rand.nextFloat() > 0.999) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, Blocks.flowing_lava, 0, 2); + } + else { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, Blocks.fire, 0, 2); + + block = worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos - 1, (int)targetPosition.zPos); + + if (Settings.CREATE_NETHERRACK && (block == Blocks.stone || block == Blocks.grass || block == Blocks.dirt) && worldObj.rand.nextFloat() > 0.75) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos - 1, (int)targetPosition.zPos, Blocks.netherrack, 0, 2); + } + } + } + else if(block == Blocks.ice) + { + if(DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + } + } + } + } + + worldObj.playSoundEffect(position.xPos + 0.5D, position.yPos + 0.5D, position.zPos + 0.5D, Reference.PREFIX + "explosionfire", 6.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 1F); + } + + worldObj.setWorldTime(18000); + } + } + + @Override + public boolean canFocusBeam(World worldObj, Pos3D position) + { + long worldTime = worldObj.getWorldTime(); + + while(worldTime > 23999) + { + worldTime -= 23999; + } + + return worldTime < 12000 && !worldObj.isRaining() && super.canFocusBeam(worldObj, position); + } + +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastFire.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastFire.java new file mode 100644 index 000000000..ccc29e4ff --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastFire.java @@ -0,0 +1,100 @@ +package defense.common.explosive.blast; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import defense.common.DefenseUtils; +import defense.common.Reference; + +public class BlastFire extends Blast +{ + public BlastFire(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doExplode() + { + if (!this.worldObj.isRemote) + { + int radius = (int) this.getRadius(); + + for (int x = 0; x < radius; ++x) + { + for (int y = 0; y < radius; ++y) + { + for (int z = 0; z < radius; ++z) + { + if (x == 0 || x == radius - 1 || y == 0 || y == radius - 1 || z == 0 || z == radius - 1) + { + double xStep = x / (radius - 1.0F) * 2.0F - 1.0F; + double yStep = y / (radius - 1.0F) * 2.0F - 1.0F; + double zStep = z / (radius - 1.0F) * 2.0F - 1.0F; + double diagonalDistance = Math.sqrt(xStep * xStep + yStep * yStep + zStep * zStep); + xStep /= diagonalDistance; + yStep /= diagonalDistance; + zStep /= diagonalDistance; + float var14 = radius * (0.7F + worldObj.rand.nextFloat() * 0.6F); + double var15 = position.xPos; + double var17 = position.yPos; + double var19 = position.zPos; + + for (float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * 0.75F) + { + Pos3D targetPosition = new Pos3D(var15, var17, var19); + double distanceFromCenter = position.distance(targetPosition); + Block block = worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(!worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)) + { + var14 -= (block.getExplosionResistance(this.exploder, worldObj, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, position.xPos, position.yPos, position.zPos) + 0.3F) * var21; + } + + if(var14 > 0.0F) + { + // Set fire by chance and distance + double chance = radius - (Math.random() * distanceFromCenter); + + if(chance > distanceFromCenter * 0.55) + { + /* + * Check to see if the block is an air block and there is a + * block below it to support the fire. + */ + + if((worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos) || block == Blocks.snow) && worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos - 1, (int)targetPosition.zPos).getMaterial().isSolid()) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, Blocks.fire, 0, 2); + } + else if(block == Blocks.ice) + { + if(DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + } + } + } + + var15 += xStep * var21; + var17 += yStep * var21; + var19 += zStep * var21; + } + } + } + } + } + } + + worldObj.playSoundEffect(position.xPos + 0.5D, position.yPos + 0.5D, position.zPos + 0.5D, Reference.PREFIX + "explosionfire", 4.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 1F); + } + + @Override + public long getEnergy() + { + return 3000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastMine.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastMine.java new file mode 100644 index 000000000..dac5ac4a7 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastMine.java @@ -0,0 +1,88 @@ +package defense.common.explosive.blast; + +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.client.model.missile.ModelMissileBase; +import defense.client.model.tile.ModelSMine; + +public class BlastMine extends Blast +{ + public BlastMine(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doPreExplode() + { + if (!this.worldObj.isRemote) + { + this.worldObj.createExplosion(this.controller, position.xPos, position.yPos, position.zPos, 1.5f, true); + } + + this.controller.motionX = -0.125 + 0.25 * this.worldObj.rand.nextFloat(); + this.controller.motionY = 0.7 + 0.4 * this.worldObj.rand.nextFloat(); + this.controller.motionZ = -0.125 + 0.25 * this.worldObj.rand.nextFloat(); + } + + @Override + public void doExplode() + { + this.controller.motionY -= 0.045; + this.controller.rotationPitch += 1.5 * this.worldObj.rand.nextFloat(); + + if (!this.worldObj.isRemote) + { + if (this.callCount < 20 * 2 && !this.controller.isCollided) + { + return; + } + + if (this.callCount >= 20 * 2 && this.callCount % 2 == 0) + { + new BlastShrapnel(this.worldObj, this.exploder, this.position.xPos, this.position.yPos, this.position.zPos, this.getRadius(), true, true, false).doExplode(); + } + + if (this.callCount >= 20 * 2 + 20) + { + this.controller.endExplosion(); + } + } + } + + @Override + public boolean isMovable() + { + return true; + } + + @Override + public int proceduralInterval() + { + return 1; + } + + @Override + public long getEnergy() + { + return 8000; + } + + @SideOnly(Side.CLIENT) + @Override + public ModelMissileBase getRenderModel() + { + return ModelSMine.INSTANCE; + } + + @SideOnly(Side.CLIENT) + @Override + public ResourceLocation getRenderResource() + { + return ModelSMine.TEXTURE; + } + +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastMutation.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastMutation.java new file mode 100644 index 000000000..23700fe93 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastMutation.java @@ -0,0 +1,60 @@ +package defense.common.explosive.blast; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + +public class BlastMutation extends Blast +{ + public BlastMutation(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doExplode() + { + if (!this.worldObj.isRemote) + { + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.xPos - this.getRadius(), position.yPos - this.getRadius(), position.zPos - this.getRadius(), position.xPos + this.getRadius(), position.yPos + this.getRadius(), position.zPos + this.getRadius()); + List entitiesNearby = worldObj.getEntitiesWithinAABB(EntityLiving.class, bounds); + + for (EntityLiving entity : entitiesNearby) + { + if (entity instanceof EntityPig) + { + EntityPigZombie newEntity = new EntityPigZombie(worldObj); + newEntity.preventEntitySpawning = true; + newEntity.setPosition(entity.posX, entity.posY, entity.posZ); + entity.setDead(); + } + else if (entity instanceof EntityVillager) + { + EntityZombie newEntity = new EntityZombie(worldObj); + newEntity.preventEntitySpawning = true; + newEntity.setPosition(entity.posX, entity.posY, entity.posZ); + entity.setDead(); + } + } + } + } + + @Override + public float getRadius() + { + return 0; + } + + @Override + public long getEnergy() + { + return 50; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastNuclear.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastNuclear.java new file mode 100644 index 000000000..e03ec5598 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastNuclear.java @@ -0,0 +1,201 @@ +package defense.common.explosive.blast; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import defense.common.DefenseTech; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.explosive.thread.ThreadLargeExplosion; + +public class BlastNuclear extends Blast +{ + private ThreadLargeExplosion thread; + private float explosionEnergy; + private boolean spawnMoreParticles = false; + private boolean isRadioactive = false; + + public BlastNuclear(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastNuclear(World world, Entity entity, double x, double y, double z, float size, float energy) + { + this(world, entity, x, y, z, size); + explosionEnergy = energy; + } + + public BlastNuclear setNuclear() + { + spawnMoreParticles = true; + isRadioactive = true; + + return this; + } + + @Override + public void doPreExplode() + { + if(!worldObj.isRemote) + { + thread = new ThreadLargeExplosion(worldObj, position, (int)getRadius(), explosionEnergy, exploder); + + thread.start(); + + } + else if(spawnMoreParticles && DefenseTech.proxy.isFancyGraphicsEnabled()) + { + // Spawn nuclear cloud. + for(int y = 0; y < 26; y++) + { + int r = 4; + + if(y < 8) + { + r = Math.max(Math.min((8 - y) * 2, 10), 4); + } + else if(y > 15) + { + r = Math.max(Math.min((y - 15) * 2, 15), 5); + } + + for(int x = -r; x < r; x++) + { + for (int z = -r; z < r; z++) + { + double distance = MathHelper.sqrt_double(x * x + z * z); + + if(r > distance && r - 3 < distance) + { + Pos3D spawnPosition = position.clone().translate(new Pos3D(x * 2, (y - 2) * 2, z * 2)); + float xDiff = (float) (spawnPosition.xPos - position.xPos); + float zDiff = (float) (spawnPosition.zPos - position.zPos); + DefenseTech.proxy.spawnParticle("smoke", worldObj, spawnPosition, xDiff * 0.3 * worldObj.rand.nextFloat(), -worldObj.rand.nextFloat(), zDiff * 0.3 * worldObj.rand.nextFloat(), (float) (distance / getRadius()) * worldObj.rand.nextFloat(), 0, 0, 8F, 1.2F); + } + } + } + } + } + + doDamageEntities(getRadius(), explosionEnergy * 1000); + + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "explosion", 7.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + + @Override + public void doExplode() + { + int r = callCount; + + if(worldObj.isRemote) + { + if(DefenseTech.proxy.isFancyGraphicsEnabled()) + { + for(int x = -r; x < r; x++) + { + for(int z = -r; z < r; z++) + { + double distance = MathHelper.sqrt_double(x * x + z * z); + + if(distance < r && distance > r - 1) + { + Pos3D targetPosition = position.clone().translate(new Pos3D(x, 0, z)); + + if(worldObj.rand.nextFloat() < Math.max(0.001 * r, 0.05)) + { + DefenseTech.proxy.spawnParticle("smoke", worldObj, targetPosition, 5F, 1F); + } + } + } + } + } + + } + else { + if(thread != null) + { + if(thread.isComplete) + { + controller.endExplosion(); + } + } + else { + controller.endExplosion(); + DefenseTech.LOGGER.severe("Something went wrong with multi-threading while detonating the nuclear explosive."); + } + } + } + + @Override + public void doPostExplode() + { + try { + if(!worldObj.isRemote && thread.isComplete) + { + for(Pos3D p : thread.results) + { + Block block = worldObj.getBlock((int)p.xPos, (int)p.yPos, (int)p.zPos); + + if(!worldObj.isAirBlock((int)p.xPos, (int)p.yPos, (int)p.zPos)) + { + if(DefenseUtils.canBreak(worldObj, block, p.xPos, p.yPos, p.zPos)) + { + block.onBlockExploded(worldObj, (int)p.xPos, (int)p.yPos, (int)p.zPos, this); + } + } + } + } + } catch(Exception e) { + DefenseTech.LOGGER.severe("Nuclear-type detonation failed!"); + e.printStackTrace(); + } + + doDamageEntities(getRadius(), explosionEnergy * 1000); + + if(isRadioactive) + { + new BlastRot(worldObj, exploder, position.xPos, position.yPos, position.zPos, getRadius(), explosionEnergy).explode(); + new BlastMutation(worldObj, exploder, position.xPos, position.yPos, position.zPos, getRadius()).explode(); + + if(worldObj.rand.nextInt(3) == 0) + { + worldObj.getWorldInfo().setRaining(true); + } + } + + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "explosion", 10.0F, (1.0F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @param return - Return -1 if this explosive does not need procedural calls */ + @Override + public int proceduralInterval() + { + return 1; + } + + @Override + public long getEnergy() + { + return (long)(41840000 * explosionEnergy); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + spawnMoreParticles = nbt.getBoolean("spawnMoreParticles"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setBoolean("spawnMoreParticles", spawnMoreParticles); + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastRedmatter.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastRedmatter.java new file mode 100644 index 000000000..2ec67afb5 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastRedmatter.java @@ -0,0 +1,297 @@ +package defense.common.explosive.blast; + +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidBlock; +import defense.api.IExplosiveIgnore; +import defense.common.DefenseTech; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.Settings; +import defense.common.entity.EntityExplosion; +import defense.common.entity.EntityExplosive; +import defense.common.entity.EntityFlyingBlock; + +public class BlastRedmatter extends Blast +{ + private int maxTakeBlocks = 5; + + public BlastRedmatter(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doPreExplode() + { + if (!this.worldObj.isRemote) + { + this.worldObj.createExplosion(this.exploder, position.xPos, position.yPos, position.zPos, 5.0F, true); + } + } + + @Override + protected void doPostExplode() + { + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(this.explosionX - this.explosionSize, this.explosionY - this.explosionSize, this.explosionZ - this.explosionSize, this.explosionX + this.explosionSize, this.explosionY + this.explosionSize, this.explosionZ + this.explosionSize); + List list = this.worldObj.getEntitiesWithinAABB(EntityExplosion.class, bounds); + + for (Object obj : list) + { + if (obj instanceof EntityExplosion) + { + EntityExplosion explosion = (EntityExplosion) obj; + + if (explosion.blast instanceof BlastRedmatter) + { + explosion.setDead(); + } + } + } + + } + + @Override + public void doExplode() + { + if (Settings.DO_REDMATTER_DESPAWN && callCount >= Settings.MAX_REDMATTER_LIFESPAN) + { + this.postExplode(); + } + + // Try to find and grab some blocks to orbit + if (!this.worldObj.isRemote) + { + Pos3D currentPos = new Pos3D(); + int blockID = -1; + int metadata = -1; + double dist = -1; + int takenBlocks = 0; + Block block = null; + + /** Block removal loop */ + loop: + for (int radius = 1; radius < this.getRadius(); radius++) + { + for (int xCoord = -radius; xCoord < radius; xCoord++) + { + for (int yCoord = -radius; yCoord < radius; yCoord++) + { + for (int zCoord = -radius; zCoord < radius; zCoord++) + { + currentPos.xPos = position.xPos + xCoord; + currentPos.yPos = position.yPos + yCoord; + currentPos.zPos = position.zPos + zCoord; + + dist = MathHelper.sqrt_double((xCoord * xCoord + yCoord * yCoord + zCoord * zCoord)); + + if (dist > radius || dist < radius - 2) + continue; + + block = currentPos.getCoord(worldObj.provider.dimensionId).getBlock(this.worldObj); + metadata = currentPos.getCoord(worldObj.provider.dimensionId).getMetadata(this.worldObj); + + if(!worldObj.isAirBlock((int)currentPos.xPos, (int)currentPos.yPos, (int)currentPos.zPos) && block.getBlockHardness(this.worldObj, (int)currentPos.xPos, (int)currentPos.yPos, (int)currentPos.zPos) >= 0) + { + if(DefenseUtils.canBreak(worldObj, block, currentPos.xPos, currentPos.yPos, currentPos.zPos)) + { + worldObj.setBlock((int)currentPos.xPos, (int)currentPos.yPos, (int)currentPos.zPos, Blocks.air, 0, block instanceof BlockLiquid ? 0 : 2); + //TODO: render fluid streams + if(block instanceof BlockLiquid || block instanceof IFluidBlock) + { + continue; + } + + currentPos.translate(0.5D, 0.5D, 0.5D); + + if(worldObj.rand.nextFloat() > 0.8) + { + EntityFlyingBlock entity = new EntityFlyingBlock(worldObj, currentPos, block, metadata); + worldObj.spawnEntityInWorld(entity); + entity.yawChange = 50 * this.worldObj.rand.nextFloat(); + entity.pitchChange = 50 * this.worldObj.rand.nextFloat(); + } + + takenBlocks++; + + if(takenBlocks > maxTakeBlocks) + { + break loop; + } + } + } + } + } + } + } + } + + /** Entity orbital removal & movement loop */ + float radius = this.getRadius() + this.getRadius() / 2; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.xPos - radius, position.yPos - radius, position.zPos - radius, position.xPos + radius, position.yPos + radius, position.zPos + radius); + List allEntities = this.worldObj.getEntitiesWithinAABB(Entity.class, bounds); + boolean doExplosion = true; + + for(Entity entity : allEntities) + { + doExplosion = !this.affectEntity(radius, entity, doExplosion); + } + /* + * if (this.worldObj.isRemote) { for (int i = 0; i < 10 * (2 - + * ZhuYaoZhaPin.proxy.getParticleSetting()); i++) { Pos3D randomVector = new + * Pos3D(this.worldObj.rand.nextInt((int) this.getRadius()) - this.getRadius(), + * this.worldObj.rand.nextInt((int) this.getRadius()) - this.getRadius(), + * this.worldObj.rand.nextInt((int) this.getRadius()) - this.getRadius()); + * ZhuYaoZhaPin.proxy.spawnParticle("smoke", this.worldObj, Pos3D.add(this.position, + * randomVector), 0, 0, 0, 1, 1, 1, 7.0F, 8); } + * List list = ZhuYaoZhaPin.proxy.getEntityFXs(); + * if (list != null) { for (Entity entity : list) { if (this.position.distanceTo(new + * Pos3D(entity)) <= radius) { this.affectEntity(radius, entity, false); } } } } + */ + + if (this.worldObj.rand.nextInt(8) == 0) + { + this.worldObj.playSoundEffect(position.xPos + (Math.random() - 0.5) * radius, position.yPos + (Math.random() - 0.5) * radius, position.zPos + (Math.random() - 0.5) * radius, Reference.PREFIX + "collapse", 6.0F - this.worldObj.rand.nextFloat(), 1.0F - this.worldObj.rand.nextFloat() * 0.4F); + } + + this.worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "redmatter", 3.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 1F); + } + + /** Makes an entity get affected by Red Matter. + * + * @Return True if explosion happened */ + public boolean affectEntity(float radius, Entity entity, boolean doExplosion) + { + boolean explosionCreated = false; + + if(entity == controller) + { + return false; + } + + if(entity instanceof IExplosiveIgnore) + { + if(((IExplosiveIgnore)entity).canIgnore(this)) + { + return false; + } + } + + if(entity instanceof EntityPlayer) + { + if (((EntityPlayer)entity).capabilities.isCreativeMode) + { + return false; + } + } + + double xDifference = entity.posX - position.xPos; + double yDifference = entity.posY - position.yPos; + double zDifference = entity.posZ - position.zPos; + + /** The percentage of the closeness of the entity. */ + double xPercentage = 1 - (xDifference / radius); + double yPercentage = 1 - (yDifference / radius); + double zPercentage = 1 - (zDifference / radius); + double distancePercentage = (this.position.distance(new Pos3D(entity)) / radius); + + Pos3D entityPosition = new Pos3D(entity); + Pos3D centeredPosition = entityPosition.clone().diff(this.position); + centeredPosition.rotate(1.5 * distancePercentage * Math.random(), 1.5 * distancePercentage * Math.random(), 1.5 * distancePercentage * Math.random()); + Pos3D newPosition = this.position.clone().translate(centeredPosition); + // Orbit Velocity + entity.addVelocity(newPosition.xPos - entityPosition.xPos, 0, newPosition.zPos - entityPosition.zPos); + // Gravity Velocity + entity.addVelocity(-xDifference * 0.015 * xPercentage, -yDifference * 0.015 * yPercentage, -zDifference * 0.015 * zPercentage); + + if(worldObj.isRemote) + { + if(entity instanceof EntityFlyingBlock) + { + if (DefenseTech.proxy.getParticleSetting() == 0) + { + if (this.worldObj.rand.nextInt(5) == 0) + { + DefenseTech.proxy.spawnParticle("digging", this.worldObj, new Pos3D(entity), -xDifference, -yDifference + 10, -zDifference, Block.getIdFromBlock(((EntityFlyingBlock) entity).block), 0, ((EntityFlyingBlock) entity).metadata, 2, 1); + } + } + } + } + + if(new Pos3D(entity.posX, entity.posY, entity.posZ).distance(position) < 4) + { + if(doExplosion && !explosionCreated && callCount % 5 == 0) + { + /** Inject velocities to prevent this explosion to move RedMatter. */ + Pos3D tempMotion = new Pos3D(this.controller.motionX, this.controller.motionY, this.controller.motionZ); + this.worldObj.createExplosion(this.exploder, entity.posX, entity.posY, entity.posZ, 3.0F, true); + this.controller.motionX = tempMotion.xPos; + this.controller.motionY = tempMotion.yPos; + this.controller.motionZ = tempMotion.zPos; + explosionCreated = true; + } + + if (entity instanceof EntityLivingBase) + { + entity.fallDistance = 0; + entity.attackEntityFrom(DamageSource.setExplosionSource(this), 4F); + } + else { + if(entity instanceof EntityExplosion) + { + if(((EntityExplosion)entity).blast instanceof BlastAntimatter || ((EntityExplosion)entity).blast instanceof BlastRedmatter) + { + worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "explosion", 7.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + + if(worldObj.rand.nextFloat() > 0.85 && !worldObj.isRemote) + { + entity.setDead(); + return explosionCreated; + } + } + } + else if(entity instanceof EntityExplosive) + { + ((EntityExplosive)entity).explode(); + } + else { + entity.setDead(); + } + } + } + + return explosionCreated; + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @return - Return -1 if this explosive does not need proceudral calls */ + @Override + public int proceduralInterval() + { + return 1; + } + + @Override + public long getEnergy() + { + return -3000; + } + + @Override + public boolean isMovable() + { + return this.callCount > 1; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastRegen.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastRegen.java new file mode 100644 index 000000000..6e914901c --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastRegen.java @@ -0,0 +1,71 @@ +package defense.common.explosive.blast; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraft.world.gen.ChunkProviderServer; + +public class BlastRegen extends Blast +{ + public BlastRegen(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doExplode() + { + if(!worldObj.isRemote) + { + try { + Chunk oldChunk = worldObj.getChunkFromBlockCoords((int)position.xPos, (int)position.zPos); + + if(worldObj instanceof WorldServer) + { + WorldServer worldServer = (WorldServer) worldObj; + ChunkProviderServer chunkProviderServer = worldServer.theChunkProviderServer; + IChunkProvider chunkProviderGenerate = chunkProviderServer.currentChunkProvider; + + Chunk newChunk = chunkProviderGenerate.provideChunk(oldChunk.xPosition, oldChunk.zPosition); + + for (int x = 0; x < 16; x++) + { + for (int z = 0; z < 16; z++) + { + for (int y = 0; y < worldObj.getHeight(); y++) + { + Block block = newChunk.getBlock(x, y, z); + int metadata = newChunk.getBlockMetadata(x, y, z); + + worldServer.setBlock(x + oldChunk.xPosition * 16, y, z + oldChunk.zPosition * 16, block, metadata, 2); + + TileEntity tileEntity = newChunk.getTileEntityUnsafe(x, y, z); + + if(tileEntity != null) + { + worldServer.setTileEntity(x + oldChunk.xPosition * 16, y, z + oldChunk.zPosition * 16, tileEntity); + } + } + } + } + + oldChunk.isTerrainPopulated = false; + chunkProviderGenerate.populate(chunkProviderGenerate, oldChunk.xPosition, oldChunk.zPosition); + } + } catch(Exception e) { + System.out.println("Rejuvenation Failed!"); + e.printStackTrace(); + } + } + } + + @Override + public long getEnergy() + { + return 0; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastRepulsive.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastRepulsive.java new file mode 100644 index 000000000..9118f6a49 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastRepulsive.java @@ -0,0 +1,223 @@ +package defense.common.explosive.blast; + +import java.util.ArrayList; +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import defense.common.DefenseUtils; + +public class BlastRepulsive extends Blast +{ + private int checkBanJing = 16; + protected float nengLiang = 10F; + + private List blownBlocks = new ArrayList(); + + /** 0- No push, 1 - Attract, 2 - Repel */ + private int pushType = 0; + private boolean destroyItem = false; + + public BlastRepulsive(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastRepulsive setPushType(int type) + { + this.pushType = type; + return this; + } + + public BlastRepulsive setDestroyItems() + { + this.destroyItem = true; + return this; + } + + @Override + public void doExplode() + { + if (!this.worldObj.isRemote) + { + for (int x = 0; x < this.checkBanJing; ++x) + { + for (int y = 0; y < this.checkBanJing; ++y) + { + for (int z = 0; z < this.checkBanJing; ++z) + { + if (x == 0 || x == this.checkBanJing - 1 || y == 0 || y == this.checkBanJing - 1 || z == 0 || z == this.checkBanJing - 1) + { + double xStep = x / (this.checkBanJing - 1.0F) * 2.0F - 1.0F; + double yStep = y / (this.checkBanJing - 1.0F) * 2.0F - 1.0F; + double zStep = z / (this.checkBanJing - 1.0F) * 2.0F - 1.0F; + double diagonalDistance = Math.sqrt(xStep * xStep + yStep * yStep + zStep * zStep); + xStep /= diagonalDistance; + yStep /= diagonalDistance; + zStep /= diagonalDistance; + float var14 = this.getRadius() * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + double var15 = this.position.xPos; + double var17 = this.position.yPos; + double var19 = this.position.zPos; + + for (float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * 0.75F) + { + int var22 = MathHelper.floor_double(var15); + int var23 = MathHelper.floor_double(var17); + int var24 = MathHelper.floor_double(var19); + Block block = this.worldObj.getBlock(var22, var23, var24); + + if (!worldObj.isAirBlock(var22, var23, var24)) + { + var14 -= (block.getExplosionResistance(this.exploder, this.worldObj, var22, var23, var24, (int)this.position.xPos, (int)this.position.yPos, (int)this.position.zPos) + 0.3F) * var21; + } + + if (var14 > 0.0F) + { + blownBlocks.add(new Pos3D(var22, var23, var24)); + } + + var15 += xStep * var21; + var17 += yStep * var21; + var19 += zStep * var21; + } + } + } + } + } + + } + + this.worldObj.playSoundEffect(this.position.xPos, this.position.yPos, this.position.zPos, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + + switch (this.pushType) + { + case 0: + this.doDamageEntities(this.getRadius(), nengLiang, this.destroyItem); + break; + default: + this.pushEntities(12, this.getRadius() * 4, this.pushType); + break; + } + + if(!this.worldObj.isRemote) + { + int var3; + Pos3D blownPosition; + int x; + int y; + int z; + Block block; + int metadata; + + for(var3 = blownBlocks.size() - 1; var3 >= 0; --var3) + { + blownPosition = blownBlocks.get(var3); + x = (int)blownPosition.xPos; + y = (int)blownPosition.yPos; + z = (int)blownPosition.zPos; + block = this.worldObj.getBlock(x, y, z); + metadata = this.worldObj.getBlockMetadata(x, y, z); + + double var9 = (x + this.worldObj.rand.nextFloat()); + double var11 = (y + this.worldObj.rand.nextFloat()); + double var13 = (z + this.worldObj.rand.nextFloat()); + double var151 = var9 - this.position.yPos; + double var171 = var11 - this.position.yPos; + double var191 = var13 - this.position.zPos; + double var211 = MathHelper.sqrt_double(var151 * var151 + var171 * var171 + var191 * var191); + var151 /= var211; + var171 /= var211; + var191 /= var211; + double var23 = 0.5D / (var211 / this.getRadius() + 0.1D); + var23 *= (this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); + var151 *= var23; + var171 *= var23; + var191 *= var23; + this.worldObj.spawnParticle("explode", (var9 + this.position.xPos * 1.0D) / 2.0D, (var11 + this.position.yPos * 1.0D) / 2.0D, (var13 + this.position.zPos * 1.0D) / 2.0D, var151, var171, var191); + this.worldObj.spawnParticle("smoke", var9, var11, var13, var151, var171, var191); + + if(!worldObj.isAirBlock(x, y, z) && DefenseUtils.canBreak(worldObj, block, x, y, z)) + { + try { + if(block.canDropFromExplosion(null)) + { + block.dropBlockAsItemWithChance(worldObj, x, y, z, worldObj.getBlockMetadata(x, y, z), 1F, 0); + } + + block.onBlockExploded(worldObj, x, y, z, this); + } catch(Exception e) { + e.printStackTrace(); + } + } + } + } + } + + public void pushEntities(float radius, float force, int type) + { + // Step 2: Damage all entities + Pos3D minCoord = position.clone(); + minCoord.translate(-radius - 1, -radius - 1, -radius - 1); + Pos3D maxCoord = position.clone(); + maxCoord.translate(radius + 1, radius + 1, radius + 1); + + AxisAlignedBB box = AxisAlignedBB.getBoundingBox(minCoord.xPos, minCoord.yPos, minCoord.zPos, maxCoord.xPos, maxCoord.yPos, maxCoord.zPos); + List entities = worldObj.getEntitiesWithinAABB(Entity.class, box); + + for (Entity entity : entities) + { + double var13 = entity.getDistance(position.xPos, position.yPos, position.zPos) / radius; + + if (var13 <= 1.0D) + { + double xDifference = entity.posX - position.xPos; + double yDifference = entity.posY - position.yPos; + double zDifference = entity.posZ - position.zPos; + double distance = MathHelper.sqrt_double(xDifference * xDifference + yDifference * yDifference + zDifference * zDifference); + xDifference /= distance; + yDifference /= distance; + zDifference /= distance; + + if (type == 1) + { + double modifier = var13 * force * (entity instanceof EntityPlayer ? 0.5 : 1); + entity.addVelocity(-xDifference * modifier, -yDifference * modifier, -zDifference * modifier); + } + else if (type == 2) + { + double modifier = (1.0D - var13) * force * (entity instanceof EntityPlayer ? 0.5 : 1); + entity.addVelocity(xDifference * modifier, yDifference * modifier, zDifference * modifier); + } + } + } + } + + @Override + public long getEnergy() + { + return 418000; + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.pushType = nbt.getInteger("pushType"); + this.destroyItem = nbt.getBoolean("destroyItem"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("pushType", this.pushType); + nbt.setBoolean("destroyItem", this.destroyItem); + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastRot.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastRot.java new file mode 100644 index 000000000..6a9aacf0c --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastRot.java @@ -0,0 +1,123 @@ +package defense.common.explosive.blast; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidRegistry; +import defense.common.DefenseTechBlocks; +import defense.common.DefenseUtils; +import defense.common.explosive.thread.ThreadLargeExplosion; + +/** Creates radiation spawning + * + * @author Calclavia */ +public class BlastRot extends Blast +{ + private ThreadLargeExplosion thread; + private float nengLiang; + + public BlastRot(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastRot(World world, Entity entity, double x, double y, double z, float size, float nengLiang) + { + this(world, entity, x, y, z, size); + this.nengLiang = nengLiang; + } + + @Override + public void doPreExplode() + { + if (!worldObj.isRemote) + { + this.thread = new ThreadLargeExplosion(worldObj, this.position, (int) this.getRadius(), this.nengLiang, this.exploder); + this.thread.start(); + } + } + + @Override + public void doExplode() + { + if (!worldObj.isRemote) + { + if (this.thread.isComplete) + { + for (Pos3D targetPosition : this.thread.results) + { + /** Decay the blocks. */ + Block block = new Coord4D((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos).getBlock(worldObj); + + if(!DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + continue; + } + + if (!worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)) + { + if (block == Blocks.grass || block == Blocks.sand) + { + if (worldObj.rand.nextFloat() > 0.96) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, DefenseTechBlocks.blockRadioactive); + } + } + + if (block == Blocks.stone) + { + if (worldObj.rand.nextFloat() > 0.99) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, DefenseTechBlocks.blockRadioactive); + } + } + + else if (block == Blocks.leaves) + { + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + else if (block == Blocks.grass) + { + if (Math.random() * 100 > 50) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, Blocks.cobblestone); + } + else + { + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + } + else if (block == Blocks.farmland) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, DefenseTechBlocks.blockRadioactive); + } + else if (block == Blocks.water || block == Blocks.flowing_water) + { + if (FluidRegistry.getFluid("toxicwaste") != null) + { + worldObj.setBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, FluidRegistry.getFluid("toxicwaste").getBlock()); + } + } + } + } + + this.controller.endExplosion(); + } + } + } + + @Override + public int proceduralInterval() + { + return 1; + } + + @Override + public long getEnergy() + { + return 100; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastShrapnel.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastShrapnel.java new file mode 100644 index 000000000..2d4a15a2b --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastShrapnel.java @@ -0,0 +1,71 @@ +package defense.common.explosive.blast; + +import defense.common.entity.EntityFragments; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class BlastShrapnel extends Blast +{ + private boolean isExplosive = false; + private boolean isAnvil = false; + + public BlastShrapnel(World world, Entity entity, double x, double y, double z, float size, boolean isFlaming, boolean isExplosive, boolean isAnvil) + { + this(world, entity, x, y, z, size); + this.isFlaming = isFlaming; + this.isExplosive = isExplosive; + this.isAnvil = isAnvil; + } + + public BlastShrapnel(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + @Override + public void doExplode() + { + if (!worldObj.isRemote) + { + float amountToRotate = 360 / this.getRadius(); + + for (int i = 0; i < this.getRadius(); i++) + { + // Try to do a 360 explosion on all 6 faces of the cube. + float rotationYaw = 0.0F + amountToRotate * i; + + for (int ii = 0; ii < this.getRadius(); ii++) + { + EntityFragments arrow = new EntityFragments(worldObj, position.xPos, position.yPos, position.zPos, this.isExplosive, this.isAnvil); + + if (this.isFlaming) + { + arrow.arrowCritical = true; + arrow.setFire(100); + } + + float rotationPitch = 0.0F + amountToRotate * ii; + arrow.setLocationAndAngles(position.xPos, position.yPos, position.zPos, rotationYaw, rotationPitch); + arrow.posX -= (MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * 0.16F); + arrow.posY -= 0.10000000149011612D; + arrow.posZ -= (MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * 0.16F); + arrow.setPosition(arrow.posX, arrow.posY, arrow.posZ); + arrow.yOffset = 0.0F; + arrow.motionX = (-MathHelper.sin(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI)); + arrow.motionZ = (MathHelper.cos(rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float) Math.PI)); + arrow.motionY = (-MathHelper.sin(rotationPitch / 180.0F * (float) Math.PI)); + arrow.setArrowHeading(arrow.motionX * worldObj.rand.nextFloat(), arrow.motionY * worldObj.rand.nextFloat(), arrow.motionZ * worldObj.rand.nextFloat(), 0.5f + (0.7f * worldObj.rand.nextFloat()), 1.0F); + worldObj.spawnEntityInWorld(arrow); + + } + } + } + } + + @Override + public long getEnergy() + { + return 1000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/blast/BlastSonic.java b/src/main/java/mekanism/defense/common/explosive/blast/BlastSonic.java new file mode 100644 index 000000000..177545d96 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/blast/BlastSonic.java @@ -0,0 +1,231 @@ +package defense.common.explosive.blast; + +import java.util.Iterator; +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidBlock; +import defense.common.DefenseTechBlocks; +import defense.common.DefenseUtils; +import defense.common.Reference; +import defense.common.block.BlockExplosive; +import defense.common.entity.EntityFlyingBlock; +import defense.common.entity.EntityMissile; +import defense.common.explosive.thread.ThreadLargeExplosion; +import defense.common.explosive.thread.ThreadLargeExplosion.IThreadCallBack; +import defense.common.tile.TileExplosive; + +public class BlastSonic extends Blast +{ + private float nengLiang; + private ThreadLargeExplosion thread; + private boolean hasShockWave = false;; + + public BlastSonic(World world, Entity entity, double x, double y, double z, float size) + { + super(world, entity, x, y, z, size); + } + + public BlastSonic(World world, Entity entity, double x, double y, double z, float size, float nengLiang) + { + this(world, entity, x, y, z, size); + this.nengLiang = nengLiang; + } + + public Blast setShockWave() + { + this.hasShockWave = true; + return this; + } + + @Override + public void doPreExplode() + { + if (!this.worldObj.isRemote) + { + if (this.hasShockWave) + { + for (int x = (int) (-this.getRadius() * 2); x < this.getRadius() * 2; ++x) + { + for (int y = (int) (-this.getRadius() * 2); y < this.getRadius() * 2; ++y) + { + for (int z = (int) (-this.getRadius() * 2); z < this.getRadius() * 2; ++z) + { + Pos3D targetPosition = position.clone().translate(new Pos3D(x, y, z)); + Block block = worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(!DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + continue; + } + + if (!worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)) + { + Material material = block.getMaterial(); + + if (block != Blocks.bedrock && !(block instanceof BlockLiquid) && (block.getExplosionResistance(this.exploder, worldObj, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, position.xPos, position.yPos, position.zPos) > this.nengLiang || material == Material.glass)) + { + worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + } + } + } + } + } + + this.thread = new ThreadLargeExplosion(worldObj, this.position, (int) this.getRadius(), this.nengLiang, this.exploder, new IThreadCallBack() + { + @Override + public float getResistance(World world, Pos3D explosionPosition, Pos3D targetPosition, Entity source, Block block) + { + float resistance = 0; + + if (block instanceof BlockLiquid || block instanceof IFluidBlock) + { + resistance = 1f; + } + else + { + resistance = block.getExplosionResistance(source, world, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, explosionPosition.xPos, explosionPosition.yPos, explosionPosition.zPos); + } + + return resistance; + } + + }); + this.thread.start(); + } + + if (this.hasShockWave) + { + this.worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "hypersonic", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + else + { + this.worldObj.playSoundEffect(position.xPos, position.yPos, position.zPos, Reference.PREFIX + "sonicwave", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + } + } + + @Override + public void doExplode() + { + int r = callCount; + + if(!worldObj.isRemote) + { + if(thread != null && thread.isComplete) + { + Iterator it = thread.results.iterator(); + + while(it.hasNext()) + { + Pos3D targetPosition = it.next(); + double distance = targetPosition.clone().distance(position); + + if (distance > r || distance < r - 3) + continue; + + Block block = this.worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if(!DefenseUtils.canBreak(worldObj, block, targetPosition.xPos, targetPosition.yPos, targetPosition.zPos)) + { + continue; + } + + if(worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos) || block == Blocks.bedrock || block == Blocks.obsidian) + { + continue; + } + + int metadata = this.worldObj.getBlockMetadata((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if (distance < r - 1 || this.worldObj.rand.nextInt(3) > 0) + { + if (block == DefenseTechBlocks.blockExplosive) + { + BlockExplosive.detonate(this.worldObj, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, ((TileExplosive) this.worldObj.getTileEntity((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)).explosiveID, 1); + } + else { + this.worldObj.setBlockToAir((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + } + + targetPosition.translate(0.5D, 0.5D, 0.5D); + + if (this.worldObj.rand.nextFloat() < 0.3 * (this.getRadius() - r)) + { + EntityFlyingBlock entity = new EntityFlyingBlock(this.worldObj, targetPosition, block, metadata); + this.worldObj.spawnEntityInWorld(entity); + entity.yawChange = 50 * this.worldObj.rand.nextFloat(); + entity.pitchChange = 100 * this.worldObj.rand.nextFloat(); + } + + it.remove(); + } + } + } + } + + int radius = 2 * this.callCount; + AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(position.xPos - radius, position.yPos - radius, position.zPos - radius, position.xPos + radius, position.yPos + radius, position.zPos + radius); + List allEntities = this.worldObj.getEntitiesWithinAABB(Entity.class, bounds); + + synchronized (allEntities) + { + for (Iterator it = allEntities.iterator(); it.hasNext();) + { + Entity entity = (Entity) it.next(); + + if (entity instanceof EntityMissile) + { + ((EntityMissile) entity).setExplode(); + break; + } + else { + double xDifference = entity.posX - position.xPos; + double zDifference = entity.posZ - position.zPos; + + r = (int) this.getRadius(); + if (xDifference < 0) + r = (int) -this.getRadius(); + + entity.motionX += (r - xDifference) * 0.02 * this.worldObj.rand.nextFloat(); + entity.motionY += 3 * this.worldObj.rand.nextFloat(); + + r = (int) this.getRadius(); + if (zDifference < 0) + r = (int) -this.getRadius(); + + entity.motionZ += (r - zDifference) * 0.02 * this.worldObj.rand.nextFloat(); + } + } + } + + if (this.callCount > this.getRadius()) + { + this.controller.endExplosion(); + } + + } + + /** The interval in ticks before the next procedural call of this explosive + * + * @return - Return -1 if this explosive does not need proceudral calls */ + @Override + public int proceduralInterval() + { + return 4; + } + + @Override + public long getEnergy() + { + return 3000; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/thread/ThreadExplosion.java b/src/main/java/mekanism/defense/common/explosive/thread/ThreadExplosion.java new file mode 100644 index 000000000..9f5dac623 --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/thread/ThreadExplosion.java @@ -0,0 +1,38 @@ +package defense.common.explosive.thread; + +import java.util.HashSet; + +import mekanism.api.Pos3D; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + +/** @author Calclavia */ +public abstract class ThreadExplosion extends Thread +{ + public final Pos3D position; + public World worldObj; + public int explosionRadius; + public float explosionEnergy; + public Entity explosionSource; + + public boolean isComplete = false; + + public final HashSet deltaSet = new HashSet(); + public final HashSet results = new HashSet(); + + public ThreadExplosion(World world, Pos3D pos, int radius, float energy, Entity source) + { + worldObj = world; + position = pos; + explosionRadius = radius; + explosionEnergy = energy; + explosionSource = source; + setPriority(Thread.MIN_PRIORITY); + } + + @Override + public void run() + { + isComplete = true; + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/thread/ThreadLargeExplosion.java b/src/main/java/mekanism/defense/common/explosive/thread/ThreadLargeExplosion.java new file mode 100644 index 000000000..5ef18bffa --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/thread/ThreadLargeExplosion.java @@ -0,0 +1,95 @@ +package defense.common.explosive.thread; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidBlock; + +/** Used for large raycasting explosions. + * + * @author Calclavia */ +public class ThreadLargeExplosion extends ThreadExplosion +{ + public static interface IThreadCallBack + { + public float getResistance(World world, Pos3D position, Pos3D targetPosition, Entity source, Block block); + } + + public IThreadCallBack callBack; + + public ThreadLargeExplosion(World world, Pos3D position, int range, float energy, Entity source, IThreadCallBack cb) + { + super(world, position, range, energy, source); + callBack = cb; + } + + public ThreadLargeExplosion(World world, Pos3D position, int range, float energy, Entity source) + { + this(world, position, range, energy, source, new IThreadCallBack() { + @Override + public float getResistance(World world, Pos3D pos, Pos3D targetPosition, Entity source, Block block) + { + float resistance = 0; + + if(block instanceof BlockLiquid || block instanceof IFluidBlock) + { + resistance = 0.25f; + } + else { + resistance = block.getExplosionResistance(source, world, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, pos.xPos, pos.yPos, pos.zPos); + } + + return resistance; + } + }); + } + + @Override + public void run() + { + int steps = (int)Math.ceil(Math.PI / Math.atan(1.0D / explosionRadius)); + + for(int phi_n = 0; phi_n < 2 * steps; phi_n++) + { + for(int theta_n = 0; theta_n < steps; theta_n++) + { + double phi = Math.PI * 2 / steps * phi_n; + double theta = Math.PI / steps * theta_n; + + Pos3D delta = new Pos3D(Math.sin(theta) * Math.cos(phi), Math.cos(theta), Math.sin(theta) * Math.sin(phi)); + float power = explosionEnergy - (explosionEnergy * worldObj.rand.nextFloat() / 2); + + Pos3D t = position.clone(); + + for(float d = 0.3F; power > 0f; power -= d * 0.75F * 10) + { + if(t.distance(position) > explosionRadius) + { + break; + } + + Block block = worldObj.getBlock((int)t.xPos, (int)t.yPos, (int)t.zPos); + + if(!worldObj.isAirBlock((int)t.xPos, (int)t.yPos, (int)t.zPos)) + { + if(block.getBlockHardness(worldObj, (int)t.xPos, (int)t.yPos, (int)t.zPos) >= 0) + { + power -= callBack.getResistance(worldObj, position, t, explosionSource, block); + + if(power > 0f) + { + results.add(t.clone()); + } + } + } + + t.translate(delta); + } + } + } + + super.run(); + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/thread/ThreadSky.java b/src/main/java/mekanism/defense/common/explosive/thread/ThreadSky.java new file mode 100644 index 000000000..911d8399b --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/thread/ThreadSky.java @@ -0,0 +1,104 @@ +package defense.common.explosive.thread; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraftforge.fluids.IFluidBlock; + +/** Used for searching block spawn. Returns a block above this found block coordinate. + * + * @author Calclavia */ +public class ThreadSky extends ThreadExplosion +{ + public static interface IThreadCallBack + { + public float getResistance(World world, Pos3D position, Pos3D targetPosition, Entity source, Block block); + } + + public IThreadCallBack callBack; + + public ThreadSky(World world, Pos3D position, int banJing, float nengLiang, Entity source, IThreadCallBack callBack) + { + super(world, position, banJing, nengLiang, source); + this.callBack = callBack; + } + + public ThreadSky(World world, Pos3D position, int banJing, float nengLiang, Entity source) + { + this(world, position, banJing, nengLiang, source, new IThreadCallBack() + { + + @Override + public float getResistance(World world, Pos3D explosionPosition, Pos3D targetPosition, Entity source, Block block) + { + float resistance = 0; + + if (block instanceof BlockLiquid || block instanceof IFluidBlock) + { + resistance = 0.25f; + } + else + { + resistance = block.getExplosionResistance(source, world, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, explosionPosition.xPos, explosionPosition.yPos, explosionPosition.zPos); + } + + return resistance; + } + + }); + } + + @Override + public void run() + { + int steps = (int) Math.ceil(Math.PI / Math.atan(1.0D / this.explosionRadius)); + + for (int phi_n = 0; phi_n < 2 * steps; phi_n++) + { + for (int theta_n = 0; theta_n < steps; theta_n++) + { + double phi = Math.PI * 2 / steps * phi_n; + double theta = Math.PI / steps * theta_n; + + Pos3D delta = new Pos3D(Math.sin(theta) * Math.cos(phi), Math.cos(theta), Math.sin(theta) * Math.sin(phi)); + float power = this.explosionEnergy - (this.explosionEnergy * this.worldObj.rand.nextFloat() / 2); + + Pos3D targetPosition = this.position.clone(); + + for (float var21 = 0.3F; power > 0f; power -= var21 * 0.75F * 10) + { + if (targetPosition.distance(position) > this.explosionRadius) + break; + + Block block = this.worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if (!worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)) + { + if (block == Blocks.bedrock) + { + break; + } + + float resistance = this.callBack.getResistance(this.worldObj, position, targetPosition, explosionSource, block); + + power -= resistance; + + if (power > 0f) + { + this.results.add(targetPosition.clone().translate(new Pos3D(0, 1, 0))); + } + } + + targetPosition.xPos += delta.xPos; + targetPosition.yPos += delta.yPos; + targetPosition.zPos += delta.zPos; + } + } + } + + super.run(); + } +} diff --git a/src/main/java/mekanism/defense/common/explosive/thread/ThreadSmallExplosion.java b/src/main/java/mekanism/defense/common/explosive/thread/ThreadSmallExplosion.java new file mode 100644 index 000000000..6384275ec --- /dev/null +++ b/src/main/java/mekanism/defense/common/explosive/thread/ThreadSmallExplosion.java @@ -0,0 +1,84 @@ +package defense.common.explosive.thread; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + +/** Used for small explosions. + * + * @author Calclavia */ +public class ThreadSmallExplosion extends ThreadExplosion +{ + public ThreadSmallExplosion(World world, Pos3D position, int banJing, Entity source) + { + super(world, position, banJing, 0, source); + } + + @Override + public void run() + { + if (!worldObj.isRemote) + { + for (int x = 0; x < this.explosionRadius; ++x) + { + for (int y = 0; y < this.explosionRadius; ++y) + { + for (int z = 0; z < this.explosionRadius; ++z) + { + if (x == 0 || x == this.explosionRadius - 1 || y == 0 || y == this.explosionRadius - 1 || z == 0 || z == this.explosionRadius - 1) + { + double xStep = x / (this.explosionRadius - 1.0F) * 2.0F - 1.0F; + double yStep = y / (this.explosionRadius - 1.0F) * 2.0F - 1.0F; + double zStep = z / (this.explosionRadius - 1.0F) * 2.0F - 1.0F; + double diagonalDistance = Math.sqrt(xStep * xStep + yStep * yStep + zStep * zStep); + xStep /= diagonalDistance; + yStep /= diagonalDistance; + zStep /= diagonalDistance; + float power = this.explosionRadius * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + double var15 = position.xPos; + double var17 = position.yPos; + double var19 = position.zPos; + + for (float var21 = 0.3F; power > 0.0F; power -= var21 * 0.75F) + { + Pos3D targetPosition = new Pos3D(var15, var17, var19); + double distanceFromCenter = position.distance(targetPosition); + Block block = this.worldObj.getBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos); + + if (!worldObj.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)) + { + float resistance = 0; + + if (block == Blocks.bedrock) + { + break; + } + else + { + resistance = block.getExplosionResistance(this.explosionSource, this.worldObj, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, position.xPos, position.yPos, position.zPos); + } + // TODO rather than remove power divert a percentage to the + // sides, and then calculate how much is absorbed by the block + power -= resistance; + } + + if (power > 0.0F) + { + this.results.add(targetPosition.clone()); + } + + var15 += xStep * var21; + var17 += yStep * var21; + var19 += zStep * var21; + } + } + } + } + } + } + + super.run(); + } +} diff --git a/src/main/java/mekanism/defense/common/inventory/container/ContainerBase.java b/src/main/java/mekanism/defense/common/inventory/container/ContainerBase.java new file mode 100644 index 000000000..9b60ea435 --- /dev/null +++ b/src/main/java/mekanism/defense/common/inventory/container/ContainerBase.java @@ -0,0 +1,115 @@ +package defense.common.inventory.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerBase extends Container +{ + protected int slotCount = 0; + protected int xInventoryDisplacement = 8; + protected int yInventoryDisplacement = 135; + protected int yHotBarDisplacement = 193; + private IInventory inventory; + + public ContainerBase(IInventory inventory) + { + this.inventory = inventory; + this.slotCount = inventory.getSizeInventory(); + } + + public void addPlayerInventory(EntityPlayer player) + { + for(int y = 0; y < 3; y++) + { + for(int x = 0; x < 9; x++) + { + addSlotToContainer(new Slot(player.inventory, x + y * 9 + 9, this.xInventoryDisplacement + x * 18, this.yInventoryDisplacement + y * 18)); + } + } + + for(int x = 0; x < 9; x++) + { + addSlotToContainer(new Slot(player.inventory, x, this.xInventoryDisplacement + x * 18, this.yHotBarDisplacement)); + } + } + + /** Called to transfer a stack from one inventory to the other eg. when shift clicking. */ + @Override + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slotID) + { + ItemStack var2 = null; + + Slot var3 = (Slot) this.inventorySlots.get(slotID); + + if (var3 != null && var3.getHasStack()) + { + ItemStack itemStack = var3.getStack(); + var2 = itemStack.copy(); + + // A slot ID greater than the slot count means it is inside the TileEntity GUI. + if (slotID >= this.slotCount) + { + // Player Inventory, Try to place into slot. + boolean didTry = false; + + for (int i = 0; i < this.slotCount; i++) + { + if (this.getSlot(i).isItemValid(itemStack)) + { + didTry = true; + + if (this.mergeItemStack(itemStack, i, i + 1, false)) + { + break; + } + } + } + + if (!didTry) + { + if (slotID < 27 + this.slotCount) + { + if (!this.mergeItemStack(itemStack, 27 + this.slotCount, 36 + this.slotCount, false)) + { + return null; + } + } + else if (slotID >= 27 + this.slotCount && slotID < 36 + this.slotCount && !this.mergeItemStack(itemStack, slotCount, 27 + slotCount, false)) + { + return null; + } + } + } + else if(!mergeItemStack(itemStack, this.slotCount, 36 + this.slotCount, false)) + { + return null; + } + + if(itemStack.stackSize == 0) + { + var3.putStack((ItemStack) null); + } + else { + var3.onSlotChanged(); + } + + if(itemStack.stackSize == var2.stackSize) + { + return null; + } + + var3.onPickupFromSlot(par1EntityPlayer, itemStack); + } + + return var2; + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) + { + return inventory.isUseableByPlayer(entityplayer); + } +} diff --git a/src/main/java/mekanism/defense/common/inventory/container/ContainerCruiseLauncher.java b/src/main/java/mekanism/defense/common/inventory/container/ContainerCruiseLauncher.java new file mode 100644 index 000000000..4821ecf6b --- /dev/null +++ b/src/main/java/mekanism/defense/common/inventory/container/ContainerCruiseLauncher.java @@ -0,0 +1,110 @@ +package defense.common.inventory.container; + +import defense.common.item.ItemMissile; +import defense.common.tile.TileCruiseLauncher; +import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge; +import mekanism.common.inventory.slot.SlotSpecific; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerCruiseLauncher extends Container +{ + private TileCruiseLauncher tileEntity; + + public ContainerCruiseLauncher(InventoryPlayer inventoryPlayer, TileCruiseLauncher tileEntity) + { + this.tileEntity = tileEntity; + // Missile Slot + this.addSlotToContainer(new SlotSpecific(tileEntity, 0, 151, 23, ItemMissile.class)); + // Battery Slot + this.addSlotToContainer(new SlotDischarge(tileEntity, 1, 151, 47)); + + int var3; + + for (var3 = 0; var3 < 3; ++var3) + { + for (int var4 = 0; var4 < 9; ++var4) + { + this.addSlotToContainer(new Slot(inventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + + for (var3 = 0; var3 < 9; ++var3) + { + this.addSlotToContainer(new Slot(inventoryPlayer, var3, 8 + var3 * 18, 142)); + } + + tileEntity.playersUsing.add(inventoryPlayer.player); + + } + + @Override + public void onContainerClosed(EntityPlayer player) + { + tileEntity.playersUsing.remove(player); + super.onContainerClosed(player); + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { + return this.tileEntity.isUseableByPlayer(player); + } + + /** Called to transfer a stack from one inventory to the other eg. when shift clicking. */ + @Override + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) + { + ItemStack var2 = null; + Slot var3 = (Slot) this.inventorySlots.get(par1); + + if (var3 != null && var3.getHasStack()) + { + ItemStack var4 = var3.getStack(); + var2 = var4.copy(); + + if (par1 > 1) + { + if (this.getSlot(0).isItemValid(var4)) + { + if (!this.mergeItemStack(var4, 0, 1, false)) + { + return null; + } + } + else if (this.getSlot(1).isItemValid(var4)) + { + if (!this.mergeItemStack(var4, 1, 2, false)) + { + return null; + } + } + } + else if (!this.mergeItemStack(var4, 2, 36 + 2, false)) + { + return null; + } + + if (var4.stackSize == 0) + { + var3.putStack((ItemStack) null); + } + else + { + var3.onSlotChanged(); + } + + if (var4.stackSize == var2.stackSize) + { + return null; + } + + var3.onPickupFromSlot(par1EntityPlayer, var4); + } + + return var2; + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemAntidote.java b/src/main/java/mekanism/defense/common/item/ItemAntidote.java new file mode 100644 index 000000000..fba162891 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemAntidote.java @@ -0,0 +1,61 @@ +package defense.common.item; + +import defense.common.Reference; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class ItemAntidote extends ItemBase +{ + public ItemAntidote() + { + super("antidote"); + } + + @Override + public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + par1ItemStack.stackSize--; + + if (!par2World.isRemote) + { + par3EntityPlayer.clearActivePotions(); + } + + return par1ItemStack; + } + + /** How long it takes to use or consume an item */ + @Override + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 32; + } + + /** returns the action that specifies what animation to play when the items is being used */ + @Override + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.eat; + } + + @Override + public void registerIcons(IIconRegister iconRegister) + { + super.registerIcons(iconRegister); + + // Icon for base item. + this.itemIcon = iconRegister.registerIcon(Reference.PREFIX + "antidote"); + } + + /** Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, + * world, entityPlayer */ + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + return par1ItemStack; + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemBase.java b/src/main/java/mekanism/defense/common/item/ItemBase.java new file mode 100644 index 000000000..14f6701a0 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemBase.java @@ -0,0 +1,19 @@ +package defense.common.item; + +import defense.common.CreativeTabHandler; +import defense.common.Reference; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; + +/** Prefab that sets the creative tab, texture name, and translation name + * + * @author DarkGuardsman */ +public class ItemBase extends Item +{ + public ItemBase(String name) + { + this.setUnlocalizedName(name); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + name); + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemBlockExplosive.java b/src/main/java/mekanism/defense/common/item/ItemBlockExplosive.java new file mode 100644 index 000000000..e0592d40f --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemBlockExplosive.java @@ -0,0 +1,34 @@ +package defense.common.item; + +import defense.common.explosive.ExplosiveRegistry; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; + +public class ItemBlockExplosive extends ItemBlock +{ + public ItemBlockExplosive(Block block) + { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + return this.getUnlocalizedName() + "." + ExplosiveRegistry.get(itemstack.getItemDamage()).getUnlocalizedName(); + } + + @Override + public String getUnlocalizedName() + { + return "explosive"; + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemBlockMachine.java b/src/main/java/mekanism/defense/common/item/ItemBlockMachine.java new file mode 100644 index 000000000..a53d39fa7 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemBlockMachine.java @@ -0,0 +1,110 @@ +package defense.common.item; + +import mekanism.common.Tier.BaseTier; +import mekanism.common.base.ITierItem; +import mekanism.common.tile.TileEntityBasicBlock; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import defense.api.ITier; +import defense.common.block.BlockMachine; +import defense.common.block.BlockMachine.MachineData; + +public class ItemBlockMachine extends ItemBlock implements ITierItem +{ + public ItemBlockMachine(Block block) + { + super(block); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + MachineData type = MachineData.get(itemstack.getItemDamage()); + + if(type == null) + { + return "error"; + } + + String name = getUnlocalizedName() + "." + type.unlocalized; + + if(type.hasTier) + { + name += "." + getBaseTier(itemstack).ordinal(); + } + + return name; + } + + @Override + public String getUnlocalizedName() + { + return "machine"; + } + + @Override + public BaseTier getBaseTier(ItemStack itemstack) + { + if(itemstack.stackTagCompound == null) + { + return BaseTier.BASIC; + } + + return BaseTier.values()[itemstack.stackTagCompound.getInteger("tier")]; + } + + @Override + public void setBaseTier(ItemStack itemstack, BaseTier tier) + { + if(itemstack.stackTagCompound == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + itemstack.stackTagCompound.setInteger("tier", tier.ordinal()); + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + int change = 3; + int direction = MathHelper.floor_double((player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + + switch(direction) + { + case 0: change = 2; break; + case 1: change = 5; break; + case 2: change = 3; break; + case 3: change = 4; break; + } + + boolean place = BlockMachine.canBePlacedAt(world, x, y, z, metadata, change); + + if(place && super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata)) + { + TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(x, y, z); + + if(tileEntity instanceof ITier) + { + ((ITier)tileEntity).setTier(getBaseTier(stack).ordinal()); + } + + return true; + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemBombCart.java b/src/main/java/mekanism/defense/common/item/ItemBombCart.java new file mode 100644 index 000000000..c7ccd8706 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemBombCart.java @@ -0,0 +1,84 @@ +package defense.common.item; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockRailBase; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.entity.EntityBombCart; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; + +public class ItemBombCart extends ItemBase +{ + public ItemBombCart() + { + super("minecart"); + this.setMaxStackSize(1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + /** Callback for item usage. If the item does something special on right clicking, he will have + * one of those. Return True if something happen and false if it don't. This is for ITEMS, not + * BLOCKS */ + @Override + public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int par7, float par8, float par9, float par10) + { + Block var11 = world.getBlock(x, y, z); + + if (BlockRailBase.func_150051_a(var11)) + { + if (!world.isRemote) + { + world.spawnEntityInWorld(new EntityBombCart(world, x + 0.5F, y + 0.5F, z + 0.5F, itemStack.getItemDamage())); + } + + --itemStack.stackSize; + return true; + } + else + { + return false; + } + } + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) + { + this.itemIcon = iconRegister.registerIcon("minecart_tnt"); + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + return "minecart." + ExplosiveRegistry.get(itemstack.getItemDamage()).getUnlocalizedName(); + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (Explosive zhaPin : ExplosiveRegistry.getExplosives()) + { + if (zhaPin.hasMinecartForm()) + { + par3List.add(new ItemStack(par1, 1, zhaPin.getID())); + + } + } + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemDefuser.java b/src/main/java/mekanism/defense/common/item/ItemDefuser.java new file mode 100644 index 000000000..2caf182f6 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemDefuser.java @@ -0,0 +1,102 @@ +package defense.common.item; + +import java.util.Random; + +import mekanism.api.EnumColor; +import mekanism.common.item.ItemEnergized; +import mekanism.common.util.LangUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityTNTPrimed; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.DamageSource; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.CreativeTabHandler; +import defense.common.DefenseTechBlocks; +import defense.common.Reference; +import defense.common.entity.EntityBombCart; +import defense.common.entity.EntityExplosive; + +//Explosive Defuser +public class ItemDefuser extends ItemEnergized +{ + private static final int ENERGY_USAGE = 2000; + + public ItemDefuser() + { + super(100000); + + this.setUnlocalizedName("defuser"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "defuser"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) + { + itemIcon = reg.registerIcon(getIconString()); + } + + /** Called when the player Left Clicks (attacks) an entity. Processed before damage is done, if + * return value is true further processing is canceled and the entity is not attacked. + * + * @param itemStack The Item being used + * @param player The player that is attacking + * @param entity The entity being attacked + * @return True to cancel the rest of the interaction. */ + @Override + public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer player, Entity entity) + { + if (this.getEnergy(itemStack) >= ENERGY_USAGE) + { + if (entity instanceof EntityExplosive) + { + if (!entity.worldObj.isRemote) + { + EntityExplosive entityTNT = (EntityExplosive) entity; + EntityItem entityItem = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, new ItemStack(DefenseTechBlocks.blockExplosive, 1, entityTNT.explosiveID)); + float var13 = 0.05F; + Random random = new Random(); + entityItem.motionX = ((float) random.nextGaussian() * var13); + entityItem.motionY = ((float) random.nextGaussian() * var13 + 0.2F); + entityItem.motionZ = ((float) random.nextGaussian() * var13); + entity.worldObj.spawnEntityInWorld(entityItem); + } + entity.setDead(); + } + else if (entity instanceof EntityTNTPrimed) + { + if (!entity.worldObj.isRemote) + { + EntityItem entityItem = new EntityItem(entity.worldObj, entity.posX, entity.posY, entity.posZ, new ItemStack(Blocks.tnt)); + float var13 = 0.05F; + Random random = new Random(); + entityItem.motionX = ((float) random.nextGaussian() * var13); + entityItem.motionY = ((float) random.nextGaussian() * var13 + 0.2F); + entityItem.motionZ = ((float) random.nextGaussian() * var13); + entity.worldObj.spawnEntityInWorld(entityItem); + } + entity.setDead(); + } + else if (entity instanceof EntityBombCart) + { + ((EntityBombCart) entity).killMinecart(DamageSource.generic); + } + + this.setEnergy(itemStack, this.getEnergy(itemStack) - ENERGY_USAGE); + return true; + } + else + { + player.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.defuser.nopower"))); + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemGrenade.java b/src/main/java/mekanism/defense/common/item/ItemGrenade.java new file mode 100644 index 000000000..960ca177a --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemGrenade.java @@ -0,0 +1,152 @@ +package defense.common.item; + +import java.util.List; + +import mekanism.common.util.LangUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.common.Reference; +import defense.common.entity.EntityGrenade; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; + +public class ItemGrenade extends ItemBase +{ + public static final IIcon[] ICONS = new IIcon[256]; + + public ItemGrenade() + { + super("grenade"); + this.setMaxStackSize(16); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + + @Override + public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + return par1ItemStack; + } + + @Override + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.bow; + } + + @Override + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 3 * 20; + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) + { + if(itemStack != null) + { + entityPlayer.setItemInUse(itemStack, getMaxItemUseDuration(itemStack)); + } + + return itemStack; + } + + @Override + public void onPlayerStoppedUsing(ItemStack itemStack, World world, EntityPlayer entityPlayer, int nengLiang) + { + if(!world.isRemote) + { + Explosive explosive = ExplosiveRegistry.get(itemStack.getItemDamage()); + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(world, entityPlayer, ExplosiveType.ITEM, explosive); + MinecraftForge.EVENT_BUS.post(evt); + + if(!evt.isCanceled()) + { + if(!entityPlayer.capabilities.isCreativeMode) + { + itemStack.stackSize--; + + if(itemStack.stackSize <= 0) + { + entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, null); + } + } + + world.playSoundAtEntity(entityPlayer, "game.tnt.primed", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + world.spawnEntityInWorld(new EntityGrenade(world, entityPlayer, explosive.getID(), (float)(getMaxItemUseDuration(itemStack) - nengLiang) / (float)getMaxItemUseDuration(itemStack))); + } + else { + entityPlayer.addChatMessage(new ChatComponentText("Grenades are banned in this region.")); + } + } + } + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @Override + public String getUnlocalizedName(ItemStack itemstack) + { + return getUnlocalizedName() + "." + ExplosiveRegistry.get(itemstack.getItemDamage()).getUnlocalizedName(); + } + + @Override + public String getUnlocalizedName() + { + return "grenade"; + } + + @Override + public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + int explosiveTier = ExplosiveRegistry.get(par1ItemStack.getItemDamage()).getTier(); + par3List.add(LangUtils.localize("info.misc.tier") + ": " + explosiveTier); + super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister iconRegister) + { + for(int i = 0; i < ExplosiveRegistry.getExplosives().size(); i++) + { + if(ExplosiveRegistry.get(i).hasGrenadeForm()) + { + ICONS[i] = iconRegister.registerIcon(Reference.PREFIX + "grenade_" + ExplosiveRegistry.get(i).getUnlocalizedName()); + } + } + } + + @Override + public IIcon getIconFromDamage(int i) + { + return ICONS[i]; + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + for(Explosive explosive : ExplosiveRegistry.getExplosives()) + { + if(explosive.hasGrenadeForm()) + { + par3List.add(new ItemStack(par1, 1, explosive.getID())); + } + } + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemLaserDesignator.java b/src/main/java/mekanism/defense/common/item/ItemLaserDesignator.java new file mode 100644 index 000000000..dc2e59c01 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemLaserDesignator.java @@ -0,0 +1,382 @@ +package defense.common.item; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.List; + +import mekanism.api.Coord4D; +import mekanism.api.EnumColor; +import mekanism.api.Pos3D; +import mekanism.common.Mekanism; +import mekanism.common.item.ItemEnergized; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.util.LangUtils; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.FrequencyGrid; +import defense.api.IBlockFrequency; +import defense.api.IItemFrequency; +import defense.common.CreativeTabHandler; +import defense.common.DefenseTech; +import defense.common.DefenseTechBlocks; +import defense.common.DefenseTechItems; +import defense.common.Reference; +import defense.common.Settings; +import defense.common.base.IItemPacket; +import defense.common.entity.EntityLightBeam; +import defense.common.network.PacketItem.ItemMessage; +import defense.common.tile.TileLauncherPrefab; +import defense.common.tile.TileLauncherScreen; + +public class ItemLaserDesignator extends ItemEnergized implements IItemFrequency, IItemPacket +{ + public static final int YONG_DIAN_LIANG = 8000; + + public ItemLaserDesignator() + { + super(100000); + + this.setUnlocalizedName("laserDesignator"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "laserDesignator"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) + { + itemIcon = reg.registerIcon(getIconString()); + } + + /** Allows items to add custom lines of information to the mouseover description */ + @Override + public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + super.addInformation(itemStack, par2EntityPlayer, par3List, par4); + + if (this.getFrequency(itemStack) > 0) + { + par3List.add(LangUtils.localize("info.misc.freq") + " " + getFrequency(itemStack)); + } + else + { + par3List.add(LangUtils.localize("info.designator.noFreq")); + } + } + + @Override + public int getFrequency(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + return 0; + } + return itemStack.stackTagCompound.getInteger("frequency"); + } + + @Override + public void setFrequency(int frequency, ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.stackTagCompound.setInteger("frequency", frequency); + } + + public int getLauncherCountDown(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + return -1; + } + + return par1ItemStack.stackTagCompound.getInteger("countDown"); + } + + public void setLauncherCountDown(ItemStack par1ItemStack, int value) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("countDown", value); + } + + public int getLauncherCount(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + return 0; + } + return par1ItemStack.stackTagCompound.getInteger("launcherCount"); + } + + public void setLauncherCount(ItemStack par1ItemStack, int value) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("launcherCount", value); + } + + public int getLauncherDelay(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + return 0; + } + return par1ItemStack.stackTagCompound.getInteger("launcherDelay"); + } + + public void setLauncherDelay(ItemStack par1ItemStack, int value) + { + if (par1ItemStack.stackTagCompound == null) + { + par1ItemStack.setTagCompound(new NBTTagCompound()); + } + + par1ItemStack.stackTagCompound.setInteger("launcherDelay", value); + } + + /** Called each tick as long the item is on a player inventory. Uses by maps to check if is on a + * player hand and update it's contents. */ + @Override + public void onUpdate(ItemStack itemStack, World world, Entity par3Entity, int par4, boolean par5) + { + super.onUpdate(itemStack, world, par3Entity, par4, par5); + + if (!world.isRemote) + { + List connectedLaunchers = new ArrayList(); + + if (this.getLauncherCountDown(itemStack) > 0 || this.getLauncherCount(itemStack) > 0) + { + Pos3D position = new Pos3D(par3Entity.posX, par3Entity.posY, par3Entity.posZ); + + for (IBlockFrequency blockFrequency : FrequencyGrid.instance().get(world, position, Settings.MAX_MISSILE_DISTANCE, this.getFrequency(itemStack))) + { + if (blockFrequency instanceof TileLauncherPrefab) + { + // Do airstrike! + TileLauncherPrefab missileLauncher = (TileLauncherPrefab) blockFrequency; + + if (missileLauncher.canLaunch()) + { + connectedLaunchers.add(missileLauncher); + } + } + } + } + + if (this.getLauncherCountDown(itemStack) > 0 && connectedLaunchers.size() > 0) + { + if (this.getLauncherCountDown(itemStack) % 20 == 0) + { + ((EntityPlayer) par3Entity).addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.callTime") + " " + (int) Math.floor(this.getLauncherCountDown(itemStack) / 20))); + } + + if (this.getLauncherCountDown(itemStack) == 1) + { + this.setLauncherCount(itemStack, connectedLaunchers.size()); + this.setLauncherDelay(itemStack, 0); + ((EntityPlayer) par3Entity).addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.blast"))); + } + + this.setLauncherCountDown(itemStack, this.getLauncherCountDown(itemStack) - 1); + } + + if (this.getLauncherCount(itemStack) > 0 && this.getLauncherCount(itemStack) <= connectedLaunchers.size() && connectedLaunchers.size() > 0) + { + // Launch a missile every two seconds from different launchers + if (this.getLauncherDelay(itemStack) % 40 == 0) + { + System.out.println(connectedLaunchers.get(this.getLauncherCount(itemStack) - 1).getTarget()); + connectedLaunchers.get(this.getLauncherCount(itemStack) - 1).launch(); + this.setLauncherCount(itemStack, this.getLauncherCount(itemStack) - 1); + } + + if (this.getLauncherCount(itemStack) == 0) + { + this.setLauncherDelay(itemStack, 0); + connectedLaunchers.clear(); + } + + this.setLauncherDelay(itemStack, this.getLauncherDelay(itemStack) + 1); + } + } + } + + /** Callback for item usage. If the item does something special on right clicking, he will have + * one of those. Return True if something happen and false if it don't. This is for ITEMS, not + * BLOCKS ! */ + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10) + { + if(!par3World.isRemote) + { + // SET FREQUENCY OF REMOTE + TileEntity tileEntity = par3World.getTileEntity(x, y, z); + + if(tileEntity != null) + { + if(tileEntity instanceof TileLauncherPrefab) + { + TileLauncherPrefab missileLauncher = (TileLauncherPrefab)tileEntity; + + if(missileLauncher.getFrequency() > 0) + { + setFrequency(missileLauncher.getFrequency(), par1ItemStack); + par2EntityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.setFreq") + " " + EnumColor.DARK_GREY + getFrequency(par1ItemStack))); + } + else { + par2EntityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.failFreq"))); + } + } + } + } + + return false; + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + if(world.isRemote) + { + MovingObjectPosition objectMouseOver = player.rayTrace(Settings.MAX_MISSILE_DISTANCE * 2, 1); + + if(objectMouseOver != null && objectMouseOver.typeOfHit == MovingObjectType.BLOCK) + { + Block block = world.getBlock(objectMouseOver.blockX, objectMouseOver.blockY, objectMouseOver.blockZ); + int blockMetadata = world.getBlockMetadata(objectMouseOver.blockX, objectMouseOver.blockY, objectMouseOver.blockZ); + + if(getLauncherCountDown(stack) > 0) + { + return stack; + } + + /* + * Prevents calling air strike if the user is trying to set the frequency of the + * remote. + */ + if(block == DefenseTechBlocks.blockMachine) + { + return stack; + } + else { + int airStrikeFreq = this.getFrequency(stack); + + // Check if it is possible to do an air strike. + if(airStrikeFreq > 0) + { + if(getEnergy(stack) >= YONG_DIAN_LIANG) + { + Pos3D position = new Pos3D(player.posX, player.posY, player.posZ); + + boolean doAirStrike = false; + int errorCount = 0; + + for(IBlockFrequency blockFrequency : FrequencyGrid.instance().get(world, position, Settings.MAX_MISSILE_DISTANCE, airStrikeFreq)) + { + if(blockFrequency instanceof TileLauncherPrefab) + { + // Do airstrike! + TileLauncherPrefab missileLauncher = (TileLauncherPrefab)blockFrequency; + + double yHit = objectMouseOver.blockY; + + if(missileLauncher instanceof TileLauncherScreen) + { + if(missileLauncher.getTarget() != null) + { + yHit = missileLauncher.getTarget().yPos; + } + else { + yHit = 0; + } + } + + missileLauncher.setTarget(new Pos3D(objectMouseOver.blockX, yHit, objectMouseOver.blockZ)); + + ArrayList data = new ArrayList(); + + data.add(2); + data.add((int)missileLauncher.getTarget().xPos); + data.add((int)missileLauncher.getTarget().yPos); + data.add((int)missileLauncher.getTarget().zPos); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(missileLauncher), data)); + + if(missileLauncher.canLaunch()) + { + doAirStrike = true; + } + else { + errorCount++; + player.addChatMessage(new ChatComponentText("#" + errorCount + " Missile Launcher Error: " + missileLauncher.getStatus())); + } + } + } + + if(doAirStrike && this.getLauncherCountDown(stack) >= 0) + { + ArrayList data = new ArrayList(); + + data.add(objectMouseOver.blockX); + data.add(objectMouseOver.blockY); + data.add(objectMouseOver.blockZ); + + DefenseTech.netHandler.sendToServer(new ItemMessage(data)); + player.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.callBlast"))); + } + } + else { + player.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.nopower"))); + } + } + else { + player.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.designator.noFreq"))); + } + } + } + } + + return stack; + } + + @Override + public void handlePacket(EntityPlayer player, ByteBuf data) + { + ItemStack itemStack = (ItemStack)player.getCurrentEquippedItem(); + Pos3D position = new Pos3D(data.readInt(), data.readInt(), data.readInt()); + + ((ItemLaserDesignator)DefenseTechItems.itemLaserDesignator).setLauncherCountDown(itemStack, 119); + + player.worldObj.playSoundEffect(position.xPos, player.worldObj.getHeightValue((int)position.yPos, (int)position.zPos), position.zPos, Reference.PREFIX + "airstrike", 5.0F, (1.0F + (player.worldObj.rand.nextFloat() - player.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); + player.worldObj.spawnEntityInWorld(new EntityLightBeam(player.worldObj, position, 5 * 20, 0F, 1F, 0F)); + + if(itemStack.getItem() instanceof ItemEnergized) + { + ItemEnergized item = (ItemEnergized)itemStack.getItem(); + + item.setEnergy(itemStack, item.getEnergy(itemStack) - ItemRadarGun.YONG_DIAN_LIANG); + } + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemMissile.java b/src/main/java/mekanism/defense/common/item/ItemMissile.java new file mode 100644 index 000000000..c18873283 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemMissile.java @@ -0,0 +1,69 @@ +package defense.common.item; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; +import mekanism.common.util.LangUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class ItemMissile extends ItemBase +{ + public ItemMissile() + { + super("missile"); + this.setMaxDamage(0); + this.setHasSubtypes(true); + this.setMaxStackSize(1); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) {} + + @Override + public int getMetadata(int damage) + { + return damage; + } + + @Override + public String getUnlocalizedName(ItemStack itemStack) + { + return this.getUnlocalizedName() + "." + ExplosiveRegistry.get(itemStack.getItemDamage()).getUnlocalizedName(); + } + + @Override + public String getUnlocalizedName() + { + return "missile"; + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + for (Explosive zhaPin : ExplosiveRegistry.getAllMissles()) + { + if (zhaPin.hasMissileForm()) + { + par3List.add(new ItemStack(par1, 1, zhaPin.getID())); + } + } + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) + { + int tierdata = ExplosiveRegistry.get(stack.getItemDamage()).getTier(); + list.add(LangUtils.localize("info.misc.tier") + ": " + tierdata); + + super.addInformation(stack, player, list, bool); + + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemPoisonPowder.java b/src/main/java/mekanism/defense/common/item/ItemPoisonPowder.java new file mode 100644 index 000000000..107f64f02 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemPoisonPowder.java @@ -0,0 +1,21 @@ +package defense.common.item; + +import defense.common.Reference; +import net.minecraft.client.renderer.texture.IIconRegister; + +public class ItemPoisonPowder extends ItemBase +{ + public ItemPoisonPowder() + { + super("poisonPowder"); + } + + @Override + public void registerIcons(IIconRegister iconRegister) + { + super.registerIcons(iconRegister); + + // Icon for base item. + this.itemIcon = iconRegister.registerIcon(Reference.PREFIX + "poisonPowder"); + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemRadarGun.java b/src/main/java/mekanism/defense/common/item/ItemRadarGun.java new file mode 100644 index 000000000..96f4b6e64 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemRadarGun.java @@ -0,0 +1,236 @@ +package defense.common.item; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.List; + +import mekanism.api.Coord4D; +import mekanism.api.EnumColor; +import mekanism.api.Pos3D; +import mekanism.common.Mekanism; +import mekanism.common.item.ItemEnergized; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.util.LangUtils; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.CreativeTabHandler; +import defense.common.DefenseTech; +import defense.common.DefenseTechBlocks; +import defense.common.Reference; +import defense.common.base.IItemPacket; +import defense.common.network.PacketItem.ItemMessage; +import defense.common.tile.TileCruiseLauncher; +import defense.common.tile.TileLauncherPrefab; +import defense.common.tile.TileLauncherScreen; + +public class ItemRadarGun extends ItemEnergized implements IItemPacket +{ + public static final int YONG_DIAN_LIANG = 1000; + public static final int JU_LI = 1000; + + public ItemRadarGun() + { + super(2000000); + + this.setUnlocalizedName("radarGun"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "radarGun"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) + { + itemIcon = reg.registerIcon(getIconString()); + } + + /** Allows items to add custom lines of information to the mouseover description */ + @Override + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List par3List, boolean par4) + { + Pos3D coord = getLink(itemStack); + par3List.add("\uaa74" + LangUtils.localize("info.radarGun.savedCoords")); + par3List.add(LangUtils.localize("gui.misc.x") + " " + (int)coord.xPos + ", " + LangUtils.localize("gui.misc.y") + " " + (int)coord.yPos + ", " + LangUtils.localize("gui.misc.z") + " " + (int)coord.zPos); + par3List.add((int) new Pos3D(entityPlayer).distance(coord) + " " + LangUtils.localize("info.radarGun.meters") + " (" + (int)(new Pos3D(entityPlayer).xPos - coord.xPos) + ", " + (int) (new Pos3D(entityPlayer).yPos - coord.yPos) + ", " + (int) (new Pos3D(entityPlayer).zPos - coord.zPos) + ")"); + + super.addInformation(itemStack, entityPlayer, par3List, par4); + } + + /** Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, + * world, entityPlayer */ + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World par2World, EntityPlayer entityPlayer) + { + if (par2World.isRemote) + { + MovingObjectPosition objectMouseOver = entityPlayer.rayTrace(JU_LI, 1); + + if (objectMouseOver != null) + { + TileEntity tileEntity = par2World.getTileEntity(objectMouseOver.blockX, objectMouseOver.blockY, objectMouseOver.blockZ); + + // Do not scan if the target is a + // missile launcher + if(!(tileEntity instanceof TileLauncherPrefab)) + { + // Check for electricity + if(this.getEnergy(itemStack) > YONG_DIAN_LIANG) + { + ArrayList data = new ArrayList(); + + data.add(objectMouseOver.blockX); + data.add(objectMouseOver.blockY); + data.add(objectMouseOver.blockZ); + + DefenseTech.netHandler.sendToServer(new ItemMessage(data)); + setEnergy(itemStack, getEnergy(itemStack) - YONG_DIAN_LIANG); + entityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.radarGun.scanned").replaceAll("%x", "" + objectMouseOver.blockX).replace("%y", "" + objectMouseOver.blockY).replaceAll("%z", "" + objectMouseOver.blockZ).replaceAll("%s", "" + Math.round(new Pos3D(entityPlayer).distance(new Pos3D(objectMouseOver)))))); + } + else { + entityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.radarGun.nopower"))); + } + } + } + } + + return itemStack; + } + + /** Callback for item usage. If the item does something special on right clicking, he will have + * one of those. Return True if something happen and false if it don't. This is for ITEMS, not + * BLOCKS ! */ + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, int par7, float par8, float par9, float par10) + { + Block block = par3World.getBlock(x, y, z); + int blockMetadata = par3World.getBlockMetadata(x, y, z); + + if (block == DefenseTechBlocks.blockMachine) + { + TileEntity tileEntity = par3World.getTileEntity(x, y, z); + + if (tileEntity != null) + { + if (tileEntity instanceof TileLauncherScreen) + { + TileLauncherScreen missileLauncher = (TileLauncherScreen) tileEntity; + + Pos3D savedCords = this.getLink(par1ItemStack); + + // If the vector is NOT 0 + if (!savedCords.equals(new Pos3D())) + { + if (missileLauncher.getTarget() == null) + { + missileLauncher.setTarget(new Pos3D()); + } + + missileLauncher.getTarget().xPos = (int) savedCords.xPos; + missileLauncher.getTarget().zPos = (int) savedCords.zPos; + + if (par3World.isRemote) + { + ArrayList data = new ArrayList(); + + data.add(2); + data.add((int)savedCords.xPos); + data.add((int)missileLauncher.getTarget().yPos); + data.add((int)savedCords.zPos); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(missileLauncher), data)); + par2EntityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.radarGun.transfer"))); + } + } + else + { + if (par3World.isRemote) + par2EntityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.radarGun.noCoords"))); + } + } + else if (tileEntity instanceof TileCruiseLauncher) + { + TileCruiseLauncher missileLauncher = (TileCruiseLauncher) tileEntity; + + Pos3D savedCords = this.getLink(par1ItemStack); + + if (!savedCords.equals(new Pos3D())) + { + if (missileLauncher.getTarget() == null) + { + missileLauncher.setTarget(new Pos3D()); + } + + missileLauncher.setTarget(savedCords.clone()); + + if (par3World.isRemote) + { + ArrayList data = new ArrayList(); + + data.add(2); + data.add((int)savedCords.xPos); + data.add((int)missileLauncher.getTarget().yPos); + data.add((int)savedCords.zPos); + + Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(missileLauncher), data)); + par2EntityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.radarGun.transfer"))); + } + } + else + { + if (par3World.isRemote) + { + par2EntityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.radarGun.noCoords"))); + } + } + } + } + } + + return false; + } + + public void setLink(ItemStack itemStack, Pos3D position) + { + // Saves the frequency in the ItemStack + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + position.write(itemStack.getTagCompound()); + } + + public Pos3D getLink(ItemStack itemStack) + { + if (itemStack.getTagCompound() == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + return Pos3D.read(itemStack.getTagCompound()); + } + + @Override + public void handlePacket(EntityPlayer player, ByteBuf dataStream) + { + ItemStack itemStack = (ItemStack)player.getCurrentEquippedItem(); + this.setLink(itemStack, new Pos3D(dataStream.readInt(), dataStream.readInt(), dataStream.readInt())); + + if (itemStack.getItem() instanceof ItemEnergized) + { + ItemEnergized item = (ItemEnergized)itemStack.getItem(); + + item.setEnergy(itemStack, item.getEnergy(itemStack) - ItemRadarGun.YONG_DIAN_LIANG); + } + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemRemoteDetonator.java b/src/main/java/mekanism/defense/common/item/ItemRemoteDetonator.java new file mode 100644 index 000000000..4bbd89ba1 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemRemoteDetonator.java @@ -0,0 +1,234 @@ +package defense.common.item; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.List; + +import mekanism.api.EnumColor; +import mekanism.api.Pos3D; +import mekanism.common.item.ItemEnergized; +import mekanism.common.util.LangUtils; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.CreativeTabHandler; +import defense.common.DefenseTech; +import defense.common.DefenseTechBlocks; +import defense.common.Reference; +import defense.common.base.IItemPacket; +import defense.common.block.BlockExplosive; +import defense.common.explosive.Explosive; +import defense.common.network.PacketItem.ItemMessage; +import defense.common.tile.TileExplosive; + +public class ItemRemoteDetonator extends ItemEnergized implements IItemPacket +{ + public static final int BAN_JING = 100; + public static final int ENERGY = 1500; + + public ItemRemoteDetonator() + { + super(1000000); + + setUnlocalizedName("remoteDetonator"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "remoteDetonator"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) + { + itemIcon = reg.registerIcon(getIconString()); + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer player, List par3List, boolean par4) + { + Pos3D coord = getSavedCoord(itemStack); + + if (this.isValidExplosive(coord.getCoord(player.worldObj.provider.dimensionId).getTileEntity(player.worldObj))) + { + par3List.add("\uaa74" + LangUtils.localize("info.detonator.linked")); + par3List.add(LangUtils.localize("gui.misc.x") + " " + (int) coord.xPos + ", " + LangUtils.localize("gui.misc.y") + " " + (int) coord.yPos + ", " + LangUtils.localize("gui.misc.z") + " " + (int) coord.zPos); + } + else + { + par3List.add("\u00a74" + LangUtils.localize("info.detonator.noLink")); + } + super.addInformation(itemStack, player, par3List, par4); + } + + /** Lock the remote to an explosive if it exists. */ + @Override + public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int par7, float par8, float par9, float par10) + { + TileEntity tileEntity = world.getTileEntity(x, y, z); + + if (entityPlayer.isSneaking() && tileEntity != null) + { + if (this.isValidExplosive(tileEntity)) + { + // Check for electricity + if (this.getEnergy(itemStack) > ENERGY) + { + this.setSavedCoords(itemStack, new Pos3D(x, y, z)); + this.setEnergy(itemStack, this.getEnergy(itemStack) - ENERGY); + + if (world.isRemote) + { + entityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.detonator.locked").replaceAll("%x", "" + x).replace("%y", "" + y).replace("%z", "" + z))); + } + } + else if (world.isRemote) + { + entityPlayer.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.detonator.nopower"))); + } + + return true; + } + } + + return false; + } + + /** Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, + * world, entityPlayer */ + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) + { + if (world.isRemote) + { + if (!player.isSneaking()) + { + MovingObjectPosition objectMouseOver = player.rayTrace(BAN_JING, 1); + + if (objectMouseOver != null && objectMouseOver.typeOfHit == MovingObjectType.BLOCK) + { + + TileEntity tileEntity = world.getTileEntity(objectMouseOver.blockX, objectMouseOver.blockY, objectMouseOver.blockZ); + Block block = world.getBlock(objectMouseOver.blockX, objectMouseOver.blockY, objectMouseOver.blockZ); + TileEntity tile = world.getTileEntity(objectMouseOver.blockX, objectMouseOver.blockY, objectMouseOver.blockZ); + + if (tile != null) + { + if (tile instanceof TileExplosive) + { + if (block == DefenseTechBlocks.blockMachine) + { + return itemStack; + } + else if (this.isValidExplosive(tileEntity)) + { + // Check for electricity + if (this.getEnergy(itemStack) > ENERGY) + { + ArrayList data = new ArrayList(); + + data.add(tile.xCoord); + data.add(tile.yCoord); + data.add(tile.zCoord); + + DefenseTech.netHandler.sendToServer(new ItemMessage(new ArrayList())); + this.setEnergy(itemStack, this.getEnergy(itemStack) - ENERGY); + return itemStack; + } + else + { + player.addChatMessage(new ChatComponentText(LangUtils.localize(Reference.CHAT_DESC + EnumColor.GREY + " " + "message.detonator.nopower"))); + } + } + } + } + } + } + else + { + if (this.getEnergy(itemStack) > ENERGY) + { + TileEntity tileEntity = this.getSavedCoord(itemStack).getCoord(world.provider.dimensionId).getTileEntity(world); + + if (this.isValidExplosive(tileEntity)) + { + ArrayList data = new ArrayList(); + + data.add(tileEntity.xCoord); + data.add(tileEntity.yCoord); + data.add(tileEntity.zCoord); + + DefenseTech.netHandler.sendToServer(new ItemMessage(data)); + this.setEnergy(itemStack, this.getEnergy(itemStack) - ENERGY); + } + } + else + { + player.addChatMessage(new ChatComponentText(LangUtils.localize(Reference.CHAT_DESC + EnumColor.GREY + " " + "message.detonator.nopower"))); + } + } + } + + return itemStack; + } + + public boolean isValidExplosive(TileEntity tileEntity) + { + if (tileEntity != null) + { + if (tileEntity instanceof TileExplosive) + { + return ((TileExplosive) tileEntity).explosiveID == Explosive.condensed.getID() || ((TileExplosive) tileEntity).explosiveID == Explosive.breaching.getID() || ((TileExplosive) tileEntity).explosiveID == Explosive.sMine.getID(); + } + } + + return false; + } + + public void setSavedCoords(ItemStack itemStack, Pos3D position) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.stackTagCompound.setInteger("x", (int)position.xPos); + itemStack.stackTagCompound.setInteger("y", (int)position.yPos); + itemStack.stackTagCompound.setInteger("z", (int)position.zPos); + } + + public Pos3D getSavedCoord(ItemStack par1ItemStack) + { + if (par1ItemStack.stackTagCompound == null) + { + return new Pos3D(); + } + + return new Pos3D(par1ItemStack.stackTagCompound.getInteger("x"), par1ItemStack.stackTagCompound.getInteger("y"), par1ItemStack.stackTagCompound.getInteger("z")); + } + + @Override + public void handlePacket(EntityPlayer player, ByteBuf dataStream) + { + ItemStack stack = player.getCurrentEquippedItem(); + + this.setEnergy(stack, this.getEnergy(stack) - ENERGY); + + int x = dataStream.readInt(); + int y = dataStream.readInt(); + int z = dataStream.readInt(); + + if(isValidExplosive(player.worldObj.getTileEntity(x, y, z))) + { + BlockExplosive.detonate(player.worldObj, x, y, z, ((TileExplosive)player.worldObj.getTileEntity(x, y, z)).explosiveID, 0); + } + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemRocketLauncher.java b/src/main/java/mekanism/defense/common/item/ItemRocketLauncher.java new file mode 100644 index 000000000..93c0c01da --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemRocketLauncher.java @@ -0,0 +1,150 @@ +package defense.common.item; + +import java.util.HashMap; +import java.util.List; + +import mekanism.api.EnumColor; +import mekanism.api.Pos3D; +import mekanism.common.item.ItemEnergized; +import mekanism.common.util.LangUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.common.CreativeTabHandler; +import defense.common.Reference; +import defense.common.Settings; +import defense.common.entity.EntityMissile; +import defense.common.explosion.Explosion; +import defense.common.explosive.Explosive; +import defense.common.explosive.ExplosiveRegistry; + +/** Rocket Launcher + * + * @author Calclavia */ + +public class ItemRocketLauncher extends ItemEnergized +{ + private static final int ENERGY = 1000000; + private static final int firingDelay = 1000; + private HashMap clickTimePlayer = new HashMap(); + + public ItemRocketLauncher() + { + super(8000000); + + this.setUnlocalizedName("rocketLauncher"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "rocketLauncher"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) {} + + @Override + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.bow; + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) + { + if (!world.isRemote) + { + long clickMs = System.currentTimeMillis(); + if (clickTimePlayer.containsKey(player.getCommandSenderName())) + { + if (clickMs - clickTimePlayer.get(player.getCommandSenderName()) < firingDelay) + { + //TODO play weapon empty click audio to note the gun is reloading + return itemStack; + } + } + if (this.getEnergy(itemStack) >= ENERGY || player.capabilities.isCreativeMode) + { + // Check the player's inventory and look for missiles. + for (int slot = 0; slot < player.inventory.getSizeInventory(); slot++) + { + ItemStack inventoryStack = player.inventory.getStackInSlot(slot); + + if (inventoryStack != null) + { + if (inventoryStack.getItem() instanceof ItemMissile) + { + int meta = inventoryStack.getItemDamage(); + Explosive ex = ExplosiveRegistry.get(meta); + + if (ex instanceof Explosion) + { + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(world, player.posX, player.posY, player.posZ, ExplosiveType.AIR, ExplosiveRegistry.get(meta)); + MinecraftForge.EVENT_BUS.post(evt); + + if (((Explosion) ex) != null && !evt.isCanceled()) + { + // Limit the missile to tier two. + if (((Explosion) ex).getTier() <= Settings.MAX_ROCKET_LAUNCHER_TIER && ((Explosion) ex).isCruise()) + { + Pos3D launcher = new Pos3D(player).translate(new Pos3D(0, 0.5, 0)); + Pos3D playerAim = new Pos3D(player.getLook(1)); + Pos3D start = launcher.clone().translate(playerAim.scale(1.1)); + Pos3D target = launcher.clone().translate(playerAim.scale(100)); + //TODO: possible need to fix this, scale is not cloned (aidancbrady) + + //TOD: Fix this rotation when we use the proper model loader. + EntityMissile entityMissile = new EntityMissile(world, start, ((Explosion) ex).getID(), -player.rotationYaw, -player.rotationPitch); + world.spawnEntityInWorld(entityMissile); + + if (player.isSneaking()) + { + player.mountEntity(entityMissile); + player.setSneaking(false); + } + + entityMissile.ignore(player); + entityMissile.launch(target); + + if (!player.capabilities.isCreativeMode) + { + player.inventory.setInventorySlotContents(slot, null); + this.setEnergy(itemStack, this.getEnergy(itemStack) - ENERGY); + } + + //Store last time player launched a rocket + clickTimePlayer.put(player.getCommandSenderName(), clickMs); + + return itemStack; + } + } + else + { + player.addChatMessage(new ChatComponentText(Reference.CHAT_DESC + EnumColor.GREY + " " + LangUtils.localize("message.launcher.protected"))); + } + } + + } + } + } + } + } + + return itemStack; + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer entityPlayer, List list, boolean par4) + { + String str = LangUtils.localize("info.rocketlauncher.tooltip").replaceAll("%s", String.valueOf(Settings.MAX_ROCKET_LAUNCHER_TIER)); + list.add(str); + + super.addInformation(itemStack, entityPlayer, list, par4); + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemSignalDisrupter.java b/src/main/java/mekanism/defense/common/item/ItemSignalDisrupter.java new file mode 100644 index 000000000..17147437c --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemSignalDisrupter.java @@ -0,0 +1,109 @@ +package defense.common.item; + +import io.netty.buffer.ByteBuf; + +import java.util.List; + +import mekanism.common.item.ItemEnergized; +import mekanism.common.util.LangUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IItemFrequency; +import defense.common.CreativeTabHandler; +import defense.common.DefenseTech; +import defense.common.Reference; +import defense.common.base.IItemPacket; + +public class ItemSignalDisrupter extends ItemEnergized implements IItemFrequency, IItemPacket +{ + private static final long ENERGY_PER_TICK = 20; + + public ItemSignalDisrupter() + { + super(100000); + + setUnlocalizedName("signalDisrupter"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "signalDisrupter"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister reg) + { + itemIcon = reg.registerIcon(getIconString()); + } + + /** Allows items to add custom lines of information to the mouseover description */ + @Override + public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + super.addInformation(itemStack, par2EntityPlayer, par3List, par4); + par3List.add(LangUtils.localize("info.misc.freq") + " " + this.getFrequency(itemStack)); + } + + @Override + public int getFrequency(ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + return 0; + } + + return itemStack.stackTagCompound.getInteger("frequency"); + } + + @Override + public void setFrequency(int frequency, ItemStack itemStack) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + itemStack.stackTagCompound.setInteger("frequency", frequency); + } + + @Override + public void onUpdate(ItemStack itemStack, World world, Entity entity, int par4, boolean par5) + { + if (!world.isRemote) + { + if (this.getEnergy(itemStack) > 20 && world.getWorldTime() % 20 == 0) + { + this.setEnergy(itemStack, getEnergy(itemStack) - ENERGY_PER_TICK); + } + } + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + par3EntityPlayer.openGui(DefenseTech.INSTANCE, 0, par2World, (int) par3EntityPlayer.posX, (int) par3EntityPlayer.posY, (int) par3EntityPlayer.posZ); + return par1ItemStack; + } + + @Override + public void handlePacket(EntityPlayer player, ByteBuf dataStream) + { + ItemStack itemStack = player.getCurrentEquippedItem(); + int frequency = dataStream.readInt(); + + if(itemStack != null) + { + Item clientItem = itemStack.getItem(); + + if(clientItem instanceof ItemSignalDisrupter) + { + ((ItemSignalDisrupter)clientItem).setFrequency(frequency, itemStack); + } + } + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemSulfurDust.java b/src/main/java/mekanism/defense/common/item/ItemSulfurDust.java new file mode 100644 index 000000000..12bd7c013 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemSulfurDust.java @@ -0,0 +1,69 @@ +package defense.common.item; + +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.common.Reference; + +public class ItemSulfurDust extends ItemBase +{ + @SideOnly(Side.CLIENT) + IIcon salt_icon; + + public ItemSulfurDust() + { + // Base name that we return. + super("sulfur"); + + // Tell minecraft we have multiple types of items based on damage. + this.setHasSubtypes(true); + } + + @Override + public IIcon getIconFromDamage(int meta) + { + // Damage value of 1 is saltpeter. + if (meta == 1) + { + return salt_icon; + } + + return super.getIconFromDamage(meta); + } + + @Override + public void registerIcons(IIconRegister iconRegister) + { + super.registerIcons(iconRegister); + + // Icon for base item which is sulfur dust. + this.itemIcon = iconRegister.registerIcon(Reference.PREFIX + "sulfur"); + + // First damage value contains icon for saltpeter. + this.salt_icon = iconRegister.registerIcon(Reference.PREFIX + "saltpeter"); + } + + public String getUnlocalizedName(ItemStack par1ItemStack) + { + // Damage value of 1 returns name of saltpeter. + if (par1ItemStack.getItemDamage() == 1) + { + return "item.saltpeter"; + } + + return super.getUnlocalizedName(); + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + super.getSubItems(par1, par2CreativeTabs, par3List); + par3List.add(new ItemStack(par1, 1, 1)); + } +} diff --git a/src/main/java/mekanism/defense/common/item/ItemTracker.java b/src/main/java/mekanism/defense/common/item/ItemTracker.java new file mode 100644 index 000000000..1b413471c --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/ItemTracker.java @@ -0,0 +1,152 @@ +package defense.common.item; + +import java.util.List; + +import mekanism.common.item.ItemEnergized; +import mekanism.common.util.LangUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IItemTracker; +import defense.common.CreativeTabHandler; +import defense.common.Reference; + +public class ItemTracker extends ItemEnergized implements IItemTracker +{ + private static final long ENERGY_PER_TICK = 1; + + public ItemTracker() + { + super(100000); + + setUnlocalizedName("tracker"); + this.setCreativeTab(CreativeTabHandler.INSTANCE); + this.setTextureName(Reference.PREFIX + "tracker"); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IIconRegister par1IconRegister) + { + if (par1IconRegister instanceof TextureMap) + { + ((TextureMap) par1IconRegister).setTextureEntry(Reference.PREFIX + "tracker", new TextureTracker()); + this.itemIcon = ((TextureMap) par1IconRegister).getTextureExtry(Reference.PREFIX + "tracker"); + } + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) + { + super.addInformation(itemStack, par2EntityPlayer, par3List, par4); + + Entity trackingEntity = getTrackingEntity(FMLClientHandler.instance().getClient().theWorld, itemStack); + + if (trackingEntity != null) + { + par3List.add(LangUtils.localize("info.tracker.tracking") + " " + trackingEntity.getCommandSenderName()); + } + + par3List.add(LangUtils.localize("info.tracker.tooltip")); + } + + @Override + public void setTrackingEntity(ItemStack itemStack, Entity entity) + { + if (itemStack.stackTagCompound == null) + { + itemStack.setTagCompound(new NBTTagCompound()); + } + + if (entity != null) + { + itemStack.stackTagCompound.setInteger("trackingEntity", entity.getEntityId()); + } + } + + @Override + public Entity getTrackingEntity(World worldObj, ItemStack itemStack) + { + if (worldObj != null) + { + if (itemStack.stackTagCompound != null) + { + int trackingID = itemStack.stackTagCompound.getInteger("trackingEntity"); + return worldObj.getEntityByID(trackingID); + } + } + return null; + } + + @Override + public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + super.onCreated(par1ItemStack, par2World, par3EntityPlayer); + setTrackingEntity(par1ItemStack, par3EntityPlayer); + } + + @Override + public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) + { + super.onUpdate(itemStack, par2World, par3Entity, par4, par5); + + if (par3Entity instanceof EntityPlayer) + { + EntityPlayer player = (EntityPlayer) par3Entity; + + if (player.inventory.getCurrentItem() != null) + { + if (player.inventory.getCurrentItem().getItem() == this && par2World.getWorldTime() % 20 == 0) + { + Entity trackingEntity = this.getTrackingEntity(par2World, itemStack); + + if (trackingEntity != null) + { + if (getEnergy(itemStack) < ENERGY_PER_TICK) + { + this.setTrackingEntity(itemStack, null); + } + + setEnergy(itemStack, getEnergy(itemStack) - ENERGY_PER_TICK); + } + } + } + } + } + + /** Called when the player Left Clicks (attacks) an entity. Processed before damage is done, if + * return value is true further processing is canceled and the entity is not attacked. + * + * @param itemStack The Item being used + * @param player The player that is attacking + * @param entity The entity being attacked + * @return True to cancel the rest of the interaction. */ + @Override + public boolean onLeftClickEntity(ItemStack itemStack, EntityPlayer player, Entity entity) + { + if (!player.worldObj.isRemote) + { + if (this.getEnergy(itemStack) > ENERGY_PER_TICK) + { + setTrackingEntity(itemStack, entity); + player.addChatMessage(new ChatComponentText(LangUtils.localize("message.tracker.nowtrack") + " " + entity.getCommandSenderName())); + return true; + } + else + { + player.addChatMessage(new ChatComponentText(LangUtils.localize("message.tracker.nopower"))); + } + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/item/TextureTracker.java b/src/main/java/mekanism/defense/common/item/TextureTracker.java new file mode 100644 index 000000000..0d7532d79 --- /dev/null +++ b/src/main/java/mekanism/defense/common/item/TextureTracker.java @@ -0,0 +1,94 @@ +package defense.common.item; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureUtil; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import defense.api.IItemTracker; +import defense.common.Reference; + +@SideOnly(Side.CLIENT) +public class TextureTracker extends TextureAtlasSprite +{ + public double currentAngle; + public double angleDelta; + + public TextureTracker() + { + super(Reference.PREFIX + "tracker"); + } + + @Override + public void updateAnimation() + { + Minecraft minecraft = Minecraft.getMinecraft(); + World world = minecraft.theWorld; + EntityPlayer player = minecraft.thePlayer; + + double angel = 0; + + if(world != null) + { + double xDifference = 0; + double zDifference = 0; + + ItemStack itemStack = player.getCurrentEquippedItem(); + + if(itemStack != null) + { + if(itemStack.getItem() instanceof IItemTracker) + { + Entity trackingEntity = ((IItemTracker) itemStack.getItem()).getTrackingEntity(FMLClientHandler.instance().getClient().theWorld, itemStack); + + if(trackingEntity != null) + { + xDifference = trackingEntity.posX - player.posX; + zDifference = trackingEntity.posZ - player.posZ; + } + } + } + + player.rotationYaw %= 360.0D; + angel = -((player.rotationYaw - 90.0D) * Math.PI / 180.0D - Math.atan2(zDifference, xDifference)); + } + + double d6; + + for(d6 = angel - currentAngle; d6 < -Math.PI; d6 += (Math.PI * 2D)) {} + + while(d6 >= Math.PI) + { + d6 -= (Math.PI * 2D); + } + + if(d6 < -1.0D) + { + d6 = -1.0D; + } + + if(d6 > 1.0D) + { + d6 = 1.0D; + } + + angleDelta += d6 * 0.1D; + angleDelta *= 0.8D; + currentAngle += angleDelta; + + int i; + + for(i = (int)((currentAngle / (Math.PI * 2D) + 1.0D) * framesTextureData.size()) % framesTextureData.size(); i < 0; i = (i + framesTextureData.size()) % framesTextureData.size()) {} + + if(i != frameCounter) + { + frameCounter = i; + TextureUtil.uploadTextureMipmap((int[][]) this.framesTextureData.get(frameCounter), width, height, originX, originY, false, false); + } + } +} diff --git a/src/main/java/mekanism/defense/common/network/PacketItem.java b/src/main/java/mekanism/defense/common/network/PacketItem.java new file mode 100644 index 000000000..e3bc630f6 --- /dev/null +++ b/src/main/java/mekanism/defense/common/network/PacketItem.java @@ -0,0 +1,59 @@ +package defense.common.network; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; + +import mekanism.common.PacketHandler; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import defense.common.base.IItemPacket; +import defense.common.network.PacketItem.ItemMessage; + +public class PacketItem implements IMessageHandler +{ + @Override + public IMessage onMessage(ItemMessage message, MessageContext context) + { + ItemStack itemstack = PacketHandler.getPlayer(context).getCurrentEquippedItem(); + + if(itemstack != null && itemstack.getItem() instanceof IItemPacket) + { + try { + ((IItemPacket)itemstack.getItem()).handlePacket(PacketHandler.getPlayer(context), message.storedBuffer); + } catch(Exception e) { + e.printStackTrace(); + } + } + + return null; + } + + public static class ItemMessage implements IMessage + { + public ArrayList data; + + public ByteBuf storedBuffer = null; + + public ItemMessage() {} + + public ItemMessage(ArrayList list) + { + data = list; + } + + @Override + public void toBytes(ByteBuf dataStream) + { + PacketHandler.encode(data.toArray(), dataStream); + } + + @Override + public void fromBytes(ByteBuf dataStream) + { + storedBuffer = dataStream.copy(); + } + } +} diff --git a/src/main/java/mekanism/defense/common/potion/ContagiousPoison.java b/src/main/java/mekanism/defense/common/potion/ContagiousPoison.java new file mode 100644 index 000000000..88923633a --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/ContagiousPoison.java @@ -0,0 +1,36 @@ +package defense.common.potion; + +import mekanism.api.Pos3D; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; + +public class ContagiousPoison extends Poison +{ + private boolean isContagious; + + public ContagiousPoison(String name, int id, boolean isContagious) + { + super(name); + this.isContagious = isContagious; + } + + @Override + protected void doPoisonEntity(Pos3D emitPosition, EntityLivingBase entity, int amplifier) + { + if (this.isContagious) + { + entity.addPotionEffect(new CustomPotionEffect(PoisonContagion.INSTANCE.getId(), 45 * 20, amplifier, null)); + entity.addPotionEffect(new CustomPotionEffect(Potion.blindness.id, 15 * 20, amplifier)); + } + else + { + entity.addPotionEffect(new CustomPotionEffect(PoisonToxin.INSTANCE.getId(), 30 * 20, amplifier, null)); + entity.addPotionEffect(new CustomPotionEffect(Potion.confusion.id, 30 * 20, amplifier)); + } + + entity.addPotionEffect(new CustomPotionEffect(Potion.hunger.id, 30 * 20, amplifier)); + entity.addPotionEffect(new CustomPotionEffect(Potion.weakness.id, 35 * 20, amplifier)); + entity.addPotionEffect(new CustomPotionEffect(Potion.digSlowdown.id, 60 * 20, amplifier)); + } + +} diff --git a/src/main/java/mekanism/defense/common/potion/CustomPotion.java b/src/main/java/mekanism/defense/common/potion/CustomPotion.java new file mode 100644 index 000000000..c7323c3f4 --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/CustomPotion.java @@ -0,0 +1,42 @@ +package defense.common.potion; + +import defense.common.Settings; +import net.minecraft.potion.Potion; + +public abstract class CustomPotion extends Potion +{ + /** Creates a new type of potion + * + * @param id - The ID of this potion. Make it greater than 20. + * @param isBadEffect - Is this potion a good potion or a bad one? + * @param color - The color of this potion. + * @param name - The name of this potion. */ + public CustomPotion(int id, boolean isBadEffect, int color, String name) + { + super(getPotionID(name, id), isBadEffect, color); + this.setPotionName("potion." + name); + Potion.potionTypes[this.getId()] = this; + } + + public static int getPotionID(String name, int id) + { + Settings.CONFIGURATION.load(); + int finalID = Settings.CONFIGURATION.get("Potion ID", name + " ID", id).getInt(id); + Settings.CONFIGURATION.save(); + return finalID; + } + + @Override + public Potion setIconIndex(int par1, int par2) + { + super.setIconIndex(par1, par2); + return this; + } + + @Override + protected Potion setEffectiveness(double par1) + { + super.setEffectiveness(par1); + return this; + } +} diff --git a/src/main/java/mekanism/defense/common/potion/CustomPotionEffect.java b/src/main/java/mekanism/defense/common/potion/CustomPotionEffect.java new file mode 100644 index 000000000..f93e3eb21 --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/CustomPotionEffect.java @@ -0,0 +1,38 @@ +package defense.common.potion; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +public class CustomPotionEffect extends PotionEffect +{ + public CustomPotionEffect(int potionID, int duration, int amplifier) + { + super(potionID, duration, amplifier); + } + + public CustomPotionEffect(Potion potion, int duration, int amplifier) + { + this(potion.getId(), duration, amplifier); + } + + /** Creates a potion effect with custom curable items. + * + * @param curativeItems - ItemStacks that can cure this potion effect */ + public CustomPotionEffect(int potionID, int duration, int amplifier, List curativeItems) + { + super(potionID, duration, amplifier); + + if (curativeItems == null) + { + this.setCurativeItems(new ArrayList()); + } + else + { + this.setCurativeItems(curativeItems); + } + } +} diff --git a/src/main/java/mekanism/defense/common/potion/Poison.java b/src/main/java/mekanism/defense/common/potion/Poison.java new file mode 100644 index 000000000..8448fb394 --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/Poison.java @@ -0,0 +1,164 @@ +package defense.common.potion; + +import java.util.EnumSet; +import java.util.HashMap; + +import mekanism.api.Pos3D; +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +import com.google.common.collect.BiMap; +import com.google.common.collect.HashBiMap; + +import defense.api.IAntiPoisonArmor; +import defense.api.IAntiPoisonBlock; +import defense.common.Settings; + +/** A poison registry class used to register different types of poison effects. + * + * @author Calclavia */ +public abstract class Poison +{ + public enum ArmorType + { + HELM, + BODY, + LEGGINGS, + BOOTS + } + + static HashMap poisons = new HashMap(); + static BiMap poisonIDs = HashBiMap.create(); + private static int maxID = 0; + + protected String name; + protected EnumSet armorRequired = EnumSet.range(ArmorType.HELM, ArmorType.BOOTS); + protected final boolean isDisabled; + + public static Poison getPoison(String name) + { + return poisons.get(name); + } + + public static Poison getPoison(int id) + { + return poisons.get(getName(id)); + } + + public static String getName(int fluidID) + { + return poisonIDs.inverse().get(fluidID); + } + + public static int getID(String name) + { + return poisonIDs.get(name); + } + + public Poison(String name) + { + this.name = name; + poisons.put(name, this); + poisonIDs.put(name, ++maxID); + isDisabled = Settings.CONFIGURATION.get("Disable Poison", "Disable " + this.name, false).getBoolean(false); + } + + public String getName() + { + return this.name; + } + + public final int getID() + { + return getID(this.getName()); + } + + public EnumSet getArmorRequired() + { + return this.armorRequired; + } + + /** Called to poison this specific entity with this specific type of poison. + * + * @amiplifier - The amplification value. + * @armorRequired - The amount of pieces of armor required to be protected. + * @param entity */ + public void poisonEntity(Pos3D emitPosition, EntityLivingBase entity, int amplifier) + { + if (!isEntityProtected(emitPosition, entity, amplifier)) + { + doPoisonEntity(emitPosition, entity, amplifier); + } + } + + public void poisonEntity(Pos3D emitPosition, EntityLivingBase entity) + { + this.poisonEntity(emitPosition, entity, 0); + } + + public boolean isEntityProtected(Pos3D emitPosition, EntityLivingBase entity, int amplifier) + { + EnumSet armorWorn = EnumSet.noneOf(ArmorType.class); + + if (entity instanceof EntityPlayer) + { + EntityPlayer entityPlayer = (EntityPlayer) entity; + + for (int i = 0; i < entityPlayer.inventory.armorInventory.length; i++) + { + if (entityPlayer.inventory.armorInventory[i] != null) + { + if (entityPlayer.inventory.armorInventory[i].getItem() instanceof IAntiPoisonArmor) + { + IAntiPoisonArmor armor = (IAntiPoisonArmor) entityPlayer.inventory.armorInventory[i].getItem(); + + if (armor.isProtectedFromPoison(entityPlayer.inventory.armorInventory[i], entity, this.getName())) + { + armorWorn.add(ArmorType.values()[armor.getArmorType() % ArmorType.values().length]); + // TODO: Consider putting this in another method. + armor.onProtectFromPoison(entityPlayer.inventory.armorInventory[i], entity, this.getName()); + } + } + } + } + } + + return armorWorn.containsAll(this.armorRequired); + } + + public int getAntiPoisonBlockCount(World world, Pos3D startingPosition, Pos3D endingPosition) + { + Pos3D delta = endingPosition.clone().diff(startingPosition).normalize(); + Pos3D targetPosition = startingPosition.clone(); + double totalDistance = startingPosition.distance(endingPosition); + + int count = 0; + + if (totalDistance > 1) + { + while (targetPosition.distance(endingPosition) <= totalDistance) + { + Block block = targetPosition.getCoord(world.provider.dimensionId).getBlock(world); + + if (!world.isAirBlock((int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos)) + { + if (block instanceof IAntiPoisonBlock) + { + if (((IAntiPoisonBlock) block).isPoisonPrevention(world, (int)targetPosition.xPos, (int)targetPosition.yPos, (int)targetPosition.zPos, this.getName())) + { + count++; + } + } + } + + targetPosition.translate(delta); + } + } + + return count; + } + + protected abstract void doPoisonEntity(Pos3D emitPosition, EntityLivingBase entity, int amplifier); +} \ No newline at end of file diff --git a/src/main/java/mekanism/defense/common/potion/PoisonContagion.java b/src/main/java/mekanism/defense/common/potion/PoisonContagion.java new file mode 100644 index 000000000..a0337bc15 --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/PoisonContagion.java @@ -0,0 +1,94 @@ +package defense.common.potion; + +import java.util.List; + +import mekanism.api.Pos3D; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraftforge.common.MinecraftForge; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.common.DefenseTech; +import defense.common.explosive.Explosive; + +public class PoisonContagion extends CustomPotion +{ + public static PoisonContagion INSTANCE; + + public PoisonContagion(int id, boolean isBadEffect, int color, String name) + { + super(id, isBadEffect, color, name); + this.setIconIndex(6, 0); + } + + @Override + public void performEffect(EntityLivingBase entityLiving, int amplifier) + { + if (!(entityLiving instanceof EntityZombie) && !(entityLiving instanceof EntityPigZombie)) + { + entityLiving.attackEntityFrom(DamageSource.magic, 1); + } + + if (entityLiving.worldObj.rand.nextFloat() > 0.8) + { + + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(entityLiving.worldObj, entityLiving.posX, entityLiving.posY, entityLiving.posZ, ExplosiveType.ALL, Explosive.chemical); + MinecraftForge.EVENT_BUS.post(evt); + + // Poison things around it + if (!evt.isCanceled()) + { + int r = 13; + AxisAlignedBB entitySurroundings = AxisAlignedBB.getBoundingBox(entityLiving.posX - r, entityLiving.posY - r, entityLiving.posZ - r, entityLiving.posX + r, entityLiving.posY + r, entityLiving.posZ + r); + List entities = entityLiving.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, entitySurroundings); + + for (EntityLivingBase entity : entities) + { + if (entity != null && entity != entityLiving) + { + if (entity instanceof EntityPig) + { + EntityPigZombie newEntity = new EntityPigZombie(entity.worldObj); + newEntity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); + + if (!entity.worldObj.isRemote) + { + entity.worldObj.spawnEntityInWorld(newEntity); + } + entity.setDead(); + } + else if (entity instanceof EntityVillager) + { + EntityZombie newEntity = new EntityZombie(entity.worldObj); + newEntity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); + newEntity.setVillager(true); + if (!entity.worldObj.isRemote) + { + entity.worldObj.spawnEntityInWorld(newEntity); + } + entity.setDead(); + } + + DefenseTech.contagios_potion.poisonEntity(new Pos3D(entity), entity); + } + } + } + } + } + + @Override + public boolean isReady(int duration, int amplifier) + { + if (duration % (20 * 2) == 0) + { + return true; + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/potion/PoisonFrostBite.java b/src/main/java/mekanism/defense/common/potion/PoisonFrostBite.java new file mode 100644 index 000000000..fb3ea4459 --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/PoisonFrostBite.java @@ -0,0 +1,56 @@ +package defense.common.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; + +public class PoisonFrostBite extends CustomPotion +{ + public static PoisonFrostBite INSTANCE; + + public PoisonFrostBite(int id, boolean isBadEffect, int color, String name) + { + super(id, isBadEffect, color, name); + this.setIconIndex(6, 0); + } + + @Override + public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) + { + if (par1EntityLiving instanceof EntityPlayer) + { + ((EntityPlayer) par1EntityLiving).addExhaustion(3F * (amplifier + 1)); + } + + if (par1EntityLiving.isBurning()) + { + par1EntityLiving.extinguish(); + par1EntityLiving.removePotionEffect(this.id); + } + + // Check to see if it's on ice + if (par1EntityLiving.worldObj.getBlock(MathHelper.floor_double(par1EntityLiving.posX), MathHelper.floor_double(par1EntityLiving.posY) - 1, MathHelper.floor_double(par1EntityLiving.posZ)) == Blocks.ice) + { + par1EntityLiving.attackEntityFrom(DamageSource.magic, 2); + } + + // Shatter enemy if health is too low + if (par1EntityLiving.getHealth() < 6) + { + par1EntityLiving.attackEntityFrom(DamageSource.magic, 999999999); + } + } + + @Override + public boolean isReady(int duration, int amplifier) + { + if (duration % 20 == 0) + { + return true; + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/potion/PoisonToxin.java b/src/main/java/mekanism/defense/common/potion/PoisonToxin.java new file mode 100644 index 000000000..964d05dbc --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/PoisonToxin.java @@ -0,0 +1,37 @@ +package defense.common.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.monster.EntityZombie; +import net.minecraft.util.DamageSource; + +public class PoisonToxin extends CustomPotion +{ + public static PoisonToxin INSTANCE; + + public PoisonToxin(int id, boolean isBadEffect, int color, String name) + { + super(id, isBadEffect, color, name); + this.setIconIndex(6, 0); + } + + @Override + public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) + { + if (!(par1EntityLiving instanceof EntityZombie) && !(par1EntityLiving instanceof EntityPigZombie)) + { + par1EntityLiving.attackEntityFrom(DamageSource.magic, 1); + } + } + + @Override + public boolean isReady(int duration, int amplifier) + { + if (duration % (20 * 2) == 0) + { + return true; + } + + return false; + } +} diff --git a/src/main/java/mekanism/defense/common/potion/PotionUtility.java b/src/main/java/mekanism/defense/common/potion/PotionUtility.java new file mode 100644 index 000000000..5b5aa8726 --- /dev/null +++ b/src/main/java/mekanism/defense/common/potion/PotionUtility.java @@ -0,0 +1,53 @@ +package defense.common.potion; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + +import defense.common.DefenseTech; +import net.minecraft.potion.Potion; + +/** call on preinit + * + * @since 22/02/14 + * @author tgame14 */ +public class PotionUtility +{ + private static final int EXTEND_LIMIT = 32; + public static int potionOffset; + + public static void resizePotionArray() + { + Potion[] headPotionArray = null; + + for (Field f : Potion.class.getDeclaredFields()) + { + f.setAccessible(true); + try + { + if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) + { + Field modfield = Field.class.getDeclaredField("modifiers"); + modfield.setAccessible(true); + modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL); + + headPotionArray = (Potion[]) f.get(null); + final Potion[] newPotionTypes = new Potion[headPotionArray.length + EXTEND_LIMIT]; + System.arraycopy(headPotionArray, 0, newPotionTypes, 0, headPotionArray.length); + f.set(null, newPotionTypes); + + potionOffset = newPotionTypes.length - 1; + } + } + catch (Exception e) + { + e.printStackTrace(); + DefenseTech.LOGGER.severe("The mod has Errored, Please report to the mod authors"); + } + } + } + + public static int getNextOptimalPotId() + { + return --potionOffset + 1; + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileCruiseLauncher.java b/src/main/java/mekanism/defense/common/tile/TileCruiseLauncher.java new file mode 100644 index 000000000..9c3f0fd3f --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileCruiseLauncher.java @@ -0,0 +1,341 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; +import mekanism.api.Pos3D; +import mekanism.common.util.ChargeUtils; +import mekanism.common.util.LangUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.MinecraftForge; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.api.ILauncherContainer; +import defense.api.ILauncherController; +import defense.api.IMissile; +import defense.common.DefenseTech; +import defense.common.base.IBlockActivate; +import defense.common.entity.EntityMissile; +import defense.common.explosion.Explosion; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.item.ItemMissile; + +public class TileCruiseLauncher extends TileLauncherPrefab implements IBlockActivate, IInventory, ILauncherContainer +{ + // The missile that this launcher is holding + public IMissile daoDan = null; + + public float rotationYaw = 0; + + public float rotationPitch = 0; + + public TileCruiseLauncher() + { + super("CruiseLauncher", 10000000); + this.targetPos = new Pos3D(); + inventory = new ItemStack[2]; + } + + /** Gets the display status of the missile launcher + * + * @return The string to be displayed */ + @Override + public String getStatus() + { + String color = "\u00a74"; + String status = LangUtils.localize("gui.misc.idle"); + + if (getEnergy() < getMaxEnergy()) + { + status = LangUtils.localize("gui.launcherCruise.statusNoPower"); + } + else if (this.daoDan == null) + { + status = LangUtils.localize("gui.launcherCruise.statusEmpty"); + } + else if (this.targetPos == null) + { + status = LangUtils.localize("gui.launcherCruise.statusInvalid"); + } + else + { + color = "\u00a72"; + status = LangUtils.localize("gui.launcherCruise.statusReady"); + } + + return color + status; + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + if(!worldObj.isRemote) + { + int packetType = dataStream.readInt(); + + if(packetType == 1) + { + setFrequency(dataStream.readInt()); + } + else if(packetType == 2) + { + targetPos = new Pos3D(dataStream.readInt(), dataStream.readInt(), dataStream.readInt()); + } + + return; + } + + super.handlePacketData(dataStream); + } + + /** Returns the name of the inventory. */ + @Override + public String getInventoryName() + { + return LangUtils.localize("gui.launcherCruise.name"); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + ChargeUtils.discharge(1, this); + + // Rotate the yaw + if (this.getYawFromTarget() - this.rotationYaw != 0) + { + this.rotationYaw += (this.getYawFromTarget() - this.rotationYaw) * 0.1; + } + if (this.getPitchFromTarget() - this.rotationPitch != 0) + { + this.rotationPitch += (this.getPitchFromTarget() - this.rotationPitch) * 0.1; + } + + if (!this.worldObj.isRemote) + { + this.setMissile(); + + if (this.ticker % 40 == 0 && this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + this.launch(); + } + } + } + + @Override + public void placeMissile(ItemStack itemStack) + { + this.inventory[0] = itemStack; + } + + public void setMissile() + { + if (!this.worldObj.isRemote) + { + if (this.inventory[0] != null) + { + if (this.inventory[0].getItem() instanceof ItemMissile) + { + int haoMa = this.inventory[0].getItemDamage(); + + if (ExplosiveRegistry.get(haoMa) instanceof Explosion) + { + Explosion missile = (Explosion) ExplosiveRegistry.get(haoMa); + + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ExplosiveType.AIR, missile); + MinecraftForge.EVENT_BUS.post(evt); + + if (!evt.isCanceled()) + { + if (this.daoDan == null) + { + + if (missile.isCruise() && missile.getTier() <= 3) + { + Pos3D startingPosition = new Pos3D((this.xCoord + 0.5f), (this.yCoord + 1f), (this.zCoord + 0.5f)); + this.daoDan = new EntityMissile(this.worldObj, startingPosition, new Pos3D(this), haoMa); + this.worldObj.spawnEntityInWorld((Entity) this.daoDan); + return; + } + } + + if (this.daoDan != null) + { + if (this.daoDan.getExplosiveType().getID() == haoMa) + { + return; + } + } + } + } + } + } + + if (this.daoDan != null) + { + ((Entity) this.daoDan).setDead(); + } + + this.daoDan = null; + } + } + + private float getPitchFromTarget() + { + double distance = Math.sqrt((this.targetPos.xPos - this.xCoord) * (this.targetPos.xPos - this.xCoord) + (this.targetPos.zPos - this.zCoord) * (this.targetPos.zPos - this.zCoord)); + return (float) Math.toDegrees(Math.atan((this.targetPos.yPos - (this.yCoord + 0.5F)) / distance)); + } + + private float getYawFromTarget() + { + double xDifference = this.targetPos.xPos - (this.xCoord + 0.5F); + double yDifference = this.targetPos.zPos - (this.zCoord + 0.5F); + return (float) Math.toDegrees(Math.atan2(yDifference, xDifference)); + } + + @Override + public boolean canLaunch() + { + if (this.daoDan != null && this.inventory[0] != null) + { + Explosion missile = (Explosion) ExplosiveRegistry.get(this.inventory[0].getItemDamage()); + + if (missile != null && missile.getID() == daoDan.getExplosiveType().getID() && missile.isCruise() && missile.getTier() <= 3) + { + if (getEnergy() == getMaxEnergy()) + { + if (!this.isTooClose(this.targetPos)) + { + return true; + } + } + } + } + + return false; + } + + /** Launches the missile + * + * @param targetVector - The target in which the missile will land in */ + @Override + public void launch() + { + if (this.canLaunch()) + { + this.decrStackSize(0, 1); + this.setEnergy(0); + this.daoDan.launch(this.targetPos); + this.daoDan = null; + } + } + + // Is the target too close? + public boolean isTooClose(Pos3D target) + { + return new Pos3D(this.xCoord, 0, this.zCoord).distance(new Pos3D(target.xPos, 0, target.zPos)) < 8; + } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + + @Override + public int getInventoryStackLimit() + { + return 1; + } + + @Override + public boolean onActivated(EntityPlayer player) + { + if (player.inventory.getCurrentItem() != null) + { + if (player.inventory.getCurrentItem().getItem() instanceof ItemMissile) + { + if (this.getStackInSlot(0) == null) + { + + this.setInventorySlotContents(0, player.inventory.getCurrentItem()); + if (!player.capabilities.isCreativeMode) + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + return true; + } + else + { + ItemStack player_held = player.inventory.getCurrentItem(); + if (!player.capabilities.isCreativeMode) + player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getStackInSlot(0)); + this.setInventorySlotContents(0, player_held); + return true; + } + } + } + else if (this.getStackInSlot(0) != null) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getStackInSlot(0)); + this.setInventorySlotContents(0, null); + return true; + } + + player.openGui(DefenseTech.INSTANCE, 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); + return true; + } + + @Override + public LauncherType getLauncherType() + { + return LauncherType.CRUISE; + } + + @Override + public boolean isItemValidForSlot(int slotID, ItemStack itemStack) + { + if (itemStack != null) + { + if (itemStack.getItem() instanceof ItemMissile && this.getStackInSlot(slotID) == null) + { + if (ExplosiveRegistry.get(itemStack.getItemDamage()) instanceof Explosion) + { + Explosion missile = (Explosion) ExplosiveRegistry.get(itemStack.getItemDamage()); + + if (missile.isCruise() && missile.getTier() <= 3) + { + return true; + } + } + } + } + + return false; + } + + @Override + public void setContainingMissile(IMissile missile) + { + this.daoDan = missile; + } + + @Override + public ILauncherController getController() + { + return this; + } + + @Override + public IMissile getMissile() + { + return this.daoDan; + } + + @Override + public AxisAlignedBB getRenderBoundingBox() + { + return AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 1, yCoord + 1, zCoord + 1); + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileEMPTower.java b/src/main/java/mekanism/defense/common/tile/TileEMPTower.java new file mode 100644 index 000000000..176d60966 --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileEMPTower.java @@ -0,0 +1,377 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; + +import mekanism.api.Coord4D; +import mekanism.api.Range4D; +import mekanism.common.Mekanism; +import mekanism.common.base.IBoundingBlock; +import mekanism.common.integration.IComputerIntegration; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.tile.TileEntityElectricBlock; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; +import defense.api.RadarRegistry; +import defense.common.DefenseTech; +import defense.common.Reference; +import defense.common.base.IBlockActivate; +import defense.common.explosive.blast.BlastEMP; + +public class TileEMPTower extends TileEntityElectricBlock implements IBoundingBlock, IBlockActivate, IComputerIntegration +{ + // The maximum possible radius for the EMP to strike + public static final int MAX_RADIUS = 150; + + public float rotation = 0; + private float rotationDelta = 0; + + // The EMP mode. 0 = All, 1 = Missiles Only, 2 = Electricity Only + public byte empMode = 0; + + private int cooldownTicks = 0; + + // The EMP explosion radius + public int empRadius = 60; + + public double energyToUse = 0; + + public boolean packet = false; + + public TileEMPTower() + { + super("EMPTower", 10000000); + RadarRegistry.register(this); + updateCapacity(); + } + + @Override + public String getInventoryName() + { + return LangUtils.localize("machine.EmpTower.name"); + } + + @Override + public void invalidate() + { + RadarRegistry.unregister(this); + super.invalidate(); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + if (!isReady()) + { + cooldownTicks--; + } + + if (ticker % 20 == 0 && getEnergy() > 0) + worldObj.playSoundEffect(xCoord, yCoord, zCoord, Reference.PREFIX + "machinehum", 0.5F, 0.85F * (float)getEnergy() / (float)getMaxEnergy()); + + rotationDelta = (float) (Math.pow(getEnergy() / getMaxEnergy(), 2) * 0.5); + rotation += rotationDelta; + if (rotation > 360) + rotation = 0; + + if(!worldObj.isRemote && ticker % 20 == 0) + { + Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this))); + } + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + if(!worldObj.isRemote) + { + int packetType = dataStream.readInt(); + + if(packetType == 1) + { + empRadius = dataStream.readInt(); + updateCapacity(); + } + else if(packetType == 2) + { + empMode = dataStream.readByte(); + } + + return; + } + + super.handlePacketData(dataStream); + + if(worldObj.isRemote) + { + int prev = empRadius; + + empRadius = dataStream.readInt(); + empMode = dataStream.readByte(); + + if(dataStream.readBoolean()) + { + switch (this.empMode) + { + default: + new BlastEMP(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, this.empRadius).setEffectBlocks().setEffectEntities().explode(); + break; + case 1: + new BlastEMP(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, this.empRadius).setEffectEntities().explode(); + break; + case 2: + new BlastEMP(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, this.empRadius).setEffectBlocks().explode(); + break; + } + } + + if(prev != empRadius) + { + updateCapacity(); + } + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(empRadius); + data.add(empMode); + data.add(packet); + + packet = false; + + return data; + } + + //@Callback + public boolean isReady() + { + return getCooldown() <= 0; + } + + //@Callback + public int getCooldown() + { + return cooldownTicks; + } + + //@Callback + public int getMaxCooldown() + { + return 120; + } + + private void updateCapacity() + { + maxEnergy = Math.max(3000000 * ((double)this.empRadius / (double)MAX_RADIUS), 10000000); + energyToUse = getMaxEnergy()/4D; + } + + /** Reads a tile entity from NBT. */ + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + + this.empRadius = par1NBTTagCompound.getInteger("banJing"); + this.empMode = par1NBTTagCompound.getByte("muoShi"); + + updateCapacity(); + } + + /** Writes a tile entity to NBT. */ + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("banJing", this.empRadius); + par1NBTTagCompound.setByte("muoShi", this.empMode); + } + + //@Callback(limit = 1) + public boolean fire() + { + if(!worldObj.isRemote) + { + if (getEnergy() >= energyToUse) + { + if (isReady()) + { + switch (this.empMode) + { + default: + new BlastEMP(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, this.empRadius).setEffectBlocks().setEffectEntities().explode(); + break; + case 1: + new BlastEMP(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, this.empRadius).setEffectEntities().explode(); + break; + case 2: + new BlastEMP(this.worldObj, null, this.xCoord, this.yCoord, this.zCoord, this.empRadius).setEffectBlocks().explode(); + break; + } + + setEnergy(getEnergy()-energyToUse); + this.cooldownTicks = getMaxCooldown(); + packet = true; + + Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this))); + + return true; + } + } + } + + return false; + } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + + @Override + public void onPowerChange() + { + if(redstone) + { + fire(); + } + } + + @Override + public boolean onActivated(EntityPlayer entityPlayer) + { + if(!worldObj.isRemote) + { + entityPlayer.openGui(DefenseTech.INSTANCE, 0, worldObj, xCoord, yCoord, zCoord); + } + + return true; + } + + @Override + public void onPlace() + { + Coord4D pos = Coord4D.get(this); + MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 1), pos); + } + + @Override + public void onBreak() + { + worldObj.setBlockToAir(xCoord, yCoord+1, zCoord); + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + + @Override + public AxisAlignedBB getRenderBoundingBox() + { + return INFINITE_EXTENT_AABB; + } + + private static final String[] methods = new String[]{"getEMPMode", "setEMPMode", "targetMissiles", "targetAll", "targetElectronics", "getEMPRadius", "getMaxEMPRadius", "setEMPRadius"}; + + @Override + public String[] getMethods() + { + return methods; + } + + @Override + public Object[] invoke(int method, Object[] args) throws Exception + { + switch(method) + { + case 0: + return new Object[]{getEmpMode()}; + case 1: + if(args.length < 1 || !(args[0] instanceof Number)) + { + return new Object[] {false, "first argument needs to be a number between 0 and 2"}; + } + return new Object[]{setEmpMode(((Number) args[0]).byteValue())}; + case 2: + empMissiles(); + return new Object[]{}; + case 3: + empAll(); + return new Object[]{}; + case 4: + empElectronics(); + return new Object[]{}; + case 5: + return new Object[]{getEmpRadius()}; + case 6: + return new Object[]{getMaxEmpRadius()}; + case 7: + if(args.length < 1 || !(args[0] instanceof Number)) + { + return new Object[] {false, "first argument needs to be a number"}; + } + setEmpRadius(((Number) args[0]).intValue()); + return new Object[]{true}; + default: + throw new NoSuchMethodException(); + } + } + + public byte getEmpMode() + { + return empMode; + } + + public boolean setEmpMode(byte empMode) + { + if (empMode >= 0 && empMode <= 2) + { + this.empMode = empMode; + return true; + } + return false; + } + + public void empMissiles() + { + this.empMode = 1; + } + + public void empAll() + { + this.empMode = 0; + } + + public void empElectronics() + { + this.empMode = 2; + } + + public int getEmpRadius() + { + return empRadius; + } + + public int getMaxEmpRadius() + { + return MAX_RADIUS; + } + + public void setEmpRadius(int empRadius) + { + int prev = getEmpRadius(); + this.empRadius = Math.min(Math.max(empRadius, 0), MAX_RADIUS); + if (prev != getEmpRadius()) + updateCapacity(); + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileExplosive.java b/src/main/java/mekanism/defense/common/tile/TileExplosive.java new file mode 100644 index 000000000..27d2a1d9e --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileExplosive.java @@ -0,0 +1,102 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; + +import defense.api.IExplosive; +import defense.api.IExplosiveContainer; +import defense.common.DefenseTech; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.item.ItemRemoteDetonator; +import mekanism.api.Coord4D; +import mekanism.common.Mekanism; +import mekanism.common.base.ITileNetwork; +import mekanism.common.network.PacketDataRequest.DataRequestMessage; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + +public class TileExplosive extends TileEntity implements IExplosiveContainer, ITileNetwork +{ + public boolean exploding = false; + public int explosiveID = 0; + public NBTTagCompound nbtData = new NBTTagCompound(); + + @Override + public boolean canUpdate() + { + return false; + } + + /** Reads a tile entity from NBT. */ + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + this.explosiveID = par1NBTTagCompound.getInteger("explosiveID"); + this.nbtData = par1NBTTagCompound.getCompoundTag("data"); + } + + /** Writes a tile entity to NBT. */ + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("explosiveID", this.explosiveID); + par1NBTTagCompound.setTag("data", this.nbtData); + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + if(worldObj.isRemote) + { + explosiveID = dataStream.readInt(); + worldObj.func_147479_m(xCoord, yCoord, zCoord); + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + data.add(explosiveID); + + return data; + } + + @Override + public void validate() + { + super.validate(); + + if(worldObj.isRemote) + { + Mekanism.packetHandler.sendToServer(new DataRequestMessage(Coord4D.get(this))); + } + } + + public ForgeDirection getDirection() + { + return ForgeDirection.getOrientation(this.getBlockMetadata()); + } + + public void setDirection(ForgeDirection facingDirection) + { + this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, facingDirection.ordinal(), 2); + } + + @Override + public IExplosive getExplosiveType() + { + return ExplosiveRegistry.get(this.explosiveID); + } + + @Override + public NBTTagCompound getTagCompound() + { + return this.nbtData; + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileLauncherBase.java b/src/main/java/mekanism/defense/common/tile/TileLauncherBase.java new file mode 100644 index 000000000..640ca1e0c --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileLauncherBase.java @@ -0,0 +1,414 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import mekanism.api.Range4D; +import mekanism.common.Mekanism; +import mekanism.common.base.IBoundingBlock; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.tile.TileEntityContainerBlock; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import defense.api.ExplosionEvent.ExplosivePreDetonationEvent; +import defense.api.ExplosiveType; +import defense.api.ILauncherContainer; +import defense.api.ILauncherController; +import defense.api.IMissile; +import defense.api.ITier; +import defense.common.Settings; +import defense.common.base.IBlockActivate; +import defense.common.entity.EntityMissile; +import defense.common.explosion.Explosion; +import defense.common.explosive.ExplosiveRegistry; +import defense.common.item.ItemMissile; + +/** This tile entity is for the base of the missile launcher + * + * @author Calclavia */ +public class TileLauncherBase extends TileEntityContainerBlock implements ILauncherContainer, ITier, IBoundingBlock, IBlockActivate +{ + // The missile that this launcher is holding + public IMissile missile = null; + + // The connected missile launcher frame + public TileLauncherFrame supportFrame = null; + + // The tier of this launcher base + private int tier = 0; + + private boolean packetGengXin = true; + + public TileLauncherBase() + { + super("LauncherBase"); + inventory = new ItemStack[1]; + } + + /** Returns the name of the inventory. */ + @Override + public String getInventoryName() + { + return LangUtils.localize("gui.launcherBase.name"); + } + + /** Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner + * uses this to count ticks and creates a new spawn inside its implementation. */ + @Override + public void onUpdate() + { + if (this.supportFrame == null) + { + for (byte i = 2; i < 6; i++) + { + Coord4D position = Coord4D.get(this); + position.step(ForgeDirection.getOrientation(i)); + + TileEntity tileEntity = position.getTileEntity(worldObj); + + if (tileEntity instanceof TileLauncherFrame) + { + this.supportFrame = (TileLauncherFrame) tileEntity; + this.supportFrame.setFacing((short)MekanismUtils.getBaseOrientation(ForgeDirection.NORTH.ordinal(), i)); + } + } + } + else + { + if (this.supportFrame.isInvalid()) + { + this.supportFrame = null; + } + } + + if (!this.worldObj.isRemote) + { + this.setMissile(); + + if (this.packetGengXin || this.ticker % (20 * 30) == 0) + { + Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this))); + this.packetGengXin = false; + } + } + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + super.handlePacketData(dataStream); + + if(worldObj.isRemote) + { + tier = dataStream.readInt(); + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(tier); + + return data; + } + + public void setMissile() + { + if (!this.worldObj.isRemote) + { + if (this.getStackInSlot(0) != null) + { + if (this.getStackInSlot(0).getItem() instanceof ItemMissile) + { + int explosiveID = this.getStackInSlot(0).getItemDamage(); + + if (ExplosiveRegistry.get(explosiveID) instanceof Explosion) + { + Explosion missile = (Explosion) ExplosiveRegistry.get(explosiveID); + + ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ExplosiveType.AIR, missile); + MinecraftForge.EVENT_BUS.post(evt); + + if (!evt.isCanceled()) + { + if (this.missile == null) + { + Pos3D startingPosition = new Pos3D((this.xCoord + 0.5f), (this.yCoord + 1.8f), (this.zCoord + 0.5f)); + this.missile = new EntityMissile(this.worldObj, startingPosition, new Pos3D(this), explosiveID); + this.worldObj.spawnEntityInWorld((Entity) this.missile); + return; + } + else + { + if (this.missile.getExplosiveType().getID() == explosiveID) + { + return; + } + } + } + } + } + } + + if (this.missile != null) + { + ((Entity) this.missile).setDead(); + } + + this.missile = null; + } + } + + /** Launches the missile + * + * @param target - The target in which the missile will land in */ + public void launchMissile(Pos3D target, int launchHeight) + { + // Apply inaccuracy + float inaccuracy; + + if(supportFrame != null) + { + inaccuracy = this.supportFrame.getInaccuracy(); + } + else { + inaccuracy = 30f; + } + + inaccuracy *= (float) Math.random() * 2 - 1; + + target.xPos += inaccuracy; + target.zPos += inaccuracy; + + decrStackSize(0, 1); + missile.launch(target, launchHeight); + missile = null; + } + + // Checks if the missile target is in range + public boolean isInRange(Pos3D target) + { + if(target != null) + { + return !isTargetTooFar(target) && !isTargetTooClose(target); + } + + return false; + } + + /** Checks to see if the target is too close. + * + * @param target + * @return */ + public boolean isTargetTooClose(Pos3D target) + { + // Check if it is greater than the minimum range + if (new Pos3D(this.xCoord, 0, this.zCoord).distance(new Pos3D(target.xPos, 0, target.zPos)) < 10) + { + return true; + } + + return false; + } + + // Is the target too far? + public boolean isTargetTooFar(Pos3D target) + { + // Checks if it is greater than the maximum range for the launcher base + if (this.tier == 0) + { + if (new Pos3D(this.xCoord, 0, this.zCoord).distance(new Pos3D(target.xPos, 0, target.zPos)) < Settings.MAX_MISSILE_DISTANCE / 10) + { + return false; + } + } + else if (this.tier == 1) + { + if (new Pos3D(this.xCoord, 0, this.zCoord).distance(new Pos3D(target.xPos, 0, target.zPos)) < Settings.MAX_MISSILE_DISTANCE / 5) + { + return false; + } + } + else if (this.tier == 2) + { + if (new Pos3D(this.xCoord, 0, this.zCoord).distance(new Pos3D(target.xPos, 0, target.zPos)) < Settings.MAX_MISSILE_DISTANCE) + { + return false; + } + } + + return true; + } + + /** Reads a tile entity from NBT. */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.tier = nbt.getInteger("tier"); + } + + /** Writes a tile entity to NBT. */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("tier", this.tier); + } + + @Override + public int getTier() + { + return this.tier; + } + + @Override + public void setTier(int tier) + { + this.tier = tier; + } + + @Override + public boolean onActivated(EntityPlayer player) + { + if (player.inventory.getCurrentItem() != null) + { + if (player.inventory.getCurrentItem().getItem() instanceof ItemMissile) + { + if (this.getStackInSlot(0) == null) + { + + this.setInventorySlotContents(0, player.inventory.getCurrentItem()); + if (!player.capabilities.isCreativeMode) + player.inventory.setInventorySlotContents(player.inventory.currentItem, null); + return true; + } + else + { + ItemStack player_held = player.inventory.getCurrentItem(); + if (!player.capabilities.isCreativeMode) + player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getStackInSlot(0)); + this.setInventorySlotContents(0, player_held); + return true; + } + } + } + else if (this.getStackInSlot(0) != null) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, this.getStackInSlot(0)); + this.setInventorySlotContents(0, null); + return true; + } + + return true; + } + + @Override + public void invalidate() + { + if (this.missile != null) + { + ((Entity) this.missile).setDead(); + } + + super.invalidate(); + } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + + @Override + public void onPlace() + { + Coord4D pos = Coord4D.get(this); + + for(Coord4D coord : getMultiBlockVectors()) + { + MekanismUtils.makeBoundingBlock(worldObj, pos.clone().translate(coord), pos); + } + } + + @Override + public void onBreak() + { + for(Coord4D coord : getMultiBlockVectors()) + { + Coord4D translated = Coord4D.get(this).translate(coord); + worldObj.setBlockToAir(translated.xCoord, translated.yCoord, translated.zCoord); + } + + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + + public Coord4D[] getMultiBlockVectors() + { + ForgeDirection facingDirection = ForgeDirection.getOrientation(facing); + + if (facingDirection == ForgeDirection.SOUTH || facingDirection == ForgeDirection.NORTH) + { + return new Coord4D[] { new Coord4D(1, 0, 0), new Coord4D(1, 1, 0), new Coord4D(1, 2, 0), new Coord4D(-1, 0, 0), new Coord4D(-1, 1, 0), new Coord4D(-1, 2, 0) }; + } + else + { + return new Coord4D[] { new Coord4D(0, 0, 1), new Coord4D(0, 1, 1), new Coord4D(0, 2, 1), new Coord4D(0, 0, -1), new Coord4D(0, 1, -1), new Coord4D(0, 2, -1) }; + } + } + + @Override + public AxisAlignedBB getRenderBoundingBox() + { + return INFINITE_EXTENT_AABB; + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack, int side) + { + return slot == 0 && stack.getItem() instanceof ItemMissile; + } + + @Override + public int[] getAccessibleSlotsFromSide(int side) + { + return new int[] {0}; + } + + @Override + public void setContainingMissile(IMissile missile) + { + this.missile = missile; + } + + @Override + public ILauncherController getController() + { + for (byte i = 2; i < 6; i++) + { + Coord4D position = Coord4D.get(this).step(ForgeDirection.getOrientation(i)); + + TileEntity tileEntity = position.getTileEntity(this.worldObj); + + if (tileEntity instanceof ILauncherController) + { + return (ILauncherController) tileEntity; + } + } + + return null; + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileLauncherFrame.java b/src/main/java/mekanism/defense/common/tile/TileLauncherFrame.java new file mode 100644 index 000000000..3908a05c6 --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileLauncherFrame.java @@ -0,0 +1,118 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; + +import defense.api.ITier; +import mekanism.api.Coord4D; +import mekanism.common.base.IBoundingBlock; +import mekanism.common.tile.TileEntityBasicBlock; +import mekanism.common.util.MekanismUtils; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; + +/** This tile entity is for the screen of the missile launcher + * + * @author Calclavia */ +public class TileLauncherFrame extends TileEntityBasicBlock implements ITier, IBoundingBlock +{ + // The tier of this screen + private int tier = 0; + + @Override + public void handlePacketData(ByteBuf dataStream) + { + super.handlePacketData(dataStream); + + if(worldObj.isRemote) + { + tier = dataStream.readInt(); + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(tier); + + return data; + } + + /** Gets the inaccuracy of the missile based on the launcher support frame's tier */ + public int getInaccuracy() + { + switch (this.tier) + { + default: + return 15; + case 1: + return 7; + case 2: + return 0; + } + } + + /** Reads a tile entity from NBT. */ + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + this.tier = par1NBTTagCompound.getInteger("tier"); + } + + /** Writes a tile entity to NBT. */ + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("tier", this.tier); + } + + @Override + public int getTier() + { + return this.tier; + } + + @Override + public void setTier(int tier) + { + this.tier = tier; + } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + + @Override + public void onPlace() + { + Coord4D pos = Coord4D.get(this); + MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 1), pos); + MekanismUtils.makeBoundingBlock(worldObj, pos.getFromSide(ForgeDirection.UP, 2), pos); + } + + @Override + public void onBreak() + { + worldObj.setBlockToAir(xCoord, yCoord+1, zCoord); + worldObj.setBlockToAir(xCoord, yCoord+2, zCoord); + + worldObj.setBlockToAir(xCoord, yCoord, zCoord); + } + + @Override + public AxisAlignedBB getRenderBoundingBox() + { + return INFINITE_EXTENT_AABB; + } + + @Override + public void onUpdate() {} +} diff --git a/src/main/java/mekanism/defense/common/tile/TileLauncherPrefab.java b/src/main/java/mekanism/defense/common/tile/TileLauncherPrefab.java new file mode 100644 index 000000000..c6665e020 --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileLauncherPrefab.java @@ -0,0 +1,191 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; + +import mekanism.api.Pos3D; +import mekanism.common.integration.IComputerIntegration; +import mekanism.common.tile.TileEntityElectricBlock; +import net.minecraft.nbt.NBTTagCompound; +import defense.api.FrequencyGrid; +import defense.api.IBlockFrequency; +import defense.api.ILauncherController; + +public abstract class TileLauncherPrefab extends TileEntityElectricBlock implements ILauncherController, IComputerIntegration, IBlockFrequency +{ + protected Pos3D targetPos = null; + protected int frequency = 0; + + private boolean initiated = false; + + public TileLauncherPrefab(String name, double baseMaxEnergy) + { + super(name, baseMaxEnergy); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + if(!initiated) + { + initiate(); + initiated = true; + } + } + + public void initiate() + { + FrequencyGrid.instance().register(this); + } + + + @Override + public void invalidate() + { + FrequencyGrid.instance().unregister(this); + super.invalidate(); + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + super.handlePacketData(dataStream); + + if(worldObj.isRemote) + { + frequency = dataStream.readInt(); + + if(dataStream.readBoolean()) + { + targetPos = new Pos3D(dataStream.readDouble(), dataStream.readDouble(), dataStream.readDouble()); + } + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(frequency); + + if(targetPos != null) + { + data.add(true); + data.add(targetPos.xPos); + data.add(targetPos.yPos); + data.add(targetPos.zPos); + } + else { + data.add(false); + } + + return data; + } + + @Override + public int getFrequency() + { + return this.frequency; + } + + @Override + public void setFrequency(int frequency) + { + this.frequency = frequency; + } + + @Override + public Pos3D getTarget() + { + if (this.targetPos == null) + { + if (this.getLauncherType() == LauncherType.CRUISE) + { + this.targetPos = new Pos3D(this.xCoord, this.yCoord, this.zCoord); + } + else + { + this.targetPos = new Pos3D(this.xCoord, 0, this.zCoord); + } + } + + return this.targetPos; + } + + @Override + public void setTarget(Pos3D target) + { + this.targetPos = target.floor(); + } + + @Override + public String[] getMethods() + { + return new String[] { "launch", "getTarget", "setTarget", "canLaunch", "getMissile" }; + } + + @Override + public Object[] invoke(int method, Object[] arguments) throws Exception + { + switch (method) + { + case 0: + this.launch(); + return null; + case 1: + return new Object[] { this.getTarget().xPos, this.getTarget().yPos, this.getTarget().zPos }; + case 2: + if (arguments[0] != null && arguments[1] != null && arguments[2] != null) + { + try + { + this.setTarget(new Pos3D(((Double) arguments[0]).doubleValue(), ((Double) arguments[1]).doubleValue(), ((Double) arguments[2]).doubleValue())); + } + catch (Exception e) + { + e.printStackTrace(); + throw new Exception("Target Parameter is Invalid."); + } + } + return null; + case 3: + return new Object[] { this.canLaunch() }; + case 4: + if (this.getMissile() != null) + { + return new Object[] { this.getMissile().getExplosiveType().getMissileName() }; + } + else + { + return null; + } + } + + throw new Exception("Invalid Launcher Function."); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + this.targetPos = Pos3D.read(nbt.getCompoundTag("target")); + this.frequency = nbt.getInteger("frequency"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + + if (this.targetPos != null) + { + nbt.setTag("target", this.targetPos.write(new NBTTagCompound())); + } + + nbt.setInteger("frequency", frequency); + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileLauncherScreen.java b/src/main/java/mekanism/defense/common/tile/TileLauncherScreen.java new file mode 100644 index 000000000..9c4c6c7f2 --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileLauncherScreen.java @@ -0,0 +1,305 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import defense.api.IMissile; +import defense.api.ITier; +import defense.common.DefenseTech; +import defense.common.base.IBlockActivate; + +/** This tile entity is for the screen of the missile launcher + * + * @author Calclavia */ +public class TileLauncherScreen extends TileLauncherPrefab implements IBlockActivate, ITier +{ + // The tier of this screen + private int tier = 0; + + // The missile launcher base in which this + // screen is connected with + public TileLauncherBase launcherBase = null; + + public short launchHeight = 3; + + private final Set playersUsing = new HashSet(); + + public TileLauncherScreen() + { + super("LauncherScreen", 10000000); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + if(launcherBase == null) + { + for(ForgeDirection side : MekanismUtils.SIDE_DIRS) + { + Coord4D position = new Coord4D(xCoord, yCoord, zCoord); + position.step(side); + + TileEntity tileEntity = position.getTileEntity(worldObj); + + if(tileEntity != null) + { + if(tileEntity instanceof TileLauncherBase) + { + launcherBase = (TileLauncherBase)tileEntity; + setFacing((short)side.getOpposite().ordinal()); + } + } + } + } + else { + if(launcherBase.isInvalid()) + { + launcherBase = null; + } + } + + if(!worldObj.isRemote) + { + if(ticker % 40 == 0 && worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) + { + launch(); + } + } + + if(!worldObj.isRemote) + { + if(ticker % 3 == 0) + { + if(targetPos == null) + { + targetPos = new Pos3D(xCoord, 0, zCoord); + } + } + + if(ticker % 600 == 0) + { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + } + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + if(!worldObj.isRemote) + { + int packetType = dataStream.readInt(); + + if(packetType == 1) + { + setFrequency(dataStream.readInt()); + } + else if(packetType == 2) + { + targetPos = new Pos3D(dataStream.readInt(), dataStream.readInt(), dataStream.readInt()); + + if(getTier() < 2) + { + targetPos.yPos = 0; + } + } + else if(packetType == 3) + { + launchHeight = (short)Math.max(Math.min(dataStream.readShort(), Short.MAX_VALUE), 3); + } + + return; + } + + super.handlePacketData(dataStream); + + if(worldObj.isRemote) + { + tier = dataStream.readInt(); + launchHeight = dataStream.readShort(); + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(tier); + data.add(launchHeight); + + return data; + } + + @Override + public void placeMissile(ItemStack itemStack) + { + if(launcherBase != null) + { + if(!launcherBase.isInvalid()) + { + launcherBase.setInventorySlotContents(0, itemStack); + } + } + } + + // Checks if the missile is launchable + @Override + public boolean canLaunch() + { + if(launcherBase != null && launcherBase.missile != null) + { + if(getEnergy() >= getLaunchCost()) + { + return launcherBase.isInRange(targetPos); + } + } + + return false; + } + + /** Calls the missile launcher base to launch it's missile towards a targeted location */ + @Override + public void launch() + { + if(canLaunch()) + { + setEnergy(getEnergy()-getLaunchCost()); + launcherBase.launchMissile(targetPos.clone(), launchHeight); + } + } + + /** Gets the display status of the missile launcher + * + * @return The string to be displayed */ + @Override + public String getStatus() + { + String color = "\u00a74"; + String status = LangUtils.localize("gui.misc.idle"); + + if(launcherBase == null) + { + status = LangUtils.localize("gui.launcherScreen.statusMissing"); + } + else if(getEnergy() < getLaunchCost()) + { + status = LangUtils.localize("gui.launcherScreen.statusNoPower"); + } + else if(launcherBase.missile == null) + { + status = LangUtils.localize("gui.launcherScreen.statusEmpty"); + } + else if(targetPos == null) + { + status = LangUtils.localize("gui.launcherScreen.statusInvalid"); + } + else if(launcherBase.isTargetTooClose(targetPos)) + { + status = LangUtils.localize("gui.launcherScreen.statusClose"); + } + else if(launcherBase.isTargetTooFar(targetPos)) + { + status = LangUtils.localize("gui.launcherScreen.statusFar"); + } + else { + color = "\u00a72"; + status = LangUtils.localize("gui.launcherScreen.statusReady"); + } + + return color + status; + } + + /** Reads a tile entity from NBT. */ + @Override + public void readFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readFromNBT(par1NBTTagCompound); + + tier = par1NBTTagCompound.getInteger("tier"); + launchHeight = par1NBTTagCompound.getShort("launchHeight"); + } + + /** Writes a tile entity to NBT. */ + @Override + public void writeToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeToNBT(par1NBTTagCompound); + + par1NBTTagCompound.setInteger("tier", tier); + par1NBTTagCompound.setShort("launchHeight", launchHeight); + } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + + @Override + public int getTier() + { + return tier; + } + + @Override + public void setTier(int t) + { + tier = t; + } + + public long getLaunchCost() + { + switch(getTier()) + { + case 0: + return 50000; + case 1: + return 80000; + } + + return 100000; + } + + @Override + public boolean onActivated(EntityPlayer entityPlayer) + { + if(!worldObj.isRemote) + { + entityPlayer.openGui(DefenseTech.INSTANCE, 0, worldObj, xCoord, yCoord, zCoord); + } + + return true; + } + + @Override + public LauncherType getLauncherType() + { + return LauncherType.TRADITIONAL; + } + + @Override + public IMissile getMissile() + { + if(launcherBase != null) + { + return launcherBase.missile; + } + + return null; + } +} diff --git a/src/main/java/mekanism/defense/common/tile/TileRadarStation.java b/src/main/java/mekanism/defense/common/tile/TileRadarStation.java new file mode 100644 index 000000000..d27b86450 --- /dev/null +++ b/src/main/java/mekanism/defense/common/tile/TileRadarStation.java @@ -0,0 +1,508 @@ +package defense.common.tile; + +import io.netty.buffer.ByteBuf; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import mekanism.api.Coord4D; +import mekanism.api.Pos3D; +import mekanism.api.Range4D; +import mekanism.common.Mekanism; +import mekanism.common.integration.IComputerIntegration; +import mekanism.common.network.PacketTileEntity.TileEntityMessage; +import mekanism.common.tile.TileEntityElectricBlock; +import mekanism.common.util.LangUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.ChunkCoordIntPair; +import net.minecraftforge.common.ForgeChunkManager; +import net.minecraftforge.common.ForgeChunkManager.Ticket; +import net.minecraftforge.common.ForgeChunkManager.Type; +import net.minecraftforge.common.util.ForgeDirection; +import defense.api.FrequencyGrid; +import defense.api.IBlockFrequency; +import defense.api.IItemFrequency; +import defense.api.IRadarDetectable; +import defense.api.RadarRegistry; +import defense.common.DefenseTech; +import defense.common.Vector2; +import defense.common.base.IBlockActivate; +import defense.common.base.IChunkLoadHandler; +import defense.common.base.IRedstoneProvider; +import defense.common.entity.EntityMissile; + +public class TileRadarStation extends TileEntityElectricBlock implements IChunkLoadHandler, IRedstoneProvider, IComputerIntegration, IBlockActivate, IBlockFrequency +{ + public final static int MAX_DETECTION_RANGE = 500; + + public float rotation = 0; + public int alarmRange = 100; + public int safetyRange = 50; + public List detectedEntities = new ArrayList(); + + public boolean initiated = false; + + public List detectedTiles = new ArrayList(); + public boolean emitAll = true; + /** List of all incoming missiles, in order of distance. */ + private List incomingMissiles = new ArrayList(); + + public static final double ENERGY_USAGE = 400; + + protected int frequency = 0; + + private Ticket ticket; + + public TileRadarStation() + { + super("RadarStation", 1000000); + RadarRegistry.register(this); + } + + public void initiate() + { + FrequencyGrid.instance().register(this); + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord)); + chunkLoaderInit(ForgeChunkManager.requestTicket(DefenseTech.INSTANCE, worldObj, Type.NORMAL)); + } + + @Override + public String getInventoryName() + { + return LangUtils.localize("machine.RadarStation.name"); + } + + @Override + public void chunkLoaderInit(Ticket t) + { + if(!worldObj.isRemote) + { + if(ticket == null && t != null) + { + ticket = t; + Coord4D.get(this).write(ticket.getModData()); + ForgeChunkManager.forceChunk(ticket, new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4)); + } + } + } + + @Override + public void onUpdate() + { + super.onUpdate(); + + if(!initiated) + { + initiate(); + initiated = true; + } + + if(!worldObj.isRemote) + { + //Update client every 2 seconds + if(ticker % 40 == 0) + { + Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getNetworkedData(new ArrayList())), new Range4D(Coord4D.get(this)));;; + } + } + + //If we have energy + if(getEnergy() >= ENERGY_USAGE) + { + rotation += 0.08f; + + if(rotation > 360) + { + rotation = 0; + } + + if(!worldObj.isRemote) + { + setEnergy(getEnergy() - ENERGY_USAGE); + } + + int prevDetectedEntities = detectedEntities.size(); + + // Do a radar scan + doScan(); + + if(prevDetectedEntities != detectedEntities.size()) + { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType()); + } + //Check for incoming and launch anti-missiles if + if(ticker % 20 == 0 && incomingMissiles.size() > 0) + { + for(IBlockFrequency blockFrequency : FrequencyGrid.instance().get()) + { + if(blockFrequency instanceof TileLauncherPrefab) + { + TileLauncherPrefab launcher = (TileLauncherPrefab)blockFrequency; + + if(new Pos3D(this).distance(new Pos3D(launcher)) < alarmRange && launcher.getFrequency() == getFrequency()) + { + if(launcher instanceof TileLauncherScreen) + { + double height = launcher.getTarget() != null ? launcher.getTarget().yPos : 0; + launcher.setTarget(new Pos3D(incomingMissiles.get(0).posX, height, incomingMissiles.get(0).posZ)); + } + else { + launcher.setTarget(new Pos3D(incomingMissiles.get(0))); + } + } + } + } + } + } + else + { + if(detectedEntities.size() > 0) + { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType()); + } + + incomingMissiles.clear(); + detectedEntities.clear(); + detectedTiles.clear(); + } + + if(ticker % 40 == 0) + { + worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType()); + } + } + + @Override + public int getFrequency() + { + return frequency; + } + + @Override + public void setFrequency(int freq) + { + frequency = freq; + } + + private void doScan() + { + incomingMissiles.clear(); + detectedEntities.clear(); + detectedTiles.clear(); + + List entities = RadarRegistry.getEntitiesWithinRadius(new Vector2(new Pos3D(this)), MAX_DETECTION_RANGE); + + for(Entity entity : entities) + { + if(entity instanceof EntityMissile) + { + if(((EntityMissile) entity).airborneTicks > -1) + { + if(!detectedEntities.contains(entity)) + { + detectedEntities.add(entity); + } + + if(isMissileGoingToHit((EntityMissile)entity)) + { + if(incomingMissiles.size() > 0) + { + /** Sort in order of distance */ + double dist = new Pos3D(this).distance(new Pos3D(entity)); + + for(int i = 0; i < incomingMissiles.size(); i++) + { + EntityMissile daoDan = incomingMissiles.get(i); + + if(dist < new Pos3D(this).distance(new Pos3D(daoDan))) + { + incomingMissiles.add(i, (EntityMissile) entity); + break; + } + else if(i == incomingMissiles.size() - 1) + { + incomingMissiles.add((EntityMissile) entity); + break; + } + } + } + else { + incomingMissiles.add((EntityMissile) entity); + } + } + } + } + else + { + detectedEntities.add(entity); + } + } + + List players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - MAX_DETECTION_RANGE, yCoord - MAX_DETECTION_RANGE, zCoord - MAX_DETECTION_RANGE, xCoord + MAX_DETECTION_RANGE, yCoord + MAX_DETECTION_RANGE, zCoord + MAX_DETECTION_RANGE)); + + for(EntityPlayer player : players) + { + if(player != null) + { + boolean youHuoLuan = false; + + for(int i = 0; i < player.inventory.getSizeInventory(); i++) + { + ItemStack itemStack = player.inventory.getStackInSlot(i); + + if(itemStack != null) + { + if(itemStack.getItem() instanceof IItemFrequency) + { + youHuoLuan = true; + break; + } + } + } + + if(!youHuoLuan) + { + detectedEntities.add(player); + } + } + } + + for(TileEntity jiQi : RadarRegistry.getTileEntitiesInArea(new Vector2(xCoord - TileRadarStation.MAX_DETECTION_RANGE, zCoord - TileRadarStation.MAX_DETECTION_RANGE), new Vector2(xCoord + TileRadarStation.MAX_DETECTION_RANGE, zCoord + TileRadarStation.MAX_DETECTION_RANGE))) + { + if(jiQi instanceof TileRadarStation) + { + if(((TileRadarStation) jiQi).getEnergy() > 0) + { + detectedTiles.add(jiQi); + } + } + else + { + if(detectedTiles instanceof IRadarDetectable) + { + if(((IRadarDetectable) detectedTiles).canDetect(this)) + { + detectedTiles.add(jiQi); + } + } + else + { + detectedTiles.add(jiQi); + } + } + } + } + + /** Checks to see if the missile will hit within the range of the radar station + * + * @param missile - missile being checked + * @return true if it will */ + public boolean isMissileGoingToHit(EntityMissile missile) + { + if(missile == null || missile.targetVector == null) + { + return false; + } + return (Vector2.distance(new Vector2(new Pos3D(missile)), new Vector2(xCoord, zCoord)) < alarmRange && Vector2.distance(new Vector2(missile.targetVector), new Vector2(xCoord, zCoord)) < safetyRange); + } + + @Override + public void handlePacketData(ByteBuf dataStream) + { + if(!worldObj.isRemote) + { + int packetType = dataStream.readInt(); + + if(packetType == 2) + { + safetyRange = dataStream.readInt(); + } + else if(packetType == 3) + { + alarmRange = dataStream.readInt(); + } + else if(packetType == 4) + { + frequency = dataStream.readInt(); + } + + return; + } + + super.handlePacketData(dataStream); + + if(worldObj.isRemote) + { + alarmRange = dataStream.readInt(); + safetyRange = dataStream.readInt(); + frequency = dataStream.readInt(); + } + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(alarmRange); + data.add(safetyRange); + data.add(frequency); + + return data; + } + + @Override + public boolean canSetFacing(int facing) + { + return facing != 0 && facing != 1; + } + + @Override + public boolean isPoweringTo(ForgeDirection side) + { + if(incomingMissiles.size() > 0) + { + if(emitAll) + { + return true; + } + + for(EntityMissile incomingMissile : incomingMissiles) + { + Vector2 position = new Vector2(new Pos3D(incomingMissile)); + ForgeDirection missileTravelDirection = ForgeDirection.UNKNOWN; + double closest = -1; + + for(int i = 2; i < 6; i++) + { + double dist = Vector2.distance(position, new Vector2(xCoord + ForgeDirection.getOrientation(i).offsetX, zCoord + ForgeDirection.getOrientation(i).offsetZ)); + + if(dist < closest || closest < 0) + { + missileTravelDirection = ForgeDirection.getOrientation(i); + closest = dist; + } + } + + if(missileTravelDirection.getOpposite() == side) + { + return true; + } + } + } + + return false; + } + + @Override + public boolean isIndirectlyPoweringTo(ForgeDirection side) + { + return isPoweringTo(side); + } + + /** Reads a tile entity from NBT. */ + @Override + public void readFromNBT(NBTTagCompound nbt) + { + super.readFromNBT(nbt); + safetyRange = nbt.getInteger("safetyBanJing"); + alarmRange = nbt.getInteger("alarmBanJing"); + emitAll = nbt.getBoolean("emitAll"); + frequency = nbt.getInteger("frequency"); + } + + /** Writes a tile entity to NBT. */ + @Override + public void writeToNBT(NBTTagCompound nbt) + { + super.writeToNBT(nbt); + nbt.setInteger("safetyBanJing", safetyRange); + nbt.setInteger("alarmBanJing", alarmRange); + nbt.setBoolean("emitAll", emitAll); + nbt.setInteger("frequency", frequency); + } + + @Override + public boolean onActivated(EntityPlayer entityPlayer) + { + if(entityPlayer.inventory.getCurrentItem() != null) + { + if(MekanismUtils.hasUsableWrench(entityPlayer, xCoord, yCoord, zCoord)) + { + if(!worldObj.isRemote) + { + emitAll = !emitAll; + entityPlayer.addChatMessage(new ChatComponentText(LangUtils.localize("message.radar.redstone") + " " + emitAll)); + } + + return true; + } + } + + entityPlayer.openGui(DefenseTech.INSTANCE, 0, worldObj, xCoord, yCoord, zCoord); + return true; + } + + @Override + public String[] getMethods() + { + return new String[] { "getEntities", "getBlocks" }; + } + + @Override + public Object[] invoke(int method, Object[] arguments) throws Exception + { + if(getEnergy() < ENERGY_USAGE) + { + throw new Exception("Radar has insufficient electricity!"); + } + + HashMap returnArray = new HashMap(); + int count = 0; + + switch (method) + { + case 0: + List entities = RadarRegistry.getEntitiesWithinRadius(new Vector2(new Pos3D(this)), alarmRange); + + for(Entity entity : entities) + { + returnArray.put("x_" + count, entity.posX); + returnArray.put("y_" + count, entity.posY); + returnArray.put("z_" + count, entity.posZ); + count++; + } + + return new Object[] { returnArray }; + case 1: + for(TileEntity jiQi : RadarRegistry.getTileEntitiesInArea(new Vector2(xCoord - TileRadarStation.MAX_DETECTION_RANGE, zCoord - TileRadarStation.MAX_DETECTION_RANGE), new Vector2(xCoord + TileRadarStation.MAX_DETECTION_RANGE, zCoord + TileRadarStation.MAX_DETECTION_RANGE))) + { + returnArray.put("x_" + count, (double) jiQi.xCoord); + returnArray.put("y_" + count, (double) jiQi.yCoord); + returnArray.put("z_" + count, (double) jiQi.zCoord); + count++; + } + return new Object[] { returnArray }; + } + + throw new Exception("Invalid Radar Function."); + } + + @Override + public void invalidate() + { + FrequencyGrid.instance().unregister(this); + ForgeChunkManager.releaseTicket(ticket); + RadarRegistry.unregister(this); + + super.invalidate(); + } +} diff --git a/src/main/resources/assets/defense/lang/de_DE.lang b/src/main/resources/assets/defense/lang/de_DE.lang new file mode 100644 index 000000000..35ddb4a0f --- /dev/null +++ b/src/main/resources/assets/defense/lang/de_DE.lang @@ -0,0 +1,259 @@ +## Translated by Vexatos +itemGroup.DefenseTech=DefenseTech + +potion.toxin=Toxin +potion.virus=Virus +potion.frostBite=Erfrierung +potion.radiation=Strahlung + +## Items +item.sulfur.name=Schwefel +item.saltpeter.name=Salpeter +item.poisonPowder.name=Giftpulver +item.antidote.name=Gegengift +item.radarGun.name=Radarpistole +item.remoteDetonator.name=Fernzünder +item.defuser.name=Entschärfer +item.laserDesignator.name=Laser-Zielerfasser +item.tracker.name=Tracker +item.signalDisrupter.name=Störsender +item.rocketLauncher.name=Raketenwerfer + +## Machines +machine.LauncherBase.0.name=Startplattform Stufe 1 +machine.LauncherBase.1.name=Startplattform Stufe 2 +machine.LauncherBase.2.name=Startplattform Stufe 3 +machine.LauncherScreen.0.name=Abschuss-Steuerpult Stufe 1 +machine.LauncherScreen.1.name=Abschuss-Steuerpult Stufe 2 +machine.LauncherScreen.2.name=Abschuss-Steuerpult Stufe 3 +machine.LauncherFrame.0.name=Startplatforms-Stützgestell Stufe 1 +machine.LauncherFrame.1.name=Startplatforms-Stützgestell Stufe 2 +machine.LauncherFrame.2.name=Startplatforms-Stützgestell Stufe 3 +machine.RadarStation.name=Radarstation +machine.EmpTower.name=EMP-Turm +machine.CruiseLauncher.name=Mobile Abschussrampe +machine.MissileCoordinator.name=Raketen-Koordinator + +## Blocks +tile.sulfurOre.name=Schwefelerz + +## Explosives + +## Block Form +explosive.condensed.name=Verdichteter Sprengstoff +explosive.shrapnel.name=Schrapnellsprengstoff +explosive.incendiary.name=Brennender Sprengstoff +explosive.debilitation.name=Entkräftender Sprengstoff +explosive.chemical.name=Chemischer Sprengstoff +explosive.anvil.name=Amboss-Sprengstoff +explosive.repulsive.name=Abstoßender Sprengstoff +explosive.attractive.name=Anziehener Sprengstoff + +explosive.fragmentation.name=Splitternder Sprengstoff +explosive.contagious.name=Ansteckender Sprengstoff +explosive.sonic.name=Schallsprengstoff +explosive.breaching.name=Durchschlagssprengstoff +explosive.rejuvenation.name=Revitalisierungssprengstoff +explosive.thermobaric.name=Thermobarischer Sprengstoff + +explosive.nuclear.name=Atomarer Sprengstoff +explosive.emp.name=EMP-Sprengstoff +explosive.exothermic.name=Exothermer Sprengstoff +explosive.endothermic.name=Endothermer Sprengstoff +explosive.antiGravitational.name=Anti-Schwerkraft-Sprengstoff +explosive.ender.name=Endersprengstoff +explosive.hypersonic.name=Hyperschallsprengstoff + +explosive.antimatter.name=Antimateriensprengstoff +explosive.redMatter.name=Rotmateriensprengstoff + +explosive.sMine.name=S-Mine + +## Missile Form +missile.condensed.name=Konventionelle Rakete +missile.shrapnel.name=Schrapnellrakete +missile.incendiary.name=Brandrakete +missile.debilitation.name=Entkräftende Rakete +missile.chemical.name=Chemische Rakete +missile.anvil.name=Amboss-Rakete +missile.repulsive.name=Abstoßende Rakete +missile.attractive.name=Anziehende Rakete + +missile.fragmentation.name=Splitterrakete +missile.contagious.name=Ansteckende Rakete +missile.sonic.name=Schallrakete +missile.breaching.name=Durchschlagsrakete +missile.rejuvenation.name=Revitalisierungsrakete +missile.thermobaric.name=Thermobarische Rakete + +missile.nuclear.name=Atomrakete +missile.emp.name=EMP-Rakete +missile.exothermic.name=Exotherme Rakete +missile.endothermic.name=Endotherme Rakete +missile.antiGravitational.name=Anti-Schwerkraft-Rakete +missile.ender.name=Enderrakete +missile.hypersonic.name=Hyperschallrakete + +missile.antimatter.name=Antimaterienrakete +missile.redMatter.name=Rotmaterienrakete + +## Special Missiles +missile.missileModule.name=Raketenmodul +missile.antiBallistic.name=Flugabwehrrakete +missile.cluster.name=Streurakete +missile.nuclearCluster.name=Atomare Streurakete +missile.homing.name=Verfolgungsrakete + +## Grenades +grenade.condensed.name=Konventionelle Granate +grenade.shrapnel.name=Schrapnellgranate +grenade.incendiary.name=Brandgranate +grenade.debilitation.name=Entkräftende Granate +grenade.chemical.name=Chemische Granate +grenade.anvil.name=Ambossgranate +grenade.repulsive.name=Abstoßende Granate +grenade.attractive.name=Anziehende Granate + +## Explosive Minecarts +minecart.condensed.name=Explosive Lore +minecart.shrapnel.name=Schrapnelllore +minecart.incendiary.name=Brandlore +minecart.debilitation.name=Entkräftende Lore +minecart.chemical.name=Chemische Lore +minecart.anvil.name=Amboss-Lore +minecart.repulsive.name=Abstoßende Lore +minecart.attractive.name=Anziehende Lore + +minecart.fragmentation.name=Splitterlore +minecart.contagious.name=Ansteckede Lore +minecart.sonic.name=Schall-Lore +minecart.breaching.name=Durchbrechende Lore +minecart.rejuvenation.name=Revitalisierungslore +minecart.thermobaric.name=Thermobarische Lore + +## Chat messages +message.tracker.nowtrack=Nun Verfolgend: +message.tracker.nopower=Tracker hat nicht genügend Energie! +message.tracker.banned=Ein Tracker ist in diesem Bereich verboten! + +message.defuser.nopower=Entschärfer hat nicht genügend Energie! + +message.designator.callTime=Rufe Luftschlag in: +message.designator.blast=Luftschlag kommt! +message.designator.setFreq=Laser-Zielerfasser-Frequenz eingestellt: +message.designator.failFreq=Frequenz muss größer als null sein. +message.designator.callBlast=Rufe Luftschlag zu erfasster Position! +message.designator.nopower=Laser-Zielerfasser hat nicht genügend Energie! +message.designator.noFreq=Laser-Zielerfasser hat keine Frequenz eingestellt! + +message.radarGun.scanned=Koordinaten gescannt: X:%x, Y:%y, Z:%z - Entfernung: %d +message.radarGun.nopower=Radarpistole hat nicht genügend Energie! +message.radarGun.transfer=Koordinateninformation übertragen! +message.radarGun.noCoords=Du musst eine Koordinate scannen! +message.launcher.protected=Region wird geschützt. +message.detonator.locked=Fernzünder gebunden an: X:%x, Y:%y, Z:%z +message.detonator.nopower=Fernzünder hat nicht genügend Energie! +message.radar.redstone=Radar-Redstone-Emission auf allen Seiten: + +## GUI stuff +gui.misc.nopower=Nicht genügend Energie! +gui.misc.idle=Bereit +gui.misc.freq=Frequenz: +gui.misc.XCoord=X-Koord: +gui.misc.YCoord=Y-Koord: +gui.misc.ZCoord=Z-Koord: +gui.misc.x=X: +gui.misc.y=Y: +gui.misc.z=Z: +gui.misc.dimension=Dimension: +gui.misc.status=Status: +gui.misc.voltage=Spannung: + +gui.tracker.freq=Frequenz +gui.detector.name=Umgebungs-Scanner +gui.detector.all=Alles +gui.detector.players=Spieler +gui.detector.mobs=Lebendes +gui.detector.range=Erkennungsradius +gui.detector.min=Min +gui.detector.max=Max +gui.detector.exclude=Ausschließen +gui.detector.include=Einschließen +gui.detector.target=Ziel: +gui.detector.on=An +gui.detector.status=Status: + +gui.empTower.name=EMP-Turm +gui.empTower.missiles=Raketen +gui.empTower.elec=Energie +gui.empTower.both=Beides +gui.empTower.radius=EMP-Radius: %p Blöcke +gui.empTower.effect=EMP-Effekt: +gui.empTower.effectDebilitate=Elektronik schwächen +gui.empTower.effectDisrupt=Raketen stören +gui.empTower.effectDeplete=Energie erschöpfen +gui.empTower.mode=Modus: +gui.empTower.ready=Bereit zum Feuern! + +gui.launcherBase.name=Abschussplattform +gui.launcherBase.place=Platziere Rakete +gui.launcherScreen.name=Abschuss-Steuerpult +gui.launcherScreen.detHeight=Detonationshöhe: +gui.launcherScreen.lockHeight=Feste Höhe: +gui.launcherScreen.target=Raketenziel +gui.launcherScreen.inaccuracy=Ungenauigkeit: %p Blöcke +gui.launcherScreen.statusMissing=Nicht verbunden! +gui.launcherScreen.statusNoPower=Zu wenig Energie! +gui.launcherScreen.statusEmpty=Raketensilo ist leer! +gui.launcherScreen.statusInvalid=Ziel ist ungültig! +gui.launcherScreen.statusClose=Ziel zu nah! +gui.launcherScreen.statusFar=Ziel zu weit entfernt! +gui.launcherScreen.statusReady=Bereit zum Start! +gui.launcherCruise.name=Mobile Rampe +gui.launcherCruise.statusNoPower=Keine Energie! +gui.launcherCruise.statusEmpty=Silo leer! +gui.launcherCruise.statusInvalid=Ziel ungültig! +gui.launcherCruise.statusReady=Bereit! + +gui.coordinator.name=Raketen-Koordinator +gui.coordinator.sim=Pfadsimulator +gui.coordinator.from=Von: +gui.coordinator.to=Bis: +gui.coordinator.displace=Abstand: %p Meter +gui.coordinator.arc=Weg: %p Meter +gui.coordinator.time=Zeit: %p Sekunden +gui.coordinator.direction=Richtung: +gui.coordinator.wip=Mehr Funktionen kommen! + +gui.assembler.name=Raketentisch +gui.radar.coords=Koordinaten: +gui.radar.zoneSafe=Sicherheitszone: +gui.radar.zoneAlarm=Alarmzone: +gui.radar.on=Radar An! +gui.radar.nopower=Keine Energie! + +gui.terminal.name=Terminal +gui.platform.ammo=Munition +gui.platform.upgrades=Upgrades +gui.platform.joules=von %j +gui.platform.access=Nutzerzugriff + +## Tooltips +info.misc.freq=Frequenz: +info.tracker.tracking=Verfolgend: +info.designator.noFreq=Frequenz: Nicht gesetzt +info.radarGun.savedCoords=Gespeicherte Koordinaten: +info.radarGun.meters=Meter +info.detonator.linked=Verbundener Sprengsatz: +info.detonator.noLink=Kein verbundener Sprengsatz +info.misc.tier=Explosivstufe +info.rocketlauncher.tooltip=Dieser Raketenwerfer kann Raketen bis Stufe %s abfeuern +info.tracker.tooltip=Linksklicke ein Lebewesen (auch Spieler) und der Tracker wird in dessen Richtung zeigen. + +## Config Gui +defensetech.configgui.ctgy.general=Generelle Einstellungen +defensetech.configgui.ctgy.explosives=Sprengstoffeinstellungen + +## Config Tooltips +defensetech.configgui.ctgy.general.tooltip=Generelle Einstellungen bezüglich DefenseTech und all seinen Modulen +defensetech.configgui.ctgy.explosives.tooltip=Einstellungen bezüglich des Aktivierens und Deaktivierens einzelner Sprengstoffarten diff --git a/src/main/resources/assets/defense/lang/en_US.lang b/src/main/resources/assets/defense/lang/en_US.lang new file mode 100644 index 000000000..d1ba846a2 --- /dev/null +++ b/src/main/resources/assets/defense/lang/en_US.lang @@ -0,0 +1,259 @@ +## Master language file +itemGroup.DefenseTech=DefenseTech + +potion.toxin=Toxin +potion.virus=Virus +potion.frostBite=Frost Bite +potion.radiation=Radiation + +## Items +item.sulfur.name=Sulfur +item.saltpeter.name=Saltpeter +item.poisonPowder.name=Poison Powder +item.antidote.name=Antidote +item.radarGun.name=Radar Gun +item.remoteDetonator.name=Remote Detonator +item.defuser.name=Defuser +item.laserDesignator.name=Laser Designator +item.tracker.name=Tracker +item.signalDisrupter.name=Signal Disrupter +item.rocketLauncher.name=Rocket Launcher + +## Machines +machine.LauncherBase.0.name=Launcher Platform T1 +machine.LauncherBase.1.name=Launcher Platform T2 +machine.LauncherBase.2.name=Launcher Platform T3 +machine.LauncherScreen.0.name=Launcher Control Panel T1 +machine.LauncherScreen.1.name=Launcher Control Panel T2 +machine.LauncherScreen.2.name=Launcher Control Panel T3 +machine.LauncherFrame.0.name=Launcher Support Frame T1 +machine.LauncherFrame.1.name=Launcher Support Frame T2 +machine.LauncherFrame.2.name=Launcher Support Frame T3 +machine.RadarStation.name=Radar Station +machine.EmpTower.name=EMP Tower +machine.CruiseLauncher.name=Cruise Launcher +machine.MissileCoordinator.name=Missile Coordinator + +## Blocks +tile.sulfurOre.name=Sulfur Ore + +## Explosives + +## Block Form +explosive.condensed.name=Condensed Explosives +explosive.shrapnel.name=Shrapnel Explosives +explosive.incendiary.name=Incendiary Explosives +explosive.debilitation.name=Debilitation Explosives +explosive.chemical.name=Chemical Explosives +explosive.anvil.name=Anvil Explosives +explosive.repulsive.name=Repulsive Explosives +explosive.attractive.name=Attractive Explosives + +explosive.fragmentation.name=Fragmentation Explosives +explosive.contagious.name=Contagious Explosives +explosive.sonic.name=Sonic Explosives +explosive.breaching.name=Breaching Explosives +explosive.rejuvenation.name=Rejuvenation Explosives +explosive.thermobaric.name=Thermobaric Explosives + +explosive.nuclear.name=Nuclear Explosives +explosive.emp.name=EMP Explosives +explosive.exothermic.name=Exothermic Explosives +explosive.endothermic.name=Endothermic Explosives +explosive.antiGravitational.name=Anti-Gravitational Explosives +explosive.ender.name=Ender Explosives +explosive.hypersonic.name=Hypersonic Explosives + +explosive.antimatter.name=Antimatter Explosives +explosive.redMatter.name=Red Matter Explosives + +explosive.sMine.name=S-Mine + +## Missile Form +missile.condensed.name=Conventional Missile +missile.shrapnel.name=Shrapnel Missile +missile.incendiary.name=Incendiary Missile +missile.debilitation.name=Debilitation Missile +missile.chemical.name=Chemical Missile +missile.anvil.name=Anvil Missile +missile.repulsive.name=Repulsive Missile +missile.attractive.name=Attractive Missile + +missile.fragmentation.name=Fragmentation Missile +missile.contagious.name=Contagious Missile +missile.sonic.name=Sonic Missile +missile.breaching.name=Breaching Missile +missile.rejuvenation.name=Rejuvenation Missile +missile.thermobaric.name=Thermobaric Missile + +missile.nuclear.name=Nuclear Missile +missile.emp.name=EMP Missile +missile.exothermic.name=Exothermic Missile +missile.endothermic.name=Endothermic Missile +missile.antiGravitational.name=Anti-Gravitational Missile +missile.ender.name=Ender Missile +missile.hypersonic.name=Hypersonic Missile + +missile.antimatter.name=Antimatter Missile +missile.redMatter.name=Red Matter Missile + +## Special Missiles +missile.missileModule.name=Missile Module +missile.antiBallistic.name=Anti-Ballistic Missile +missile.cluster.name=Cluster Missile +missile.nuclearCluster.name=Nuclear Cluster Missile +missile.homing.name=Homing Missile + +## Grenades +grenade.condensed.name=Conventional Grenade +grenade.shrapnel.name=Shrapnel Grenade +grenade.incendiary.name=Incendiary Grenade +grenade.debilitation.name=Debilitation Grenade +grenade.chemical.name=Chemical Grenade +grenade.anvil.name=Anvil Grenade +grenade.repulsive.name=Repulsive Grenade +grenade.attractive.name=Attractive Grenade + +## Explosive Minecarts +minecart.condensed.name=Explosive Cart +minecart.shrapnel.name=Shrapnel Minecart +minecart.incendiary.name=Incendiary Minecart +minecart.debilitation.name=Debilitation Minecart +minecart.chemical.name=Chemical Minecart +minecart.anvil.name=Anvil Minecart +minecart.repulsive.name=Repulsive Minecart +minecart.attractive.name=Attractive Minecart + +minecart.fragmentation.name=Fragmentation Minecart +minecart.contagious.name=Contagious Minecart +minecart.sonic.name=Sonic Minecart +minecart.breaching.name=Breaching Minecart +minecart.rejuvenation.name=Rejuvenation Minecart +minecart.thermobaric.name=Thermobaric Minecart + +## Chat messages +message.tracker.nowtrack=Now tracking: +message.tracker.nopower=Tracker out of electricity! +message.tracker.banned=Tracker is banned in this area! + +message.defuser.nopower=Defuser out of electricity! + +message.designator.callTime=Calling airstrike in: +message.designator.blast=Incoming airstrike! +message.designator.setFreq=Laser Designator frequency set: +message.designator.failFreq=Frequency must be greater than zero. +message.designator.callBlast=Calling airstrike onto designated position! +message.designator.nopower=Laser Designator out of electricity! +message.designator.noFreq=Laser Designator frequency not set! + +message.radarGun.scanned=Scanned Coordinates: X:%x, Y:%y, Z:%z - Distance: %d +message.radarGun.nopower=Radar gun out of electricity! +message.radarGun.transfer=Coordinate information transferred! +message.radarGun.noCoords=You must scan a coordinate! +message.launcher.protected=Region is being protected. +message.detonator.locked=Remote Locked to: X:%x, Y:%y, Z:%z +message.detonator.nopower=Remote out of electricity! +message.radar.redstone=Radar redstone all side emission: + +## GUI stuff +gui.misc.nopower=Insufficient electricity! +gui.misc.idle=Idle +gui.misc.freq=Frequency: +gui.misc.XCoord=X-Coord: +gui.misc.YCoord=Y-Coord: +gui.misc.ZCoord=Z-Coord: +gui.misc.x=X: +gui.misc.y=Y: +gui.misc.z=Z: +gui.misc.dimension=Dimension: +gui.misc.status=Status: +gui.misc.voltage=Voltage: + +gui.tracker.freq=Frequency +gui.detector.name=Proximity Detector +gui.detector.all=All +gui.detector.players=Players +gui.detector.mobs=Mobs +gui.detector.range=Detection Range +gui.detector.min=Min +gui.detector.max=Max +gui.detector.exclude=Exclude +gui.detector.include=Include +gui.detector.target=Target: +gui.detector.on=On +gui.detector.status=Status: + +gui.empTower.name=EMP Tower +gui.empTower.missiles=Missiles +gui.empTower.elec=Electricity +gui.empTower.both=Both +gui.empTower.radius=EMP Radius: %p blocks +gui.empTower.effect=EMP Effect: +gui.empTower.effectDebilitate=Debilitate Electronics +gui.empTower.effectDisrupt=Disrupt Missiles +gui.empTower.effectDeplete=Deplete Electricity +gui.empTower.mode=Mode: +gui.empTower.ready=Ready to blast! + +gui.launcherBase.name=Launcher Platform +gui.launcherBase.place=Place Missile +gui.launcherScreen.name=Launcher Control Panel +gui.launcherScreen.detHeight=Detonation Height: +gui.launcherScreen.lockHeight=Lock Height: +gui.launcherScreen.target=Missile Target +gui.launcherScreen.inaccuracy=Inaccuracy: %p blocks +gui.launcherScreen.statusMissing=Not connected! +gui.launcherScreen.statusNoPower=Insufficient electricity! +gui.launcherScreen.statusEmpty=Missile silo is empty! +gui.launcherScreen.statusInvalid=Target is invalid! +gui.launcherScreen.statusClose=Target too close! +gui.launcherScreen.statusFar=Target too far! +gui.launcherScreen.statusReady=Ready to launch! +gui.launcherCruise.name=Cruise Launcher +gui.launcherCruise.statusNoPower=No Power! +gui.launcherCruise.statusEmpty=Silo Empty! +gui.launcherCruise.statusInvalid=Invalid Target! +gui.launcherCruise.statusReady=Ready! + +gui.coordinator.name=Missile Coordinator +gui.coordinator.sim=Path Simulator +gui.coordinator.from=From: +gui.coordinator.to=To: +gui.coordinator.displace=Displacement: %p Meters +gui.coordinator.arc=Arc: %p Meters +gui.coordinator.time=Time: %p Seconds +gui.coordinator.direction=Direction: +gui.coordinator.wip=More features coming soon! + +gui.assembler.name=Missile Table +gui.radar.coords=Coordinates: +gui.radar.zoneSafe=Safe Zone: +gui.radar.zoneAlarm=Alarm Zone: +gui.radar.on=Radar On! +gui.radar.nopower=No Electricity! + +gui.terminal.name=Terminal +gui.platform.ammo=Ammunition +gui.platform.upgrades=Upgrades +gui.platform.joules=of %j +gui.platform.access=User Access + +## Tooltips +info.misc.freq=Frequency: +info.tracker.tracking=Tracking: +info.designator.noFreq=Frequency: Not Set +info.radarGun.savedCoords=Saved Coordinates: +info.radarGun.meters=Meters +info.detonator.linked=Linked Explosive: +info.detonator.noLink=No Linked Explosive +info.misc.tier=Explosive Tier +info.rocketlauncher.tooltip=This rocket launcher can fire up to Tier %s rockets +info.tracker.tooltip=Left Click on a mob (players aswell), and I will point to it. + +## Config Gui +defensetech.configgui.ctgy.general=General Settings +defensetech.configgui.ctgy.explosives=Explosive Settings + +## Config Tooltips +defensetech.configgui.ctgy.general.tooltip=General settings regarding DefenseTech and all its modules +defensetech.configgui.ctgy.explosives.tooltip=Settings regarding enabling and disabling of specific explosives \ No newline at end of file diff --git a/src/main/resources/assets/defense/lang/es_ES.lang b/src/main/resources/assets/defense/lang/es_ES.lang new file mode 100644 index 000000000..0d00a1d70 --- /dev/null +++ b/src/main/resources/assets/defense/lang/es_ES.lang @@ -0,0 +1,136 @@ + +itemGroup.ICBM=ICBM + +children=es_AR,es_MX,es_UY,es_VE + +## Items +item.icbm\:sulfur.name=Sulfuro +item.icbm\:poisonPowder.name=Polvo Venenoso +item.icbm\:antidote.name=Ant\u00EDdoto +item.icbm\:radarGun.name=Pistola Radar +item.icbm\:remoteDetonator.name=Detonador Remoto +item.icbm\:defuser.name=Desactivador +item.icbm\:laserDesignator.name=Designador L\u00E1ser +item.icbm\:tracker.name=Rastreador +item.icbm\:signalDisrupter.name=Disruptor de Se\u00F1al + +item.icbm\:bullet.0.name=Bala Convencional +item.icbm\:bullet.1.name=Bala Antimateria +item.icbm\:launcher.name=Lanzacohetes + +## ICBM Machines +icbm.machine.0.name=Plataforma de Lanzacohetes T1 +icbm.machine.1.name=Plataforma de Lanzacohetes T2 +icbm.machine.2.name=Plataforma de Lanzacohetes T3 +icbm.machine.3.name=Panel de Control de Lanzacohetes T1 +icbm.machine.4.name=Panel de Control de Lanzacohetes T2 +icbm.machine.5.name=Panel de Control de Lanzacohetes T3 +icbm.machine.6.name=Marco de Soporte para Lanzacohetes T1 +icbm.machine.7.name=Marco de Soporte para Lanzacohetes T2 +icbm.machine.8.name=Marco de Soporte para Lanzacohetes T3 +icbm.machine.9.name=Estaci\u00F3n de Radar +icbm.machine.10.name=Torre PEM +icbm.machine.12.name=Lanzacohetes Crucero + +## ICBM Explosives + +## Block Form +icbm.explosive.condensed.name=Explosivo Condensado +icbm.explosive.shrapnel.name=Explosivo de Esquirlas +icbm.explosive.incendiary.name=Explosivo Incendiario +icbm.explosive.chemical.name=Explosivo Qu\u00EDmico +icbm.explosive.anvil.name=Explosivo de Yunques +icbm.explosive.repulsive.name=Explosivo Repulsivo +icbm.explosive.attractive.name=Explosivo Atractivo + +icbm.explosive.fragmentation.name=Explosivo de Fragmentaci\u00F3n +icbm.explosive.contagious.name=Explosivo Contagioso +icbm.explosive.sonic.name=Explosivo S\u00F3nico +icbm.explosive.breaching.name=Explosivo Penetrante +icbm.explosive.rejuvenation.name=Explosivo Rejuvenecedor +icbm.explosive.thermobaric.name=Explosivo Termob\u00E1rico + +icbm.explosive.nuclear.name=Explosivo Nuclear +icbm.explosive.emp.name=Explosivo PEM +icbm.explosive.conflagration.name=Explosivo de Conflagraci\u00F3n +icbm.explosive.endothermic.name=Explosivo Endot\u00E9rmico +icbm.explosive.antiGravitational.name=Explosivo Anti-Gravitacional +icbm.explosive.ender.name=Explosivo Ender +icbm.explosive.hypersonic.name=Explosivo Hipers\u00F3nico + +icbm.explosive.antimatter.name=Explosivo de Antimateria +icbm.explosive.redMatter.name=Explosivo de Materia Roja + +icbm.explosive.sMine.name=Mina-S + +## Missile Form +icbm.missile.condensed.name=Misil Convencional +icbm.missile.shrapnel.name=Misil de Esquirlas +icbm.missile.incendiary.name=Misil Incendiario +icbm.missile.chemical.name=Misil Qu\u00EDmico +icbm.missile.anvil.name=Misil de Yunques +icbm.missile.repulsive.name=Misil Repulsivo +icbm.missile.attractive.name=Misil Atractivo + +icbm.missile.fragmentation.name=Misil de Fragmentaci\u00F3n +icbm.missile.contagious.name=Misil Contagioso +icbm.missile.sonic.name=Misil S\u00F3nico +icbm.missile.breaching.name=Misil Penetrante +icbm.missile.rejuvenation.name=Misil Rejuvenecedor +icbm.missile.thermobaric.name=Misil Termob\u00E1rico + +icbm.missile.nuclear.name=Misil Nuclear +icbm.missile.emp.name=Misil PEM +icbm.missile.conflagration.name=Misil de Conflagraci\u00F3n +icbm.missile.endothermic.name=Misil Endot\u00E9rmico +icbm.missile.antiGravitational.name=Misil Anti-Gravitacional +icbm.missile.ender.name=Misil Ender +icbm.missile.hypersonic.name=Misil Hipers\u00F3nico + +icbm.missile.antimatter.name=Misil de Antimateria +icbm.missile.redMatter.name=Misil de Materia Roja + +## Special Missiles +icbm.missile.missileModule.name=Modulo para Misiles +icbm.missile.antiBallistic.name=Misil Anti-Bal\u00EDstico +icbm.missile.cluster.name=Misil de Racimos +icbm.missile.nuclearCluster.name=Misil Nuclear de Racimos +icbm.missile.homing.name=Misil Rastreador + +## Grenades +icbm.grenade.condensed.name=Granada Convencional +icbm.grenade.shrapnel.name=Granada de Esquirlas +icbm.grenade.incendiary.name=Granada Incendiaria +icbm.grenade.chemical.name=Granada Qu\u00EDmica +icbm.grenade.anvil.name=Granada de Yunques +icbm.grenade.repulsive.name=Granada Repulsiva +icbm.grenade.attractive.name=Granada Atractiva + +## Explosive Minecarts +icbm.minecart.condensed.name=Carro Explosivo +icbm.minecart.shrapnel.name=Carro Minero de Esquirlas +icbm.minecart.incendiary.name=Carro Minero Incendiario +icbm.minecart.chemical.name=Carro Minero Qu\u00EDmico +icbm.minecart.anvil.name=Carro Minero de Yunques +icbm.minecart.repulsive.name=Carro Minero Repulsivo +icbm.minecart.attractive.name=Carro Minero Atractivo + +icbm.minecart.fragmentation.name=Carro Minero de Fragmentacion +icbm.minecart.contagious.name=Carro Minero Contagioso +icbm.minecart.sonic.name=Carro Minero S\u00F3nico +icbm.minecart.breaching.name=Carro Minero Penetrante +icbm.minecart.rejuvenation.name=Carro Minero Rejuvenecedor +icbm.minecart.thermobaric.name=Carro Minero Termob\u00E1rico + +## ICBM Misc Blocks +tile.icbm\:sulfurOre.name=Mineral de Sulfuro +tile.icbm\:glassPressurePlate.name=Placa a Presi\u00F3n de Vidrio +tile.icbm\:glassButton.name=Bot\u00F3n de Vidrio +tile.icbm\:camouflage.name=Camuflaje +tile.icbm\:proximityDetector.name=Detector de Proximidad +tile.icbm\:spike.0.name=Pinchos +tile.icbm\:spike.1.name=Pinchos Venenosos +tile.icbm\:spike.2.name=Pinchos Inflamables + +## Tooltips +info.misc.tier=Nivel Explosivo \ No newline at end of file diff --git a/src/main/resources/assets/defense/lang/pt_BR.lang b/src/main/resources/assets/defense/lang/pt_BR.lang new file mode 100644 index 000000000..e11c51f3d --- /dev/null +++ b/src/main/resources/assets/defense/lang/pt_BR.lang @@ -0,0 +1,288 @@ +## Master language file +itemGroup.ICBM=ICBM + +potion.toxin=Toxina +potion.virus=Vírus +potion.frostBite=Frost Bite +potion.radiation=Radiação + +## Items +item.icbm\:sulfurDust.name=Sulfur +item.icbm\:poisonPowder.name=Veneno em Pó +item.icbm\:antidote.name=Antidoto +item.icbm\:radarGun.name=Arma de Radar +item.icbm\:remoteDetonator.name=Detonador Remoto +item.icbm\:defuser.name=Desarmador +item.icbm\:laserDesignator.name=Designador a Laser +item.icbm\:tracker.name=Rastreador +item.icbm\:signalDisrupter.name=Desruptor de Sinal + +item.icbm\:rocketLauncher.name=Lançador de Foguetes + +## ICBM Machines +icbm.machine.0.name=Plataforma de Lançamento T1 +icbm.machine.1.name=Plataforma de Lançamento T2 +icbm.machine.2.name=Plataforma de Lançamento T3 +icbm.machine.3.name=Painel de Controle do Lançador T1 +icbm.machine.4.name=Painel de Controle do Lançador T2 +icbm.machine.5.name=Painel de Controle do Lançador T3 +icbm.machine.6.name=Quadro de Apoio do Lançador T1 +icbm.machine.7.name=Quadro de Apoio do Lançador T2 +icbm.machine.8.name=Quadro de Apoio do Lançador T3 +icbm.machine.9.name=Estação de Radar +icbm.machine.10.name=Torre EMP +icbm.machine.11.name=Lançador Cruise +icbm.machine.12.name=Coordenador de Missíl + +## Blocks +tile.icbm\:sulfurOre.name=Sulfur +tile.icbm\:missileAssembler.name=Montador de Missil + +## ICBM Explosives + +## Block Form +icbm.explosive.condensed.name=Explosivo Condensado +icbm.explosive.shrapnel.name=Explosivo de Estilhaço +icbm.explosive.incendiary.name=Explosivo Incendiário +icbm.explosive.debilitation.name=Explosivo de Enfraquecimento +icbm.explosive.chemical.name=Explosivo Químico +icbm.explosive.anvil.name=Explosivo de Bigorna +icbm.explosive.repulsive.name=Explosivo Repulsivo +icbm.explosive.attractive.name=Explosivo Atrativo + +icbm.explosive.fragmentation.name=Explosivo de Fragmentação +icbm.explosive.contagious.name=Explosivo Infeccioso +icbm.explosive.sonic.name=Explosivos Sônico +icbm.explosive.breaching.name=Explosivos de Brecha +icbm.explosive.rejuvenation.name=Explosivo de Rejuvenação +icbm.explosive.thermobaric.name=Explosivo Termobárico + +icbm.explosive.nuclear.name=Explosivo Nuclear +icbm.explosive.emp.name=Explosivo EMP +icbm.explosive.exothermic.name=Explosivo Exotérmico +icbm.explosive.endothermic.name=Explosivo Endotérmico +icbm.explosive.antiGravitational.name=Explosivo Anti-Gravitacional +icbm.explosive.ender.name=Explosivo do Ender +icbm.explosive.hypersonic.name=Explosivo Supersônico + +icbm.explosive.antimatter.name=Explosivo de Antimatéria +icbm.explosive.redMatter.name=Explosivo de Matéria Vermelha + +icbm.explosive.sMine.name=Mina-S + +## Missile Form +icbm.missile.condensed.name=Missíl Condensado +icbm.missile.shrapnel.name=Missíl de Estilhaço +icbm.missile.incendiary.name=Missíl Invendiário +icbm.missile.debilitation.name=Missíl de Enfraquecimento +icbm.missile.chemical.name=Missíl Químico +icbm.missile.anvil.name=Missíl de Bigorna +icbm.missile.repulsive.name=Missíl Repulsivo +icbm.missile.attractive.name=Missíl Atrativo + +icbm.missile.fragmentation.name=Missíl de Fragmentação +icbm.missile.contagious.name=Missíl Infeccioso +icbm.missile.sonic.name=Missíl Sônico +icbm.missile.breaching.name=Missíl de Brecha +icbm.missile.rejuvenation.name=Missíl de Rejuvenação +icbm.missile.thermobaric.name=Missíl Termobárico + +icbm.missile.nuclear.name=Missil Nuclear +icbm.missile.emp.name=Missíl EMP +icbm.missile.exothermic.name=Missíl Exotérmico +icbm.missile.endothermic.name=Missíl Endotérmico +icbm.missile.antiGravitational.name=Missíl Anti-Gravitacional +icbm.missile.ender.name=Missíl do Ender +icbm.missile.hypersonic.name=Missíl Supersônico + +icbm.missile.antimatter.name=Missíl de Antimatéria +icbm.missile.redMatter.name=Missíl de Matéria Vermelha + +## Special Missiles +icbm.missile.missileModule.name=Modulo de Missíl +icbm.missile.antiBallistic.name=Missíl Anti-Balístico +icbm.missile.cluster.name=Missíl Cluster +icbm.missile.nuclearCluster.name=Missíl Cluster Nuclear +icbm.missile.homing.name=Missíl Teleguiado + +## Grenades +icbm.grenade.condensed.name=Granada Condensada +icbm.grenade.shrapnel.name=Granada de Estilhaço +icbm.grenade.incendiary.name=Granada Incendiária +icbm.grenade.debilitation.name=Granada de Enfraquecimento +icbm.grenade.chemical.name=Granada Química +icbm.grenade.anvil.name=Granada de Bigorna +icbm.grenade.repulsive.name=Granada Repulsiva +icbm.grenade.attractive.name=Granada Atrativa + +## Explosive Minecarts +icbm.minecart.condensed.name=Carrinho Explosivo +icbm.minecart.shrapnel.name=Carrinho de Estilhaço +icbm.minecart.incendiary.name=Carrinho Incendiário +icbm.minecart.debilitation.name=Carrinho de Enfraquecimento +icbm.minecart.chemical.name=Carrinho Químico +icbm.minecart.anvil.name=Carrinho de Bigorna +icbm.minecart.repulsive.name=Carrinho Repulsivo +icbm.minecart.attractive.name=Carrinho Atrativo + +icbm.minecart.fragmentation.name=Carrinho de Fragmentação +icbm.minecart.contagious.name=Carrinho Infeccioso +icbm.minecart.sonic.name=Carrinho Sônico +icbm.minecart.breaching.name=Carrinho de Brecha +icbm.minecart.rejuvenation.name=Carrinho Rejuvenativo +icbm.minecart.thermobaric.name=Carrinho Termobárico + +## ICBM Misc Blocks +tile.icbm\:oreSulfur.name=Minério de Sulfur +tile.icbm\:concrete.0.name=Concreto +tile.icbm\:concrete.1.name=Concreto Compacto +tile.icbm\:concrete.2.name=Conncreto Reforçado +tile.icbm\:reinforcedGlass.name=Vidro Reforçado +tile.icbm\:glassPressurePlate.name=Placa de Pressão de Vidro +tile.icbm\:glassButton.name=Botão de Vidro +tile.icbm\:camouflage.name=Camuflagem +tile.icbm\:proximityDetector.name=Detector de Proximidade +tile.icbm\:spikes.0.name=Espinhos +tile.icbm\:spikes.1.name=Espinhos Venenosos +tile.icbm\:spikes.2.name=Espinhos Inflamáveis + +## ICBM Sentry +tile.icbm\:turret.gunTurret.name=Torre Sentinela +tile.icbm\:turret.railgun.name=Railgun +tile.icbm\:turret.antiAircraftTurret.name=Torre Anti-Aérea +tile.icbm\:turret.laserTurret.name=Torre de Laser +tile.icbm\:turretPlatform.name=Plataforma da Torre + +item.icbm\:bulletShell.name=Cápsula +item.icbm\:bullet.name=Munição +item.icbm\:bulletRailgun.name=Munição da Railgun +item.icbm\:bulletAntimatter.name=Munição Antimatéria +item.icbm\:bulletInfinite.name=Munição Infinita + +item.icbm\:targetCard.name=Upgrade de Distância +item.icbm\:shellCollector.name=Upgrade de coletor de Cápsula + +## Deaths +death.attack.bullet=%1$s virou um queijo suíço! +death.attack.laser=%1$s foi vaporizado por um laser! + +## Chat messages +message.tracker.nowtrack=Rastreando: +message.tracker.nopower=Rastreador sem energia! +message.tracker.banned=O rastreador está banido nesta área! + +message.defuser.nopower=Desarmador sem energia! + +message.designator.callTime=Chamando ataque aéreo em: +message.designator.blast=Ataque Aéreo Chegando! +message.designator.setFreq=Designador a Laser Definido na Frequência: +message.designator.failFreq=A frequência tem que ser maior que zero. +message.designator.callBlast=Chamando ataque aéreo na posição designada! +message.designator.nopower=Designador a Laser sem energia! +message.designator.noFreq=Frequencia do designador a laser não definida! + +message.radarGun.scanned=Coordenadas Escaneadas: X:%x, Y:%y, Z:%z - Distancia: %d +message.radarGun.nopower=Arma de Radar sem energia! +message.radarGun.transfer=Informação das Coordenadas Transferidas! +message.radarGun.noCoords=Vocâ deve escanear uma coordenada! +message.launcher.protected=A região está sendo protegida. +message.detonator.locked=Controle bloqueado para: X:%x, Y:%y, Z:%z +message.detonator.nopower=Controle sem energia! +message.radar.redstone=Rastrear a emissão de redstone em todas as direções: + +## GUI stuff +gui.misc.nopower=Sem energia! +gui.misc.idle=Inativo +gui.misc.freq=Frequência: +gui.misc.XCoord=Coord-X: +gui.misc.YCoord=Coord-Y: +gui.misc.ZCoord=Coord-Z: +gui.misc.x=X: +gui.misc.y=Y: +gui.misc.z=Z: +gui.misc.status=Status: +gui.misc.voltage=Voltagem: + +gui.tracker.freq=Frequência +gui.detector.name=Detector de Proximidade +gui.detector.all=Tudo +gui.detector.players=Jogadores +gui.detector.mobs=Monstros +gui.detector.range=Area de Detecção +gui.detector.min=Min +gui.detector.max=Max +gui.detector.exclude=Excluir +gui.detector.include=Incluir +gui.detector.target=Alvo: +gui.detector.on=Ligado +gui.detector.status=Status: + +gui.empTower.name=Torre EMP +gui.empTower.missiles=Missíls +gui.empTower.elec=Energia +gui.empTower.both=Ambos +gui.empTower.radius=Raio do EMP: %p blocks +gui.empTower.effect=Efeito do EMP: +gui.empTower.effectDebilitate=Enfraquecer Eletrônicos +gui.empTower.effectDisrupt=Interromper Missíls +gui.empTower.effectDeplete=Esgotar a Eletricidade +gui.empTower.mode=Modo: +gui.empTower.ready=Pronto para explodir! + +gui.launcherBase.name=Plataforma de Lançamento +gui.launcherBase.place=Coloque o missíl +gui.launcherScreen.name=Painel de Controle do Lançador +gui.launcherScreen.detHeight=Altura da Detonação: +gui.launcherScreen.lockHeight=Trava de Altura: +gui.launcherScreen.target=Alvo do Missíl +gui.launcherScreen.inaccuracy=Inexatidão de: %p blocos +gui.launcherScreen.statusMissing=Não conectado! +gui.launcherScreen.statusNoPower=Energia insuficiente! +gui.launcherScreen.statusEmpty=Silo do missíl esta vazio! +gui.launcherScreen.statusInvalid=Alvo inválido! +gui.launcherScreen.statusClose=Alvo muito perto! +gui.launcherScreen.statusFar=Alvo muito longe! +gui.launcherScreen.statusReady=Pronto para disparar! +gui.launcherCruise.name=Lancador Cruise +gui.launcherCruise.statusNoPower=Sem energia! +gui.launcherCruise.statusEmpty=Silo vazio! +gui.launcherCruise.statusInvalid=Alvo Invalido! +gui.launcherCruise.statusReady=Pronto! + +gui.coordinator.name=Coordenador de Missíl +gui.coordinator.sim=Simulador de Trajeto +gui.coordinator.from=De: +gui.coordinator.to=Para: +gui.coordinator.displace=Deslocamento: %p Metros +gui.coordinator.arc=Arco: %p Metros +gui.coordinator.time=Tempo: %p Segundos +gui.coordinator.direction=Direção: +gui.coordinator.wip=Mais coisas estao por vir! + +gui.assembler.name=Mesa de Missíl +gui.radar.coords=Coordenadas: +gui.radar.zoneSafe=Zona de Segurança: +gui.radar.zoneAlarm=Zona de Alarme: +gui.radar.on=Radar Ligado! +gui.radar.nopower=Sem Energia! + +gui.terminal.name=Terminal +gui.platform.ammo=Munição +gui.platform.upgrades=Upgrades +gui.platform.joules=de %j +gui.platform.access=Acesso do Usuário + +## Tooltips +info.misc.freq=Frequência: +info.tracker.tracking=Rastreando: +info.designator.noFreq=Frequencia: Não Definida +info.radarGun.savedCoords=Coordenadas Salvas: +info.radarGun.meters=Metros +info.detonator.linked=Explosivo vinculado: +info.detonator.noLink=Nenhum explosivo vinculado +info.misc.tier=Nível do Explosivo +info.rocketlauncher.tooltip=Este Lancador de Foguetes pode atirar até o nível %s de foguetes + +info.upgrade.range=Faz upgrade na distancia da mira da Arma Sentinela. +info.upgrade.collect=Permite que a sentinela coletar as cápsulas ejetadas. +info.upgrade.sentry=Um upgrade para a Sentinela \ No newline at end of file diff --git a/src/main/resources/assets/defense/lang/ru_RU.lang b/src/main/resources/assets/defense/lang/ru_RU.lang new file mode 100644 index 000000000..170aaab9d --- /dev/null +++ b/src/main/resources/assets/defense/lang/ru_RU.lang @@ -0,0 +1,297 @@ +## Russian language file +itemGroup.ICBM=ICBM + +potion.toxin=\u0422\u043E\u043A\u0441\u0438\u043D +potion.virus=\u0412\u0438\u0440\u0443\u0441 +potion.frostBite=\u041C\u043E\u0440\u043E\u0437\u043D\u044B\u0439 \u0443\u043A\u0443\u0441 +potion.radiation=\u041E\u0431\u043B\u0443\u0447\u0435\u043D\u0438\u0435 + +## Items +item.icbm\:sulfurDust.name=\u0421\u0435\u0440\u0430 +item.icbm\:saltpeter.name=\u0421\u0435\u043B\u0438\u0442\u0440\u0430 +item.icbm\:poisonPowder.name=\u042F\u0434\u043E\u0432\u0438\u0442\u044B\u0439 \u043F\u043E\u0440\u043E\u0448\u043E\u043A +item.icbm\:antidote.name=\u041F\u0440\u043E\u0442\u0438\u0432\u043E\u044F\u0434\u0438\u0435 +item.icbm\:radarGun.name=\u0418\u0437\u043C\u0435\u0440\u0438\u0442\u0435\u043B\u044C +item.icbm\:remoteDetonator.name=\u0414\u0438\u0441\u0442\u0430\u043D\u0446\u0438\u043E\u043D\u043D\u044B\u0439 \u0434\u0435\u0442\u043E\u043D\u0430\u0442\u043E\u0440 +item.icbm\:defuser.name=\u0421\u0430\u043F\u0451\u0440 +item.icbm\:laserDesignator.name=\u041B\u0430\u0437\u0435\u0440\u043D\u044B\u0439 \u0446\u0435\u043B\u0435\u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C +item.icbm\:tracker.name=\u041F\u0440\u0435\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C +item.icbm\:signalDisrupter.name=\u0413\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440 \u043F\u043E\u043C\u0435\u0445 +item.icbm\:computer.name=\u0422\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 +item.icbm\:rocketLauncher.name=\u0420\u0435\u0430\u043A\u0442\u0438\u0432\u043D\u0430\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 + +## ICBM Machines +icbm.machine.0.name=\u041F\u0443\u0441\u043A\u043E\u0432\u0430\u044F \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0430 T1 +icbm.machine.1.name=\u041F\u0443\u0441\u043A\u043E\u0432\u0430\u044F \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0430 T2 +icbm.machine.2.name=\u041F\u0443\u0441\u043A\u043E\u0432\u0430\u044F \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0430 T3 +icbm.machine.3.name=\u041F\u0430\u043D\u0435\u043B\u044C \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0443\u0441\u043A\u043E\u043C T1 +icbm.machine.4.name=\u041F\u0430\u043D\u0435\u043B\u044C \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0443\u0441\u043A\u043E\u043C T2 +icbm.machine.5.name=\u041F\u0430\u043D\u0435\u043B\u044C \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0443\u0441\u043A\u043E\u043C T3 +icbm.machine.6.name=\u041E\u043F\u043E\u0440\u043D\u0430\u044F \u0440\u0430\u043C\u043A\u0430 T1 +icbm.machine.7.name=\u041E\u043F\u043E\u0440\u043D\u0430\u044F \u0440\u0430\u043C\u043A\u0430 T2 +icbm.machine.8.name=\u041E\u043F\u043E\u0440\u043D\u0430\u044F \u0440\u0430\u043C\u043A\u0430 T3 +icbm.machine.9.name=\u0420\u0430\u0434\u0438\u043E\u043B\u043E\u043A\u0430\u0446\u0438\u043E\u043D\u043D\u0430\u044F \u0441\u0442\u0430\u043D\u0446\u0438\u044F +icbm.machine.10.name=\u042D\u041C\u0418-\u0431\u0430\u0448\u043D\u044F +icbm.machine.11.name=\u041A\u0440\u044B\u043B\u0430\u0442\u0430\u044F \u043F\u0443\u0441\u043A\u043E\u0432\u0430\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 +icbm.machine.12.name=\u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u043E\u0440 \u0440\u0430\u043A\u0435\u0442 + +## Blocks +tile.icbm\:sulfurOre.name=\u0421\u0435\u0440\u043D\u0430\u044F \u0440\u0443\u0434\u0430 +tile.icbm\:missileAssembler.name=\u0421\u0431\u043E\u0440\u0449\u0438\u043A \u0440\u0430\u043A\u0435\u0442 +tile.icbm\:reinforcedRail.name=\u0410\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0440\u0435\u043B\u044C\u0441\u044B + +## ICBM Explosives + +## Block Form +icbm.explosive.condensed.name=\u041A\u043E\u043D\u0434\u0435\u043D\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.shrapnel.name=\u041E\u0441\u043A\u043E\u043B\u043E\u0447\u043D\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.incendiary.name=\u0417\u0430\u0436\u0438\u0433\u0430\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.debilitation.name=\u041E\u0441\u043B\u0430\u0431\u043B\u044F\u044E\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.chemical.name=\u0425\u0438\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.anvil.name=\u0412\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430-\u043D\u0430\u043A\u043E\u0432\u0430\u043B\u044C\u043D\u044F +icbm.explosive.repulsive.name=\u041E\u0442\u0442\u0430\u043B\u043A\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.attractive.name=\u041F\u0440\u0438\u0442\u044F\u0433\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 + +icbm.explosive.fragmentation.name=\u0414\u0440\u043E\u0431\u044F\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.contagious.name=\u0418\u043D\u0444\u0438\u0446\u0438\u0440\u0443\u044E\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.sonic.name=\u0417\u0432\u0443\u043A\u043E\u0432\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.breaching.name=\u0420\u0430\u0437\u0440\u0443\u0448\u0430\u044E\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.rejuvenation.name=\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u044F\u044E\u0449\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.thermobaric.name=\u0422\u0435\u0440\u043C\u043E\u0431\u0430\u0440\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 + +icbm.explosive.nuclear.name=\u042F\u0434\u0435\u0440\u043D\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.emp.name=\u042D\u041C\u0418-\u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.exothermic.name=\u042D\u043A\u0437\u043E\u0442\u0435\u0440\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.endothermic.name=\u042D\u043D\u0434\u043E\u0442\u0435\u0440\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.antiGravitational.name=\u0410\u043D\u0442\u0438\u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043E\u043D\u043D\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 +icbm.explosive.ender.name=\u0412\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 \u041A\u0440\u0430\u044F +icbm.explosive.hypersonic.name=\u0421\u0432\u0435\u0440\u0445\u0437\u0432\u0443\u043A\u043E\u0432\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 + +icbm.explosive.antimatter.name=\u0412\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 \u0438\u0437 \u0430\u043D\u0442\u0438\u043C\u0430\u0442\u0435\u0440\u0438\u0438 +icbm.explosive.redMatter.name=\u0412\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430 \u0438\u0437 \u043A\u0440\u0430\u0441\u043D\u043E\u0439 \u043C\u0430\u0442\u0435\u0440\u0438\u0438 + +icbm.explosive.sMine.name=\u041F\u0440\u044B\u0433\u0430\u044E\u0449\u0430\u044F \u0411\u0435\u0442\u0442\u0438 + +## Missile Form +icbm.missile.condensed.name=\u041E\u0431\u044B\u0447\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.shrapnel.name=\u041E\u0441\u043A\u043E\u043B\u043E\u0447\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.incendiary.name=\u0417\u0430\u0436\u0438\u0433\u0430\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.debilitation.name=\u041E\u0441\u043B\u0430\u0431\u043B\u044F\u044E\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.chemical.name=\u0425\u0438\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.anvil.name=\u0420\u0430\u043A\u0435\u0442\u0430-\u043D\u0430\u043A\u043E\u0432\u0430\u043B\u044C\u043D\u044F +icbm.missile.repulsive.name=\u041E\u0442\u0442\u0430\u043B\u043A\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.attractive.name=\u041F\u0440\u0438\u0442\u044F\u0433\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 + +icbm.missile.fragmentation.name=\u0414\u0440\u043E\u0431\u044F\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.contagious.name=\u0418\u043D\u0444\u0438\u0446\u0438\u0440\u0443\u044E\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.sonic.name=\u0417\u0432\u0443\u043A\u043E\u0432\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.breaching.name=\u0420\u0430\u0437\u0440\u0443\u0448\u0430\u044E\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.rejuvenation.name=\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u044F\u044E\u0449\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.thermobaric.name=\u0422\u0435\u0440\u043C\u043E\u0431\u0430\u0440\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 + +icbm.missile.nuclear.name=\u042F\u0434\u0435\u0440\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.emp.name=\u042D\u041C\u0418-\u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.exothermic.name=\u042D\u043A\u0437\u043E\u0442\u0435\u0440\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.endothermic.name=\u042D\u043D\u0434\u043E\u0442\u0435\u0440\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.antiGravitational.name=\u0410\u043D\u0442\u0438-\u0433\u0440\u0430\u0432\u0438\u0442\u0430\u0446\u0438\u043E\u043D\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.ender.name=\u0420\u0430\u043A\u0435\u0442\u0430 \u041A\u0440\u0430\u044F +icbm.missile.hypersonic.name=\u0421\u0432\u0435\u0440\u0445\u0437\u0432\u0443\u043A\u043E\u0432\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 + +icbm.missile.antimatter.name=\u0420\u0430\u043A\u0435\u0442\u0430 \u0438\u0437 \u0430\u043D\u0442\u0438\u043C\u0430\u0442\u0435\u0440\u0438\u0438 +icbm.missile.redMatter.name=\u0420\u0430\u043A\u0435\u0442\u0430 \u0438\u0437 \u043A\u0440\u0430\u0441\u043D\u043E\u0439 \u043C\u0430\u0442\u0435\u0440\u0438\u0438 + +## Special Missiles +icbm.missile.missileModule.name=\u0420\u0430\u043A\u0435\u0442\u043D\u044B\u0439 \u043C\u043E\u0434\u0443\u043B\u044C +icbm.missile.antiBallistic.name=\u0410\u043D\u0442\u0438-\u0431\u0430\u043B\u043B\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.cluster.name=\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.nuclearCluster.name=\u041A\u043B\u0430\u0441\u0442\u0435\u0440\u043D\u0430\u044F \u044F\u0434\u0435\u0440\u043D\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +icbm.missile.homing.name=\u0441\u0430\u043C\u043E\u043D\u0430\u0432\u043E\u0434\u044F\u0449\u0430\u044F\u0441\u044F \u0440\u0430\u043A\u0435\u0442\u0430 + +## Grenades +icbm.grenade.condensed.name=\u041E\u0431\u044B\u0447\u043D\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 +icbm.grenade.shrapnel.name=\u041E\u0441\u043A\u043E\u043B\u043E\u0447\u043D\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 +icbm.grenade.incendiary.name=\u0417\u0430\u0436\u0438\u0433\u0430\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 +icbm.grenade.debilitation.name=\u041E\u0441\u043B\u0430\u0431\u043B\u044F\u044E\u0449\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 +icbm.grenade.chemical.name=\u0425\u0438\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 +icbm.grenade.anvil.name=\u0413\u0440\u0430\u043D\u0430\u0442\u0430-\u043D\u0430\u043A\u043E\u0432\u0430\u043B\u044C\u043D\u044F +icbm.grenade.repulsive.name=\u041E\u0442\u0442\u0430\u043B\u043A\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 +icbm.grenade.attractive.name=\u041F\u0440\u0438\u0442\u044F\u0433\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0433\u0440\u0430\u043D\u0430\u0442\u0430 + +## Explosive Minecarts +icbm.minecart.condensed.name=\u0412\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u044B\u0439 \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.shrapnel.name=\u041E\u0441\u043A\u043E\u043B\u043E\u0447\u043D\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.incendiary.name=\u0417\u0430\u0436\u0438\u0433\u0430\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.debilitation.name=\u041E\u0441\u043B\u0430\u0431\u043B\u044F\u044E\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.chemical.name=\u0425\u0438\u043C\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.anvil.name=\u0412\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430-\u043D\u0430\u043A\u043E\u0432\u0430\u043B\u044C\u043D\u044F +icbm.minecart.repulsive.name=\u041E\u0442\u0442\u0430\u043B\u043A\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.attractive.name=\u041F\u0440\u0438\u0442\u044F\u0433\u0438\u0432\u0430\u044E\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 + +icbm.minecart.fragmentation.name=\u0414\u0440\u043E\u0431\u044F\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.contagious.name=\u0418\u043D\u0444\u0438\u0446\u0438\u0440\u0443\u044E\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.sonic.name=\u0417\u0432\u0443\u043A\u043E\u0432\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.breaching.name=\u0420\u0430\u0437\u0440\u0443\u0448\u0430\u044E\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.rejuvenation.name=\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u044F\u044E\u0449\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 +icbm.minecart.thermobaric.name=\u0422\u0435\u0440\u043C\u043E\u0431\u0430\u0440\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0432\u0430\u0433\u043E\u043D\u0435\u0442\u043A\u0430 + +## ICBM Misc Blocks +tile.icbm\:oreSulfur.name=\u0421\u0435\u0440\u043D\u0430\u044F \u0440\u0443\u0434\u0430 +tile.icbm\:concrete.0.name=\u0411\u0435\u0442\u043E\u043D +tile.icbm\:concrete.1.name=\u041F\u043B\u043E\u0442\u043D\u044B\u0439 \u0431\u0435\u0442\u043E\u043D +tile.icbm\:concrete.2.name=\u0423\u043A\u0440\u0435\u043F\u043B\u0451\u043D\u043D\u044B\u0439 \u0431\u0435\u0442\u043E\u043D +tile.icbm\:reinforcedGlass.name=\u0410\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0435 \u0441\u0442\u0435\u043A\u043B\u043E +tile.icbm\:glassPressurePlate.name=\u0421\u0442\u0435\u043A\u043B\u044F\u043D\u043D\u0430\u044F \u043D\u0430\u0436\u0438\u043C\u043D\u0430\u044F \u043F\u043B\u0430\u0441\u0442\u0438\u043D\u0430 +tile.icbm\:glassButton.name=\u0421\u0442\u0435\u043A\u043B\u044F\u043D\u043D\u0430\u044F \u043A\u043D\u043E\u043F\u043A\u0430 +tile.icbm\:camouflage.name=\u041A\u0430\u043C\u0443\u0444\u043B\u044F\u0436 +tile.icbm\:proximityDetector.name=\u0414\u0435\u0442\u0435\u043A\u0442\u043E\u0440 \u0441\u0431\u043B\u0438\u0436\u0435\u043D\u0438\u044F +tile.icbm\:spikes.0.name=\u0428\u0438\u043F\u044B +tile.icbm\:spikes.1.name=\u042F\u0434\u043E\u0432\u0438\u0442\u044B\u0435 \u0448\u0438\u043F\u044B +tile.icbm\:spikes.2.name=\u0413\u043E\u0440\u044F\u0449\u0438\u0435 \u0448\u0438\u043F\u044B + +## ICBM Sentry +## Translated by Adaptivity +tile.icbm\:turret.gunTurret.name=\u041E\u0440\u0443\u0434\u0438\u0439\u043D\u0430\u044F \u0431\u0430\u0448\u043D\u044F +tile.icbm\:turret.railgun.name=\u0420\u0435\u043B\u044C\u0441\u043E\u0442\u0440\u043E\u043D +tile.icbm\:turret.antiAircraftTurret.name=\u0417\u0435\u043D\u0438\u0442\u043D\u0430\u044F \u0431\u0430\u0448\u043D\u044F +tile.icbm\:turret.laserTurret.name=\u041B\u0430\u0437\u0435\u0440\u043D\u0430\u044F \u0431\u0430\u0448\u043D\u044F +tile.icbm\:turret.autoBow.name=\u0410\u0440\u0431\u0430\u043B\u0435\u0442\u043D\u0430\u044F \u0431\u0430\u0448\u043D\u044F +tile.icbm\:turretPlatform.name=\u041F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0430 \u0431\u0430\u0448\u043D\u0438 + +item.icbm\:bulletShell.name=\u0413\u0438\u043B\u044C\u0437\u0430 +item.icbm\:bullet.name=\u041F\u0443\u043B\u044F +item.icbm\:bulletRailgun.name=\u041F\u0443\u043B\u044F \u0440\u0435\u043B\u044C\u0441\u043E\u0442\u0440\u043E\u043D\u0430 +item.icbm\:bulletAntimatter.name=\u041F\u0443\u043B\u044F \u0430\u043D\u0442\u0438\u043C\u0430\u0442\u0435\u0440\u0438\u0438 +item.icbm\:bulletInfinite.name=\u0411\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u0430\u044F \u043F\u0443\u043B\u044F + +item.icbm\:targetCard.name=\u0423\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u0435: \u00AB\u0414\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u044C\u00BB +item.icbm\:shellCollector.name=\u0423\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u0435: \u00AB\u0421\u0431\u043E\u0440\u0449\u0438\u043A \u0433\u0438\u043B\u044C\u0437\u00BB + +entity.turretseat.name=ICBM \u0441\u0438\u0434\u0435\u043D\u044C\u0435 \u0431\u0430\u0448\u043D\u0438 + +## Deaths +death.attack.bullet=%1$s \u0431\u044B\u043B \u0440\u0430\u0441\u0441\u0442\u0440\u0435\u043B\u044F\u043D \u0432 \u0448\u0432\u0435\u0439\u0446\u0430\u0440\u0441\u043A\u0438\u0439 \u0441\u044B\u0440! +death.attack.laser=%1$s \u0432\u044B\u043F\u0430\u0440\u0438\u043B\u0438 \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u043B\u0430\u0437\u0435\u0440\u043E\u0432! + +## Chat messages +message.tracker.nowtrack=\u0422\u0435\u043F\u0435\u0440\u044C \u043F\u0440\u0435\u0441\u043B\u0435\u0434\u0443\u0435\u0442: +message.tracker.nopower=\u0423 \u043F\u0440\u0435\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u043E\u0441\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E! +message.tracker.banned=\u041F\u0440\u0435\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0437\u0430\u043F\u0440\u0435\u0449\u0451\u043D \u043D\u0430 \u044D\u0442\u043E\u0439 \u0442\u0435\u0440\u0440\u0438\u0442\u043E\u0440\u0438\u0438! + +message.defuser.nopower=\u0423 \u0441\u0430\u043F\u0451\u0440\u0430 \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u043E\u0441\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E! + +message.designator.callTime=\u0412\u043E\u0437\u0434\u0443\u0448\u043D\u043E\u0439 \u0443\u0434\u0430\u0440 \u0447\u0435\u0440\u0435\u0437: +message.designator.blast=\u041F\u0440\u0438\u0431\u043B\u0438\u0436\u0430\u0435\u0442\u0441\u044F \u0432\u043E\u0437\u0434\u0443\u0448\u043D\u044B\u0439 \u0443\u0434\u0430\u0440! +message.designator.setFreq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430 \u043B\u0430\u0437\u0435\u0440\u043D\u043E\u0433\u043E \u0446\u0435\u043B\u0435\u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0430 \u043D\u0430: +message.designator.failFreq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430 \u0434\u043E\u043B\u0436\u043D\u0430 \u0431\u044B\u0442\u044C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0443\u043B\u044F. +message.designator.callBlast=\u0412\u043E\u0437\u0434\u0443\u0448\u043D\u044B\u0439 \u0443\u0434\u0430\u0440 \u043F\u043E \u0443\u043A\u0430\u0437\u0430\u043D\u043D\u043E\u0439 \u043F\u043E\u0437\u0438\u0446\u0438\u0438! +message.designator.nopower=\u0423 \u043B\u0430\u0437\u0435\u0440\u043D\u043E\u0433\u043E \u0446\u0435\u043B\u0435\u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u043E\u0441\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E! +message.designator.noFreq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430 \u0434\u043B\u044F \u043B\u0430\u0437\u0435\u0440\u043D\u043E\u0433\u043E \u0446\u0435\u043B\u0435\u0443\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044F \u043D\u0435 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0430! + +message.radarGun.scanned=\u041E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B: X:%x, Y:%y, Z:%z - \u0414\u0438\u0441\u0442\u0430\u043D\u0446\u0438\u044F: %d +message.radarGun.nopower=\u0423 \u0438\u0437\u043C\u0435\u0440\u0438\u0442\u0435\u043B\u044F \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u043E\u0441\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E! +message.radarGun.transfer=\u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B \u043F\u0435\u0440\u0435\u0434\u0430\u043D\u044B! +message.radarGun.noCoords=\u0412\u044B \u0434\u043E\u043B\u0436\u043D\u044B \u043E\u0442\u0441\u043A\u0430\u043D\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B! +message.launcher.protected=\u0420\u0435\u0433\u0438\u043E\u043D \u0437\u0430\u0449\u0438\u0449\u0451\u043D. +message.detonator.locked=\u0414\u0438\u0441\u0442\u0430\u043D\u0446\u0438\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0430 \u043D\u0430: X:%x, Y:%y, Z:%z +message.detonator.nopower=\u0423 \u0434\u0438\u0441\u0442\u0430\u043D\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0434\u0435\u0442\u043E\u043D\u0430\u0442\u043E\u0440\u0430 \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u043B\u043E\u0441\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E! +message.radar.redstone=Radar redstone all side emission: + +## GUI stuff +gui.misc.nopower=\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u0430! +gui.misc.idle=\u041F\u0440\u043E\u0441\u0442\u043E\u0439 +gui.misc.freq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430: +gui.misc.XCoord=X-\u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430: +gui.misc.YCoord=Y-\u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430: +gui.misc.ZCoord=Z-\u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430: +gui.misc.x=X: +gui.misc.y=Y: +gui.misc.z=Z: +gui.misc.status=\u0421\u0442\u0430\u0442\u0443\u0441: +gui.misc.voltage=\u041D\u0430\u043F\u0440\u044F\u0436\u0435\u043D\u0438\u0435: + +gui.tracker.freq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430 +gui.detector.name=\u0414\u0435\u0442\u0435\u043A\u0442\u043E\u0440 \u0441\u0431\u043B\u0438\u0436\u0435\u043D\u0438\u044F +gui.detector.all=\u0412\u0441\u0435 +gui.detector.players=\u0418\u0433\u0440\u043E\u043A\u0438 +gui.detector.mobs=\u041C\u043E\u0431\u044B +gui.detector.range=\u0414\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u043D\u0430\u0440\u0443\u0436\u0435\u043D\u0438\u044F +gui.detector.min=\u041C\u0438\u043D. +gui.detector.max=\u041C\u0430\u043A\u0441. +gui.detector.exclude=\u0418\u0441\u043A\u043B\u044E\u0447\u0438\u0442\u044C +gui.detector.include=\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C +gui.detector.target=\u0426\u0435\u043B\u044C: +gui.detector.on=\u0412\u043A\u043B. +gui.detector.status=\u0421\u0442\u0430\u0442\u0443\u0441: + +gui.empTower.name=\u042D\u041C\u0418-\u0431\u0430\u0448\u043D\u044F +gui.empTower.missiles=\u0420\u0430\u043A\u0435\u0442\u044B +gui.empTower.elec=\u042D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E +gui.empTower.both=\u041E\u0431\u0430 +gui.empTower.radius=\u042D\u041C\u0418 \u0440\u0430\u0434\u0438\u0443\u0441: %p \u0431\u043B\u043E\u043A\u043E\u0432(\u0430) +gui.empTower.effect=\u042D\u041C\u0418 \u044D\u0444\u0444\u0435\u043A\u0442: +gui.empTower.effectDebilitate=\u041E\u0441\u043B\u0430\u0431\u043B\u044F\u0442\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u0438\u043A\u0443 +gui.empTower.effectDisrupt=\u0420\u0430\u0437\u0440\u0443\u0448\u0430\u0442\u044C \u0440\u0430\u043A\u0435\u0442\u044B +gui.empTower.effectDeplete=\u0418\u0441\u0447\u0435\u0440\u043F\u044B\u0432\u0430\u0442\u044C \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043E +gui.empTower.mode=\u0420\u0435\u0436\u0438\u043C: +gui.empTower.ready=\u0413\u043E\u0442\u043E\u0432\u0430 \u043A \u042D\u041C\u0418-\u0443\u0434\u0430\u0440\u0443! + +gui.launcherBase.name=\u041F\u0443\u0441\u043A\u043E\u0432\u0430\u044F \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0430 +gui.launcherBase.place=\u0423\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0440\u0430\u043A\u0435\u0442\u0443 +gui.launcherScreen.name=\u041F\u0430\u043D\u0435\u043B\u044C \u0443\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0443\u0441\u043A\u043E\u043C +gui.launcherScreen.detHeight=\u0414\u0435\u0442\u043E\u043D\u0430\u0446\u0438\u043E\u043D\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430: +gui.launcherScreen.lockHeight=\u0417\u0430\u0445\u0432\u0430\u0442 \u0432\u044B\u0441\u043E\u0442\u044B: +gui.launcherScreen.target=\u0426\u0435\u043B\u0435\u0432\u0430\u044F \u0440\u0430\u043A\u0435\u0442\u0430 +gui.launcherScreen.inaccuracy=\u041D\u0435\u0442\u043E\u0447\u043D\u043E\u0441\u0442\u044C: %p \u0431\u043B\u043E\u043A\u043E\u0432 +gui.launcherScreen.statusMissing=\u041D\u0435\u0442 \u0441\u043E\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u044F! +gui.launcherScreen.statusNoPower=\u041D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u0430! +gui.launcherScreen.statusEmpty=\u0421\u0438\u043B\u043E\u0441 \u0440\u0430\u043A\u0435\u0442\u044B \u043F\u0443\u0441\u0442! +gui.launcherScreen.statusInvalid=\u0426\u0435\u043B\u044C \u043D\u0435 \u0432\u0435\u0440\u043D\u0430! +gui.launcherScreen.statusClose=\u0426\u0435\u043B\u044C \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043B\u0438\u0437\u043A\u043E! +gui.launcherScreen.statusFar=\u0426\u0435\u043B\u044C \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0434\u0430\u043B\u0435\u043A\u043E! +gui.launcherScreen.statusReady=\u0413\u043E\u0442\u043E\u0432\u0430 \u043A \u0437\u0430\u043F\u0443\u0441\u043A\u0443! +gui.launcherCruise.name=\u041A\u0440\u044B\u043B\u0430\u0442\u0430\u044F \u043F\u0443\u0441\u043A\u043E\u0432\u0430\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 +gui.launcherCruise.statusNoPower=\u041D\u0435\u0442 \u043F\u0438\u0442\u0430\u043D\u0438\u044F! +gui.launcherCruise.statusEmpty=\u0421\u0438\u043B\u043E\u0441 \u043F\u0443\u0441\u0442! +gui.launcherCruise.statusInvalid=\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0446\u0435\u043B\u044C! +gui.launcherCruise.statusReady=\u0413\u043E\u0442\u043E\u0432\u043D\u043E\u0441\u0442\u044C! + +gui.coordinator.name=\u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u043E\u0440 \u0440\u0430\u043A\u0435\u0442 +gui.coordinator.sim=\u0421\u0438\u043C\u0443\u043B\u044F\u0442\u043E\u0440 \u043F\u0443\u0442\u0438 +gui.coordinator.from=\u0418\u0437: +gui.coordinator.to=\u0412: +gui.coordinator.displace=\u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435: %p \u043C\u0435\u0442\u0440\u043E\u0432(\u0430) +gui.coordinator.arc=\u0414\u0443\u0433\u0430: %p \u043C\u0435\u0442\u0440\u043E\u0432(\u0430) +gui.coordinator.time=\u0412\u0440\u0435\u043C\u044F: %p \u0441\u0435\u043A\u0443\u043D\u0434(\u0430-\u044B) +gui.coordinator.direction=\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435: +gui.coordinator.wip=\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0435 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u0438 \u0443\u0436\u0435 \u0441\u043A\u043E\u0440\u043E! + +gui.assembler.name=\u0420\u0430\u043A\u0435\u0442\u043D\u044B\u0439 \u0441\u0442\u043E\u043B +gui.radar.coords=\u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B: +gui.radar.zoneSafe=\u0411\u0435\u0437\u043E\u043F\u0430\u0441\u043D\u0430\u044F \u0437\u043E\u043D\u0430: +gui.radar.zoneAlarm=\u0417\u043E\u043D\u0430 \u0442\u0440\u0435\u0432\u043E\u0433\u0438: +gui.radar.on=\u0420\u0430\u0434\u0430\u0440 \u0432\u043A\u043B\u044E\u0447\u0451\u043D! +gui.radar.nopower=\u041D\u0435\u0442 \u044D\u043B\u0435\u043A\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u0430! + +gui.terminal.name=\u0422\u0435\u0440\u043C\u0438\u043D\u0430\u043B +gui.platform.ammo=\u0411\u043E\u0435\u043F\u0440\u0438\u043F\u0430\u0441\u044B +gui.platform.upgrades=\u0423\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u044F +gui.platform.joules=\u0438\u0437 %j +gui.platform.access=\u041F\u043E\u043B\u044C\u0437\u043E\u0432. \u0434\u043E\u0441\u0442\u0443\u043F + +## Tooltips +info.misc.freq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430: +info.tracker.tracking=\u041F\u0440\u0435\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u0435: +info.designator.noFreq=\u0427\u0430\u0441\u0442\u043E\u0442\u0430: \u041D\u0435 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0430 +info.radarGun.savedCoords=\u0421\u043E\u0445\u0440\u0430\u043D\u0451\u043D\u043D\u044B\u0435 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B: +info.radarGun.meters=\u041C\u0435\u0442\u0440\u043E\u0432(\u0430) +info.detonator.linked=\u0421\u043E\u0435\u0434\u0438\u043D\u0451\u043D\u043D\u0430\u044F \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0430: +info.detonator.noLink=\u041D\u0435\u0442 \u0441\u043E\u0435\u0434\u0438\u043D\u0451\u043D\u043D\u043E\u0439 \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0438 +info.misc.tier=\u0423\u0440\u043E\u0432\u0435\u043D\u044C \u0432\u0437\u0440\u044B\u0432\u0447\u0430\u0442\u043A\u0438 +info.rocketlauncher.tooltip=\u042D\u0442\u0430 \u0440\u0435\u0430\u043A\u0442\u0438\u0432\u043D\u0430\u044F \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u043C\u043E\u0436\u0435\u0442 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0440\u0430\u043A\u0435\u0442\u044B %s \u0443\u0440\u043E\u0432\u043D\u044F +info.tracker.tooltip=\u041B\u041A\u041C \u043F\u043E \u043C\u043E\u0431\u0443 (\u0438\u0433\u0440\u043E\u043A\u0443), \u0438 \u042F \u0431\u0443\u0434\u0443 \u0441\u043B\u0435\u0434\u043E\u0432\u0430\u0442\u044C \u0437\u0430 \u043D\u0438\u043C. + +info.upgrade.range=\u0423\u043B\u0443\u0447\u0448\u0430\u0435\u0442 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u043F\u0440\u0435\u0441\u043B\u0435\u0434\u043E\u0432\u0430\u043D\u0438\u044F \u0442\u0443\u0440\u0435\u043B\u0438. +info.upgrade.collect=\u041F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u0442\u0443\u0440\u0435\u043B\u0438 \u0441\u043E\u0431\u0438\u0440\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0435 \u0433\u0438\u043B\u044C\u0437\u044B. +info.upgrade.sentry=\u0423\u043B\u0443\u0447\u0448\u0435\u043D\u0438\u0435 \u0434\u043B\u044F \u0442\u0443\u0440\u0435\u043B\u0438 + +info.turretdenied.waila=\u0423 \u0432\u0430\u0441 \u043D\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u0430 \u043A %u diff --git a/src/main/resources/assets/defense/lang/zh_CN.lang b/src/main/resources/assets/defense/lang/zh_CN.lang new file mode 100644 index 000000000..216696fbc --- /dev/null +++ b/src/main/resources/assets/defense/lang/zh_CN.lang @@ -0,0 +1,133 @@ + +itemGroup.ICBM=ICBM + +children=zh_TW, + +## Items +item.sulfur.name=\u786B\u78FA +item.poisonPowder.name=\u6BD2\u7C89 +item.antidote.name=\u85E5\u5291 +item.radarGun.name=\u96F7\u9054\u69CD +item.remoteDetonator.name=\u9059\u63A7\u5F15\u7206\u5668 +item.defuser.name=\u7184\u6EC5\u7CFB\u7D71 +item.laserDesignator.name=\u9433\u5C04\u6307\u793A\u7B26 +item.tracker.name=\u8FFD\u8E64\u5668 +item.signalDisrupter.name=\u4FE1\u865F\u5E72\u64FE\u7CFB\u7D71 + +item.bullet.0.name=\u666E\u7528\u6027\u5B50\u5F48 +item.bullet.1.name=\u53CD\u7269\u8CEA\u5B50\u5F48 +item.launcher.name=\u706B\u7BAD\u7B52 + +## ICBM Machines +icbm.machine.0.name=\u767C\u5C04\u53F0T1 +icbm.machine.1.name=\u767C\u5C04\u53F0T2 +icbm.machine.2.name=\u767C\u5C04\u53F0T3 +icbm.machine.3.name=\u63A7\u5236\u7CFB\u7D71T1 +icbm.machine.4.name=\u63A7\u5236\u7CFB\u7D71T2 +icbm.machine.5.name=\u63A7\u5236\u7CFB\u7D71T3 +icbm.machine.6.name=\u652F\u63F4\u6846T1 +icbm.machine.7.name=\u652F\u63F4\u6846T2 +icbm.machine.8.name=\u652F\u63F4\u6846T3 +icbm.machine.9.name=\u96F7\u9054\u53F0 +icbm.machine.10.name=\u78C1\u66B4\u5854 +icbm.machine.12.name=\u5DE1\u822A\u767C\u5C04\u5668 + +## ICBM Explosives + +## Block Form +icbm.explosive.condensed.name=\u58D3\u7E2E\u6027\u70B8\u85E5 +icbm.explosive.shrapnel.name=\u6563\u5F48\u6027\u70B8\u85E5 +icbm.explosive.incendiary.name=\u71C3\u71D2\u6027\u70B8\u85E5 +icbm.explosive.chemical.name=\u5316\u5B78\u6B66\u5668 +icbm.explosive.anvil.name=\u7827\u70B8\u85E5 +icbm.explosive.repulsive.name=\u6297\u62D2\u6027\u70B8\u85E5 +icbm.explosive.attractive.name=\u5438\u5F15\u6027\u70B8\u85E5 + +icbm.explosive.fragmentation.name=\u788E\u7247\u6027\u70B8\u85E5 +icbm.explosive.contagious.name=\u50B3\u67D3\u6027\u70B8\u85E5 +icbm.explosive.sonic.name=\u97F3\u6CE2\u70B8\u5F48 +icbm.explosive.breaching.name=\u9055\u53CD\u6027\u70B8\u85E5 +icbm.explosive.rejuvenation.name=\u6CBB\u7642\u6027\u70B8\u85E5 +icbm.explosive.thermobaric.name=\u6EAB\u58D3\u6027\u70B8\u85E5 + +icbm.explosive.nuclear.name=\u6838\u5F48 +icbm.explosive.emp.name=\u78C1\u66B4\u5F48 +icbm.explosive.conflagration.name=\u71F9\u70B8\u85E5 +icbm.explosive.endothermic.name=\u5438\u71B1\u6027\u70B8\u85E5 +icbm.explosive.antiGravitational.name=\u53CD\u5730\u5FC3\u5438\u529B\u70B8\u5F48 +icbm.explosive.ender.name=\u77AC\u79FB\u5F48 +icbm.explosive.hypersonic.name=\u8D85\u97F3\u6CE2\u5F48 + +icbm.explosive.antimatter.name=\u53CD\u7269\u8CEA\u70B8\u5F48 +icbm.explosive.redMatter.name=\u7D05\u7269\u8CEA\u70B8\u5F48 + +icbm.explosive.sMine.name=S\u578B\u5730\u96F7 + +## Missile Form +icbm.missile.condensed.name=\u666E\u7528\u5F0F\u5C0E\u5F48 +icbm.missile.shrapnel.name=\u6563\u5F48\u5C0E\u5F48 +icbm.missile.incendiary.name=\u71C3\u71D2\u5C0E\u5F48 +icbm.missile.chemical.name=\u5316\u5B78\u5C0E\u5F48 +icbm.missile.anvil.name=\u7827\u5C0E\u5F48 +icbm.missile.repulsive.name=\u62D2\u6297\u6027\u5C0E\u5F48 +icbm.missile.attractive.name=\u5438\u5F15\u6027\u5C0E\u5F48 + +icbm.missile.fragmentation.name=\u788E\u7247\u5C0E\u5F48 +icbm.missile.contagious.name=\u50B3\u67D3\u6027\u5C0E\u5F48 +icbm.missile.sonic.name=\u97F3\u6CE2\u5C0E\u5F48 +icbm.missile.breaching.name=\u9055\u53CD\u6027\u5C0E\u5F48 +icbm.missile.rejuvenation.name=\u6CBB\u7642\u6027\u5C0E\u5F48 +icbm.missile.thermobaric.name=\u6EAB\u58D3\u6027\u5C0E\u5F48 + +icbm.missile.nuclear.name=\u6838\u5C0E\u5F48 +icbm.missile.emp.name=\u78C1\u66B4\u5C0E\u5F48 +icbm.missile.conflagration.name=\u71F9\u5C0E\u5F48 +icbm.missile.endothermic.name=\u5438\u71B1\u5C0E\u5F48 +icbm.missile.antiGravitational.name=\u53CD\u5730\u5FC3\u5438\u529B\u5C0E\u5F48 +icbm.missile.ender.name=\u77AC\u79FB\u5C0E\u5F48 +icbm.missile.hypersonic.name=\u8D85\u97F3\u6CE2\u5C0E\u5F48 + +icbm.missile.antimatter.name=\u53CD\u7269\u8CEA\u5C0E\u5F48 +icbm.missile.redMatter.name=\u7D05\u7269\u8CEA\u5C0E\u5F48 + +## Special Missiles +icbm.missile.missileModule.name=\u5C0E\u5F48\u6A21 +icbm.missile.antiBallistic.name=\u53CD\u5F48\u9053\u5C0E\u5F48 +icbm.missile.cluster.name=\u98A8\u66B4\u5C0E\u5F48 +icbm.missile.nuclearCluster.name=\u6838\u98A8\u66B4\u5C0E\u5F48 +icbm.missile.homing.name=\u8FFD\u8E64\u6027\u5C0E\u5F48 + +## Grenades +icbm.grenade.condensed.name=\u666E\u7528\u6027\u624B\u69B4\u5F48 +icbm.grenade.shrapnel.name=\u6563\u5F48\u624B\u69B4\u5F48 +icbm.grenade.incendiary.name=\u71C3\u71D2\u6027\u624B\u69B4\u5F48 +icbm.grenade.chemical.name=\u5316\u5B78\u6027\u624B\u69B4\u5F48 +icbm.grenade.anvil.name=\u7827\u624B\u69B4\u5F48 +icbm.grenade.repulsive.name=\u62D2\u6297\u6027\u624B\u69B4\u5F48 +icbm.grenade.attractive.name=\u5438\u5F15\u6027\u624B\u69B4\u5F48 + +## Explosive Minecarts +icbm.minecart.condensed.name=\u7206\u70B8\u5927\u8ECA +icbm.minecart.shrapnel.name=\u6563\u5F48\u5927\u8ECA +icbm.minecart.incendiary.name=\u71C3\u71D2\u5927\u8ECA +icbm.minecart.chemical.name=\u5316\u5B78\u5927\u8ECA +icbm.minecart.anvil.name=\u7827\u5927\u8ECA +icbm.minecart.repulsive.name=\u62D2\u6297\u6027\u5927\u8ECA +icbm.minecart.attractive.name=\u5438\u5F15\u6027\u5927\u8ECA + +icbm.minecart.fragmentation.name=\u788E\u7247\u5927\u8ECA +icbm.minecart.contagious.name=\u50B3\u67D3\u6027\u5927\u8ECA +icbm.minecart.sonic.name=\u97F3\u6CE2\u5927\u8ECA +icbm.minecart.breaching.name=\u9055\u53CD\u6027\u5927\u8ECA +icbm.minecart.rejuvenation.name=\u6CBB\u7642\u6027\u5927\u8ECA +icbm.minecart.thermobaric.name=\u6EAB\u58D3\u6027\u5927\u8ECA + +## ICBM Misc Blocks +tile.sulfurOre.name=\u786B\u7926\u77F3 +tile.glassPressurePlate.name=\u73BB\u7483\u611F\u61C9\u677F +tile.glassButton.name=\u73BB\u7483\u6309\u9215 +tile.camouflage.name=\u507D\u88DD +tile.proximityDetector.name=\u63A5\u8FD1\u7387\u8A08\u7B97\u5668 +tile.spike.0.name=\u5C16\u523A +tile.spike.1.name=\u6709\u6BD2\u5C16\u523A +tile.spike.2.name=\u71C3\u71D2\u5C16\u523A diff --git a/src/main/resources/assets/defense/models/rocketLauncher.obj b/src/main/resources/assets/defense/models/rocketLauncher.obj new file mode 100644 index 000000000..f91280458 --- /dev/null +++ b/src/main/resources/assets/defense/models/rocketLauncher.obj @@ -0,0 +1,579 @@ +# Converted with GloomyFolken's tcn2obj Converter +# +o a +v 0.125000 0.150000 -1.000000 +v -0.125000 0.150000 -1.000000 +v -0.125000 0.400000 -1.000000 +v 0.125000 0.400000 -1.000000 +v -0.125000 0.150000 1.125000 +v 0.125000 0.150000 1.125000 +v 0.125000 0.400000 1.125000 +v -0.125000 0.400000 1.125000 +vt 0.265625 0.703125 +vt 0.296875 0.703125 +vt 0.296875 0.734375 +vt 0.265625 0.734375 +vt 0.562500 0.703125 +vt 0.593750 0.703125 +vt 0.593750 0.734375 +vt 0.562500 0.734375 +vt 0.296875 1.000000 +vt 0.265625 1.000000 +vt 0.328125 0.734375 +vt 0.328125 1.000000 +vt 0.000000 0.703125 +vt 0.000000 0.734375 +f 1/1 2/2 3/3 4/4 +f 5/5 6/6 7/7 8/8 +f 4/4 3/3 8/9 7/10 +f 6/3 5/11 2/12 1/9 +f 6/13 1/1 4/4 7/14 +f 2/2 5/5 8/8 3/3 +o b +v -0.000000 -0.030237 -0.573318 +v -0.062500 -0.030237 -0.573318 +v -0.062500 0.150000 -0.625000 +v 0.000000 0.150000 -0.625000 +v -0.062500 0.004218 -0.453160 +v 0.000000 0.004218 -0.453160 +v 0.000000 0.184455 -0.504842 +v -0.062500 0.184455 -0.504842 +vt 0.015625 0.906250 +vt 0.023438 0.906250 +vt 0.023438 0.929688 +vt 0.015625 0.929688 +vt 0.039063 0.906250 +vt 0.046875 0.906250 +vt 0.046875 0.929688 +vt 0.039063 0.929688 +vt 0.023438 0.945313 +vt 0.015625 0.945313 +vt 0.031250 0.929688 +vt 0.031250 0.945313 +vt 0.000000 0.906250 +vt 0.000000 0.929688 +f 9/15 10/16 11/17 12/18 +f 13/19 14/20 15/21 16/22 +f 12/18 11/17 16/23 15/24 +f 14/17 13/25 10/26 9/23 +f 14/27 9/15 12/18 15/28 +f 10/16 13/19 16/22 11/17 +o c +v -0.000000 -0.100000 0.125000 +v -0.062500 -0.100000 0.125000 +v -0.062500 0.150000 0.125000 +v 0.000000 0.150000 0.125000 +v -0.062500 -0.100000 0.250000 +v -0.000000 -0.100000 0.250000 +v 0.000000 0.150000 0.250000 +v -0.062500 0.150000 0.250000 +vt 0.070313 0.906250 +vt 0.078125 0.906250 +vt 0.078125 0.937500 +vt 0.070313 0.937500 +vt 0.093750 0.906250 +vt 0.101563 0.906250 +vt 0.101563 0.937500 +vt 0.093750 0.937500 +vt 0.078125 0.953125 +vt 0.070313 0.953125 +vt 0.085938 0.937500 +vt 0.085938 0.953125 +vt 0.054688 0.906250 +vt 0.054688 0.937500 +f 17/29 18/30 19/31 20/32 +f 21/33 22/34 23/35 24/36 +f 20/32 19/31 24/37 23/38 +f 22/31 21/39 18/40 17/37 +f 22/41 17/29 20/32 23/42 +f 18/30 21/33 24/36 19/31 +o d +v 0.062500 0.525000 -0.875000 +v -0.062500 0.525000 -0.875000 +v -0.062500 0.775000 -0.875000 +v 0.062500 0.775000 -0.875000 +vt 0.109375 0.945313 +vt 0.125000 0.945313 +vt 0.125000 0.976563 +vt 0.109375 0.976563 +vt 0.140625 0.945313 +vt 0.140625 0.976563 +f 25/43 26/44 27/45 28/46 +f 26/44 25/47 28/48 27/45 +o e +v 0.062500 0.400000 -0.937500 +v -0.062500 0.400000 -0.937500 +v -0.062500 0.462500 -0.937500 +v 0.062500 0.462500 -0.937500 +v -0.062500 0.400000 -0.687500 +v 0.062500 0.400000 -0.687500 +v 0.062500 0.462500 -0.687500 +v -0.062500 0.462500 -0.687500 +vt 0.031250 0.960938 +vt 0.046875 0.960938 +vt 0.046875 0.968750 +vt 0.031250 0.968750 +vt 0.078125 0.960938 +vt 0.093750 0.960938 +vt 0.093750 0.968750 +vt 0.078125 0.968750 +vt 0.046875 1.000000 +vt 0.031250 1.000000 +vt 0.062500 0.968750 +vt 0.062500 1.000000 +vt 0.000000 0.960938 +vt 0.000000 0.968750 +f 29/49 30/50 31/51 32/52 +f 33/53 34/54 35/55 36/56 +f 32/52 31/51 36/57 35/58 +f 34/51 33/59 30/60 29/57 +f 34/61 29/49 32/52 35/62 +f 30/50 33/53 36/56 31/51 +o f +v 0.125000 0.400000 -0.875000 +v -0.125000 0.400000 -0.875000 +v -0.125000 0.525000 -0.875000 +v 0.125000 0.525000 -0.875000 +vt 0.109375 0.984375 +vt 0.140625 0.984375 +vt 0.140625 1.000000 +vt 0.109375 1.000000 +vt 0.171875 0.984375 +vt 0.171875 1.000000 +f 37/63 38/64 39/65 40/66 +f 38/64 37/67 40/68 39/65 +o g +v 0.187500 0.212500 0.562500 +v 0.054917 0.079917 0.562500 +v 0.010723 0.124112 0.562500 +v 0.143306 0.256694 0.562500 +v 0.054917 0.079917 1.312500 +v 0.187500 0.212500 1.312500 +v 0.143306 0.256694 1.312500 +v 0.010723 0.124112 1.312500 +vt 0.093750 0.585938 +vt 0.117188 0.585938 +vt 0.117188 0.593750 +vt 0.093750 0.593750 +vt 0.210938 0.585938 +vt 0.234375 0.585938 +vt 0.234375 0.593750 +vt 0.210938 0.593750 +vt 0.117188 0.687500 +vt 0.093750 0.687500 +vt 0.140625 0.593750 +vt 0.140625 0.687500 +vt 0.000000 0.585938 +vt 0.000000 0.593750 +f 41/69 42/70 43/71 44/72 +f 45/73 46/74 47/75 48/76 +f 44/72 43/71 48/77 47/78 +f 46/71 45/79 42/80 41/77 +f 46/81 41/69 44/72 47/82 +f 42/70 45/73 48/76 43/71 +o h +v 0.150888 0.285723 0.687500 +v 0.018306 0.418306 0.687500 +v 0.062500 0.462500 0.687500 +v 0.195083 0.329917 0.687500 +v 0.018306 0.418306 1.187500 +v 0.150888 0.285723 1.187500 +v 0.195083 0.329917 1.187500 +v 0.062500 0.462500 1.187500 +vt 0.062500 0.515625 +vt 0.085938 0.515625 +vt 0.085938 0.523438 +vt 0.062500 0.523438 +vt 0.148438 0.515625 +vt 0.171875 0.515625 +vt 0.171875 0.523438 +vt 0.148438 0.523438 +vt 0.085938 0.585938 +vt 0.062500 0.585938 +vt 0.109375 0.523438 +vt 0.109375 0.585938 +vt 0.000000 0.515625 +vt 0.000000 0.523438 +f 49/83 50/84 51/85 52/86 +f 53/87 54/88 55/89 56/90 +f 52/86 51/85 56/91 55/92 +f 54/85 53/93 50/94 49/91 +f 54/95 49/83 52/86 55/96 +f 50/84 53/87 56/90 51/85 +o i +v 0.062500 0.087500 0.562500 +v -0.062500 0.087500 0.562500 +v -0.062500 0.150000 0.562500 +v 0.062500 0.150000 0.562500 +v -0.062500 0.087500 1.312500 +v 0.062500 0.087500 1.312500 +v 0.062500 0.150000 1.312500 +v -0.062500 0.150000 1.312500 +vt 0.335938 0.585938 +vt 0.351563 0.585938 +vt 0.351563 0.593750 +vt 0.335938 0.593750 +vt 0.445313 0.585938 +vt 0.460938 0.585938 +vt 0.460938 0.593750 +vt 0.445313 0.593750 +vt 0.351563 0.687500 +vt 0.335938 0.687500 +vt 0.367188 0.593750 +vt 0.367188 0.687500 +vt 0.242188 0.585938 +vt 0.242188 0.593750 +f 57/97 58/98 59/99 60/100 +f 61/101 62/102 63/103 64/104 +f 60/100 59/99 64/105 63/106 +f 62/99 61/107 58/108 57/105 +f 62/109 57/97 60/100 63/110 +f 58/98 61/101 64/104 59/99 +o j +v 0.062500 0.400000 0.687500 +v -0.062500 0.400000 0.687500 +v -0.062500 0.462500 0.687500 +v 0.062500 0.462500 0.687500 +v -0.062500 0.400000 1.187500 +v 0.062500 0.400000 1.187500 +v 0.062500 0.462500 1.187500 +v -0.062500 0.462500 1.187500 +vt 0.242188 0.515625 +vt 0.257813 0.515625 +vt 0.257813 0.523438 +vt 0.242188 0.523438 +vt 0.320313 0.515625 +vt 0.335938 0.515625 +vt 0.335938 0.523438 +vt 0.320313 0.523438 +vt 0.257813 0.585938 +vt 0.242188 0.585938 +vt 0.273438 0.523438 +vt 0.273438 0.585938 +vt 0.179688 0.515625 +vt 0.179688 0.523438 +f 65/111 66/112 67/113 68/114 +f 69/115 70/116 71/117 72/118 +f 68/114 67/113 72/119 71/120 +f 70/113 69/121 66/122 65/119 +f 70/123 65/111 68/114 71/124 +f 66/112 69/115 72/118 67/113 +o k +v -0.018306 0.418306 0.687500 +v -0.150888 0.285723 0.687500 +v -0.195082 0.329917 0.687500 +v -0.062500 0.462500 0.687500 +v -0.150888 0.285723 1.187500 +v -0.018306 0.418306 1.187500 +v -0.062500 0.462500 1.187500 +v -0.195082 0.329917 1.187500 +vt 0.062500 0.515625 +vt 0.085938 0.515625 +vt 0.085938 0.523438 +vt 0.062500 0.523438 +vt 0.148438 0.515625 +vt 0.171875 0.515625 +vt 0.171875 0.523438 +vt 0.148438 0.523438 +vt 0.085938 0.585938 +vt 0.062500 0.585938 +vt 0.109375 0.523438 +vt 0.109375 0.585938 +vt 0.000000 0.515625 +vt 0.000000 0.523438 +f 73/125 74/126 75/127 76/128 +f 77/129 78/130 79/131 80/132 +f 76/128 75/127 80/133 79/134 +f 78/127 77/135 74/136 73/133 +f 78/137 73/125 76/128 79/138 +f 74/126 77/129 80/132 75/127 +o l +v -0.062500 0.087500 0.562500 +v -0.195083 0.220083 0.562500 +v -0.150888 0.264277 0.562500 +v -0.018306 0.131694 0.562500 +v -0.195083 0.220083 1.312500 +v -0.062500 0.087500 1.312500 +v -0.018306 0.131694 1.312500 +v -0.150888 0.264277 1.312500 +vt 0.093750 0.585938 +vt 0.117188 0.585938 +vt 0.117188 0.593750 +vt 0.093750 0.593750 +vt 0.210938 0.585938 +vt 0.234375 0.585938 +vt 0.234375 0.593750 +vt 0.210938 0.593750 +vt 0.117188 0.687500 +vt 0.093750 0.687500 +vt 0.140625 0.593750 +vt 0.140625 0.687500 +vt 0.000000 0.585938 +vt 0.000000 0.593750 +f 81/139 82/140 83/141 84/142 +f 85/143 86/144 87/145 88/146 +f 84/142 83/141 88/147 87/148 +f 86/141 85/149 82/150 81/147 +f 86/151 81/139 84/142 87/152 +f 82/140 85/143 88/146 83/141 +o m +v -0.125000 0.400000 -0.625000 +v -0.250000 0.400000 -0.625000 +v -0.250000 0.525000 -0.625000 +v -0.125000 0.525000 -0.625000 +v -0.250000 0.400000 -0.250000 +v -0.125000 0.400000 -0.250000 +v -0.125000 0.525000 -0.250000 +v -0.250000 0.525000 -0.250000 +vt 0.414063 0.937500 +vt 0.429688 0.937500 +vt 0.429688 0.953125 +vt 0.414063 0.953125 +vt 0.476563 0.937500 +vt 0.492188 0.937500 +vt 0.492188 0.953125 +vt 0.476563 0.953125 +vt 0.429688 1.000000 +vt 0.414063 1.000000 +vt 0.445313 0.953125 +vt 0.445313 1.000000 +vt 0.367188 0.937500 +vt 0.367188 0.953125 +f 89/153 90/154 91/155 92/156 +f 93/157 94/158 95/159 96/160 +f 92/156 91/155 96/161 95/162 +f 94/155 93/163 90/164 89/161 +f 94/165 89/153 92/156 95/166 +f 90/154 93/157 96/160 91/155 +o n +v 0.007583 0.392417 -0.562500 +v -0.080806 0.304029 -0.562500 +v -0.213388 0.436612 -0.562500 +v -0.125000 0.525000 -0.562500 +v -0.080806 0.304029 -0.500000 +v 0.007583 0.392417 -0.500000 +v -0.125000 0.525000 -0.500000 +v -0.213388 0.436612 -0.500000 +vt 0.375000 0.890625 +vt 0.390625 0.890625 +vt 0.390625 0.914063 +vt 0.375000 0.914063 +vt 0.398438 0.890625 +vt 0.414063 0.890625 +vt 0.414063 0.914063 +vt 0.398438 0.914063 +vt 0.390625 0.921875 +vt 0.375000 0.921875 +vt 0.406250 0.914063 +vt 0.406250 0.921875 +vt 0.367188 0.890625 +vt 0.367188 0.914063 +f 97/167 98/168 99/169 100/170 +f 101/171 102/172 103/173 104/174 +f 100/170 99/169 104/175 103/176 +f 102/169 101/177 98/178 97/175 +f 102/179 97/167 100/170 103/180 +f 98/168 101/171 104/174 99/169 +o o +v 0.007583 0.392417 -0.375000 +v -0.080806 0.304029 -0.375000 +v -0.213388 0.436612 -0.375000 +v -0.125000 0.525000 -0.375000 +v -0.080806 0.304029 -0.312500 +v 0.007583 0.392417 -0.312500 +v -0.125000 0.525000 -0.312500 +v -0.213388 0.436612 -0.312500 +vt 0.375000 0.890625 +vt 0.390625 0.890625 +vt 0.390625 0.914063 +vt 0.375000 0.914063 +vt 0.398438 0.890625 +vt 0.414063 0.890625 +vt 0.414063 0.914063 +vt 0.398438 0.914063 +vt 0.390625 0.921875 +vt 0.375000 0.921875 +vt 0.406250 0.914063 +vt 0.406250 0.921875 +vt 0.367188 0.890625 +vt 0.367188 0.914063 +f 105/181 106/182 107/183 108/184 +f 109/185 110/186 111/187 112/188 +f 108/184 107/183 112/189 111/190 +f 110/183 109/191 106/192 105/189 +f 110/193 105/181 108/184 111/194 +f 106/182 109/185 112/188 107/183 +o p +v -0.018306 0.418306 -1.062500 +v -0.150888 0.285723 -1.062500 +v -0.195082 0.329917 -1.062500 +v -0.062500 0.462500 -1.062500 +v -0.150888 0.285723 -0.812500 +v -0.018306 0.418306 -0.812500 +v -0.062500 0.462500 -0.812500 +v -0.195082 0.329917 -0.812500 +vt 0.031250 0.851563 +vt 0.054688 0.851563 +vt 0.054688 0.859375 +vt 0.031250 0.859375 +vt 0.085938 0.851563 +vt 0.109375 0.851563 +vt 0.109375 0.859375 +vt 0.085938 0.859375 +vt 0.054688 0.890625 +vt 0.031250 0.890625 +vt 0.078125 0.859375 +vt 0.078125 0.890625 +vt 0.000000 0.851563 +vt 0.000000 0.859375 +f 113/195 114/196 115/197 116/198 +f 117/199 118/200 119/201 120/202 +f 116/198 115/197 120/203 119/204 +f 118/197 117/205 114/206 113/203 +f 118/207 113/195 116/198 119/208 +f 114/196 117/199 120/202 115/197 +o q +v -0.062500 0.087500 -1.062500 +v -0.195083 0.220083 -1.062500 +v -0.150888 0.264277 -1.062500 +v -0.018306 0.131694 -1.062500 +v -0.195083 0.220083 -0.812500 +v -0.062500 0.087500 -0.812500 +v -0.018306 0.131694 -0.812500 +v -0.150888 0.264277 -0.812500 +vt 0.031250 0.851563 +vt 0.054688 0.851563 +vt 0.054688 0.859375 +vt 0.031250 0.859375 +vt 0.085938 0.851563 +vt 0.109375 0.851563 +vt 0.109375 0.859375 +vt 0.085938 0.859375 +vt 0.054688 0.890625 +vt 0.031250 0.890625 +vt 0.078125 0.859375 +vt 0.078125 0.890625 +vt 0.000000 0.851563 +vt 0.000000 0.859375 +f 121/209 122/210 123/211 124/212 +f 125/213 126/214 127/215 128/216 +f 124/212 123/211 128/217 127/218 +f 126/211 125/219 122/220 121/217 +f 126/221 121/209 124/212 127/222 +f 122/210 125/213 128/216 123/211 +o r +v -0.125000 0.212500 -1.062500 +v -0.187500 0.212500 -1.062500 +v -0.187500 0.337500 -1.062500 +v -0.125000 0.337500 -1.062500 +v -0.187500 0.212500 -0.812500 +v -0.125000 0.212500 -0.812500 +v -0.125000 0.337500 -0.812500 +v -0.187500 0.337500 -0.812500 +vt 0.031250 0.789063 +vt 0.039063 0.789063 +vt 0.039063 0.804688 +vt 0.031250 0.804688 +vt 0.070313 0.789063 +vt 0.078125 0.789063 +vt 0.078125 0.804688 +vt 0.070313 0.804688 +vt 0.039063 0.835938 +vt 0.031250 0.835938 +vt 0.046875 0.804688 +vt 0.046875 0.835938 +vt 0.000000 0.789063 +vt 0.000000 0.804688 +f 129/223 130/224 131/225 132/226 +f 133/227 134/228 135/229 136/230 +f 132/226 131/225 136/231 135/232 +f 134/225 133/233 130/234 129/231 +f 134/235 129/223 132/226 135/236 +f 130/224 133/227 136/230 131/225 +o s +v 0.143306 0.293306 -1.062500 +v 0.010723 0.425888 -1.062500 +v 0.054918 0.470082 -1.062500 +v 0.187500 0.337500 -1.062500 +v 0.010723 0.425888 -0.812500 +v 0.143306 0.293306 -0.812500 +v 0.187500 0.337500 -0.812500 +v 0.054918 0.470082 -0.812500 +vt 0.031250 0.851563 +vt 0.054688 0.851563 +vt 0.054688 0.859375 +vt 0.031250 0.859375 +vt 0.085938 0.851563 +vt 0.109375 0.851563 +vt 0.109375 0.859375 +vt 0.085938 0.859375 +vt 0.054688 0.890625 +vt 0.031250 0.890625 +vt 0.078125 0.859375 +vt 0.078125 0.890625 +vt 0.000000 0.851563 +vt 0.000000 0.859375 +f 137/237 138/238 139/239 140/240 +f 141/241 142/242 143/243 144/244 +f 140/240 139/239 144/245 143/246 +f 142/239 141/247 138/248 137/245 +f 142/249 137/237 140/240 143/250 +f 138/238 141/241 144/244 139/239 +o t +v 0.187500 0.212500 -1.062500 +v 0.125000 0.212500 -1.062500 +v 0.125000 0.337500 -1.062500 +v 0.187500 0.337500 -1.062500 +v 0.125000 0.212500 -0.812500 +v 0.187500 0.212500 -0.812500 +v 0.187500 0.337500 -0.812500 +v 0.125000 0.337500 -0.812500 +vt 0.031250 0.789063 +vt 0.039063 0.789063 +vt 0.039063 0.804688 +vt 0.031250 0.804688 +vt 0.070313 0.789063 +vt 0.078125 0.789063 +vt 0.078125 0.804688 +vt 0.070313 0.804688 +vt 0.039063 0.835938 +vt 0.031250 0.835938 +vt 0.046875 0.804688 +vt 0.046875 0.835938 +vt 0.000000 0.789063 +vt 0.000000 0.804688 +f 145/251 146/252 147/253 148/254 +f 149/255 150/256 151/257 152/258 +f 148/254 147/253 152/259 151/260 +f 150/253 149/261 146/262 145/259 +f 150/263 145/251 148/254 151/264 +f 146/252 149/255 152/258 147/253 +o u +v 0.187500 0.212500 -1.062500 +v 0.054917 0.079917 -1.062500 +v 0.010723 0.124112 -1.062500 +v 0.143306 0.256694 -1.062500 +v 0.054917 0.079917 -0.812500 +v 0.187500 0.212500 -0.812500 +v 0.143306 0.256694 -0.812500 +v 0.010723 0.124112 -0.812500 +vt 0.031250 0.851563 +vt 0.054688 0.851563 +vt 0.054688 0.859375 +vt 0.031250 0.859375 +vt 0.085938 0.851563 +vt 0.109375 0.851563 +vt 0.109375 0.859375 +vt 0.085938 0.859375 +vt 0.054688 0.890625 +vt 0.031250 0.890625 +vt 0.078125 0.859375 +vt 0.078125 0.890625 +vt 0.000000 0.851563 +vt 0.000000 0.859375 +f 153/265 154/266 155/267 156/268 +f 157/269 158/270 159/271 160/272 +f 156/268 155/267 160/273 159/274 +f 158/267 157/275 154/276 153/273 +f 158/277 153/265 156/268 159/278 +f 154/266 157/269 160/272 155/267 diff --git a/src/main/resources/assets/defense/models/rocketLauncher.png b/src/main/resources/assets/defense/models/rocketLauncher.png new file mode 100644 index 000000000..bf9b2d13a Binary files /dev/null and b/src/main/resources/assets/defense/models/rocketLauncher.png differ diff --git a/src/main/resources/assets/defense/sounds.json b/src/main/resources/assets/defense/sounds.json new file mode 100644 index 000000000..d7a3fc3e9 --- /dev/null +++ b/src/main/resources/assets/defense/sounds.json @@ -0,0 +1,46 @@ +{ + "aagun": {"category": "master", "sounds": [{"name": "aagun", "stream": false}]}, + "airstrike": {"category": "master", "sounds": [{"name": "airstrike", "stream": false}]}, + "alarm": {"category": "master", "sounds": [{"name": "alarm", "stream": false}]}, + "antigravity": {"category": "master", "sounds": [{"name": "antigravity", "stream": false}]}, + "antimatter": {"category": "master", "sounds": [{"name": "antimatter", "stream": false}]}, + "beamcharging": {"category": "master", "sounds": [{"name": "beamcharging", "stream": false}]}, + "collapse": {"category": "master", "sounds": [ + {"name": "collapse1", "stream": false}, + {"name": "collapse2", "stream": false}, + {"name": "collapse3", "stream": false}, + {"name": "collapse4", "stream": false}, + {"name": "collapse5", "stream": false}, + {"name": "collapse6", "stream": false}, + {"name": "collapse7", "stream": false}, + {"name": "collapse8", "stream": false} + ] + }, + "debilitation": {"category": "master", "sounds": [{"name": "debilitation", "stream": false}]}, + "emp": {"category": "master", "sounds": [{"name": "emp", "stream": false}]}, + "explosion": {"category": "master", "sounds": [{"name": "explosion", "stream": false}]}, + "explosionfire": {"category": "master", "sounds": [{"name": "explosionfire", "stream": false}]}, + "gasleak": {"category": "master", "sounds": [{"name": "gasleak", "stream": false}]}, + "hypersonic": {"category": "master", "sounds": [{"name": "hypersonic", "stream": false}]}, + "interface": {"category": "master", "sounds": [{"name": "interface", "stream": false}]}, + "laser": {"category": "master", "sounds": [{"name": "laser", "stream": false}]}, + "lasershot": {"category": "master", "sounds": [{"name": "lasershot", "stream": false}]}, + "machinegun": {"category": "master", "sounds": [ + {"name": "machinegun1", "stream": false}, + {"name": "machinegun2", "stream": false} + ] + }, + "machinehum": {"category": "master", "sounds": [{"name": "machinehum", "stream": false}]}, + "missileinair": {"category": "master", "sounds": [{"name": "missileinair", "stream": false}]}, + "missilelaunch": {"category": "master", "sounds": [ + {"name": "missilelaunch1", "stream": false}, + {"name": "missilelaunch2", "stream": false} + ] + }, + "powerdown": {"category": "master", "sounds": [{"name": "powerdown", "stream": false}]}, + "radaralarm": {"category": "master", "sounds": [{"name": "radaralarm", "stream": false}]}, + "railgun": {"category": "master", "sounds": [{"name": "railgun", "stream": false}]}, + "redmatter": {"category": "master", "sounds": [{"name": "redmatter", "stream": false}]}, + "sonicwave": {"category": "master", "sounds": [{"name": "sonicwave", "stream": false}]}, + "targetlocked": {"category": "master", "sounds": [{"name": "targetlocked", "stream": false}]} +} \ No newline at end of file diff --git a/src/main/resources/assets/defense/sounds/aagun.ogg b/src/main/resources/assets/defense/sounds/aagun.ogg new file mode 100644 index 000000000..c4de36b97 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/aagun.ogg differ diff --git a/src/main/resources/assets/defense/sounds/airstrike.ogg b/src/main/resources/assets/defense/sounds/airstrike.ogg new file mode 100644 index 000000000..7368b5ce8 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/airstrike.ogg differ diff --git a/src/main/resources/assets/defense/sounds/alarm.ogg b/src/main/resources/assets/defense/sounds/alarm.ogg new file mode 100644 index 000000000..5fa951b34 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/alarm.ogg differ diff --git a/src/main/resources/assets/defense/sounds/antigravity.ogg b/src/main/resources/assets/defense/sounds/antigravity.ogg new file mode 100644 index 000000000..3202883ca Binary files /dev/null and b/src/main/resources/assets/defense/sounds/antigravity.ogg differ diff --git a/src/main/resources/assets/defense/sounds/antimatter.ogg b/src/main/resources/assets/defense/sounds/antimatter.ogg new file mode 100644 index 000000000..f23602f02 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/antimatter.ogg differ diff --git a/src/main/resources/assets/defense/sounds/beamcharging.ogg b/src/main/resources/assets/defense/sounds/beamcharging.ogg new file mode 100644 index 000000000..b44a09180 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/beamcharging.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse1.ogg b/src/main/resources/assets/defense/sounds/collapse1.ogg new file mode 100644 index 000000000..37b70445a Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse1.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse2.ogg b/src/main/resources/assets/defense/sounds/collapse2.ogg new file mode 100644 index 000000000..f2405e94b Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse2.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse3.ogg b/src/main/resources/assets/defense/sounds/collapse3.ogg new file mode 100644 index 000000000..c66bc4b5d Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse3.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse4.ogg b/src/main/resources/assets/defense/sounds/collapse4.ogg new file mode 100644 index 000000000..1681f97bb Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse4.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse5.ogg b/src/main/resources/assets/defense/sounds/collapse5.ogg new file mode 100644 index 000000000..7fd61ed50 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse5.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse6.ogg b/src/main/resources/assets/defense/sounds/collapse6.ogg new file mode 100644 index 000000000..46c4e4eff Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse6.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse7.ogg b/src/main/resources/assets/defense/sounds/collapse7.ogg new file mode 100644 index 000000000..3b44e3825 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse7.ogg differ diff --git a/src/main/resources/assets/defense/sounds/collapse8.ogg b/src/main/resources/assets/defense/sounds/collapse8.ogg new file mode 100644 index 000000000..af056e2bf Binary files /dev/null and b/src/main/resources/assets/defense/sounds/collapse8.ogg differ diff --git a/src/main/resources/assets/defense/sounds/debilitation.ogg b/src/main/resources/assets/defense/sounds/debilitation.ogg new file mode 100644 index 000000000..d5dfa4cdd Binary files /dev/null and b/src/main/resources/assets/defense/sounds/debilitation.ogg differ diff --git a/src/main/resources/assets/defense/sounds/emp.ogg b/src/main/resources/assets/defense/sounds/emp.ogg new file mode 100644 index 000000000..0c5a1b313 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/emp.ogg differ diff --git a/src/main/resources/assets/defense/sounds/explosion.ogg b/src/main/resources/assets/defense/sounds/explosion.ogg new file mode 100644 index 000000000..efbe496d0 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/explosion.ogg differ diff --git a/src/main/resources/assets/defense/sounds/explosionfire.ogg b/src/main/resources/assets/defense/sounds/explosionfire.ogg new file mode 100644 index 000000000..ca3a85b77 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/explosionfire.ogg differ diff --git a/src/main/resources/assets/defense/sounds/gasleak.ogg b/src/main/resources/assets/defense/sounds/gasleak.ogg new file mode 100644 index 000000000..3366fc74a Binary files /dev/null and b/src/main/resources/assets/defense/sounds/gasleak.ogg differ diff --git a/src/main/resources/assets/defense/sounds/hypersonic.ogg b/src/main/resources/assets/defense/sounds/hypersonic.ogg new file mode 100644 index 000000000..7db3c9e0c Binary files /dev/null and b/src/main/resources/assets/defense/sounds/hypersonic.ogg differ diff --git a/src/main/resources/assets/defense/sounds/interface.ogg b/src/main/resources/assets/defense/sounds/interface.ogg new file mode 100644 index 000000000..ae3432813 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/interface.ogg differ diff --git a/src/main/resources/assets/defense/sounds/laser.ogg b/src/main/resources/assets/defense/sounds/laser.ogg new file mode 100644 index 000000000..0578f8813 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/laser.ogg differ diff --git a/src/main/resources/assets/defense/sounds/lasershot.ogg b/src/main/resources/assets/defense/sounds/lasershot.ogg new file mode 100644 index 000000000..cc3350ae6 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/lasershot.ogg differ diff --git a/src/main/resources/assets/defense/sounds/machinegun1.ogg b/src/main/resources/assets/defense/sounds/machinegun1.ogg new file mode 100644 index 000000000..f13b70357 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/machinegun1.ogg differ diff --git a/src/main/resources/assets/defense/sounds/machinegun2.ogg b/src/main/resources/assets/defense/sounds/machinegun2.ogg new file mode 100644 index 000000000..9d3712e92 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/machinegun2.ogg differ diff --git a/src/main/resources/assets/defense/sounds/machinehum.ogg b/src/main/resources/assets/defense/sounds/machinehum.ogg new file mode 100644 index 000000000..854dedac6 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/machinehum.ogg differ diff --git a/src/main/resources/assets/defense/sounds/missileinair.ogg b/src/main/resources/assets/defense/sounds/missileinair.ogg new file mode 100644 index 000000000..111f7f1d5 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/missileinair.ogg differ diff --git a/src/main/resources/assets/defense/sounds/missilelaunch1.ogg b/src/main/resources/assets/defense/sounds/missilelaunch1.ogg new file mode 100644 index 000000000..5631b02e7 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/missilelaunch1.ogg differ diff --git a/src/main/resources/assets/defense/sounds/missilelaunch2.ogg b/src/main/resources/assets/defense/sounds/missilelaunch2.ogg new file mode 100644 index 000000000..c51c70d54 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/missilelaunch2.ogg differ diff --git a/src/main/resources/assets/defense/sounds/powerdown.ogg b/src/main/resources/assets/defense/sounds/powerdown.ogg new file mode 100644 index 000000000..501b33fcd Binary files /dev/null and b/src/main/resources/assets/defense/sounds/powerdown.ogg differ diff --git a/src/main/resources/assets/defense/sounds/radaralarm.ogg b/src/main/resources/assets/defense/sounds/radaralarm.ogg new file mode 100644 index 000000000..b4926b954 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/radaralarm.ogg differ diff --git a/src/main/resources/assets/defense/sounds/railgun.ogg b/src/main/resources/assets/defense/sounds/railgun.ogg new file mode 100644 index 000000000..b4689bb20 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/railgun.ogg differ diff --git a/src/main/resources/assets/defense/sounds/redmatter.ogg b/src/main/resources/assets/defense/sounds/redmatter.ogg new file mode 100644 index 000000000..bebf8c533 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/redmatter.ogg differ diff --git a/src/main/resources/assets/defense/sounds/sonicwave.ogg b/src/main/resources/assets/defense/sounds/sonicwave.ogg new file mode 100644 index 000000000..280fa963e Binary files /dev/null and b/src/main/resources/assets/defense/sounds/sonicwave.ogg differ diff --git a/src/main/resources/assets/defense/sounds/targetlocked.ogg b/src/main/resources/assets/defense/sounds/targetlocked.ogg new file mode 100644 index 000000000..621328e19 Binary files /dev/null and b/src/main/resources/assets/defense/sounds/targetlocked.ogg differ diff --git a/src/main/resources/assets/defense/textures/antimatter.png b/src/main/resources/assets/defense/textures/antimatter.png new file mode 100644 index 000000000..c25ff57c2 Binary files /dev/null and b/src/main/resources/assets/defense/textures/antimatter.png differ diff --git a/src/main/resources/assets/defense/textures/blackhole.png b/src/main/resources/assets/defense/textures/blackhole.png new file mode 100644 index 000000000..bc4142fa0 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blackhole.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_bottom.png b/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_bottom.png new file mode 100644 index 000000000..0a7f66a91 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_bottom.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_side.png new file mode 100644 index 000000000..45cf297bd Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_top.png new file mode 100644 index 000000000..e558b5142 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_antiGravitational_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_side.png new file mode 100644 index 000000000..99d8905d4 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_side.png.mcmeta b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_side.png.mcmeta new file mode 100644 index 000000000..1ca3a06b6 --- /dev/null +++ b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_side.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": + { + "frametime": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_top.png new file mode 100644 index 000000000..1931f8583 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_top.png.mcmeta b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_top.png.mcmeta new file mode 100644 index 000000000..1ca3a06b6 --- /dev/null +++ b/src/main/resources/assets/defense/textures/blocks/explosive_antimatter_top.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": + { + "frametime": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_anvil_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_anvil_side.png new file mode 100644 index 000000000..4d7da41a0 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_anvil_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_anvil_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_anvil_top.png new file mode 100644 index 000000000..61e0756a5 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_anvil_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_attractive_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_attractive_side.png new file mode 100644 index 000000000..7c2dac033 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_attractive_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_attractive_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_attractive_top.png new file mode 100644 index 000000000..9588f6c38 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_attractive_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_base_1.png b/src/main/resources/assets/defense/textures/blocks/explosive_base_1.png new file mode 100644 index 000000000..bd05a2b0d Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_base_1.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_base_2.png b/src/main/resources/assets/defense/textures/blocks/explosive_base_2.png new file mode 100644 index 000000000..e40968b03 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_base_2.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_base_3.png b/src/main/resources/assets/defense/textures/blocks/explosive_base_3.png new file mode 100644 index 000000000..fdc36a9ce Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_base_3.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_bottom_1.png b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_1.png new file mode 100644 index 000000000..56eccaa54 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_1.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_bottom_2.png b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_2.png new file mode 100644 index 000000000..d30e9fc6b Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_2.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_bottom_3.png b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_3.png new file mode 100644 index 000000000..9cadfadba Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_3.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_bottom_4.png b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_4.png new file mode 100644 index 000000000..6c226db80 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_bottom_4.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_breaching_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_breaching_side.png new file mode 100644 index 000000000..74c949f0e Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_breaching_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_breaching_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_breaching_top.png new file mode 100644 index 000000000..289332339 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_breaching_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_chemical_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_chemical_side.png new file mode 100644 index 000000000..89cfdd322 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_chemical_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_chemical_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_chemical_top.png new file mode 100644 index 000000000..d0869a062 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_chemical_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_condensed_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_condensed_side.png new file mode 100644 index 000000000..446327e1a Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_condensed_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_condensed_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_condensed_top.png new file mode 100644 index 000000000..1f2ae4322 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_condensed_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_contagious_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_contagious_side.png new file mode 100644 index 000000000..32bf838c7 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_contagious_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_contagious_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_contagious_top.png new file mode 100644 index 000000000..ad1e14238 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_contagious_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_debilitation_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_debilitation_side.png new file mode 100644 index 000000000..7b86c3cb4 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_debilitation_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_debilitation_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_debilitation_top.png new file mode 100644 index 000000000..787d7a782 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_debilitation_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_emp_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_emp_side.png new file mode 100644 index 000000000..d379a554b Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_emp_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_emp_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_emp_top.png new file mode 100644 index 000000000..eb1907ca6 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_emp_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_ender_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_ender_side.png new file mode 100644 index 000000000..a54f9073c Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_ender_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_ender_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_ender_top.png new file mode 100644 index 000000000..74a6d4794 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_ender_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_endothermic_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_endothermic_side.png new file mode 100644 index 000000000..ca2766fe9 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_endothermic_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_endothermic_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_endothermic_top.png new file mode 100644 index 000000000..b5c59bc95 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_endothermic_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_exothermic_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_exothermic_side.png new file mode 100644 index 000000000..71b8e0a20 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_exothermic_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_exothermic_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_exothermic_top.png new file mode 100644 index 000000000..25dd01092 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_exothermic_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_fragmentation_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_fragmentation_side.png new file mode 100644 index 000000000..6d18771d2 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_fragmentation_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_fragmentation_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_fragmentation_top.png new file mode 100644 index 000000000..9eaa83929 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_fragmentation_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_hypersonic_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_hypersonic_side.png new file mode 100644 index 000000000..fa438761b Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_hypersonic_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_hypersonic_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_hypersonic_top.png new file mode 100644 index 000000000..00e6f2e8b Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_hypersonic_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_incendiary_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_incendiary_side.png new file mode 100644 index 000000000..de8c53f0c Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_incendiary_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_incendiary_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_incendiary_top.png new file mode 100644 index 000000000..1c5cad953 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_incendiary_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_nuclear_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_nuclear_side.png new file mode 100644 index 000000000..6f97220fc Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_nuclear_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_nuclear_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_nuclear_top.png new file mode 100644 index 000000000..0670b5425 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_nuclear_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_side.png new file mode 100644 index 000000000..b18c0bf88 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_side.png.mcmeta b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_side.png.mcmeta new file mode 100644 index 000000000..1ca3a06b6 --- /dev/null +++ b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_side.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": + { + "frametime": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_top.png new file mode 100644 index 000000000..de2f3cd60 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_top.png.mcmeta b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_top.png.mcmeta new file mode 100644 index 000000000..1ca3a06b6 --- /dev/null +++ b/src/main/resources/assets/defense/textures/blocks/explosive_redMatter_top.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": + { + "frametime": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_rejuvenation_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_rejuvenation_side.png new file mode 100644 index 000000000..744a4a674 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_rejuvenation_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_rejuvenation_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_rejuvenation_top.png new file mode 100644 index 000000000..9e2181f82 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_rejuvenation_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_repulsive_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_repulsive_side.png new file mode 100644 index 000000000..5e598c68a Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_repulsive_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_repulsive_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_repulsive_top.png new file mode 100644 index 000000000..25841b70e Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_repulsive_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_shrapnel _top.png b/src/main/resources/assets/defense/textures/blocks/explosive_shrapnel _top.png new file mode 100644 index 000000000..787d7a782 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_shrapnel _top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_shrapnel_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_shrapnel_side.png new file mode 100644 index 000000000..0ade6f3eb Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_shrapnel_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_sonic_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_sonic_side.png new file mode 100644 index 000000000..94095f950 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_sonic_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_sonic_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_sonic_top.png new file mode 100644 index 000000000..a749784b5 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_sonic_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_thermobaric_side.png b/src/main/resources/assets/defense/textures/blocks/explosive_thermobaric_side.png new file mode 100644 index 000000000..042409106 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_thermobaric_side.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/explosive_thermobaric_top.png b/src/main/resources/assets/defense/textures/blocks/explosive_thermobaric_top.png new file mode 100644 index 000000000..228f5fa1e Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/explosive_thermobaric_top.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/machine.png b/src/main/resources/assets/defense/textures/blocks/machine.png new file mode 100644 index 000000000..7a7eee798 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/machine.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/oreSulfur.png b/src/main/resources/assets/defense/textures/blocks/oreSulfur.png new file mode 100644 index 000000000..84ec5ce62 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/oreSulfur.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/radioactive.png b/src/main/resources/assets/defense/textures/blocks/radioactive.png new file mode 100644 index 000000000..235fb43a2 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/radioactive.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/radioactive_bottom.png b/src/main/resources/assets/defense/textures/blocks/radioactive_bottom.png new file mode 100644 index 000000000..484b9579a Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/radioactive_bottom.png differ diff --git a/src/main/resources/assets/defense/textures/blocks/radioactive_top.png b/src/main/resources/assets/defense/textures/blocks/radioactive_top.png new file mode 100644 index 000000000..6a7730df1 Binary files /dev/null and b/src/main/resources/assets/defense/textures/blocks/radioactive_top.png differ diff --git a/src/main/resources/assets/defense/textures/fadedSphere.png b/src/main/resources/assets/defense/textures/fadedSphere.png new file mode 100644 index 000000000..f2f38796d Binary files /dev/null and b/src/main/resources/assets/defense/textures/fadedSphere.png differ diff --git a/src/main/resources/assets/defense/textures/gui/greendot.png b/src/main/resources/assets/defense/textures/gui/greendot.png new file mode 100644 index 000000000..35c0a2de8 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/greendot.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_base.png b/src/main/resources/assets/defense/textures/gui/gui_base.png new file mode 100644 index 000000000..6cdb0ba09 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_base.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_button.png b/src/main/resources/assets/defense/textures/gui/gui_button.png new file mode 100644 index 000000000..6a100b84e Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_button.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_components.png b/src/main/resources/assets/defense/textures/gui/gui_components.png new file mode 100644 index 000000000..d9e935088 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_components.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_container.png b/src/main/resources/assets/defense/textures/gui/gui_container.png new file mode 100644 index 000000000..96188c5b7 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_container.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_conventional_modifier.png b/src/main/resources/assets/defense/textures/gui/gui_conventional_modifier.png new file mode 100644 index 000000000..2fe376c2b Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_conventional_modifier.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_cruise_launcher.png b/src/main/resources/assets/defense/textures/gui/gui_cruise_launcher.png new file mode 100644 index 000000000..b83c5335c Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_cruise_launcher.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_empty.png b/src/main/resources/assets/defense/textures/gui/gui_empty.png new file mode 100644 index 000000000..7bca84cb2 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_empty.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_launcher.png b/src/main/resources/assets/defense/textures/gui/gui_launcher.png new file mode 100644 index 000000000..3bc6c036b Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_launcher.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_platform_slot.png b/src/main/resources/assets/defense/textures/gui/gui_platform_slot.png new file mode 100644 index 000000000..690c32794 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_platform_slot.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_platform_terminal.png b/src/main/resources/assets/defense/textures/gui/gui_platform_terminal.png new file mode 100644 index 000000000..ad3c68471 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_platform_terminal.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_radar.png b/src/main/resources/assets/defense/textures/gui/gui_radar.png new file mode 100644 index 000000000..8ae051147 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_radar.png differ diff --git a/src/main/resources/assets/defense/textures/gui/gui_secret.png b/src/main/resources/assets/defense/textures/gui/gui_secret.png new file mode 100644 index 000000000..a92ff0fa3 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/gui_secret.png differ diff --git a/src/main/resources/assets/defense/textures/gui/reddot.png b/src/main/resources/assets/defense/textures/gui/reddot.png new file mode 100644 index 000000000..cf1fa1c25 Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/reddot.png differ diff --git a/src/main/resources/assets/defense/textures/gui/whitedot.png b/src/main/resources/assets/defense/textures/gui/whitedot.png new file mode 100644 index 000000000..3c73e895e Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/whitedot.png differ diff --git a/src/main/resources/assets/defense/textures/gui/yellowdot.png b/src/main/resources/assets/defense/textures/gui/yellowdot.png new file mode 100644 index 000000000..0b03cc10a Binary files /dev/null and b/src/main/resources/assets/defense/textures/gui/yellowdot.png differ diff --git a/src/main/resources/assets/defense/textures/items/antidote.png b/src/main/resources/assets/defense/textures/items/antidote.png new file mode 100644 index 000000000..94eb1bc6a Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/antidote.png differ diff --git a/src/main/resources/assets/defense/textures/items/defuser.png b/src/main/resources/assets/defense/textures/items/defuser.png new file mode 100644 index 000000000..927159a09 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/defuser.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_anvil.png b/src/main/resources/assets/defense/textures/items/grenade_anvil.png new file mode 100644 index 000000000..037082e6a Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_anvil.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_attractive.png b/src/main/resources/assets/defense/textures/items/grenade_attractive.png new file mode 100644 index 000000000..b57e0be20 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_attractive.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_chemical.png b/src/main/resources/assets/defense/textures/items/grenade_chemical.png new file mode 100644 index 000000000..214060183 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_chemical.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_condensed.png b/src/main/resources/assets/defense/textures/items/grenade_condensed.png new file mode 100644 index 000000000..25dac2ab5 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_condensed.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_debilitation.png b/src/main/resources/assets/defense/textures/items/grenade_debilitation.png new file mode 100644 index 000000000..037082e6a Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_debilitation.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_incendiary.png b/src/main/resources/assets/defense/textures/items/grenade_incendiary.png new file mode 100644 index 000000000..d055ce59b Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_incendiary.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_repulsive.png b/src/main/resources/assets/defense/textures/items/grenade_repulsive.png new file mode 100644 index 000000000..b6a38fb73 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_repulsive.png differ diff --git a/src/main/resources/assets/defense/textures/items/grenade_shrapnel.png b/src/main/resources/assets/defense/textures/items/grenade_shrapnel.png new file mode 100644 index 000000000..50d1eb7b4 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/grenade_shrapnel.png differ diff --git a/src/main/resources/assets/defense/textures/items/icons.png b/src/main/resources/assets/defense/textures/items/icons.png new file mode 100644 index 000000000..835a5b9c1 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/icons.png differ diff --git a/src/main/resources/assets/defense/textures/items/laserDesignator.png b/src/main/resources/assets/defense/textures/items/laserDesignator.png new file mode 100644 index 000000000..0d37e509a Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/laserDesignator.png differ diff --git a/src/main/resources/assets/defense/textures/items/missileModule.png b/src/main/resources/assets/defense/textures/items/missileModule.png new file mode 100644 index 000000000..847125d12 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/missileModule.png differ diff --git a/src/main/resources/assets/defense/textures/items/poisonPowder.png b/src/main/resources/assets/defense/textures/items/poisonPowder.png new file mode 100644 index 000000000..fd2d06b45 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/poisonPowder.png differ diff --git a/src/main/resources/assets/defense/textures/items/radarGun.png b/src/main/resources/assets/defense/textures/items/radarGun.png new file mode 100644 index 000000000..5fc488a04 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/radarGun.png differ diff --git a/src/main/resources/assets/defense/textures/items/remoteDetonator.png b/src/main/resources/assets/defense/textures/items/remoteDetonator.png new file mode 100644 index 000000000..0e851f345 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/remoteDetonator.png differ diff --git a/src/main/resources/assets/defense/textures/items/saltpeter.png b/src/main/resources/assets/defense/textures/items/saltpeter.png new file mode 100644 index 000000000..52e673ff6 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/saltpeter.png differ diff --git a/src/main/resources/assets/defense/textures/items/signalDisrupter.png b/src/main/resources/assets/defense/textures/items/signalDisrupter.png new file mode 100644 index 000000000..aed04a9f8 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/signalDisrupter.png differ diff --git a/src/main/resources/assets/defense/textures/items/sulfur.png b/src/main/resources/assets/defense/textures/items/sulfur.png new file mode 100644 index 000000000..78207ba1c Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/sulfur.png differ diff --git a/src/main/resources/assets/defense/textures/items/tracker.png b/src/main/resources/assets/defense/textures/items/tracker.png new file mode 100644 index 000000000..07b171691 Binary files /dev/null and b/src/main/resources/assets/defense/textures/items/tracker.png differ diff --git a/src/main/resources/assets/defense/textures/items/tracker.png.mcmeta b/src/main/resources/assets/defense/textures/items/tracker.png.mcmeta new file mode 100644 index 000000000..1ca3a06b6 --- /dev/null +++ b/src/main/resources/assets/defense/textures/items/tracker.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation": + { + "frametime": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/defense/textures/models/cruise_launcher.png b/src/main/resources/assets/defense/textures/models/cruise_launcher.png new file mode 100644 index 000000000..3864bcb4a Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/cruise_launcher.png differ diff --git a/src/main/resources/assets/defense/textures/models/emp_tower.png b/src/main/resources/assets/defense/textures/models/emp_tower.png new file mode 100644 index 000000000..e12bdddc5 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/emp_tower.png differ diff --git a/src/main/resources/assets/defense/textures/models/fragment.png b/src/main/resources/assets/defense/textures/models/fragment.png new file mode 100644 index 000000000..71e69edae Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/fragment.png differ diff --git a/src/main/resources/assets/defense/textures/models/grey.png b/src/main/resources/assets/defense/textures/models/grey.png new file mode 100644 index 000000000..db31659b5 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/grey.png differ diff --git a/src/main/resources/assets/defense/textures/models/launcher_0.png b/src/main/resources/assets/defense/textures/models/launcher_0.png new file mode 100644 index 000000000..7fdcd7ded Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/launcher_0.png differ diff --git a/src/main/resources/assets/defense/textures/models/launcher_1.png b/src/main/resources/assets/defense/textures/models/launcher_1.png new file mode 100644 index 000000000..6c0283fe9 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/launcher_1.png differ diff --git a/src/main/resources/assets/defense/textures/models/launcher_2.png b/src/main/resources/assets/defense/textures/models/launcher_2.png new file mode 100644 index 000000000..1fc38db84 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/launcher_2.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_antiBallistic.png b/src/main/resources/assets/defense/textures/models/missile_antiBallistic.png new file mode 100644 index 000000000..ba48a20e6 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_antiBallistic.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_antiGravitational.png b/src/main/resources/assets/defense/textures/models/missile_antiGravitational.png new file mode 100644 index 000000000..ec2280f7f Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_antiGravitational.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_antimatter.png b/src/main/resources/assets/defense/textures/models/missile_antimatter.png new file mode 100644 index 000000000..fa21a3c56 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_antimatter.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_anvil.png b/src/main/resources/assets/defense/textures/models/missile_anvil.png new file mode 100644 index 000000000..26956b41e Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_anvil.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_attractive.png b/src/main/resources/assets/defense/textures/models/missile_attractive.png new file mode 100644 index 000000000..d6880256d Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_attractive.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_breaching.png b/src/main/resources/assets/defense/textures/models/missile_breaching.png new file mode 100644 index 000000000..6e4f393ee Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_breaching.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_chemical.png b/src/main/resources/assets/defense/textures/models/missile_chemical.png new file mode 100644 index 000000000..5010e9d42 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_chemical.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_cluster.png b/src/main/resources/assets/defense/textures/models/missile_cluster.png new file mode 100644 index 000000000..2361a4b1e Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_cluster.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_condensed.png b/src/main/resources/assets/defense/textures/models/missile_condensed.png new file mode 100644 index 000000000..8396aebb3 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_condensed.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_contagious.png b/src/main/resources/assets/defense/textures/models/missile_contagious.png new file mode 100644 index 000000000..4734e917b Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_contagious.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_coordinator_off.png b/src/main/resources/assets/defense/textures/models/missile_coordinator_off.png new file mode 100644 index 000000000..23ba8f723 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_coordinator_off.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_coordinator_on.png b/src/main/resources/assets/defense/textures/models/missile_coordinator_on.png new file mode 100644 index 000000000..2a5bad3c6 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_coordinator_on.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_corrosive.png b/src/main/resources/assets/defense/textures/models/missile_corrosive.png new file mode 100644 index 000000000..12b8d1f80 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_corrosive.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_debilitation.png b/src/main/resources/assets/defense/textures/models/missile_debilitation.png new file mode 100644 index 000000000..ee27e2a23 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_debilitation.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_emp.png b/src/main/resources/assets/defense/textures/models/missile_emp.png new file mode 100644 index 000000000..7205910f0 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_emp.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_ender.png b/src/main/resources/assets/defense/textures/models/missile_ender.png new file mode 100644 index 000000000..5194ef697 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_ender.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_endothermic.png b/src/main/resources/assets/defense/textures/models/missile_endothermic.png new file mode 100644 index 000000000..64ac93775 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_endothermic.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_exothermic.png b/src/main/resources/assets/defense/textures/models/missile_exothermic.png new file mode 100644 index 000000000..e5c45d47c Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_exothermic.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_fragmentation.png b/src/main/resources/assets/defense/textures/models/missile_fragmentation.png new file mode 100644 index 000000000..75b2b58ef Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_fragmentation.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_homing.png b/src/main/resources/assets/defense/textures/models/missile_homing.png new file mode 100644 index 000000000..36f4198b3 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_homing.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_hypersonic.png b/src/main/resources/assets/defense/textures/models/missile_hypersonic.png new file mode 100644 index 000000000..497dfcc04 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_hypersonic.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_incendiary.png b/src/main/resources/assets/defense/textures/models/missile_incendiary.png new file mode 100644 index 000000000..02fd7b6f2 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_incendiary.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_missileModule.png b/src/main/resources/assets/defense/textures/models/missile_missileModule.png new file mode 100644 index 000000000..43870151c Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_missileModule.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_nuclear.png b/src/main/resources/assets/defense/textures/models/missile_nuclear.png new file mode 100644 index 000000000..28065e224 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_nuclear.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_nuclearCluster.png b/src/main/resources/assets/defense/textures/models/missile_nuclearCluster.png new file mode 100644 index 000000000..a1ccff616 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_nuclearCluster.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_redMatter.png b/src/main/resources/assets/defense/textures/models/missile_redMatter.png new file mode 100644 index 000000000..1a5cb69c7 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_redMatter.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_rejuvenation.png b/src/main/resources/assets/defense/textures/models/missile_rejuvenation.png new file mode 100644 index 000000000..d6df43f7e Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_rejuvenation.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_repulsive.png b/src/main/resources/assets/defense/textures/models/missile_repulsive.png new file mode 100644 index 000000000..8f62bb730 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_repulsive.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_shrapnel.png b/src/main/resources/assets/defense/textures/models/missile_shrapnel.png new file mode 100644 index 000000000..5772cb175 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_shrapnel.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_sonic.png b/src/main/resources/assets/defense/textures/models/missile_sonic.png new file mode 100644 index 000000000..d568a0a03 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_sonic.png differ diff --git a/src/main/resources/assets/defense/textures/models/missile_thermobaric.png b/src/main/resources/assets/defense/textures/models/missile_thermobaric.png new file mode 100644 index 000000000..668457b50 Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/missile_thermobaric.png differ diff --git a/src/main/resources/assets/defense/textures/models/radar.png b/src/main/resources/assets/defense/textures/models/radar.png new file mode 100644 index 000000000..d73d2d75f Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/radar.png differ diff --git a/src/main/resources/assets/defense/textures/models/radar_off.png b/src/main/resources/assets/defense/textures/models/radar_off.png new file mode 100644 index 000000000..dc8ab4f5b Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/radar_off.png differ diff --git a/src/main/resources/assets/defense/textures/models/s-mine.png b/src/main/resources/assets/defense/textures/models/s-mine.png new file mode 100644 index 000000000..59466462a Binary files /dev/null and b/src/main/resources/assets/defense/textures/models/s-mine.png differ diff --git a/src/main/resources/assets/defense/textures/noise.png b/src/main/resources/assets/defense/textures/noise.png new file mode 100644 index 000000000..a442aed93 Binary files /dev/null and b/src/main/resources/assets/defense/textures/noise.png differ