Added laser drill model into code
This commit is contained in:
parent
29be8c5ce3
commit
d96d48ea2d
11 changed files with 188 additions and 33 deletions
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
139
src/minecraft/assemblyline/client/model/ModelLaserDrill.java
Normal file
139
src/minecraft/assemblyline/client/model/ModelLaserDrill.java
Normal file
|
@ -0,0 +1,139 @@
|
|||
package assemblyline.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelLaserDrill extends ModelBase
|
||||
{
|
||||
// fields
|
||||
ModelRenderer Spitze;
|
||||
ModelRenderer Upper_plating;
|
||||
ModelRenderer Middle_plating;
|
||||
ModelRenderer Shape3_1;
|
||||
ModelRenderer Shape3_2;
|
||||
ModelRenderer Shape3_3;
|
||||
ModelRenderer Shape3_4;
|
||||
ModelRenderer lower_plating;
|
||||
ModelRenderer lower_plating_2;
|
||||
ModelRenderer Hubbel_1;
|
||||
ModelRenderer Hubbel_2;
|
||||
ModelRenderer Hubbel_3;
|
||||
ModelRenderer Hubbel_4;
|
||||
ModelRenderer Querbatzen;
|
||||
|
||||
public ModelLaserDrill()
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
|
||||
Spitze = new ModelRenderer(this, 0, 8);
|
||||
Spitze.addBox(-1F, 0F, -1F, 2, 16, 2);
|
||||
Spitze.setRotationPoint(0F, 8F, 0F);
|
||||
Spitze.setTextureSize(64, 32);
|
||||
Spitze.mirror = true;
|
||||
setRotation(Spitze, 0F, 0F, 0F);
|
||||
Upper_plating = new ModelRenderer(this, 0, 0);
|
||||
Upper_plating.addBox(-2F, 0F, -2F, 4, 1, 4);
|
||||
Upper_plating.setRotationPoint(0F, 11F, 0F);
|
||||
Upper_plating.setTextureSize(64, 32);
|
||||
Upper_plating.mirror = true;
|
||||
setRotation(Upper_plating, 0F, 0F, 0F);
|
||||
Middle_plating = new ModelRenderer(this, 16, 0);
|
||||
Middle_plating.addBox(-3F, 0F, -3F, 6, 1, 6);
|
||||
Middle_plating.setRotationPoint(0F, 15F, 0F);
|
||||
Middle_plating.setTextureSize(64, 32);
|
||||
Middle_plating.mirror = true;
|
||||
setRotation(Middle_plating, 0F, 0F, 0F);
|
||||
Shape3_1 = new ModelRenderer(this, 8, 8);
|
||||
Shape3_1.addBox(2F, 0F, -1F, 1, 6, 2);
|
||||
Shape3_1.setRotationPoint(0F, 11F, 0F);
|
||||
Shape3_1.setTextureSize(64, 32);
|
||||
Shape3_1.mirror = true;
|
||||
setRotation(Shape3_1, 0F, -3.141593F, 0F);
|
||||
Shape3_2 = new ModelRenderer(this, 8, 8);
|
||||
Shape3_2.addBox(2F, 0F, -1F, 1, 6, 2);
|
||||
Shape3_2.setRotationPoint(0F, 11F, 0F);
|
||||
Shape3_2.setTextureSize(64, 32);
|
||||
Shape3_2.mirror = true;
|
||||
setRotation(Shape3_2, 0F, -1.570796F, 0F);
|
||||
Shape3_3 = new ModelRenderer(this, 8, 8);
|
||||
Shape3_3.addBox(2F, 0F, -1F, 1, 6, 2);
|
||||
Shape3_3.setRotationPoint(0F, 11F, 0F);
|
||||
Shape3_3.setTextureSize(64, 32);
|
||||
Shape3_3.mirror = true;
|
||||
setRotation(Shape3_3, 0F, 1.570796F, 0F);
|
||||
Shape3_4 = new ModelRenderer(this, 8, 8);
|
||||
Shape3_4.addBox(2F, 0F, -1F, 1, 6, 2);
|
||||
Shape3_4.setRotationPoint(0F, 11F, 0F);
|
||||
Shape3_4.setTextureSize(64, 32);
|
||||
Shape3_4.mirror = true;
|
||||
setRotation(Shape3_4, 0F, 0F, 0F);
|
||||
lower_plating = new ModelRenderer(this, 40, 0);
|
||||
lower_plating.addBox(-2F, 0F, -2F, 4, 1, 4);
|
||||
lower_plating.setRotationPoint(0F, 18F, 0F);
|
||||
lower_plating.setTextureSize(64, 32);
|
||||
lower_plating.mirror = true;
|
||||
setRotation(lower_plating, 0F, 0F, 0F);
|
||||
lower_plating_2 = new ModelRenderer(this, 40, 0);
|
||||
lower_plating_2.addBox(-2F, 0F, -2F, 4, 1, 4);
|
||||
lower_plating_2.setRotationPoint(0F, 20F, 0F);
|
||||
lower_plating_2.setTextureSize(64, 32);
|
||||
lower_plating_2.mirror = true;
|
||||
setRotation(lower_plating_2, 0F, 0F, 0F);
|
||||
Hubbel_1 = new ModelRenderer(this, 56, 0);
|
||||
Hubbel_1.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1);
|
||||
Hubbel_1.setRotationPoint(0F, 12F, 3F);
|
||||
Hubbel_1.setTextureSize(64, 32);
|
||||
Hubbel_1.mirror = true;
|
||||
setRotation(Hubbel_1, 0F, 0.7853982F, 0F);
|
||||
Hubbel_2 = new ModelRenderer(this, 56, 0);
|
||||
Hubbel_2.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1);
|
||||
Hubbel_2.setRotationPoint(3F, 12F, 0F);
|
||||
Hubbel_2.setTextureSize(64, 32);
|
||||
Hubbel_2.mirror = true;
|
||||
setRotation(Hubbel_2, 0F, 0.7853982F, 0F);
|
||||
Hubbel_3 = new ModelRenderer(this, 56, 0);
|
||||
Hubbel_3.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1);
|
||||
Hubbel_3.setRotationPoint(0F, 12F, -3F);
|
||||
Hubbel_3.setTextureSize(64, 32);
|
||||
Hubbel_3.mirror = true;
|
||||
setRotation(Hubbel_3, 0F, 0.7853982F, 0F);
|
||||
Hubbel_4 = new ModelRenderer(this, 56, 0);
|
||||
Hubbel_4.addBox(-0.5F, -0.5F, -0.5F, 1, 4, 1);
|
||||
Hubbel_4.setRotationPoint(-3F, 12F, 0F);
|
||||
Hubbel_4.setTextureSize(64, 32);
|
||||
Hubbel_4.mirror = true;
|
||||
setRotation(Hubbel_4, 0F, 0.7853982F, 0F);
|
||||
Querbatzen = new ModelRenderer(this, 14, 8);
|
||||
Querbatzen.addBox(-0.5F, -0.5F, -0.5F, 3, 1, 3);
|
||||
Querbatzen.setRotationPoint(-1.5F, 11F, 0F);
|
||||
Querbatzen.setTextureSize(64, 32);
|
||||
Querbatzen.mirror = true;
|
||||
setRotation(Querbatzen, 0F, 0.7853982F, 0F);
|
||||
}
|
||||
|
||||
public void render(float rotation, float f5)
|
||||
{
|
||||
Spitze.render(f5);
|
||||
Upper_plating.render(f5);
|
||||
Middle_plating.render(f5);
|
||||
Shape3_1.render(f5);
|
||||
Shape3_2.render(f5);
|
||||
Shape3_3.render(f5);
|
||||
Shape3_4.render(f5);
|
||||
lower_plating.render(f5);
|
||||
lower_plating_2.render(f5);
|
||||
Hubbel_1.render(f5);
|
||||
Hubbel_2.render(f5);
|
||||
Hubbel_3.render(f5);
|
||||
Hubbel_4.render(f5);
|
||||
Querbatzen.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -22,10 +22,6 @@ public class RenderDetector extends RenderImprintable
|
|||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
||||
{
|
||||
if (tileEntity instanceof TileEntityDetector)
|
||||
{
|
||||
// this.render(((TileEntityDetector) tileEntity).isInverted(), new Vector3(x, y, z));
|
||||
}
|
||||
super.renderTileEntityAt(tileEntity, x, y, z, var8);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.BlockMachine;
|
||||
|
@ -41,7 +40,10 @@ public class BlockArmbot extends BlockMachine
|
|||
{
|
||||
TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (tileEntity != null && tileEntity instanceof IMultiBlock) { return ((IMultiBlock) tileEntity).onActivated(player); }
|
||||
if (tileEntity != null && tileEntity instanceof IMultiBlock)
|
||||
{
|
||||
return ((IMultiBlock) tileEntity).onActivated(player);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -96,8 +98,10 @@ public class BlockArmbot extends BlockMachine
|
|||
public boolean isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int side)
|
||||
{
|
||||
TileEntity ent = world.getBlockTileEntity(x, y, z);
|
||||
// if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot) ent).isProvidingPowerSide(ForgeDirection.getOrientation(side)); }
|
||||
// if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot) ent).getFacingDirectionFromAngle().getOpposite() == ForgeDirection.getOrientation(side);}
|
||||
// if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot)
|
||||
// ent).isProvidingPowerSide(ForgeDirection.getOrientation(side)); }
|
||||
// if (ent instanceof TileEntityArmbot) { return ((TileEntityArmbot)
|
||||
// ent).getFacingDirectionFromAngle().getOpposite() == ForgeDirection.getOrientation(side);}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -107,5 +111,4 @@ public class BlockArmbot extends BlockMachine
|
|||
return this.isProvidingStrongPower(world, x, y, z, side);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -778,7 +778,10 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult
|
|||
{
|
||||
for (int i = 0; i < found.size(); i++)
|
||||
{
|
||||
if (found.get(i) != null && !(found.get(i) instanceof EntityPlayer) && found.get(i).ridingEntity == null) { return new Object[] { true }; }
|
||||
if (found.get(i) != null && !(found.get(i) instanceof EntityPlayer) && found.get(i).ridingEntity == null)
|
||||
{
|
||||
return new Object[] { true };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -935,14 +938,15 @@ public class TileEntityArmbot extends TileEntityAssemblyNetwork implements IMult
|
|||
this.grabbedEntities.clear();
|
||||
this.grabbedItems.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* called by the block when another checks it too
|
||||
* see if it is providing power to a direction
|
||||
* called by the block when another checks it too see if it is providing power to a direction
|
||||
*/
|
||||
public boolean isProvidingPowerSide(ForgeDirection dir)
|
||||
{
|
||||
return this.isProvidingPower && dir.getOpposite() == this.getFacingDirectionFromAngle();
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the facing direction using the yaw angle
|
||||
*/
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package assemblyline.common.machine.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.passive.EntityChicken;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -24,7 +20,8 @@ public class CommandGrab extends Command
|
|||
|
||||
public static final float radius = 0.5f;
|
||||
/**
|
||||
* If the grab command is specific to one entity this tell whether or not to grab the child version of that entity.
|
||||
* If the grab command is specific to one entity this tell whether or not to grab the child
|
||||
* version of that entity.
|
||||
*/
|
||||
public boolean child = false;
|
||||
/**
|
||||
|
@ -63,7 +60,10 @@ public class CommandGrab extends Command
|
|||
{
|
||||
super.doTask();
|
||||
|
||||
if (this.tileEntity.getGrabbedEntities().size() > 0) { return false; }
|
||||
if (this.tileEntity.getGrabbedEntities().size() > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Vector3 serachPosition = this.tileEntity.getHandPosition();
|
||||
List<Entity> found = this.world.getEntitiesWithinAABB(this.entityToInclude, AxisAlignedBB.getBoundingBox(serachPosition.x - radius, serachPosition.y - radius, serachPosition.z - radius, serachPosition.x + radius, serachPosition.y + radius, serachPosition.z + radius));
|
||||
|
|
|
@ -3,15 +3,12 @@ package assemblyline.common.machine.command;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import dark.minecraft.helpers.DebugToPlayer;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import dark.minecraft.helpers.ItemWorldHelper;
|
||||
|
||||
public class CommandPowerTo extends Command
|
||||
|
@ -44,11 +41,12 @@ public class CommandPowerTo extends Command
|
|||
{
|
||||
powerBlock(false);
|
||||
return false;
|
||||
}else if(this.tileEntity.isProvidingPower)
|
||||
}
|
||||
else if (this.tileEntity.isProvidingPower)
|
||||
{
|
||||
Vector3 loc = this.tileEntity.getHandPosition();
|
||||
world.spawnParticle("smoke", loc.x, loc.y , loc.z, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", loc.x, loc.y , loc.z, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("smoke", loc.x, loc.y, loc.z, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", loc.x, loc.y, loc.z, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
Block block = Block.blocksList[this.world.getBlockId(tileEntity.getHandPosition().intX(), tileEntity.getHandPosition().intY(), tileEntity.getHandPosition().intZ())];
|
||||
|
|
|
@ -43,15 +43,21 @@ public class GrabDictionary
|
|||
String name = (String) ob;
|
||||
for (GrabDictionary ref : grabList)
|
||||
{
|
||||
if (ref.getName().equalsIgnoreCase(name)) { return ref; }
|
||||
if (ref.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ob instanceof Class)
|
||||
if (ob instanceof Class)
|
||||
{
|
||||
Class<? extends Entity> cc = (Class<? extends Entity>) ob;
|
||||
for (GrabDictionary ref : grabList)
|
||||
{
|
||||
if (ref.getEntityClass() == cc) { return ref; }
|
||||
if (ref.getEntityClass() == cc)
|
||||
{
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new GrabDictionary("Entity", Entity.class);
|
||||
|
@ -64,7 +70,10 @@ public class GrabDictionary
|
|||
*/
|
||||
public String getName()
|
||||
{
|
||||
if (name != null) { return this.name; }
|
||||
if (name != null)
|
||||
{
|
||||
return this.name;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -75,12 +84,16 @@ public class GrabDictionary
|
|||
*/
|
||||
public Class<? extends Entity> getEntityClass()
|
||||
{
|
||||
if (this.entityClass != null) { return this.entityClass; }
|
||||
if (this.entityClass != null)
|
||||
{
|
||||
return this.entityClass;
|
||||
}
|
||||
return Entity.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* registers an entity by a name to its class allowing it to be called by the grab command to be picked up
|
||||
* registers an entity by a name to its class allowing it to be called by the grab command to be
|
||||
* picked up
|
||||
*/
|
||||
public static void registerGrabableEntity(String name, Class<? extends Entity> eClass)
|
||||
{
|
||||
|
@ -89,7 +102,10 @@ public class GrabDictionary
|
|||
{
|
||||
for (GrabDictionary ref : grabList)
|
||||
{
|
||||
if (ref.getName().equalsIgnoreCase(name)) { return; }
|
||||
if (ref.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
GrabDictionary.getList().add(newGrab);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package assemblyline.common.machine.imprinter;
|
|||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class SlotCraftingResult extends WatchedSlot
|
||||
|
|
Loading…
Reference in a new issue