Permalink
Browse files

Added sevastopol blast doors

  • Loading branch information...
Ri5ux committed Nov 4, 2017
1 parent 2cb1693 commit 4b855f2f0b65d90c570a63bea3ea0983ec532b8a
@@ -27,6 +27,7 @@
import org.avp.block.BlockReflective;
import org.avp.block.BlockSatelliteDish;
import org.avp.block.BlockSatelliteModem;
import org.avp.block.BlockSevastopolBlastDoor;
import org.avp.block.BlockSolarPanel;
import org.avp.block.BlockStalagmite;
import org.avp.block.BlockStasisMechanism;
@@ -156,6 +157,7 @@
public Block repulsionGenerator = new BlockGenerator(Material.IRON).setHardness(5.0F).setResistance(10.0F);
public Block powerline = new BlockPowerline(Material.IRON).setHardness(3.2F).setResistance(2.6F);
public Block blastDoor = new BlockBlastdoor(Material.IRON).setHardness(10F).setResistance(15.0F).setLightOpacity(0);
public Block sevastopolBlastDoor = new BlockSevastopolBlastDoor().setHardness(10F).setResistance(15.0F).setLightOpacity(0);
public Block cryoTube = new BlockCryostasisTube(Material.IRON).setHardness(10F).setResistance(15.0F).setLightOpacity(4);
public Block lightPanel = new BlockLightPanel(Material.IRON).setHardness(1.5F).setResistance(2.0F);
public Block satelliteModem = new BlockSatelliteModem(Material.IRON).setHardness(3.2F).setResistance(2.6F);
@@ -243,6 +245,7 @@ private void register()
register("generator", repulsionGenerator).setCreativeTab(AliensVsPredator.tabMain());
register("powerline", powerline).setCreativeTab(AliensVsPredator.tabMain());
register("blastdoor", blastDoor).setCreativeTab(AliensVsPredator.tabMain());
register("blastdoor.sevastopol", sevastopolBlastDoor).setCreativeTab(AliensVsPredator.tabMain());
register("supplychuteblock", supplyCrate).setCreativeTab(AliensVsPredator.tabMain());
register("supplychuteblock.marines", crateMarines).setCreativeTab(AliensVsPredator.tabMain());
register("supplychuteblock.seegson", crateSeegson).setCreativeTab(AliensVsPredator.tabMain());
@@ -85,6 +85,7 @@
import org.avp.tile.TileEntityRepulsionGenerator;
import org.avp.tile.TileEntitySatelliteDish;
import org.avp.tile.TileEntitySatelliteModem;
import org.avp.tile.TileEntitySevastopolBlastDoor;
import org.avp.tile.TileEntitySkull;
import org.avp.tile.TileEntitySolarPanel;
import org.avp.tile.TileEntityStasisMechanism;
@@ -140,6 +141,7 @@ public void registerTileEntities()
GameRegistry.registerTileEntity(TileEntityRepulsionGenerator.class, "tileEntityGenerator");
GameRegistry.registerTileEntity(TileEntityPowerline.class, "tileEntityPowerline");
GameRegistry.registerTileEntity(TileEntityBlastdoor.class, "tileEntityBlastdoor");
GameRegistry.registerTileEntity(TileEntitySevastopolBlastDoor.class, "tileEntitySevastopolBlastdoor");
GameRegistry.registerTileEntity(TileEntityCryostasisTube.class, "tileEntityCryostasisTube");
GameRegistry.registerTileEntity(TileEntityLightPanel.class, "tileEntityLightPanel");
GameRegistry.registerTileEntity(TileEntitySatelliteModem.class, "tileEntitySatelliteModem");
@@ -1,5 +1,6 @@
package org.avp.block;
import org.avp.AliensVsPredator;
import org.avp.item.ItemMaintenanceJack;
import org.avp.tile.TileEntityBlastdoor;
@@ -80,6 +81,7 @@ private void onOpen(TileEntityBlastdoor blastdoor, World world, EntityPlayer pla
}
else
{
blastdoor.playDoorOpenSound();
blastdoor.setOpen(!blastdoor.isOpen());
if (world.isRemote)
@@ -0,0 +1,22 @@
package org.avp.block;
import org.avp.tile.TileEntitySevastopolBlastDoor;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockSevastopolBlastDoor extends BlockBlastdoor
{
public BlockSevastopolBlastDoor()
{
super(Material.IRON);
}
@Override
public TileEntity createTileEntity(World world, IBlockState state)
{
return new TileEntitySevastopolBlastDoor();
}
}
@@ -150,6 +150,7 @@
import org.avp.client.render.tile.RenderRepulsionGenerator;
import org.avp.client.render.tile.RenderSatelliteDish;
import org.avp.client.render.tile.RenderSatelliteModem;
import org.avp.client.render.tile.RenderSevastopolBlastdoor;
import org.avp.client.render.tile.RenderSkull;
import org.avp.client.render.tile.RenderSolarPanel;
import org.avp.client.render.tile.RenderStasisMechanism;
@@ -243,6 +244,7 @@
import org.avp.tile.TileEntityRepulsionGenerator;
import org.avp.tile.TileEntitySatelliteDish;
import org.avp.tile.TileEntitySatelliteModem;
import org.avp.tile.TileEntitySevastopolBlastDoor;
import org.avp.tile.TileEntitySkull;
import org.avp.tile.TileEntitySolarPanel;
import org.avp.tile.TileEntityStasisMechanism;
@@ -553,6 +555,7 @@ private void registerTileEntitySpecialRenderers()
bindTileEntitySpecialRenderer(TileEntityStasisMechanism.class, new RenderStasisMechanism());
bindTileEntitySpecialRenderer(TileEntityPowerline.class, new RenderPowerline());
bindTileEntitySpecialRenderer(TileEntityBlastdoor.class, new RenderBlastdoor());
bindTileEntitySpecialRenderer(TileEntitySevastopolBlastDoor.class, new RenderSevastopolBlastdoor());
bindTileEntitySpecialRenderer(TileEntityCryostasisTube.class, new RenderCryostasisTube());
bindTileEntitySpecialRenderer(TileEntityRepulsionGenerator.class, new RenderRepulsionGenerator());
bindTileEntitySpecialRenderer(TileEntityAssembler.class, new RenderAssembler());
@@ -73,6 +73,7 @@
import org.avp.client.model.tile.ModelRedstoneFluxGenerator;
import org.avp.client.model.tile.ModelRepulsionGenerator;
import org.avp.client.model.tile.ModelSatelliteDish;
import org.avp.client.model.tile.ModelSevastopolBlastdoor;
import org.avp.client.model.tile.ModelSolarPanel;
import org.avp.client.model.tile.ModelStasisMechanism;
import org.avp.client.model.tile.ModelTransformer;
@@ -149,6 +150,11 @@ public Models models()
public final TexturedModel<ModelRepulsionGenerator> REPULSION_GENERATOR = new TexturedModel(new ModelRepulsionGenerator(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/generator.png"));
public final TexturedModel<ModelCable> CABLE = new TexturedModel(new ModelCable(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/cable.png"));
public final TexturedModel<ModelBlastdoor> BLASTDOOR = new TexturedModel(new ModelBlastdoor(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/blastdoor.png"));
public final TexturedModel<ModelSevastopolBlastdoor> BLASTDOOR_SEVASTOPOL = new TexturedModel(new ModelSevastopolBlastdoor(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/sevastopolblastdoor.png"));
public final TexturedModel<ModelSevastopolBlastdoor> BLASTDOOR_SEVASTOPOL_LOCKED = new TexturedModel(new ModelSevastopolBlastdoor(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/sevastopolblastdoor_locked.png"));
public final TexturedModel<ModelSevastopolBlastdoor> BLASTDOOR_SEVASTOPOL_UNLOCKED = new TexturedModel(new ModelSevastopolBlastdoor(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/sevastopolblastdoor_unlocked.png"));
public final TexturedModel<ModelSevastopolBlastdoor> BLASTDOOR_SEVASTOPOL_ENABLED = new TexturedModel(new ModelSevastopolBlastdoor(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/sevastopolblastdoor_power_on.png"));
public final TexturedModel<ModelSevastopolBlastdoor> BLASTDOOR_SEVASTOPOL_DISABLED = new TexturedModel(new ModelSevastopolBlastdoor(), new Texture(AliensVsPredator.Properties.ID, "textures/tile/sevastopolblastdoor_power_off.png"));
public final TexturedModel<ModelChestburster> CHESTBUSTER = new TexturedModel(new ModelChestburster(), new Texture(AliensVsPredator.Properties.ID, "textures/mob/chestburster.png"));
public final TexturedModel<ModelChestbursterPredalien> CHESTBUSTER_PREDALIEN = new TexturedModel(new ModelChestbursterPredalien(), new Texture(AliensVsPredator.Properties.ID, "textures/mob/chestburster_predalien.png"));
public final TexturedModel<ModelChestbursterQueen> CHESTBUSTER_QUEEN = new TexturedModel(new ModelChestbursterQueen(), new Texture(AliensVsPredator.Properties.ID, "textures/mob/chestburster_queen.png"));
@@ -0,0 +1,167 @@
package org.avp.client.model.tile;
import org.avp.tile.TileEntityBlastdoor;
import com.arisux.mdx.lib.client.Model;
import com.arisux.mdx.lib.game.Game;
import net.minecraft.client.model.ModelRenderer;
public class ModelSevastopolBlastdoor extends Model
{
public ModelRenderer frameL;
public ModelRenderer doorMain;
public ModelRenderer frameR;
public ModelRenderer frameT;
public ModelRenderer frameB;
public ModelRenderer frameTL;
public ModelRenderer frameTR;
public ModelRenderer frameTL2;
public ModelRenderer frameTR2;
public ModelRenderer frameBL;
public ModelRenderer frameBR;
public ModelRenderer frameBR2;
public ModelRenderer frameBL2;
public ModelRenderer doorTop;
public ModelRenderer doorBotton;
public ModelRenderer keypadF;
public ModelRenderer doorTopL;
public ModelRenderer doorTopR;
public ModelRenderer doorBottomL;
public ModelRenderer doorBottomR;
public ModelRenderer keypadB;
public ModelRenderer indicatorLightF;
public ModelRenderer indicatorLightB;
public ModelSevastopolBlastdoor()
{
this.textureWidth = 256;
this.textureHeight = 128;
this.frameTR = new ModelRenderer(this, 111, 33);
this.frameTR.mirror = true;
this.frameTR.setRotationPoint(0.0F, 0.0F, 0.0F);
this.frameTR.addBox(8.0F, -2.5F, -8.0F, 8, 11, 16, 0.0F);
this.indicatorLightB = new ModelRenderer(this, 19, 106);
this.indicatorLightB.setRotationPoint(0.0F, 0.0F, 0.0F);
this.indicatorLightB.addBox(-3.0F, 4.6F, 1.0F, 6, 3, 1, 0.0F);
this.frameBL = new ModelRenderer(this, 111, 67);
this.frameBL.setRotationPoint(0.0F, 0.0F, 0.0F);
this.frameBL.addBox(-16.0F, -9.5F, -8.0F, 8, 11, 16, 0.0F);
this.frameB = new ModelRenderer(this, 112, 1);
this.frameB.setRotationPoint(14.0F, 22.5F, 0.0F);
this.frameB.addBox(-8.0F, -2.5F, -8.0F, 16, 4, 16, 0.0F);
this.frameTL = new ModelRenderer(this, 111, 33);
this.frameTL.setRotationPoint(0.0F, 0.0F, 0.0F);
this.frameTL.addBox(-16.0F, -2.5F, -8.0F, 8, 11, 16, 0.0F);
this.frameT = new ModelRenderer(this, 44, 1);
this.frameT.setRotationPoint(14.0F, -21.5F, 0.0F);
this.frameT.addBox(-8.0F, -2.5F, -8.0F, 16, 4, 16, 0.0F);
this.frameTR2 = new ModelRenderer(this, 166, 31);
this.frameTR2.mirror = true;
this.frameTR2.setRotationPoint(4.4F, 0.0F, 0.0F);
this.frameTR2.addBox(-1.23F, 0.8F, -8.0F, 4, 8, 16, 0.0F);
this.setRotation(frameTR2, 0.0F, 0.0F, -0.5918411493512771F);
this.frameL = new ModelRenderer(this, 0, 0);
this.frameL.setRotationPoint(-6.0F, 0.0F, 0.0F);
this.frameL.addBox(-2.0F, -13.0F, -8.0F, 4, 26, 16, 0.0F);
this.doorTop = new ModelRenderer(this, 73, 46);
this.doorTop.setRotationPoint(0.0F, -1.1F, 0.0F);
this.doorTop.addBox(4.0F, -8.3F, -4.0F, 8, 8, 8, 0.0F);
this.frameTL2 = new ModelRenderer(this, 166, 31);
this.frameTL2.setRotationPoint(-6.0F, 0.0F, 0.0F);
this.frameTL2.addBox(-1.23F, -0.1F, -8.0F, 4, 8, 16, 0.0F);
this.setRotation(frameTL2, 0.0F, 0.0F, 0.5918411493512771F);
this.keypadF = new ModelRenderer(this, 0, 91);
this.keypadF.setRotationPoint(8.0F, 9.9F, -3.5F);
this.keypadF.addBox(-3.0F, -4.0F, -1.0F, 6, 8, 1, 0.0F);
this.indicatorLightF = new ModelRenderer(this, 0, 106);
this.indicatorLightF.setRotationPoint(0.0F, 0.0F, 0.0F);
this.indicatorLightF.addBox(-3.0F, 4.6F, -1.0F, 6, 3, 1, 0.0F);
this.frameBL2 = new ModelRenderer(this, 166, 67);
this.frameBL2.setRotationPoint(-4.4F, 0.3F, 0.0F);
this.frameBL2.addBox(-1.83F, -9.7F, -8.0F, 4, 9, 16, 0.0F);
this.setRotation(frameBL2, 0.0F, 0.0F, -0.5918411493512771F);
this.doorTopL = new ModelRenderer(this, 73, 85);
this.doorTopL.setRotationPoint(4.5F, -9.0F, 0.0F);
this.doorTopL.addBox(0.5F, 1.1F, -4.0F, 4, 9, 8, 0.0F);
this.setRotation(doorTopL, 0.0F, 0.0F, 0.5918411493512771F);
this.doorBottomL = new ModelRenderer(this, 73, 106);
this.doorBottomL.setRotationPoint(4.5F, 30.9F, 0.0F);
this.doorBottomL.addBox(-0.1F, -9.6F, -4.0F, 4, 9, 8, 0.0F);
this.setRotation(doorBottomL, 0.0F, 0.0F, -0.5918411493512771F);
this.frameBR2 = new ModelRenderer(this, 166, 67);
this.frameBR2.mirror = true;
this.frameBR2.setRotationPoint(4.4F, 0.3F, 0.0F);
this.frameBR2.addBox(-2.18F, -9.7F, -8.0F, 4, 9, 16, 0.0F);
this.setRotation(frameBR2, 0.0F, 0.0F, 0.5918411493512771F);
this.doorBotton = new ModelRenderer(this, 73, 65);
this.doorBotton.setRotationPoint(0.0F, 0.2F, 0.0F);
this.doorBotton.addBox(4.0F, 22.8F, -4.0F, 8, 8, 8, 0.0F);
this.doorMain = new ModelRenderer(this, 0, 48);
this.doorMain.setRotationPoint(0.0F, -11.0F, 0.0F);
this.doorMain.addBox(-4.0F, -2.0F, -4.0F, 24, 26, 8, 0.0F);
this.frameBR = new ModelRenderer(this, 111, 67);
this.frameBR.mirror = true;
this.frameBR.setRotationPoint(0.0F, 0.0F, 0.0F);
this.frameBR.addBox(8.0F, -9.5F, -8.0F, 8, 11, 16, 0.0F);
this.doorBottomR = new ModelRenderer(this, 73, 106);
this.doorBottomR.mirror = true;
this.doorBottomR.setRotationPoint(11.0F, 30.7F, 0.0F);
this.doorBottomR.addBox(-3.4F, -9.7F, -4.0F, 4, 9, 8, 0.0F);
this.setRotation(doorBottomR, 0.0F, 0.0F, 0.5918411493512771F);
this.doorTopR = new ModelRenderer(this, 73, 85);
this.doorTopR.mirror = true;
this.doorTopR.setRotationPoint(11.0F, -9.0F, 0.0F);
this.doorTopR.addBox(-4.0F, 1.4F, -4.0F, 4, 9, 8, 0.0F);
this.setRotation(doorTopR, 0.0F, 0.0F, -0.5918411493512771F);
this.frameR = new ModelRenderer(this, 0, 0);
this.frameR.mirror = true;
this.frameR.setRotationPoint(20.0F, 0.0F, 0.0F);
this.frameR.addBox(6.0F, -13.0F, -8.0F, 4, 26, 16, 0.0F);
this.keypadB = new ModelRenderer(this, 19, 91);
this.keypadB.setRotationPoint(0.0F, 0.0F, 6.0F);
this.keypadB.addBox(-3.0F, -4.0F, 1.0F, 6, 8, 1, 0.0F);
this.frameT.addChild(this.frameTR);
this.keypadB.addChild(this.indicatorLightB);
this.frameB.addChild(this.frameBL);
this.frameL.addChild(this.frameB);
this.frameT.addChild(this.frameTL);
this.frameL.addChild(this.frameT);
this.frameT.addChild(this.frameTR2);
this.doorMain.addChild(this.doorTop);
this.frameT.addChild(this.frameTL2);
this.doorMain.addChild(this.keypadF);
this.keypadF.addChild(this.indicatorLightF);
this.frameB.addChild(this.frameBL2);
this.doorTop.addChild(this.doorTopL);
this.doorBotton.addChild(this.doorBottomL);
this.frameB.addChild(this.frameBR2);
this.doorMain.addChild(this.doorBotton);
this.frameB.addChild(this.frameBR);
this.doorBotton.addChild(this.doorBottomR);
this.doorTop.addChild(this.doorTopR);
this.frameL.addChild(this.frameR);
this.keypadF.addChild(this.keypadB);
}
@Override
public void render(Object obj)
{
TileEntityBlastdoor tile = (TileEntityBlastdoor) obj;
if (tile != null)
{
float doorProgress = tile.getDoorProgress() * 2;
float doorProgressPrev = tile.getDoorProgressPrev() * 2;
doorProgress = doorProgressPrev + (doorProgress - doorProgressPrev) * Game.partialTicks();
float doorRight = -doorProgress - 0.05F;
doorMain.offsetY = doorRight;
doorMain.offsetY = doorRight;
}
draw(frameL);
draw(doorMain);
}
}
@@ -0,0 +1,41 @@
package org.avp.client.render.tile;
import static org.lwjgl.opengl.GL11.GL_CULL_FACE;
import org.avp.AliensVsPredator;
import org.avp.tile.TileEntityBlastdoor;
import com.arisux.mdx.lib.client.render.OpenGL;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
public class RenderSevastopolBlastdoor extends TileEntitySpecialRenderer<TileEntityBlastdoor>
{
@Override
public void renderTileEntityAt(TileEntityBlastdoor tile, double x, double y, double z, float partialTicks, int destroyStage)
{
if (tile != null && !tile.isChild())
{
OpenGL.pushMatrix();
{
OpenGL.disable(GL_CULL_FACE);
OpenGL.translate(x + 0.5F, y + 1.5F, z + 0.5F);
OpenGL.scale(1.0F, -1.0F, 1.0F);
OpenGL.rotate(tile);
AliensVsPredator.resources().models().BLASTDOOR_SEVASTOPOL.draw(tile);
if (tile.isOperational())
{
OpenGL.disableLight();
AliensVsPredator.resources().models().BLASTDOOR_SEVASTOPOL_ENABLED.draw(tile);
OpenGL.enableLight();
}
else
{
AliensVsPredator.resources().models().BLASTDOOR_SEVASTOPOL_DISABLED.draw(tile);
}
}
OpenGL.popMatrix();
}
}
}
@@ -23,6 +23,7 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
public class TileEntityBlastdoor extends TileEntityElectrical implements IVoltageReceiver, IRotatable, IOpenable, IMultiBlock
{
@@ -35,8 +36,8 @@
private TileEntityBlastdoor parent;
private ArrayList<TileEntityBlastdoor> children;
private int ticksExisted;
private String identifier;
private String password;
protected String identifier;
protected String password;
private long timeOfLastPry;
public TileEntityBlastdoor()
@@ -147,7 +148,7 @@ public void update()
this.getParent().setVoltage(this.getVoltage());
}
}
if (this.isParent)
{
double childrenVoltage = 0.0D;
@@ -170,12 +171,12 @@ public void update()
{
if (this.isOpen() && this.isOperational())
{
this.doorProgress = this.doorProgress < getMaxDoorProgress() ? this.doorProgress + 0.02F : this.doorProgress;
this.doorProgress = this.doorProgress < getMaxDoorProgress() ? this.doorProgress + getDoorSpeed() : this.doorProgress;
}
if (!this.isOpen() && !isBeingPryedOpen())
{
this.doorProgress = this.doorProgress > 0.0F ? this.doorProgress - 0.02F : this.doorProgress;
this.doorProgress = this.doorProgress > 0.0F ? this.doorProgress - getDoorSpeed() : this.doorProgress;
}
long timeSinceLastPry = (System.currentTimeMillis() - this.getTimeOfLastPry());
@@ -424,6 +425,11 @@ public int getDoorResealTime()
{
return 600;
}
public float getDoorSpeed()
{
return 0.03F;
}
public float getDoorProgressPrev()
{
@@ -450,4 +456,9 @@ public float getDoorProgressPrev()
return set.toArray(new BlockPos[set.size()]);
}
public void playDoorOpenSound()
{
AliensVsPredator.sounds().BLASTDOOR_OPEN.playSound(world, pos, 1F, 1F);
}
}
Oops, something went wrong.

0 comments on commit 4b855f2

Please sign in to comment.