Permalink
Browse files

Added network racks, removed satellite modems.

  • Loading branch information...
Ri5ux committed Dec 18, 2017
1 parent cf1d1e2 commit f643acc5fee5ad0712da449b34913ac4f9bc5eee
Showing with 1,340 additions and 329 deletions.
  1. +2 −2 src/main/java/org/avp/EntityHandler.java
  2. +132 −0 src/main/java/org/avp/block/BlockNetworkRack.java
  3. +0 −43 src/main/java/org/avp/block/BlockSatelliteModem.java
  4. +14 −3 src/main/java/org/avp/client/Renders.java
  5. +47 −0 src/main/java/org/avp/client/gui/GuiNetworkRack.java
  6. +70 −0 src/main/java/org/avp/client/render/items/RenderItemNetworkRack.java
  7. +83 −0 src/main/java/org/avp/client/render/items/RenderItemNetworkRackModule.java
  8. +85 −0 src/main/java/org/avp/client/render/tile/RenderNetworkRack.java
  9. +0 −34 src/main/java/org/avp/client/render/tile/RenderSatelliteModem.java
  10. +98 −0 src/main/java/org/avp/inventory/ContainerNetworkRack.java
  11. +55 −0 src/main/java/org/avp/item/ItemNetworkRackModule.java
  12. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule1.java
  13. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule2.java
  14. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule3.java
  15. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule4.java
  16. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule5.java
  17. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule6.java
  18. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule7.java
  19. +33 −0 src/main/java/org/avp/item/rackmodules/ItemNetworkRackModule8.java
  20. +172 −208 src/main/java/org/avp/tile/TileEntityBlastdoor.java
  21. +318 −0 src/main/java/org/avp/tile/TileEntityNetworkRack.java
  22. +0 −39 src/main/java/org/avp/tile/TileEntitySatelliteModem.java
@@ -85,7 +85,7 @@
import org.avp.tile.TileEntityReflective;
import org.avp.tile.TileEntityRepulsionGenerator;
import org.avp.tile.TileEntitySatelliteDish;
import org.avp.tile.TileEntitySatelliteModem;
import org.avp.tile.TileEntityNetworkRack;
import org.avp.tile.TileEntitySevastopolBlastDoor;
import org.avp.tile.TileEntitySkull;
import org.avp.tile.TileEntitySolarPanel;
@@ -146,7 +146,7 @@ public void registerTileEntities()
GameRegistry.registerTileEntity(TileEntityCryostasisTube.class, "tileEntityCryostasisTube");
GameRegistry.registerTileEntity(TileEntityLightPanel.class, "tileEntityLightPanel");
GameRegistry.registerTileEntity(TileEntityCCFLTube.class, "tileEntityCCFLTube");
GameRegistry.registerTileEntity(TileEntitySatelliteModem.class, "tileEntitySatelliteModem");
GameRegistry.registerTileEntity(TileEntityNetworkRack.class, "tileEntitySatelliteModem");
GameRegistry.registerTileEntity(TileEntitySatelliteDish.class, "tileEntitySatelliteDish");
GameRegistry.registerTileEntity(TileEntityTransformer.class, "tileEntityTransformer");
GameRegistry.registerTileEntity(TileEntityNegativeTransformer.class, "tileEntityNegativeTransformer");
@@ -0,0 +1,132 @@
package org.avp.block;
import org.avp.AliensVsPredator;
import org.avp.tile.TileEntityNetworkRack;
import com.arisux.mdx.lib.world.entity.Entities;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;
public class BlockNetworkRack extends Block
{
public BlockNetworkRack(Material material)
{
super(material);
this.setTickRandomly(true);
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.INVISIBLE;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state)
{
return new TileEntityNetworkRack();
}
@Override
public boolean hasTileEntity(IBlockState state)
{
return true;
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state)
{
TileEntity tile = world.getTileEntity(pos);
if (tile != null && tile instanceof TileEntityNetworkRack)
{
TileEntityNetworkRack rack = (TileEntityNetworkRack) tile;
if (rack.isChild())
{
if (rack.getParent() != null)
{
world.setBlockToAir(rack.getParent().getPos());
rack.getParent().breakChildren(world);
}
}
else
{
rack.breakChildren(world);
}
}
world.removeTileEntity(pos);
super.breakBlock(world, pos, state);
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack)
{
TileEntity tile = world.getTileEntity(pos);
if (tile != null && tile instanceof TileEntityNetworkRack && placer != null)
{
TileEntityNetworkRack rack = (TileEntityNetworkRack) tile;
rack.setRotationYAxis(Entities.getEntityFacingRotY(placer));
if (!rack.setup(world, true))
{
world.setBlockToAir(pos);
}
}
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
TileEntity tile = world.getTileEntity(pos);
if (tile != null && tile instanceof TileEntityNetworkRack)
{
TileEntityNetworkRack rackSubBlock = (TileEntityNetworkRack) tile;
TileEntityNetworkRack rack = null;
if (rackSubBlock.isChild() && rackSubBlock.getParent() != null)
{
rack = rackSubBlock.getParent();
}
else if (rackSubBlock.isParent())
{
rack = rackSubBlock;
}
showNetworkRackGUI(playerIn, rack);
}
return true;
}
public static void showNetworkRackGUI(EntityPlayer player, TileEntityNetworkRack rack)
{
if (!player.world.isRemote)
{
FMLNetworkHandler.openGui(player, AliensVsPredator.instance(), AliensVsPredator.interfaces().GUI_NETWORK_RACK, player.world, rack.getPos().getX(), rack.getPos().getY(), rack.getPos().getZ());
}
}
}

