Removed rejector code as it was unused

This commit is contained in:
Robert S 2014-09-16 11:15:59 -04:00
parent fcf0966804
commit 373c9038e4
3 changed files with 0 additions and 362 deletions

View file

@ -1,172 +0,0 @@
// Date: 1/17/2013 8:14:56 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package resonantinduction.mechanical.logistic.belt;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelRejectorPiston extends ModelBase
{
// fields
ModelRenderer BodyBottom;
ModelRenderer PistonFace2;
ModelRenderer PistonShaft;
ModelRenderer Piston;
ModelRenderer H1;
ModelRenderer H2;
ModelRenderer H3;
ModelRenderer PistonFace;
ModelRenderer WireCCRight;
ModelRenderer WireCCLeft;
ModelRenderer BodyP2;
ModelRenderer BodyP1;
ModelRenderer LeftSide;
ModelRenderer RightSide;
ModelRenderer PistonBack;
ModelRenderer WireCCFront;
public ModelRejectorPiston()
{
textureWidth = 128;
textureHeight = 128;
BodyBottom = new ModelRenderer(this, 29, 69);
BodyBottom.addBox(-5F, 0F, -2F, 10, 5, 15);
BodyBottom.setRotationPoint(0F, 19F, -6F);
BodyBottom.setTextureSize(128, 128);
BodyBottom.mirror = true;
setRotation(BodyBottom, 0F, 0F, 0F);
PistonFace2 = new ModelRenderer(this, 0, 53);
PistonFace2.addBox(-2F, -2F, -1F, 4, 6, 1);
PistonFace2.setRotationPoint(0F, 15F, -6F);
PistonFace2.setTextureSize(128, 128);
PistonFace2.mirror = true;
setRotation(PistonFace2, 0F, 0F, 0F);
PistonShaft = new ModelRenderer(this, 0, 75);
PistonShaft.addBox(-1.5F, -1.5F, 0F, 3, 3, 10);
PistonShaft.setRotationPoint(0F, 16F, -6F);
PistonShaft.setTextureSize(128, 128);
PistonShaft.mirror = true;
setRotation(PistonShaft, 0F, 0F, 0F);
Piston = new ModelRenderer(this, 0, 22);
Piston.addBox(-3F, -1F, 0F, 6, 6, 10);
Piston.setRotationPoint(0F, 14F, -5F);
Piston.setTextureSize(128, 128);
Piston.mirror = true;
setRotation(Piston, 0F, 0F, 0F);
H1 = new ModelRenderer(this, 33, 23);
H1.addBox(-1.5F, 0F, 0F, 3, 1, 8);
H1.setRotationPoint(0F, 12F, -4F);
H1.setTextureSize(128, 128);
H1.mirror = true;
setRotation(H1, 0F, 0F, 0F);
H2 = new ModelRenderer(this, 90, 23);
H2.addBox(0F, -1.5F, 0F, 1, 3, 8);
H2.setRotationPoint(-4F, 16F, -4F);
H2.setTextureSize(128, 128);
H2.mirror = true;
setRotation(H2, 0F, 0F, 0F);
H3 = new ModelRenderer(this, 70, 23);
H3.addBox(0F, -1.5F, 0F, 1, 3, 8);
H3.setRotationPoint(3F, 16F, -4F);
H3.setTextureSize(128, 128);
H3.mirror = true;
setRotation(H3, 0F, 0F, 0F);
PistonFace = new ModelRenderer(this, 0, 62);
PistonFace.addBox(-3F, -2F, -1F, 6, 4, 1);
PistonFace.setRotationPoint(0F, 16F, -6F);
PistonFace.setTextureSize(128, 128);
PistonFace.mirror = true;
setRotation(PistonFace, 0F, 0F, 0F);
WireCCRight = new ModelRenderer(this, 69, 52);
WireCCRight.addBox(-3F, -3F, 0F, 6, 11, 1);
WireCCRight.setRotationPoint(0F, 16F, 7F);
WireCCRight.setTextureSize(128, 128);
WireCCRight.mirror = true;
setRotation(WireCCRight, 0F, 0F, 0F);
WireCCLeft = new ModelRenderer(this, 54, 37);
WireCCLeft.addBox(0F, -3F, -3F, 1, 8, 6);
WireCCLeft.setRotationPoint(7F, 16F, 0F);
WireCCLeft.setTextureSize(128, 128);
WireCCLeft.mirror = true;
setRotation(WireCCLeft, 0F, 0F, 0F);
BodyP2 = new ModelRenderer(this, 100, 60);
BodyP2.addBox(1F, -2F, -2F, 2, 7, 4);
BodyP2.setRotationPoint(-8F, 16F, 0F);
BodyP2.setTextureSize(128, 128);
BodyP2.mirror = true;
setRotation(BodyP2, 0F, 0F, 0F);
BodyP1 = new ModelRenderer(this, 87, 60);
BodyP1.addBox(3F, -2F, -2F, 2, 7, 4);
BodyP1.setRotationPoint(2F, 16F, 0F);
BodyP1.setTextureSize(128, 128);
BodyP1.mirror = true;
setRotation(BodyP1, 0F, 0F, 0F);
LeftSide = new ModelRenderer(this, 29, 91);
LeftSide.addBox(0F, 0F, -2F, 3, 3, 14);
LeftSide.setRotationPoint(5F, 21F, -5F);
LeftSide.setTextureSize(128, 128);
LeftSide.mirror = true;
setRotation(LeftSide, 0F, 0F, 0F);
RightSide = new ModelRenderer(this, 64, 91);
RightSide.addBox(0F, 0F, -2F, 3, 3, 14);
RightSide.setRotationPoint(-8F, 21F, -5F);
RightSide.setTextureSize(128, 128);
RightSide.mirror = true;
setRotation(RightSide, 0F, 0F, 0F);
PistonBack = new ModelRenderer(this, 0, 12);
PistonBack.addBox(-2.5F, -2.5F, -1F, 5, 5, 2);
PistonBack.setRotationPoint(0F, 16F, 6F);
PistonBack.setTextureSize(128, 128);
PistonBack.mirror = true;
setRotation(PistonBack, 0F, 0F, 0F);
WireCCFront = new ModelRenderer(this, 69, 37);
WireCCFront.addBox(0F, -3F, -3F, 1, 8, 6);
WireCCFront.setRotationPoint(-8F, 16F, 0F);
WireCCFront.setTextureSize(128, 128);
WireCCFront.mirror = true;
setRotation(WireCCFront, 0F, 0F, 0F);
}
public void render(float f5)
{
BodyBottom.render(f5);
Piston.render(f5);
H1.render(f5);
H2.render(f5);
H3.render(f5);
WireCCRight.render(f5);
WireCCLeft.render(f5);
BodyP2.render(f5);
BodyP1.render(f5);
LeftSide.render(f5);
RightSide.render(f5);
PistonBack.render(f5);
WireCCFront.render(f5);
}
public void renderPiston(float f5, int p)
{
PistonFace2.setRotationPoint(0F, 15F, -6F - p);
PistonShaft.setRotationPoint(0F, 16F, -6F - p);
PistonFace.setRotationPoint(0F, 16F, -6F - p);
PistonFace2.render(f5);
PistonShaft.render(f5);
PistonFace.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -1,55 +0,0 @@
package resonantinduction.mechanical.logistic.belt;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import resonantinduction.core.Reference;
import resonantinduction.core.render.RenderImprintable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderRejector extends RenderImprintable
{
public static final ModelRejectorPiston MODEL = new ModelRejectorPiston();
public static final ResourceLocation TEXTURE = new ResourceLocation(Reference.domain(), Reference.modelPath() + "rejector.png");
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
{
TileRejector tile = (TileRejector) tileEntity;
boolean fire = tile.firePiston;
int face = tile.getDirection().ordinal();
int pos = 0;
if (fire)
{
pos = 8;
}
bindTexture(TEXTURE);
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glScalef(1.0F, -1F, -1F);
if (face == 2)
{
GL11.glRotatef(180f, 0f, 1f, 0f);
}
if (face == 3)
{
GL11.glRotatef(0f, 0f, 1f, 0f);
}
else if (face == 4)
{
GL11.glRotatef(90f, 0f, 1f, 0f);
}
else if (face == 5)
{
GL11.glRotatef(270f, 0f, 1f, 0f);
}
MODEL.render(0.0625F);
MODEL.renderPiston(0.0625F, pos);
GL11.glPopMatrix();
}
}

View file

@ -1,135 +0,0 @@
package resonantinduction.mechanical.logistic.belt;
import java.util.List;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.common.util.ForgeDirection;
import resonant.api.IEntityConveyor;
import resonant.engine.ResonantEngine;
import resonant.lib.network.discriminator.PacketTile;
import resonant.lib.network.discriminator.PacketType;
import resonant.lib.network.handle.IPacketIDReceiver;
import resonantinduction.archaic.blocks.TileFilterable;
import universalelectricity.core.transform.vector.Vector3;
/** @author Darkguardsman */
public class TileRejector extends TileFilterable implements IPacketIDReceiver
{
/** should the piston fire, or be extended */
public boolean firePiston = false;
public TileRejector()
{
super(Material.circuits);
this.isOpaqueCube(false);
this.normalRender(false);
}
@Override
public void update()
{
super.update();
/** Has to update a bit faster than a conveyer belt */
if (this.ticks() % 5 == 0)
{
this.firePiston = false;
Vector3 searchPosition = new Vector3(this);
searchPosition.add(this.getDirection());
TileEntity tileEntity = searchPosition.getTileEntity(this.worldObj);
try
{
if (this.isFunctioning())
{
/**
* Find all entities in the position in which this block is facing and attempt
* to push it out of the way.
*/
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(searchPosition.x(), searchPosition.y(), searchPosition.z(), searchPosition.x() + 1, searchPosition.y() + 1, searchPosition.z() + 1);
List<Entity> entitiesInFront = this.worldObj.getEntitiesWithinAABB(Entity.class, bounds);
for (Entity entity : entitiesInFront)
{
if (this.canEntityBeThrow(entity))
{
this.throwItem(tileEntity, this.getDirection(), entity);
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
/** Pushs an entity in the direction in which the rejector is facing */
public void throwItem(TileEntity tileEntity, ForgeDirection side, Entity entity)
{
this.firePiston = true;
// TODO add config to adjust the motion magnitude per rejector
entity.posX += side.offsetX;
// entity.motionY += 0.10000000298023224D;
entity.posZ += side.offsetZ;
if (!this.worldObj.isRemote && tileEntity instanceof IEntityConveyor)
{
((IEntityConveyor) tileEntity).ignoreEntity(entity);
}
}
/** Checks to see if the rejector can push the entity in the facing direction */
public boolean canEntityBeThrow(Entity entity)
{
// TODO Add other things than items
if (entity instanceof EntityItem)
{
EntityItem entityItem = (EntityItem) entity;
ItemStack itemStack = entityItem.getEntityItem();
return this.isFiltering(itemStack);
}
return false;
}
@Override
public Packet getDescriptionPacket()
{
return ResonantEngine.instance.packetHandler.toMCPacket(new PacketTile(this, 0, this.isInverted(), this.firePiston));
}
@Override
public boolean read(ByteBuf data, int id, EntityPlayer player, PacketType type)
{
try
{
if (this.worldObj.isRemote)
{
if (id == 0)
{
this.setInverted(data.readBoolean());
this.firePiston = data.readBoolean();
return true;
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
return false;
}
}