mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the malicious gigglefish from the silly dimension
This commit is contained in:
parent
e2807f0721
commit
daaf50efd4
@ -9,6 +9,7 @@
|
||||
* Using desulfurized oil skips the (rather destructive) desulfurization process of the standard refinery, yielding higher-quality oils
|
||||
* Hydrotreating also allows cracked diesel variants to turn into their normal counterparts
|
||||
* Can convert coal oil directly into coal gasoline
|
||||
* For people afraid that this means yet another oil expansion that they need to progress through, I can assure you that this machine is entirely optional
|
||||
* Rural house
|
||||
* A new structure of an old brick house
|
||||
* Industrial lighting
|
||||
@ -38,6 +39,9 @@
|
||||
* Covneyor ejectors can now eject sulfur out of the side ports of refineries
|
||||
* Refineries and vacuum refineries now have fluid ID slots for changing the recipe
|
||||
* Removed the remaining old oil separation recipes from the chemical plant
|
||||
* To help people coping with this terrible, terrible loss, fraction towers are now twice as fast
|
||||
* This is a reminder that the chemical plant is a chemical reactor first and foremost, recipes like mixing and fractioning only existed because at the time there was no dedicated machine for it
|
||||
* Fractional distilling is not a chemical process but a purely physical one, I don't know who needs to know this but I feel like some people might be unaware of the fact
|
||||
* More large models have been converted into display lists which should improve performance somewhat
|
||||
* Corroded barrels now crumble after a while
|
||||
* PWRs on the edge of unloaded chunks now additionally reset their internal heat value to further reduce the time until they can potentially melt down
|
||||
@ -59,6 +63,8 @@
|
||||
* Oxyhydrogen can now be made by mixing air (i.e. nothing) with hydrogen
|
||||
* The oxygen + hydrogen recipe remains in order to give an option to void oxygen without needing to resort to flare stacks
|
||||
* Removed some of the lower tier items fomr the red room loot pool, making the average red room better
|
||||
* Retextured the fallout effect, fallout no longer has large snowflakes and the color now matches the crater better
|
||||
* High-yield mini nukes no longer create chunk radiation, since they use the MK5 which already has AoE radiation, this prevents dead grass from spawning that makes the crater look uglier
|
||||
|
||||
## Fixed
|
||||
* Fixed dupe caused by shift-clicking ashes out of the bricked furnace
|
||||
@ -73,4 +79,5 @@
|
||||
* Fixed several chemistry templates missing names
|
||||
* Fixed rampant mode random scout spawns being able to appear inside blocks
|
||||
* Fixed turret rotation sometimes desyncing when out of range, this is especially noticeable with slow-moving arty
|
||||
* Fixed research reactor OC integration allowing the control rods to be set out of bounds
|
||||
* Fixed research reactor OC integration allowing the control rods to be set out of bounds
|
||||
* Fixed fallout falling faster and overlaying if multiple fallout areas intersect
|
||||
@ -36,7 +36,6 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl
|
||||
|
||||
public BlockDummyable(Material mat) {
|
||||
super(mat);
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
|
||||
@ -1,14 +1,16 @@
|
||||
package com.hbm.blocks.bomb;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPadLarge;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LaunchPadLarge extends BlockDummyable {
|
||||
public class LaunchPadLarge extends BlockDummyable implements IBomb {
|
||||
|
||||
public LaunchPadLarge(Material mat) {
|
||||
super(mat);
|
||||
@ -34,4 +36,39 @@ public class LaunchPadLarge extends BlockDummyable {
|
||||
public int getOffset() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||
|
||||
if(!world.isRemote) {
|
||||
|
||||
int[] corePos = findCore(world, x, y, z);
|
||||
if(corePos != null){
|
||||
TileEntity core = world.getTileEntity(corePos[0], corePos[1], corePos[2]);
|
||||
if(core instanceof TileEntityLaunchPadLarge){
|
||||
TileEntityLaunchPadLarge entity = (TileEntityLaunchPadLarge)core;
|
||||
return entity.launchFromDesignator();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return BombReturnCode.UNDEFINED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block blockIn){
|
||||
|
||||
if(!world.isRemote){
|
||||
|
||||
int[] corePos = findCore(world, x, y, z);
|
||||
if(corePos != null){
|
||||
TileEntity core = world.getTileEntity(corePos[0], corePos[1], corePos[2]);
|
||||
if(core instanceof TileEntityLaunchPadLarge){
|
||||
TileEntityLaunchPadLarge door = (TileEntityLaunchPadLarge)core;
|
||||
door.updateRedstonePower(x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
super.onNeighborBlockChange( world, x, y, z, blockIn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@ public class MachineCentrifuge extends BlockDummyable {
|
||||
super(mat);
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.5D, 0D, -0.5D, 0.5D, 1D, 0.5D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.375D, 1D, -0.375D, 0.375D, 4D, 0.375D));
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -37,6 +37,7 @@ public class MachineCrucible extends BlockDummyable implements ICrucibleAcceptor
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.25D, 0.5D, -1.25D, -1D, 1.5D, 1.25D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.25D, 0.5D, 1D, 1.25D, 1.5D, 1.25D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(1D, 0.5D, -1.25D, 1.25D, 1.5D, 1.25D));
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -20,6 +20,7 @@ public class MachineGasCent extends BlockDummyable implements IMultiblock {
|
||||
super(mat);
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.5D, 0D, -0.5D, 0.5D, 1D, 0.5D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.4375D, 1D, -0.4375D, 0.4375D, 4D, 0.4375D));
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -25,6 +25,7 @@ public class MachineGasFlare extends BlockDummyable implements ITooltipProvider
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.75D, 3.875D, -0.75D, 0.75D, 9, 0.75D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 9D, -1.5D, 1.5D, 9.375D, 1.5D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.75D, 9.375D, -0.75D, 0.75D, 12, 0.75D));
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -33,6 +33,7 @@ public class MachineSawmill extends BlockDummyable implements ILookOverlay, IToo
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.5D, 0D, -1.5D, 1.5D, 1D, 1.5D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-1.25D, 1D, -0.5D, -0.625D, 1.875D, 0.5D));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.625D, 1D, -1D, 1.375D, 2D, 1D));
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -32,6 +32,7 @@ public class RailStandardRamp extends BlockDummyable implements IRailNTM, IRende
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(-0.5, 0.0, -1.5, 0.5, 0.5, 0.5));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(0.5, 0.0, -1.5, 1.5, 0.7, 0.5));
|
||||
this.bounding.add(AxisAlignedBB.getBoundingBox(1.5, 0.0, -1.5, 2.5, 0.9, 0.5));
|
||||
this.maxY = 0.999D; //item bounce prevention
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -100,6 +100,7 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
|
||||
this.dataWatcher.addObject(3, new Byte((byte) 5));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -238,7 +239,7 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
if(this.isEntityInvulnerable()) {
|
||||
return false;
|
||||
} else {
|
||||
if(!this.isDead && !this.worldObj.isRemote) {
|
||||
if(this.health > 0 && !this.worldObj.isRemote) {
|
||||
health -= amount;
|
||||
|
||||
if(this.health <= 0) {
|
||||
@ -251,10 +252,12 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
}
|
||||
|
||||
protected void killMissile() {
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
||||
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
||||
ExplosionLarge.spawnMissileDebris(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 0.25, getDebris(), getDebrisRareDrop());
|
||||
if(!this.isDead) {
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
||||
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
||||
ExplosionLarge.spawnMissileDebris(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 0.25, getDebris(), getDebrisRareDrop());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -72,8 +72,11 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
|
||||
|
||||
@Override
|
||||
protected void killMissile() {
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
||||
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
||||
if(!this.isDead) {
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
|
||||
ExplosionLarge.spawnShrapnelShower(worldObj, posX, posY, posZ, motionX, motionY, motionZ, 15, 0.075);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -34,12 +34,14 @@ public class ExplosionNukeSmall {
|
||||
if(params.killRadius > 0) ExplosionNukeGeneric.dealDamage(world, posX, posY, posZ, params.killRadius);
|
||||
if(!params.miniNuke) world.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(world, (int) params.blastRadius, posX, posY, posZ).mute());
|
||||
|
||||
float radMod = params.radiationLevel / 3F;
|
||||
|
||||
for(int i = -2; i <= 2; i++) {
|
||||
for(int j = -2; j <= 2; j++) {
|
||||
if(Math.abs(i) + Math.abs(j) < 4) {
|
||||
ChunkRadiationManager.proxy.incrementRad(world, (int) Math.floor(posX + i * 16), (int) Math.floor(posY), (int) Math.floor(posZ + j * 16), 50 / (Math.abs(i) + Math.abs(j) + 1) * radMod);
|
||||
if(params.miniNuke) {
|
||||
float radMod = params.radiationLevel / 3F;
|
||||
|
||||
for(int i = -2; i <= 2; i++) {
|
||||
for(int j = -2; j <= 2; j++) {
|
||||
if(Math.abs(i) + Math.abs(j) < 4) {
|
||||
ChunkRadiationManager.proxy.incrementRad(world, (int) Math.floor(posX + i * 16), (int) Math.floor(posY), (int) Math.floor(posZ + j * 16), 50 / (Math.abs(i) + Math.abs(j) + 1) * radMod);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -49,7 +51,7 @@ public class ExplosionNukeSmall {
|
||||
public static MukeParams PARAMS_TOTS = new MukeParams() {{ blastRadius = 10F; killRadius = 30F; particle = "tinytot"; shrapnelCount = 0; resolution = 32; radiationLevel = 1; }};
|
||||
public static MukeParams PARAMS_LOW = new MukeParams() {{ blastRadius = 15F; killRadius = 45F; radiationLevel = 2; }};
|
||||
public static MukeParams PARAMS_MEDIUM = new MukeParams() {{ blastRadius = 20F; killRadius = 55F; radiationLevel = 3; }};
|
||||
public static MukeParams PARAMS_HIGH = new MukeParams() {{ miniNuke = false; blastRadius = BombConfig.fatmanRadius; shrapnelCount = 0; radiationLevel = 4; }};
|
||||
public static MukeParams PARAMS_HIGH = new MukeParams() {{ miniNuke = false; blastRadius = BombConfig.fatmanRadius; shrapnelCount = 0; }};
|
||||
|
||||
/* more sensible approach with more customization options, idea shamelessly stolen from Martin */
|
||||
public static class MukeParams {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPadLarge;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPadBase;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@ -11,9 +11,9 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerLaunchPadLarge extends Container {
|
||||
|
||||
private TileEntityLaunchPadLarge launchpad;
|
||||
private TileEntityLaunchPadBase launchpad;
|
||||
|
||||
public ContainerLaunchPadLarge(InventoryPlayer invPlayer, TileEntityLaunchPadLarge tedf) {
|
||||
public ContainerLaunchPadLarge(InventoryPlayer invPlayer, TileEntityLaunchPadBase tedf) {
|
||||
|
||||
launchpad = tedf;
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemMissile;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.item.ItemRenderMissileGeneric;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPadLarge;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPadBase;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
@ -23,9 +23,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
public class GUILaunchPadLarge extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/weapon/gui_launch_pad_large.png");
|
||||
private TileEntityLaunchPadLarge launchpad;
|
||||
private TileEntityLaunchPadBase launchpad;
|
||||
|
||||
public GUILaunchPadLarge(InventoryPlayer invPlayer, TileEntityLaunchPadLarge tedf) {
|
||||
public GUILaunchPadLarge(InventoryPlayer invPlayer, TileEntityLaunchPadBase tedf) {
|
||||
super(new ContainerLaunchPadLarge(invPlayer, tedf));
|
||||
launchpad = tedf;
|
||||
|
||||
|
||||
@ -13,17 +13,22 @@ public class ItemMissile extends ItemCustomLore {
|
||||
public final MissileFormFactor formFactor;
|
||||
public final MissileTier tier;
|
||||
public final MissileFuel fuel;
|
||||
public int fuelCap;
|
||||
|
||||
public ItemMissile(MissileFormFactor form, MissileTier tier) {
|
||||
this.formFactor = form;
|
||||
this.tier = tier;
|
||||
this.fuel = form.defaultFuel;
|
||||
this(form, tier, form.defaultFuel);
|
||||
}
|
||||
|
||||
public ItemMissile(MissileFormFactor form, MissileTier tier, MissileFuel fuel) {
|
||||
this.formFactor = form;
|
||||
this.tier = tier;
|
||||
this.fuel = fuel;
|
||||
this.setFuelCap(this.fuel.defaultCap);
|
||||
}
|
||||
|
||||
public ItemMissile setFuelCap(int fuelCap) {
|
||||
this.fuelCap = fuelCap;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -64,16 +69,18 @@ public class ItemMissile extends ItemCustomLore {
|
||||
}
|
||||
|
||||
public enum MissileFuel {
|
||||
SOLID(EnumChatFormatting.GOLD + "Solid Fuel (pre-fueled)"),
|
||||
ETHANOL_PEROXIDE(EnumChatFormatting.AQUA + "Ethanol / Hydrogen Peroxide"),
|
||||
KEROSENE_PEROXIDE(EnumChatFormatting.BLUE + "Kerosene / Hydrogen Peroxide"),
|
||||
KEROSENE_LOXY(EnumChatFormatting.LIGHT_PURPLE + "Kerosene / Liquid Oxygen"),
|
||||
JETFUEL_LOXY(EnumChatFormatting.RED + "Jet Fuel / Liquid Oxygen");
|
||||
SOLID(EnumChatFormatting.GOLD + "Solid Fuel (pre-fueled)", 0),
|
||||
ETHANOL_PEROXIDE(EnumChatFormatting.AQUA + "Ethanol / Hydrogen Peroxide", 4_000),
|
||||
KEROSENE_PEROXIDE(EnumChatFormatting.BLUE + "Kerosene / Hydrogen Peroxide", 8_000),
|
||||
KEROSENE_LOXY(EnumChatFormatting.LIGHT_PURPLE + "Kerosene / Liquid Oxygen", 12_000),
|
||||
JETFUEL_LOXY(EnumChatFormatting.RED + "Jet Fuel / Liquid Oxygen", 16_000);
|
||||
|
||||
public String display;
|
||||
public int defaultCap;
|
||||
|
||||
private MissileFuel(String display) {
|
||||
private MissileFuel(String display, int defaultCap) {
|
||||
this.display = display;
|
||||
this.defaultCap = defaultCap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,45 +17,34 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
|
||||
public class RenderFallout extends Render {
|
||||
|
||||
private Minecraft mc;
|
||||
private static final ResourceLocation falloutTexture = new ResourceLocation(RefStrings.MODID, "textures/entity/fallout.png");
|
||||
private Random random = new Random();
|
||||
float[] rainXCoords;
|
||||
float[] rainYCoords;
|
||||
private int rendererUpdateCount;
|
||||
long lastTime = System.nanoTime();
|
||||
private static final ResourceLocation falloutTexture = new ResourceLocation(RefStrings.MODID,
|
||||
"textures/entity/fallout.png");
|
||||
|
||||
@Override
|
||||
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
|
||||
float p_76986_9_) {
|
||||
public void doRender(Entity entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
if (p_76986_1_ instanceof EntityFalloutRain)
|
||||
this.render((EntityFalloutRain) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
|
||||
if(entity instanceof EntityFalloutRain)
|
||||
this.render((EntityFalloutRain) entity, x, y, z, f0, f1);
|
||||
|
||||
}
|
||||
|
||||
public void render(EntityFalloutRain p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
|
||||
float p_76986_8_, float p_76986_9_) {
|
||||
|
||||
this.mc = Minecraft.getMinecraft();
|
||||
public void render(EntityFalloutRain entity, double x, double y, double z, float f0, float f1) {
|
||||
|
||||
EntityLivingBase entitylivingbase = this.mc.renderViewEntity;
|
||||
Vec3 vector = Vec3.createVectorHelper(entitylivingbase.posX - p_76986_1_.posX,
|
||||
entitylivingbase.posY - p_76986_1_.posY, entitylivingbase.posZ - p_76986_1_.posZ);
|
||||
|
||||
double d = vector.lengthVector();
|
||||
|
||||
if (d <= p_76986_1_.getScale()) {
|
||||
rendererUpdateCount++;
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
EntityLivingBase entitylivingbase = mc.renderViewEntity;
|
||||
Vec3 vector = Vec3.createVectorHelper(entitylivingbase.posX - entity.posX, entitylivingbase.posY - entity.posY, entitylivingbase.posZ - entity.posZ);
|
||||
|
||||
if(vector.lengthVector() <= entity.getScale()) {
|
||||
long time = System.nanoTime();
|
||||
float t = (time - lastTime) / 50000000;
|
||||
if (t <= 1.0F)
|
||||
float t = (time - lastTime) / 50_000_000;
|
||||
if(t <= 1.0F)
|
||||
renderRainSnow(t);
|
||||
else
|
||||
renderRainSnow(1.0F);
|
||||
@ -65,31 +54,25 @@ public class RenderFallout extends Render {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
|
||||
return null;
|
||||
protected ResourceLocation getEntityTexture(Entity entity) {
|
||||
return this.falloutTexture;
|
||||
}
|
||||
|
||||
protected void renderRainSnow(float p_78474_1_) {
|
||||
protected void renderRainSnow(float interp) {
|
||||
|
||||
IRenderHandler renderer = null;
|
||||
if ((renderer = this.mc.theWorld.provider.getWeatherRenderer()) != null) {
|
||||
renderer.render(p_78474_1_, this.mc.theWorld, mc);
|
||||
return;
|
||||
}
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
int timer = mc.thePlayer.ticksExisted;
|
||||
|
||||
// float f1 = this.mc.theWorld.getRainStrength(p_78474_1_);
|
||||
float intensity = 1F;
|
||||
|
||||
float f1 = 1;
|
||||
if(intensity > 0.0F) {
|
||||
|
||||
if (f1 > 0.0F) {
|
||||
// this.enableLightmap((double)p_78474_1_);
|
||||
|
||||
if (this.rainXCoords == null) {
|
||||
if(this.rainXCoords == null) {
|
||||
this.rainXCoords = new float[1024];
|
||||
this.rainYCoords = new float[1024];
|
||||
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
for (int j = 0; j < 32; ++j) {
|
||||
for(int i = 0; i < 32; ++i) {
|
||||
for(int j = 0; j < 32; ++j) {
|
||||
float f2 = j - 16;
|
||||
float f3 = i - 16;
|
||||
float f4 = MathHelper.sqrt_float(f2 * f2 + f3 * f3);
|
||||
@ -99,185 +82,88 @@ public class RenderFallout extends Render {
|
||||
}
|
||||
}
|
||||
|
||||
EntityLivingBase entitylivingbase = this.mc.renderViewEntity;
|
||||
WorldClient worldclient = this.mc.theWorld;
|
||||
int k2 = MathHelper.floor_double(entitylivingbase.posX);
|
||||
int l2 = MathHelper.floor_double(entitylivingbase.posY);
|
||||
int i3 = MathHelper.floor_double(entitylivingbase.posZ);
|
||||
WorldClient worldclient = mc.theWorld;
|
||||
EntityLivingBase camera = mc.renderViewEntity;
|
||||
|
||||
int playerX = MathHelper.floor_double(camera.posX);
|
||||
int playerY = MathHelper.floor_double(camera.posY);
|
||||
int playerZ = MathHelper.floor_double(camera.posZ);
|
||||
double dX = camera.lastTickPosX + (camera.posX - camera.lastTickPosX) * interp;
|
||||
double dY = camera.lastTickPosY + (camera.posY - camera.lastTickPosY) * interp;
|
||||
double dZ = camera.lastTickPosZ + (camera.posZ - camera.lastTickPosZ) * interp;
|
||||
|
||||
int playerHeight = MathHelper.floor_double(dY);
|
||||
byte renderLayerCount = 5;
|
||||
byte layer = -1;
|
||||
|
||||
if(mc.gameSettings.fancyGraphics) renderLayerCount = 10;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glNormal3f(0.0F, 1.0F, 0.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
double d0 = entitylivingbase.lastTickPosX
|
||||
+ (entitylivingbase.posX - entitylivingbase.lastTickPosX) * p_78474_1_;
|
||||
double d1 = entitylivingbase.lastTickPosY
|
||||
+ (entitylivingbase.posY - entitylivingbase.lastTickPosY) * p_78474_1_;
|
||||
double d2 = entitylivingbase.lastTickPosZ
|
||||
+ (entitylivingbase.posZ - entitylivingbase.lastTickPosZ) * p_78474_1_;
|
||||
int k = MathHelper.floor_double(d1);
|
||||
byte b0 = 5;
|
||||
|
||||
if (this.mc.gameSettings.fancyGraphics) {
|
||||
b0 = 10;
|
||||
}
|
||||
|
||||
byte b1 = -1;
|
||||
float f5 = this.rendererUpdateCount + p_78474_1_;
|
||||
|
||||
if (this.mc.gameSettings.fancyGraphics) {
|
||||
b0 = 10;
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
for (int l = i3 - b0; l <= i3 + b0; ++l) {
|
||||
for (int i1 = k2 - b0; i1 <= k2 + b0; ++i1) {
|
||||
int j1 = (l - i3 + 16) * 32 + i1 - k2 + 16;
|
||||
float f6 = this.rainXCoords[j1] * 0.5F;
|
||||
float f7 = this.rainYCoords[j1] * 0.5F;
|
||||
BiomeGenBase biomegenbase = worldclient.getBiomeGenForCoords(i1, l);
|
||||
|
||||
if (true) {
|
||||
int k1 = worldclient.getPrecipitationHeight(i1, l);
|
||||
int l1 = l2 - b0;
|
||||
int i2 = l2 + b0;
|
||||
for(int layerZ = playerZ - renderLayerCount; layerZ <= playerZ + renderLayerCount; ++layerZ) {
|
||||
for(int layerX = playerX - renderLayerCount; layerX <= playerX + renderLayerCount; ++layerX) {
|
||||
int rainCoord = (layerZ - playerZ + 16) * 32 + layerX - playerX + 16;
|
||||
float rainCoordX = this.rainXCoords[rainCoord] * 0.5F;
|
||||
float rainCoordY = this.rainYCoords[rainCoord] * 0.5F;
|
||||
|
||||
if (l1 < k1) {
|
||||
l1 = k1;
|
||||
}
|
||||
int rainHeight = worldclient.getPrecipitationHeight(layerX, layerZ);
|
||||
int minHeight = playerY - renderLayerCount;
|
||||
int maxHeight = playerY + renderLayerCount;
|
||||
|
||||
if (i2 < k1) {
|
||||
i2 = k1;
|
||||
}
|
||||
if(minHeight < rainHeight) minHeight = rainHeight;
|
||||
if(maxHeight < rainHeight) maxHeight = rainHeight;
|
||||
|
||||
int layerY = rainHeight;
|
||||
if(rainHeight < playerHeight) layerY = playerHeight;
|
||||
|
||||
float f8 = 1.0F;
|
||||
int j2 = k1;
|
||||
if(minHeight != maxHeight) {
|
||||
this.random.setSeed(layerX * layerX * 3121 + layerX * 45238971 ^ layerZ * layerZ * 418711 + layerZ * 13761);
|
||||
|
||||
if (k1 < k) {
|
||||
j2 = k;
|
||||
}
|
||||
|
||||
if (l1 != i2) {
|
||||
this.random.setSeed(i1 * i1 * 3121 + i1 * 45238971 ^ l * l * 418711 + l * 13761);
|
||||
biomegenbase.getFloatTemperature(i1, l1, l);
|
||||
float f10;
|
||||
double d4;
|
||||
|
||||
/*
|
||||
* if (false) { if (b1 != 0) { if (b1 >= 0) {
|
||||
* tessellator.draw(); }
|
||||
*
|
||||
* b1 = 0;
|
||||
* this.mc.getTextureManager().bindTexture(this.
|
||||
* falloutTexture); tessellator.startDrawingQuads();
|
||||
* //System.out.println("Called!"); }
|
||||
*
|
||||
* f10 = ((float)(this.rendererUpdateCount + i1 * i1
|
||||
* * 3121 + i1 * 45238971 + l * l * 418711 + l *
|
||||
* 13761 & 31) + p_78474_1_) / 32.0F * (3.0F +
|
||||
* this.random.nextFloat()); double d3 =
|
||||
* (double)((float)i1 + 0.5F) -
|
||||
* entitylivingbase.posX; d4 = (double)((float)l +
|
||||
* 0.5F) - entitylivingbase.posZ; float f12 =
|
||||
* MathHelper.sqrt_double(d3 * d3 + d4 * d4) /
|
||||
* (float)b0; float f13 = 1.0F;
|
||||
* tessellator.setBrightness(worldclient.
|
||||
* getLightBrightnessForSkyBlocks(i1, j2, l, 0));
|
||||
* tessellator.setColorRGBA_F(f13, f13, f13, ((1.0F
|
||||
* - f12 * f12) * 0.5F + 0.5F) * f1);
|
||||
* tessellator.setTranslation(-d0 * 1.0D, -d1 *
|
||||
* 1.0D, -d2 * 1.0D);
|
||||
* tessellator.addVertexWithUV((double)((float)i1 -
|
||||
* f6) + 0.5D, (double)l1, (double)((float)l - f7) +
|
||||
* 0.5D, (double)(0.0F * f8), (double)((float)l1 *
|
||||
* f8 / 4.0F + f10 * f8));
|
||||
* tessellator.addVertexWithUV((double)((float)i1 +
|
||||
* f6) + 0.5D, (double)l1, (double)((float)l + f7) +
|
||||
* 0.5D, (double)(1.0F * f8), (double)((float)l1 *
|
||||
* f8 / 4.0F + f10 * f8));
|
||||
* tessellator.addVertexWithUV((double)((float)i1 +
|
||||
* f6) + 0.5D, (double)i2, (double)((float)l + f7) +
|
||||
* 0.5D, (double)(1.0F * f8), (double)((float)i2 *
|
||||
* f8 / 4.0F + f10 * f8));
|
||||
* tessellator.addVertexWithUV((double)((float)i1 -
|
||||
* f6) + 0.5D, (double)i2, (double)((float)l - f7) +
|
||||
* 0.5D, (double)(0.0F * f8), (double)((float)i2 *
|
||||
* f8 / 4.0F + f10 * f8));
|
||||
* tessellator.setTranslation(0.0D, 0.0D, 0.0D); }
|
||||
* else
|
||||
*/
|
||||
{
|
||||
if (b1 != 1) {
|
||||
if (b1 >= 0) {
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
b1 = 1;
|
||||
this.mc.getTextureManager().bindTexture(RenderFallout.falloutTexture);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
|
||||
f10 = ((this.rendererUpdateCount & 511) + p_78474_1_) / 512.0F;
|
||||
float f16 = this.random.nextFloat() + f5 * 0.01F * (float) this.random.nextGaussian();
|
||||
float f11 = this.random.nextFloat() + f5 * (float) this.random.nextGaussian() * 0.001F;
|
||||
d4 = i1 + 0.5F - entitylivingbase.posX;
|
||||
double d5 = l + 0.5F - entitylivingbase.posZ;
|
||||
float f14 = MathHelper.sqrt_double(d4 * d4 + d5 * d5) / b0;
|
||||
float f15 = 1.0F;
|
||||
tessellator.setBrightness(
|
||||
(worldclient.getLightBrightnessForSkyBlocks(i1, j2, l, 0) * 3 + 15728880) / 4);
|
||||
tessellator.setColorRGBA_F(f15, f15, f15, ((1.0F - f14 * f14) * 0.3F + 0.5F) * f1);
|
||||
tessellator.setTranslation(-d0 * 1.0D, -d1 * 1.0D, -d2 * 1.0D);
|
||||
tessellator.addVertexWithUV(i1 - f6 + 0.5D, l1,
|
||||
l - f7 + 0.5D, 0.0F * f8 + f16,
|
||||
l1 * f8 / 4.0F + f10 * f8 + f11);
|
||||
tessellator.addVertexWithUV(i1 + f6 + 0.5D, l1,
|
||||
l + f7 + 0.5D, 1.0F * f8 + f16,
|
||||
l1 * f8 / 4.0F + f10 * f8 + f11);
|
||||
tessellator.addVertexWithUV(i1 + f6 + 0.5D, i2,
|
||||
l + f7 + 0.5D, 1.0F * f8 + f16,
|
||||
i2 * f8 / 4.0F + f10 * f8 + f11);
|
||||
tessellator.addVertexWithUV(i1 - f6 + 0.5D, i2,
|
||||
l - f7 + 0.5D, 0.0F * f8 + f16,
|
||||
i2 * f8 / 4.0F + f10 * f8 + f11);
|
||||
tessellator.setTranslation(0.0D, 0.0D, 0.0D);
|
||||
if(layer != 1) {
|
||||
if(layer >= 0) {
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
layer = 1;
|
||||
mc.getTextureManager().bindTexture(RenderFallout.falloutTexture);
|
||||
tessellator.startDrawingQuads();
|
||||
}
|
||||
|
||||
float fallSpeed = 1.0F;
|
||||
float swayLoop = ((timer & 511) + interp) / 512.0F;
|
||||
float fallVariation = 0.4F + this.random.nextFloat() * 0.2F;
|
||||
float swayVariation = this.random.nextFloat();
|
||||
double distX = layerX + 0.5F - camera.posX;
|
||||
double distZ = layerZ + 0.5F - camera.posZ;
|
||||
float intensityMod = MathHelper.sqrt_double(distX * distX + distZ * distZ) / renderLayerCount;
|
||||
float colorMod = 1.0F;
|
||||
|
||||
tessellator.setBrightness((worldclient.getLightBrightnessForSkyBlocks(layerX, layerY, layerZ, 0) * 3 + 15728880) / 4);
|
||||
tessellator.setColorRGBA_F(colorMod, colorMod, colorMod, ((1.0F - intensityMod * intensityMod) * 0.3F + 0.5F) * intensity);
|
||||
tessellator.setTranslation(-dX * 1.0D, -dY * 1.0D, -dZ * 1.0D);
|
||||
tessellator.addVertexWithUV(layerX - rainCoordX + 0.5D, minHeight, layerZ - rainCoordY + 0.5D, 0.0F * fallSpeed + fallVariation, minHeight * fallSpeed / 4.0F + swayLoop * fallSpeed + swayVariation);
|
||||
tessellator.addVertexWithUV(layerX + rainCoordX + 0.5D, minHeight, layerZ + rainCoordY + 0.5D, 1.0F * fallSpeed + fallVariation, minHeight * fallSpeed / 4.0F + swayLoop * fallSpeed + swayVariation);
|
||||
tessellator.addVertexWithUV(layerX + rainCoordX + 0.5D, maxHeight, layerZ + rainCoordY + 0.5D, 1.0F * fallSpeed + fallVariation, maxHeight * fallSpeed / 4.0F + swayLoop * fallSpeed + swayVariation);
|
||||
tessellator.addVertexWithUV(layerX - rainCoordX + 0.5D, maxHeight, layerZ - rainCoordY + 0.5D, 0.0F * fallSpeed + fallVariation, maxHeight * fallSpeed / 4.0F + swayLoop * fallSpeed + swayVariation);
|
||||
tessellator.setTranslation(0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (b1 >= 0) {
|
||||
if(layer >= 0) {
|
||||
tessellator.draw();
|
||||
// System.out.println("Fired!");
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
// this.disableLightmap((double)p_78474_1_);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* public void enableLightmap(double p_78463_1_) {
|
||||
* OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
||||
* GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glLoadIdentity(); float f =
|
||||
* 0.00390625F; GL11.glScalef(f, f, f); GL11.glTranslatef(8.0F, 8.0F, 8.0F);
|
||||
* GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
* this.mc.getTextureManager().bindTexture(this.locationLightMap);
|
||||
* GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER,
|
||||
* GL11.GL_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_2D,
|
||||
* GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
|
||||
* GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER,
|
||||
* GL11.GL_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_2D,
|
||||
* GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
|
||||
* GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
|
||||
* GL11.GL_CLAMP); GL11.glTexParameteri(GL11.GL_TEXTURE_2D,
|
||||
* GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); GL11.glColor4f(1.0F, 1.0F, 1.0F,
|
||||
* 1.0F); GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
* OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); }
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.render.entity.rocket;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileAntiBallistic;
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.entity.missile.EntityMissileStealth;
|
||||
import com.hbm.entity.missile.EntityMissileTier1.*;
|
||||
import com.hbm.main.ResourceManager;
|
||||
@ -25,6 +26,13 @@ public class RenderMissileGeneric extends Render {
|
||||
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * interp, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * interp - 90.0F, 0.0F, -1.0F, 0.0F);
|
||||
|
||||
if(entity instanceof EntityMissileBaseNT) switch(entity.getDataWatcher().getWatchableObjectByte(3)) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityMissileAntiBallistic) {
|
||||
bindTexture(ResourceManager.missileAA_tex);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.render.entity.rocket;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
@ -23,6 +24,13 @@ public class RenderMissileHuge extends Render {
|
||||
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * interp, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * interp - 90.0F, 0.0F, -1.0F, 0.0F);
|
||||
|
||||
if(entity instanceof EntityMissileBaseNT) switch(entity.getDataWatcher().getWatchableObjectByte(3)) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityMissileBurst) bindTexture(ResourceManager.missileHuge_HE_tex);
|
||||
if(entity instanceof EntityMissileInferno) bindTexture(ResourceManager.missileHuge_IN_tex);
|
||||
if(entity instanceof EntityMissileRain) bindTexture(ResourceManager.missileHuge_CL_tex);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.render.entity.rocket;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.entity.missile.EntityMissileDoomsday;
|
||||
import com.hbm.entity.missile.EntityMissileTier4.EntityMissileMirv;
|
||||
import com.hbm.entity.missile.EntityMissileTier4.EntityMissileNuclear;
|
||||
@ -25,6 +26,13 @@ public class RenderMissileNuclear extends Render {
|
||||
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * interp, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * interp - 90.0F, 0.0F, -1.0F, 0.0F);
|
||||
|
||||
if(entity instanceof EntityMissileBaseNT) switch(entity.getDataWatcher().getWatchableObjectByte(3)) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityMissileNuclear) bindTexture(ResourceManager.missileNuclear_tex);
|
||||
if(entity instanceof EntityMissileMirv) bindTexture(ResourceManager.missileMIRV_tex);
|
||||
if(entity instanceof EntityMissileDoomsday) bindTexture(ResourceManager.missileDoomsday_tex);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.render.entity.rocket;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.entity.missile.EntityMissileTier2.*;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
@ -23,6 +24,13 @@ public class RenderMissileStrong extends Render {
|
||||
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * interp - 90.0F, 0.0F, -1.0F, 0.0F);
|
||||
GL11.glScalef(1.5F, 1.5F, 1.5F);
|
||||
|
||||
if(entity instanceof EntityMissileBaseNT) switch(entity.getDataWatcher().getWatchableObjectByte(3)) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
if(entity instanceof EntityMissileStrong) bindTexture(ResourceManager.missileStrong_HE_tex);
|
||||
if(entity instanceof EntityMissileIncendiaryStrong) bindTexture(ResourceManager.missileStrong_IN_tex);
|
||||
if(entity instanceof EntityMissileClusterStrong) bindTexture(ResourceManager.missileStrong_CL_tex);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.render.entity.rocket;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.entity.missile.EntityMissileTier0.*;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
@ -23,6 +24,13 @@ public class RenderMissileTaint extends Render {
|
||||
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * interp, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * interp - 90.0F, 0.0F, -1.0F, 0.0F);
|
||||
|
||||
if(entity instanceof EntityMissileBaseNT) switch(entity.getDataWatcher().getWatchableObjectByte(3)) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
bindTexture(getEntityTexture(entity));
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
@ -352,7 +352,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tag){
|
||||
public void readFromNBT(NBTTagCompound tag) {
|
||||
this.state = tag.getByte("state");
|
||||
this.openTicks = tag.getInteger("openTicks");
|
||||
this.animStartTime = tag.getInteger("animStartTime");
|
||||
@ -361,16 +361,16 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
this.skinIndex = tag.getByte("skin");
|
||||
NBTTagCompound activatedBlocks = tag.getCompoundTag("activatedBlocks");
|
||||
this.activatedBlocks.clear();
|
||||
for(int i = 0; i < activatedBlocks.func_150296_c().size()/3; i ++){
|
||||
this.activatedBlocks.add(new BlockPos(activatedBlocks.getInteger("x"+i), activatedBlocks.getInteger("y"+i), activatedBlocks.getInteger("z"+i)));
|
||||
for(int i = 0; i < activatedBlocks.func_150296_c().size() / 3; i++) {
|
||||
this.activatedBlocks.add(new BlockPos(activatedBlocks.getInteger("x" + i), activatedBlocks.getInteger("y" + i), activatedBlocks.getInteger("z" + i)));
|
||||
}
|
||||
super.readFromNBT(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag){
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
super.writeToNBT(tag);
|
||||
|
||||
|
||||
tag.setByte("state", state);
|
||||
tag.setInteger("openTicks", openTicks);
|
||||
tag.setLong("animStartTime", animStartTime);
|
||||
@ -380,10 +380,10 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
tag.setByte("skin", skinIndex);
|
||||
NBTTagCompound activatedBlocks = new NBTTagCompound();
|
||||
int i = 0;
|
||||
for(BlockPos p : this.activatedBlocks){
|
||||
activatedBlocks.setInteger("x"+i, p.getX());
|
||||
activatedBlocks.setInteger("y"+i, p.getY());
|
||||
activatedBlocks.setInteger("z"+i, p.getZ());
|
||||
for(BlockPos p : this.activatedBlocks) {
|
||||
activatedBlocks.setInteger("x" + i, p.getX());
|
||||
activatedBlocks.setInteger("y" + i, p.getY());
|
||||
activatedBlocks.setInteger("z" + i, p.getZ());
|
||||
i++;
|
||||
}
|
||||
tag.setTag("activatedBlocks", activatedBlocks);
|
||||
@ -407,7 +407,7 @@ public class TileEntityDoorGeneric extends TileEntityLockableBase implements IAn
|
||||
}
|
||||
}
|
||||
|
||||
public void updateRedstonePower(int x, int y, int z){
|
||||
public void updateRedstonePower(int x, int y, int z) {
|
||||
//Drillgon200: Best I could come up with without having to use dummy tile entities
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
boolean powered = worldObj.isBlockIndirectlyGettingPowered(x, y, z);
|
||||
|
||||
@ -0,0 +1,345 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.missile.EntityMissileAntiBallistic;
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.interfaces.IBomb.BombReturnCode;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.container.ContainerLaunchPadLarge;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUILaunchPadLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemMissile;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class TileEntityLaunchPadBase extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver {
|
||||
|
||||
public ItemStack toRender;
|
||||
|
||||
public long power;
|
||||
public final long maxPower = 100_000;
|
||||
|
||||
public int prevRedstonePower;
|
||||
public int redstonePower;
|
||||
public Set<BlockPos> activatedBlocks = new HashSet<>(4);
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityLaunchPadBase() {
|
||||
super(7);
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.NONE, 24_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.NONE, 24_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.launchPad";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.redstonePower > 0 && this.prevRedstonePower == 0) {
|
||||
this.launchFromDesignator();
|
||||
}
|
||||
|
||||
this.prevRedstonePower = this.redstonePower;
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 2, power, maxPower);
|
||||
tanks[0].loadTank(3, 4, slots);
|
||||
tanks[1].loadTank(5, 6, slots);
|
||||
|
||||
this.networkPackNT(250);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
super.serialize(buf);
|
||||
|
||||
buf.writeLong(this.power);
|
||||
tanks[0].serialize(buf);
|
||||
tanks[1].serialize(buf);
|
||||
|
||||
if(slots[0] != null) {
|
||||
buf.writeBoolean(true);
|
||||
buf.writeInt(Item.getIdFromItem(slots[0].getItem()));
|
||||
buf.writeShort((short) slots[0].getItemDamage());
|
||||
} else {
|
||||
buf.writeBoolean(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
|
||||
this.power = buf.readLong();
|
||||
tanks[0].deserialize(buf);
|
||||
tanks[1].deserialize(buf);
|
||||
|
||||
if(buf.readBoolean()) {
|
||||
this.toRender = new ItemStack(Item.getItemById(buf.readInt()), 1, buf.readShort());
|
||||
} else {
|
||||
this.toRender = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
power = nbt.getLong("power");
|
||||
tanks[0].readFromNBT(nbt, "t0");
|
||||
tanks[1].readFromNBT(nbt, "t1");
|
||||
|
||||
this.redstonePower = nbt.getInteger("redstonePower");
|
||||
this.prevRedstonePower = nbt.getInteger("prevRedstonePower");
|
||||
NBTTagCompound activatedBlocks = nbt.getCompoundTag("activatedBlocks");
|
||||
this.activatedBlocks.clear();
|
||||
for(int i = 0; i < activatedBlocks.func_150296_c().size() / 3; i++) {
|
||||
this.activatedBlocks.add(new BlockPos(activatedBlocks.getInteger("x" + i), activatedBlocks.getInteger("y" + i), activatedBlocks.getInteger("z" + i)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
tanks[0].writeToNBT(nbt, "t0");
|
||||
tanks[1].writeToNBT(nbt, "t1");
|
||||
|
||||
nbt.setInteger("redstonePower", redstonePower);
|
||||
nbt.setInteger("prevRedstonePower", prevRedstonePower);
|
||||
NBTTagCompound activatedBlocks = new NBTTagCompound();
|
||||
int i = 0;
|
||||
for(BlockPos p : this.activatedBlocks) {
|
||||
activatedBlocks.setInteger("x" + i, p.getX());
|
||||
activatedBlocks.setInteger("y" + i, p.getY());
|
||||
activatedBlocks.setInteger("z" + i, p.getZ());
|
||||
i++;
|
||||
}
|
||||
nbt.setTag("activatedBlocks", activatedBlocks);
|
||||
}
|
||||
|
||||
public void updateRedstonePower(int x, int y, int z) {
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
boolean powered = worldObj.isBlockIndirectlyGettingPowered(x, y, z);
|
||||
boolean contained = activatedBlocks.contains(pos);
|
||||
if(!contained && powered){
|
||||
activatedBlocks.add(pos);
|
||||
if(redstonePower == -1){
|
||||
redstonePower = 0;
|
||||
}
|
||||
redstonePower++;
|
||||
} else if(contained && !powered){
|
||||
activatedBlocks.remove(pos);
|
||||
redstonePower--;
|
||||
if(redstonePower == 0){
|
||||
redstonePower = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public long getPower() { return power; }
|
||||
@Override public void setPower(long power) { this.power = power; }
|
||||
@Override public long getMaxPower() { return maxPower; }
|
||||
@Override public FluidTank[] getAllTanks() { return this.tanks; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return this.tanks; }
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerLaunchPadLarge(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUILaunchPadLarge(player.inventory, this);
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch") //shut up
|
||||
public void setFuel(ItemMissile missile) {
|
||||
switch(missile.fuel) {
|
||||
case ETHANOL_PEROXIDE:
|
||||
tanks[0].setTankType(Fluids.ETHANOL);
|
||||
tanks[1].setTankType(Fluids.ACID);
|
||||
break;
|
||||
case KEROSENE_PEROXIDE:
|
||||
tanks[0].setTankType(Fluids.KEROSENE);
|
||||
tanks[1].setTankType(Fluids.ACID);
|
||||
break;
|
||||
case KEROSENE_LOXY:
|
||||
tanks[0].setTankType(Fluids.KEROSENE);
|
||||
tanks[1].setTankType(Fluids.OXYGEN);
|
||||
break;
|
||||
case JETFUEL_LOXY:
|
||||
tanks[0].setTankType(Fluids.KEROSENE_REFORM);
|
||||
tanks[1].setTankType(Fluids.OXYGEN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** Requires the missile slot to be non-null and he item to be compatible */
|
||||
public boolean isMissileValid() {
|
||||
return slots[0] != null && slots[0].getItem() instanceof ItemMissile;
|
||||
}
|
||||
|
||||
public boolean hasFuel() {
|
||||
if(this.power < 75_000) return false;
|
||||
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemMissile) {
|
||||
ItemMissile missile = (ItemMissile) slots[0].getItem();
|
||||
if(this.tanks[0].getFill() < missile.fuelCap) return false;
|
||||
if(this.tanks[1].getFill() < missile.fuelCap) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public Entity instantiateMissile(int targetX, int targetZ) {
|
||||
|
||||
if(slots[0] == null) return null;
|
||||
|
||||
Class<? extends EntityMissileBaseNT> clazz = TileEntityLaunchPad.missiles.get(new ComparableStack(slots[0]).makeSingular());
|
||||
|
||||
if(clazz != null) {
|
||||
try {
|
||||
EntityMissileBaseNT missile = clazz.getConstructor(World.class, float.class, float.class, float.class, int.class, int.class).newInstance(worldObj, xCoord + 0.5F, yCoord + 2F, zCoord + 0.5F, targetX, targetZ);
|
||||
if(GeneralConfig.enableExtendedLogging) MainRegistry.logger.log(Level.INFO, "[MISSILE] Tried to launch missile at " + xCoord + " / " + yCoord + " / " + zCoord + " to " + xCoord + " / " + zCoord + "!");
|
||||
return missile;
|
||||
} catch(Exception e) { }
|
||||
}
|
||||
|
||||
if(slots[0].getItem() == ModItems.missile_anti_ballistic) {
|
||||
EntityMissileAntiBallistic missile = new EntityMissileAntiBallistic(worldObj);
|
||||
missile.posX = xCoord + 0.5F;
|
||||
missile.posY = yCoord + 2F;
|
||||
missile.posZ = zCoord + 0.5F;
|
||||
return missile;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void finalizeLaunch(Entity missile) {
|
||||
worldObj.spawnEntityInWorld(missile);
|
||||
worldObj.playSoundEffect(xCoord + 0.5, yCoord, zCoord + 0.5, "hbm:weapon.missileTakeOff", 2.0F, 1.0F);
|
||||
|
||||
this.power -= 75_000;
|
||||
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemMissile) {
|
||||
ItemMissile item = (ItemMissile) slots[0].getItem();
|
||||
tanks[0].setFill(tanks[0].getFill() - item.fuelCap);
|
||||
tanks[1].setFill(tanks[1].getFill() - item.fuelCap);
|
||||
}
|
||||
|
||||
this.decrStackSize(0, 1);
|
||||
}
|
||||
|
||||
public BombReturnCode launchFromDesignator() {
|
||||
if(!canLaunch()) return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
|
||||
boolean needsDesignator = needsDesignator(slots[0].getItem());
|
||||
|
||||
int targetX = 0;
|
||||
int targetZ = 0;
|
||||
|
||||
if(slots[1] != null && slots[1].getItem() instanceof IDesignatorItem) {
|
||||
|
||||
IDesignatorItem designator = (IDesignatorItem) slots[1].getItem();
|
||||
|
||||
if(!designator.isReady(worldObj, slots[1], xCoord, yCoord, zCoord) && needsDesignator) return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
|
||||
Vec3 coords = designator.getCoords(worldObj, slots[1], xCoord, yCoord, zCoord);
|
||||
targetX = (int) Math.floor(coords.xCoord);
|
||||
targetZ = (int) Math.floor(coords.zCoord);
|
||||
|
||||
} else {
|
||||
if(needsDesignator) return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
}
|
||||
|
||||
return this.launchToCoordinate(targetX, targetZ);
|
||||
}
|
||||
|
||||
public BombReturnCode launchToEntity(Entity entity) {
|
||||
if(!canLaunch()) return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
|
||||
Entity e = instantiateMissile((int) Math.floor(entity.posX), (int) Math.floor(entity.posZ));
|
||||
if(e != null) {
|
||||
|
||||
if(e instanceof EntityMissileAntiBallistic) {
|
||||
EntityMissileAntiBallistic abm = (EntityMissileAntiBallistic) e;
|
||||
abm.tracking = entity;
|
||||
}
|
||||
|
||||
finalizeLaunch(e);
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
}
|
||||
|
||||
public BombReturnCode launchToCoordinate(int targetX, int targetZ) {
|
||||
if(!canLaunch()) return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
|
||||
Entity e = instantiateMissile(targetX, targetZ);
|
||||
if(e != null) {
|
||||
finalizeLaunch(e);
|
||||
return BombReturnCode.LAUNCHED;
|
||||
}
|
||||
return BombReturnCode.ERROR_MISSING_COMPONENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendCommandPosition(int x, int y, int z) {
|
||||
return this.launchToCoordinate(x, z) == BombReturnCode.LAUNCHED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendCommandEntity(Entity target) {
|
||||
return this.launchToEntity(target) == BombReturnCode.LAUNCHED;
|
||||
}
|
||||
|
||||
public boolean needsDesignator(Item item) {
|
||||
return item != ModItems.missile_anti_ballistic;
|
||||
}
|
||||
|
||||
/** Full launch condition, checks if the item is launchable, fuel and power are present and any additional checks based on launch pad type */
|
||||
public boolean canLaunch() {
|
||||
return this.isMissileValid() && this.hasFuel() && this.isReadyForLaunch();
|
||||
}
|
||||
|
||||
/** Any extra conditions for launching in addition to the missile being valid and fueled */
|
||||
public abstract boolean isReadyForLaunch();
|
||||
}
|
||||
@ -1,34 +1,21 @@
|
||||
package com.hbm.tileentity.bomb;
|
||||
|
||||
import com.hbm.inventory.container.ContainerLaunchPadLarge;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUILaunchPadLarge;
|
||||
import com.hbm.entity.missile.EntityMissileBaseNT;
|
||||
import com.hbm.items.weapon.ItemMissile;
|
||||
import com.hbm.items.weapon.ItemMissile.MissileFormFactor;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver {
|
||||
public class TileEntityLaunchPadLarge extends TileEntityLaunchPadBase implements IEnergyUser, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver {
|
||||
|
||||
public ItemStack toRender;
|
||||
public int formFactor = -1;
|
||||
/** Whether the missile has already been placed on the launchpad. Missile will render statically on the pad if true */
|
||||
public boolean erected = false;
|
||||
@ -47,27 +34,15 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
/** Delay between erector movements */
|
||||
public int delay = 20;
|
||||
|
||||
public long power;
|
||||
public final long maxPower = 100_000;
|
||||
|
||||
private AudioWrapper audioLift;
|
||||
private AudioWrapper audioErector;
|
||||
|
||||
protected boolean liftMoving = false;
|
||||
protected boolean erectorMoving = false;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
public TileEntityLaunchPadLarge() {
|
||||
super(7);
|
||||
this.tanks = new FluidTank[2];
|
||||
this.tanks[0] = new FluidTank(Fluids.NONE, 24_000);
|
||||
this.tanks[1] = new FluidTank(Fluids.NONE, 24_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.launchPad";
|
||||
public boolean isReadyForLaunch() {
|
||||
return this.erected && this.readyToLoad;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -81,7 +56,7 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
float erectorSpeed = 1.5F;
|
||||
float liftSpeed = 0.025F;
|
||||
|
||||
if(slots[0] != null) {
|
||||
if(this.isMissileValid()) {
|
||||
if(slots[0].getItem() instanceof ItemMissile) {
|
||||
ItemMissile missile = (ItemMissile) slots[0].getItem();
|
||||
this.formFactor = missile.formFactor.ordinal();
|
||||
@ -170,8 +145,6 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
|
||||
if(prevLiftMoving && !this.liftMoving) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:door.wgh_stop", 2F, 1F);
|
||||
if(prevErectorMoving && !this.erectorMoving) worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:door.garage_stop", 2F, 1F);
|
||||
|
||||
this.networkPackNT(250);
|
||||
|
||||
} else {
|
||||
this.prevLift = this.lift;
|
||||
@ -216,28 +189,8 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("incomplete-switch") //shut up
|
||||
public void setFuel(ItemMissile missile) {
|
||||
switch(missile.fuel) {
|
||||
case ETHANOL_PEROXIDE:
|
||||
tanks[0].setTankType(Fluids.ETHANOL);
|
||||
tanks[1].setTankType(Fluids.ACID);
|
||||
break;
|
||||
case KEROSENE_PEROXIDE:
|
||||
tanks[0].setTankType(Fluids.KEROSENE);
|
||||
tanks[1].setTankType(Fluids.ACID);
|
||||
break;
|
||||
case KEROSENE_LOXY:
|
||||
tanks[0].setTankType(Fluids.KEROSENE);
|
||||
tanks[1].setTankType(Fluids.OXYGEN);
|
||||
break;
|
||||
case JETFUEL_LOXY:
|
||||
tanks[0].setTankType(Fluids.KEROSENE_REFORM);
|
||||
tanks[1].setTankType(Fluids.OXYGEN);
|
||||
break;
|
||||
}
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -246,17 +199,8 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
|
||||
buf.writeBoolean(this.liftMoving);
|
||||
buf.writeBoolean(this.erectorMoving);
|
||||
|
||||
if(slots[0] != null) {
|
||||
buf.writeBoolean(true);
|
||||
buf.writeInt(Item.getIdFromItem(slots[0].getItem()));
|
||||
buf.writeShort((short) slots[0].getItemDamage());
|
||||
} else {
|
||||
buf.writeBoolean(false);
|
||||
}
|
||||
|
||||
buf.writeBoolean(erected);
|
||||
buf.writeBoolean(readyToLoad);
|
||||
buf.writeBoolean(this.erected);
|
||||
buf.writeBoolean(this.readyToLoad);
|
||||
buf.writeByte((byte) this.formFactor);
|
||||
buf.writeFloat(this.lift);
|
||||
buf.writeFloat(this.erector);
|
||||
@ -268,17 +212,9 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
|
||||
this.liftMoving = buf.readBoolean();
|
||||
this.erectorMoving = buf.readBoolean();
|
||||
|
||||
if(buf.readBoolean()) {
|
||||
this.toRender = new ItemStack(Item.getItemById(buf.readInt()), 1, buf.readShort());
|
||||
} else {
|
||||
this.toRender = null;
|
||||
}
|
||||
|
||||
this.erected = buf.readBoolean();
|
||||
this.readyToLoad = buf.readBoolean();
|
||||
this.formFactor = buf.readByte();
|
||||
|
||||
this.syncLift = buf.readFloat();
|
||||
this.syncErector = buf.readFloat();
|
||||
|
||||
@ -290,49 +226,33 @@ public class TileEntityLaunchPadLarge extends TileEntityMachineBase implements I
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
power = nbt.getLong("power");
|
||||
|
||||
this.erected = nbt.getBoolean("erected");
|
||||
this.readyToLoad = nbt.getBoolean("readyToLoad");
|
||||
this.lift = nbt.getFloat("lift");
|
||||
this.erector = nbt.getFloat("erector");
|
||||
this.formFactor = nbt.getInteger("formFactor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
|
||||
nbt.setBoolean("erected", erected);
|
||||
nbt.setBoolean("readyToLoad", readyToLoad);
|
||||
nbt.setFloat("lift", lift);
|
||||
nbt.setFloat("erector", erector);
|
||||
nbt.setInteger("formFactor", formFactor);
|
||||
}
|
||||
|
||||
@Override public long getPower() { return power; }
|
||||
@Override public void setPower(long power) { this.power = power; }
|
||||
@Override public long getMaxPower() { return maxPower; }
|
||||
@Override public FluidTank[] getAllTanks() { return this.tanks; }
|
||||
@Override public FluidTank[] getReceivingTanks() { return this.tanks; }
|
||||
|
||||
@Override
|
||||
public boolean sendCommandPosition(int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sendCommandEntity(Entity target) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerLaunchPadLarge(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUILaunchPadLarge(player.inventory, this);
|
||||
|
||||
public Entity instantiateMissile(int targetX, int targetZ) {
|
||||
Entity missile = super.instantiateMissile(targetX, targetZ);
|
||||
|
||||
if(missile instanceof EntityMissileBaseNT) {
|
||||
EntityMissileBaseNT base = (EntityMissileBaseNT) missile;
|
||||
base.getDataWatcher().updateObject(3, (byte) (this.getBlockMetadata() - 10));
|
||||
}
|
||||
|
||||
return missile;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.recipes.FractionRecipes;
|
||||
@ -22,19 +16,16 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineFractionTower extends TileEntityLoadedBase implements IFluidSource, IFluidAcceptor, INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
public class TileEntityMachineFractionTower extends TileEntityLoadedBase implements INBTPacketReceiver, IFluidStandardTransceiver {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public List<IFluidAcceptor> list1 = new ArrayList();
|
||||
public List<IFluidAcceptor> list2 = new ArrayList();
|
||||
|
||||
public TileEntityMachineFractionTower() {
|
||||
tanks = new FluidTank[3];
|
||||
tanks[0] = new FluidTank(Fluids.HEAVYOIL, 4000, 0);
|
||||
tanks[1] = new FluidTank(Fluids.BITUMEN, 4000, 1);
|
||||
tanks[2] = new FluidTank(Fluids.SMEAR, 4000, 2);
|
||||
tanks[0] = new FluidTank(Fluids.HEAVYOIL, 4000);
|
||||
tanks[1] = new FluidTank(Fluids.BITUMEN, 4000);
|
||||
tanks[2] = new FluidTank(Fluids.SMEAR, 4000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -69,14 +60,9 @@ public class TileEntityMachineFractionTower extends TileEntityLoadedBase impleme
|
||||
setupTanks();
|
||||
this.updateConnections();
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0)
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0)
|
||||
fractionate();
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 10 == 0) {
|
||||
fillFluidInit(tanks[1].getTankType());
|
||||
fillFluidInit(tanks[2].getTankType());
|
||||
}
|
||||
|
||||
this.sendFluid();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
@ -168,76 +154,6 @@ public class TileEntityMachineFractionTower extends TileEntityLoadedBase impleme
|
||||
for(int i = 0; i < 3; i++)
|
||||
tanks[i].writeToNBT(nbt, "tank" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
|
||||
for(int i = 2; i < 6; i++) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
fillFluid(xCoord + dir.offsetX * 2, yCoord, zCoord + dir.offsetZ * 2, this.getTact(), type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
return worldObj.getTotalWorldTime() % 20 < 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
if(type == tanks[1].getTankType()) return list1;
|
||||
if(type == tanks[2].getTankType()) return list2;
|
||||
return new ArrayList<IFluidAcceptor>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
if(type == tanks[1].getTankType()) list1.clear();
|
||||
if(type == tanks[2].getTankType()) list2.clear();
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 297 B After Width: | Height: | Size: 232 B |
Loading…
x
Reference in New Issue
Block a user