This file was deleted.

Oops, something went wrong.
@@ -90,6 +90,8 @@
import org.avp.client.render.items.RenderItemM56SG;
import org.avp.client.render.items.RenderItemMedpod;
import org.avp.client.render.items.RenderItemMotionTracker;
import org.avp.client.render.items.RenderItemNetworkRack;
import org.avp.client.render.items.RenderItemNetworkRackModule;
import org.avp.client.render.items.RenderItemNostromoFlamethrower;
import org.avp.client.render.items.RenderItemPlasmaCannon;
import org.avp.client.render.items.RenderItemPowercell;
@@ -145,14 +147,14 @@
import org.avp.client.render.tile.RenderLightPanel;
import org.avp.client.render.tile.RenderLocker;
import org.avp.client.render.tile.RenderMedpod;
import org.avp.client.render.tile.RenderNetworkRack;
import org.avp.client.render.tile.RenderPowercell;
import org.avp.client.render.tile.RenderPowerline;
import org.avp.client.render.tile.RenderRedstoneEmitter;
import org.avp.client.render.tile.RenderRedstoneFluxGenerator;
import org.avp.client.render.tile.RenderRedstoneSensor;
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;
@@ -240,14 +242,14 @@
import org.avp.tile.TileEntityLocker;
import org.avp.tile.TileEntityMedpod;
import org.avp.tile.TileEntityNegativeTransformer;
import org.avp.tile.TileEntityNetworkRack;
import org.avp.tile.TileEntityPowercell;
import org.avp.tile.TileEntityPowerline;
import org.avp.tile.TileEntityRedstoneEmitter;
import org.avp.tile.TileEntityRedstoneFluxGenerator;
import org.avp.tile.TileEntityRedstoneSensor;
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;
@@ -471,6 +473,15 @@ private void registerItemRenderers(ItemHandler items)
Renderers.registerItemRenderer(items.itemSupplyChute, new RenderItemSupplyChute());
Renderers.registerItemRenderer(items.itemSupplyChuteMarines, new RenderItemSupplyChute());
Renderers.registerItemRenderer(items.itemSupplyChuteSeegson, new RenderItemSupplyChute());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().networkRack), new RenderItemNetworkRack());
Renderers.registerItemRenderer(items.rackModule1, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule2, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule3, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule4, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule5, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule6, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule7, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.rackModule8, new RenderItemNetworkRackModule());
Renderers.registerItemRenderer(items.summonerDrone, (new RenderItemSummoner(AliensVsPredator.resources().models().DRONE_ADVANCED)).setScale(7.5F).setY(6F));
Renderers.registerItemRenderer(items.summonerDeacon, (new RenderItemSummoner(AliensVsPredator.resources().models().DEACON)).setScale(14F).setY(-4F));
@@ -568,7 +579,7 @@ private void registerTileEntitySpecialRenderers()
bindTileEntitySpecialRenderer(TileEntityLightPanel.class, new RenderLightPanel());
bindTileEntitySpecialRenderer(TileEntityCCFLTube.class, new RenderCCFLTube());
bindTileEntitySpecialRenderer(TileEntitySolarPanel.class, new RenderSolarPanel());
bindTileEntitySpecialRenderer(TileEntitySatelliteModem.class, new RenderSatelliteModem());
bindTileEntitySpecialRenderer(TileEntityNetworkRack.class, new RenderNetworkRack());
bindTileEntitySpecialRenderer(TileEntityTransformer.class, new RenderTransformer());
bindTileEntitySpecialRenderer(TileEntityNegativeTransformer.class, new RenderTransformer());
bindTileEntitySpecialRenderer(TileEntityRedstoneSensor.class, new RenderRedstoneSensor());
@@ -0,0 +1,47 @@
package org.avp.client.gui;
import org.avp.tile.TileEntityNetworkRack;
import com.arisux.mdx.lib.client.render.Draw;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class GuiNetworkRack extends GuiContainer
{
private TileEntityNetworkRack rack;
public GuiNetworkRack(EntityPlayer player, TileEntityNetworkRack rack)
{
super(rack.getNewContainer(player));
this.rack = rack;
this.xSize = 170;
this.ySize = 203;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
{
drawRect(this.guiLeft, this.guiTop, this.guiLeft + this.xSize, this.guiTop + this.ySize, 0xCC000000);
Draw.drawString(this.rack.inventory.getName(), this.guiLeft + 5, this.guiTop + 5, 0xFFFFFFFF);
for (int idx = 3; idx >= 0; idx--)
{
ItemStack stack = this.rack.inventory.getStackInSlot(idx);
int sW = 16;
int sH = 16;
int sP = 2;
int sX = this.guiLeft + 5;
int sY = this.guiTop + 26 + (sH * idx) + (sP * idx);
drawRect(sX, sY, sX + sW, sY + sH, 0x1AFFFFFF);
if (stack != null)
{
Draw.drawString(stack.getDisplayName(), sX + sW + (sP * 2), sY + (sH / 4), 0xFFFFFFFF);
}
}
}
}
@@ -0,0 +1,70 @@
package org.avp.client.render.items;
import org.avp.AliensVsPredator;
import org.avp.client.model.tile.rackmodules.ModelNetworkModuleRack;
import com.arisux.mdx.lib.client.render.ItemRenderer;
import com.arisux.mdx.lib.client.render.OpenGL;
import com.arisux.mdx.lib.game.Game;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class RenderItemNetworkRack extends ItemRenderer<ModelNetworkModuleRack>
{
public RenderItemNetworkRack()
{
super(AliensVsPredator.resources().models().NETWORKMODULERACK);
}
@Override
public void renderThirdPersonRight(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
float glScale = 1F;
OpenGL.rotate(10F, 0F, 0F, 1F);
OpenGL.rotate(12F, 0F, 1F, 0F);
OpenGL.translate(0.1F, -0.1F, 0F);
GlStateManager.disableCull();
OpenGL.scale(glScale, -glScale, glScale);
this.getModel().draw();
}
@Override
public void renderFirstPersonRight(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
float glScale = 0.25F;
OpenGL.translate(-0.2F, 0.5F, 0.2F);
OpenGL.rotate(95.0F, 1.0F, 0.0F, 0.0F);
OpenGL.rotate(120.0F, 0.0F, 1.0F, 0.0F);
OpenGL.rotate(79.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.disableCull();
OpenGL.scale(glScale, glScale, glScale);
this.getModel().draw();
}
@Override
public void renderInInventory(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
float glScale = 0.375F;
OpenGL.scale(glScale, glScale, glScale);
OpenGL.translate(-0.3F, 0.1F, 0F);
OpenGL.rotate(230F, 1F, 0F, 0F);
OpenGL.rotate(45F, 0F, 0F, 1F);
OpenGL.disableCullFace();
OpenGL.scale(1F, -1F, 1F);
this.getModel().draw();
OpenGL.enableCullFace();
}
@Override
public void renderInWorld(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
OpenGL.scale(1F, -1F, 1F);
OpenGL.translate(0F, -1F, 0F);
GlStateManager.disableCull();
this.getModel().draw();
}
}
Oops, something went wrong.

0 comments on commit f643acc

Please sign in to comment.