dev_version_released
This commit is contained in:
@@ -14,6 +14,7 @@ import com.kitsu.medievalcraft.item.ModItems;
|
|||||||
import com.kitsu.medievalcraft.renderer.RenderId;
|
import com.kitsu.medievalcraft.renderer.RenderId;
|
||||||
import com.kitsu.medievalcraft.tileents.cannon.TileCannon_28;
|
import com.kitsu.medievalcraft.tileents.cannon.TileCannon_28;
|
||||||
import com.kitsu.medievalcraft.tileents.machine.TileEntityFirebox;
|
import com.kitsu.medievalcraft.tileents.machine.TileEntityFirebox;
|
||||||
|
import com.kitsu.medievalcraft.util.CannonUtil;
|
||||||
import com.kitsu.medievalcraft.util.CustomTab;
|
import com.kitsu.medievalcraft.util.CustomTab;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
@@ -44,7 +45,7 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class Cannon_28 extends BlockContainer{
|
public class Cannon_28 extends BlockContainer implements CannonUtil{
|
||||||
|
|
||||||
private final Random random = new Random();
|
private final Random random = new Random();
|
||||||
|
|
||||||
@@ -84,74 +85,35 @@ public class Cannon_28 extends BlockContainer{
|
|||||||
Item ball = new ItemStack(ModBlocks.cannonBall_28, 0, 1).getItem();
|
Item ball = new ItemStack(ModBlocks.cannonBall_28, 0, 1).getItem();
|
||||||
|
|
||||||
if(tile.getStackInSlot(0)!=null && tile.getStackInSlot(0).getItem()==Items.gunpowder){
|
if(tile.getStackInSlot(0)!=null && tile.getStackInSlot(0).getItem()==Items.gunpowder){
|
||||||
if(world.getBlockMetadata(x, y, z)==3){
|
//if(world.getBlockMetadata(x, y, z)==0){
|
||||||
tile.isOn=true;
|
tile.isOn=true;
|
||||||
world.playSoundEffect(x, y, z, "random.fizz", 0.1f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
world.playSoundEffect(x, y, z, "random.fizz", 0.1f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
||||||
world.playSoundEffect(x, y, z, "random.explode", 0.5f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
world.playSoundEffect(x, y, z, "random.explode", 0.5f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
||||||
if(tile.getStackInSlot(1)!=null){
|
if(tile.getStackInSlot(1)!=null){
|
||||||
if(tile.getStackInSlot(1).getItem()==ball){
|
if(tile.getStackInSlot(1).getItem()==ball){
|
||||||
tile.decrStackSize(1, 1);
|
tile.decrStackSize(1, 1);
|
||||||
cannonball = new EntityCannonBall(world, (double)x+2, (double)y, (double)z, null);
|
cannonball = new EntityCannonBall(world, (double)x+(Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))), (double)y, (double)z+(Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))), null);
|
||||||
cannonball.setVelocity(tile.getStackInSlot(0).stackSize-world.rand.nextFloat(), 0.25, (world.rand.nextFloat()*2-1)/5);
|
//System.out.println(angles[world.getBlockMetadata(x, y, z)]);
|
||||||
|
//System.out.println(Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])));
|
||||||
|
//System.out.println(Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])));
|
||||||
|
cannonball.setVelocity(
|
||||||
|
((tile.getStackInSlot(0).stackSize*(Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))))-(world.rand.nextFloat()/4)),
|
||||||
|
0.25,
|
||||||
|
((tile.getStackInSlot(0).stackSize*(Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))))-(world.rand.nextFloat()/4)));
|
||||||
|
/*
|
||||||
|
* (((tile.getStackInSlot(0).stackSize-world.rand.nextFloat())*((Math.sin(Math.PI)/180) * angles[world.getBlockMetadata(x, y, z)]))),
|
||||||
|
0.25,
|
||||||
|
(((tile.getStackInSlot(0).stackSize-world.rand.nextFloat())*((Math.cos(Math.PI)/180) * angles[world.getBlockMetadata(x, y, z)]))));
|
||||||
|
*/
|
||||||
tile.setInventorySlotContents(0, null);
|
tile.setInventorySlotContents(0, null);
|
||||||
tile.markForUpdate();
|
tile.markForUpdate();
|
||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
if(tile.getStackInSlot(0)!=null && tile.getStackInSlot(0).getItem()==Items.gunpowder){
|
|
||||||
if(world.getBlockMetadata(x, y, z)==2){
|
|
||||||
tile.isOn=true;
|
|
||||||
world.playSoundEffect(x, y, z, "random.fizz", 0.1f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
world.playSoundEffect(x, y, z, "random.explode", 0.5f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
if(tile.getStackInSlot(1)!=null){
|
|
||||||
if(tile.getStackInSlot(1).getItem()==ball){
|
|
||||||
tile.decrStackSize(1, 1);
|
|
||||||
cannonball = new EntityCannonBall(world, (double)x, (double)y, (double)z-2, null);
|
|
||||||
cannonball.setVelocity((world.rand.nextFloat()*2-1)/5, 0.25, -tile.getStackInSlot(0).stackSize+world.rand.nextFloat());
|
|
||||||
tile.setInventorySlotContents(0, null);
|
|
||||||
tile.markForUpdate();
|
|
||||||
tile.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(tile.getStackInSlot(0)!=null && tile.getStackInSlot(0).getItem()==Items.gunpowder){
|
|
||||||
if(world.getBlockMetadata(x, y, z)==1){
|
|
||||||
tile.isOn=true;
|
|
||||||
world.playSoundEffect(x, y, z, "random.fizz", 0.1f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
world.playSoundEffect(x, y, z, "random.explode", 0.5f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
if(tile.getStackInSlot(1)!=null){
|
|
||||||
if(tile.getStackInSlot(1).getItem()==ball){
|
|
||||||
tile.decrStackSize(1, 1);
|
|
||||||
cannonball = new EntityCannonBall(world, (double)x-2, (double)y, (double)z, null);
|
|
||||||
cannonball.setVelocity(-tile.getStackInSlot(0).stackSize+world.rand.nextFloat(), 0.25, (world.rand.nextFloat()*2-1)/5);
|
|
||||||
tile.setInventorySlotContents(0, null);
|
|
||||||
tile.markForUpdate();
|
|
||||||
tile.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(tile.getStackInSlot(0)!=null && tile.getStackInSlot(0).getItem()==Items.gunpowder){
|
|
||||||
if(world.getBlockMetadata(x, y, z)==0){
|
|
||||||
tile.isOn=true;
|
|
||||||
world.playSoundEffect(x, y, z, "random.fizz", 0.1f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
world.playSoundEffect(x, y, z, "random.explode", 0.5f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
if(tile.getStackInSlot(1)!=null){
|
|
||||||
if(tile.getStackInSlot(1).getItem()==ball){
|
|
||||||
tile.decrStackSize(1, 1);
|
|
||||||
cannonball = new EntityCannonBall(world, (double)x, (double)y, (double)z+2, null);
|
|
||||||
cannonball.setVelocity((world.rand.nextFloat()*2-1)/5, 0.25, tile.getStackInSlot(0).stackSize-world.rand.nextFloat());
|
|
||||||
tile.setInventorySlotContents(0, null);
|
|
||||||
tile.markForUpdate();
|
|
||||||
tile.markDirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tile.markForUpdate();
|
tile.markForUpdate();
|
||||||
tile.markDirty();
|
tile.markDirty();
|
||||||
return cannonball;
|
return cannonball;
|
||||||
@@ -186,9 +148,6 @@ public class Cannon_28 extends BlockContainer{
|
|||||||
{
|
{
|
||||||
TileCannon_28 tileEnt = (TileCannon_28) world.getTileEntity(x, y, z);
|
TileCannon_28 tileEnt = (TileCannon_28) world.getTileEntity(x, y, z);
|
||||||
if(tileEnt.isOn==false){
|
if(tileEnt.isOn==false){
|
||||||
tileEnt.isOn=true;
|
|
||||||
world.playSoundEffect(x, y, z, "random.fizz", 0.1f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
world.playSoundEffect(x, y, z, "random.explode", 0.5f, world.rand.nextFloat()/0.5f * 0.1F + 0.8F);
|
|
||||||
world.spawnEntityInWorld(shootCannon(world, x, y, z));
|
world.spawnEntityInWorld(shootCannon(world, x, y, z));
|
||||||
tileEnt.markForUpdate();
|
tileEnt.markForUpdate();
|
||||||
tileEnt.markDirty();
|
tileEnt.markDirty();
|
||||||
@@ -245,21 +204,74 @@ public class Cannon_28 extends BlockContainer{
|
|||||||
//11.25
|
//11.25
|
||||||
if(!world.isRemote){
|
if(!world.isRemote){
|
||||||
double a = living.rotationYaw*(-1);
|
double a = living.rotationYaw*(-1);
|
||||||
|
//System.out.println(a);
|
||||||
if(a >= 180-11.25 && a <= 180+11.25){
|
if(a >= 180-11.25 && a <= 180+11.25){
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||||
System.out.println("0");
|
//System.out.println("0");
|
||||||
}
|
}
|
||||||
if(a >= 202.5-11.25 && a <= 202.5+11.25){
|
if(a >= 202.5-11.25 && a <= 202.5+11.25){
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 1, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 1, 2);
|
||||||
System.out.println("1");
|
//System.out.println("1");
|
||||||
}
|
}
|
||||||
if(a >= 225-11.25 && a <= 225+11.25){
|
if(a >= 225-11.25 && a <= 225+11.25){
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||||
System.out.println("2");
|
//System.out.println("2");
|
||||||
|
}
|
||||||
|
if(a >= 247.5-11.25 && a <= 247.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||||
|
//System.out.println("3");
|
||||||
|
}
|
||||||
|
if(a >= 270-11.25 && a <= 270+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||||
|
//System.out.println("4");
|
||||||
|
}
|
||||||
|
if(a >= 292.5-11.25 && a <= 292.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||||
|
//System.out.println("5");
|
||||||
|
}
|
||||||
|
if(a >= 315-11.25 && a <= 315+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 6, 2);
|
||||||
|
//System.out.println("6");
|
||||||
|
}
|
||||||
|
if(a >= 337.5-11.25 && a <= 337.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 7, 2);
|
||||||
|
//System.out.println("7");
|
||||||
|
}
|
||||||
|
if(a >= 360-11.25 || a <= 0+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 8, 2);
|
||||||
|
//System.out.println("8");
|
||||||
|
}
|
||||||
|
if(a >= 22.5-11.25 && a <= 22.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 9, 2);
|
||||||
|
//System.out.println("9");
|
||||||
|
}
|
||||||
|
if(a >= 45-11.25 && a <= 45+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 10, 2);
|
||||||
|
//System.out.println("10");
|
||||||
|
}
|
||||||
|
if(a >= 67.5-11.25 && a <= 67.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 11, 2);
|
||||||
|
//System.out.println("11");
|
||||||
|
}
|
||||||
|
if(a >= 90-11.25 && a <= 90+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 12, 2);
|
||||||
|
//System.out.println("12");
|
||||||
|
}
|
||||||
|
if(a >= 112.5-11.25 && a <= 112.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 13, 2);
|
||||||
|
//System.out.println("13");
|
||||||
|
}
|
||||||
|
if(a >= 135-11.25 && a <= 135+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 14, 2);
|
||||||
|
//System.out.println("14");
|
||||||
|
}
|
||||||
|
if(a >= 157.5-11.25 && a <= 157.5+11.25){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 15, 2);
|
||||||
|
//System.out.println("15");
|
||||||
}
|
}
|
||||||
/*int l = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
/*int l = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
||||||
world.setBlockMetadataWithNotify(x, y, z, l, 2);*/
|
world.setBlockMetadataWithNotify(x, y, z, l, 2);*/
|
||||||
System.out.println((a));
|
//System.out.println((a));
|
||||||
}
|
}
|
||||||
//System.out.println(l);
|
//System.out.println(l);
|
||||||
}
|
}
|
||||||
@@ -269,17 +281,21 @@ public class Cannon_28 extends BlockContainer{
|
|||||||
if(player.isSneaking()==true){
|
if(player.isSneaking()==true){
|
||||||
if(world.getBlockMetadata(x, y, z)==15){
|
if(world.getBlockMetadata(x, y, z)==15){
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 0, 2);
|
||||||
|
//System.out.println(world.getBlockMetadata(x,y,z));
|
||||||
}
|
}
|
||||||
if(world.getBlockMetadata(x, y, z)<15){
|
if(world.getBlockMetadata(x, y, z)<15){
|
||||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)+1, 2);
|
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)+1, 2);
|
||||||
|
//System.out.println(world.getBlockMetadata(x,y,z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!player.isSneaking()==true){
|
if(!player.isSneaking()==true){
|
||||||
if(world.getBlockMetadata(x, y, z)==0){
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 15, 2);
|
|
||||||
}
|
|
||||||
if(world.getBlockMetadata(x, y, z)>0){
|
if(world.getBlockMetadata(x, y, z)>0){
|
||||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)-1, 2);
|
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)-1, 2);
|
||||||
|
//System.out.println(world.getBlockMetadata(x,y,z));
|
||||||
|
}
|
||||||
|
if(world.getBlockMetadata(x, y, z)==0){
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, 15, 2);
|
||||||
|
//System.out.println(world.getBlockMetadata(x,y,z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class Render_Cannon_28 extends TileEntitySpecialRenderer {
|
|||||||
EntityItem entItem = null;
|
EntityItem entItem = null;
|
||||||
|
|
||||||
private static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/Cannon.obj");
|
private static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/Cannon.obj");
|
||||||
|
//private static final ResourceLocation MODEL_CRUCIBLE = new ResourceLocation("kitsumedievalcraft:models/cannonTest.obj");
|
||||||
private static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/Cannon.png");
|
private static final ResourceLocation TEXTURE = new ResourceLocation("kitsumedievalcraft:models/Cannon.png");
|
||||||
private IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
private IModelCustom model = AdvancedModelLoader.loadModel(MODEL_CRUCIBLE);
|
||||||
|
|
||||||
@@ -83,68 +84,73 @@ public class Render_Cannon_28 extends TileEntitySpecialRenderer {
|
|||||||
float scale = 1.05f;
|
float scale = 1.05f;
|
||||||
GL11.glScalef(scale, scale, scale);
|
GL11.glScalef(scale, scale, scale);
|
||||||
|
|
||||||
|
/*if(dir >= 0 && dir <= 15){
|
||||||
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
|
GL11.glTranslatef(0.48F, 0.5F, -0.5F);
|
||||||
|
}*/
|
||||||
|
|
||||||
if(dir == 0){
|
if(dir == 0){
|
||||||
GL11.glTranslatef(0.48F, 0.5F, 0.7F);
|
GL11.glTranslatef(0.45F, 0.5F, 0.66F);
|
||||||
GL11.glRotated(0, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 1){
|
if(dir == 1){
|
||||||
GL11.glTranslatef(0.3F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.52F, 0.5F, 0.64F);
|
||||||
GL11.glRotated(22.5F, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 2){
|
if(dir == 2){
|
||||||
GL11.glTranslatef(0.48F, 0.5F, 0.3F);
|
GL11.glTranslatef(0.60F, 0.5F, 0.60F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 3){
|
if(dir == 3){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.64F, 0.5F, 0.530F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
|
||||||
}
|
|
||||||
if(dir == 3){
|
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 4){
|
if(dir == 4){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.655F, 0.5F, 0.44F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 5){
|
if(dir == 5){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.645F, 0.5F, 0.368F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 6){
|
if(dir == 6){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.60F, 0.5F, 0.3F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 7){
|
if(dir == 7){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.52F, 0.5F, 0.25F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 8){
|
if(dir == 8){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.45F, 0.5F, 0.232F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 9){
|
if(dir == 9){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.375F, 0.5F, 0.25F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 10){
|
if(dir == 10){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.3F, 0.5F, 0.31F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 11){
|
if(dir == 11){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.25F, 0.5F, 0.3675F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
if(dir == 12){
|
if(dir == 12){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
|
GL11.glTranslatef(0.45F, 0.5F, -0.235F);
|
||||||
}
|
}
|
||||||
if(dir == 13){
|
if(dir == 13){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
|
GL11.glTranslatef(0.58F, 0.5F, -0.022F);
|
||||||
}
|
}
|
||||||
if(dir == 14){
|
if(dir == 14){
|
||||||
GL11.glTranslatef(0.7F, 0.5F, 0.48F);
|
GL11.glTranslatef(0.3F, 0.5F, 0.6F);
|
||||||
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
|
}
|
||||||
|
if(dir == 15){
|
||||||
|
GL11.glTranslatef(0.36F, 0.5F, 0.64F);
|
||||||
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
GL11.glRotated(22.5F*dir, 0.0, 1.0F, 0.0F);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|||||||
16
src/main/java/com/kitsu/medievalcraft/util/CannonUtil.java
Normal file
16
src/main/java/com/kitsu/medievalcraft/util/CannonUtil.java
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
package com.kitsu.medievalcraft.util;
|
||||||
|
|
||||||
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
import com.kitsu.medievalcraft.item.ModItems;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public interface CannonUtil {
|
||||||
|
|
||||||
|
/*public static float[] angles = new float[] {90, (float)247.5, 270, (float)292.5, 315, (float)337.5, 0, (float)22.5, 45, (float)67.5, 90, (float) 112.5,
|
||||||
|
135, (float) 157.5, 180, (float)202.5};*/
|
||||||
|
public float[] angles = new float[] {180, (float)202.5, 225, (float)247.5, 270, (float)292.5, 315, (float)337.5, 0, (float)22.5, 45, (float)67.5, 90, (float) 112.5,
|
||||||
|
135, (float) 157.5,};
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Blender MTL File: 'cannon.blend'
|
||||||
|
# Material Count: 2
|
||||||
|
|
||||||
|
newmtl None
|
||||||
|
Ns 0
|
||||||
|
Ka 0.000000 0.000000 0.000000
|
||||||
|
Kd 0.8 0.8 0.8
|
||||||
|
Ks 0.8 0.8 0.8
|
||||||
|
d 1
|
||||||
|
illum 2
|
||||||
|
map_Kd /home/kitsudesktop/Development/Blends/Cannon.png
|
||||||
|
|
||||||
|
newmtl None_NONE
|
||||||
|
Ns 0
|
||||||
|
Ka 0.000000 0.000000 0.000000
|
||||||
|
Kd 0.8 0.8 0.8
|
||||||
|
Ks 0.8 0.8 0.8
|
||||||
|
d 1
|
||||||
|
illum 2
|
||||||
@@ -0,0 +1,281 @@
|
|||||||
|
# Blender v2.71 (sub 0) OBJ File: 'cannon.blend'
|
||||||
|
# www.blender.org
|
||||||
|
mtllib cannonTest.mtl
|
||||||
|
o Cube_Cube.001
|
||||||
|
v -0.125000 -0.125000 -1.375000
|
||||||
|
v 0.125000 -0.125000 -1.375000
|
||||||
|
v -0.125000 0.125000 -1.375000
|
||||||
|
v -0.250000 -0.250000 0.650000
|
||||||
|
v -0.225000 -0.225000 -1.225000
|
||||||
|
v 0.225000 -0.225000 -1.225000
|
||||||
|
v 0.250000 -0.250000 0.650000
|
||||||
|
v -0.250000 0.250000 0.650000
|
||||||
|
v -0.225000 0.225000 -1.225000
|
||||||
|
v 0.225000 0.225000 -1.225000
|
||||||
|
v 0.250000 0.250000 0.650000
|
||||||
|
v -0.250000 -0.250000 -1.225000
|
||||||
|
v -0.250000 -0.250000 -1.375000
|
||||||
|
v 0.250000 -0.250000 -1.375000
|
||||||
|
v 0.250000 -0.250000 -1.225000
|
||||||
|
v -0.250000 0.250000 -1.225000
|
||||||
|
v -0.250000 0.250000 -1.375000
|
||||||
|
v 0.250000 0.250000 -1.375000
|
||||||
|
v 0.250000 0.250000 -1.225000
|
||||||
|
v 0.125000 0.125000 -1.375000
|
||||||
|
v -0.125000 0.125000 0.425000
|
||||||
|
v -0.125000 -0.125000 0.425000
|
||||||
|
v 0.125000 -0.125000 0.425000
|
||||||
|
v 0.125000 0.125000 0.425000
|
||||||
|
v -0.100940 -0.100940 0.650000
|
||||||
|
v 0.100940 -0.100940 0.650000
|
||||||
|
v -0.100940 0.100940 0.650000
|
||||||
|
v 0.100940 0.100940 0.650000
|
||||||
|
v -0.100940 -0.100940 0.725000
|
||||||
|
v 0.100940 -0.100940 0.725000
|
||||||
|
v -0.100940 0.100940 0.725000
|
||||||
|
v 0.100940 0.100940 0.725000
|
||||||
|
v 0.405154 -0.054574 -0.256972
|
||||||
|
v 0.405154 -0.054574 -0.150739
|
||||||
|
v 0.405154 0.051659 -0.256972
|
||||||
|
v 0.405154 0.051659 -0.150739
|
||||||
|
v 0.228100 0.051659 -0.256972
|
||||||
|
v 0.228100 0.051659 -0.150739
|
||||||
|
v 0.228100 -0.054574 -0.256972
|
||||||
|
v 0.228100 -0.054574 -0.150739
|
||||||
|
v -0.233931 -0.054574 -0.256972
|
||||||
|
v -0.233931 -0.054574 -0.150739
|
||||||
|
v -0.233931 0.051659 -0.256972
|
||||||
|
v -0.233931 0.051659 -0.150739
|
||||||
|
v -0.410986 0.051659 -0.256972
|
||||||
|
v -0.410986 0.051659 -0.150739
|
||||||
|
v -0.410986 -0.054574 -0.256972
|
||||||
|
v -0.410986 -0.054574 -0.150739
|
||||||
|
v -0.000000 0.172810 -0.288289
|
||||||
|
v -0.000000 0.641707 -0.209682
|
||||||
|
v 0.078607 0.172810 -0.209682
|
||||||
|
v -0.000000 0.172810 -0.131075
|
||||||
|
v -0.078607 0.172810 -0.209682
|
||||||
|
vt 0.425000 0.440784
|
||||||
|
vt 0.237500 0.440784
|
||||||
|
vt 0.227083 0.005226
|
||||||
|
vt 0.735416 0.625443
|
||||||
|
vt 0.735416 0.451232
|
||||||
|
vt 0.777083 0.451232
|
||||||
|
vt 0.006250 0.005226
|
||||||
|
vt 0.214583 0.005226
|
||||||
|
vt 0.204167 0.440784
|
||||||
|
vt 0.679167 0.005226
|
||||||
|
vt 0.866667 0.005226
|
||||||
|
vt 0.877083 0.440779
|
||||||
|
vt 0.645833 0.440779
|
||||||
|
vt 0.458333 0.440779
|
||||||
|
vt 0.447917 0.005226
|
||||||
|
vt 0.831249 0.451232
|
||||||
|
vt 0.831249 0.625443
|
||||||
|
vt 0.789583 0.625443
|
||||||
|
vt 0.006250 0.994774
|
||||||
|
vt 0.006250 0.820563
|
||||||
|
vt 0.016667 0.829274
|
||||||
|
vt 0.681250 0.625443
|
||||||
|
vt 0.681250 0.451232
|
||||||
|
vt 0.722916 0.451232
|
||||||
|
vt 0.343750 0.625447
|
||||||
|
vt 0.343750 0.451237
|
||||||
|
vt 0.385416 0.451237
|
||||||
|
vt 0.162500 0.494789
|
||||||
|
vt 0.214583 0.451237
|
||||||
|
vt 0.214583 0.625447
|
||||||
|
vt 0.204167 0.986063
|
||||||
|
vt 0.214583 0.994774
|
||||||
|
vt 0.993750 0.423329
|
||||||
|
vt 0.889583 0.005226
|
||||||
|
vt 0.889583 0.423329
|
||||||
|
vt 0.564583 0.869334
|
||||||
|
vt 0.668750 0.451232
|
||||||
|
vt 0.564583 0.451232
|
||||||
|
vt 0.214583 0.820563
|
||||||
|
vt 0.254436 0.699925
|
||||||
|
vt 0.233603 0.699925
|
||||||
|
vt 0.233603 0.629586
|
||||||
|
vt 0.152475 0.758175
|
||||||
|
vt 0.152475 0.687836
|
||||||
|
vt 0.214583 0.635900
|
||||||
|
vt 0.068359 0.758175
|
||||||
|
vt 0.214583 0.810111
|
||||||
|
vt 0.068359 0.687836
|
||||||
|
vt 0.006250 0.810111
|
||||||
|
vt 0.006250 0.635900
|
||||||
|
vt 0.227083 0.619134
|
||||||
|
vt 0.227083 0.548795
|
||||||
|
vt 0.311200 0.548795
|
||||||
|
vt 0.843749 0.602363
|
||||||
|
vt 0.843749 0.532024
|
||||||
|
vt 0.864582 0.532024
|
||||||
|
vt 0.857619 0.706234
|
||||||
|
vt 0.836786 0.706234
|
||||||
|
vt 0.836786 0.635895
|
||||||
|
vt 0.843749 0.451232
|
||||||
|
vt 0.864582 0.451232
|
||||||
|
vt 0.864582 0.521571
|
||||||
|
vt 0.296445 0.701728
|
||||||
|
vt 0.296445 0.738742
|
||||||
|
vt 0.266936 0.738742
|
||||||
|
vt 0.331250 0.538342
|
||||||
|
vt 0.227083 0.451237
|
||||||
|
vt 0.227083 0.538342
|
||||||
|
vt 0.681250 0.745051
|
||||||
|
vt 0.681250 0.708037
|
||||||
|
vt 0.710759 0.708037
|
||||||
|
vt 0.435417 0.005226
|
||||||
|
vt 0.777083 0.625443
|
||||||
|
vt 0.016667 0.440784
|
||||||
|
vt 0.668750 0.440779
|
||||||
|
vt 0.656250 0.005226
|
||||||
|
vt 0.789583 0.451232
|
||||||
|
vt 0.016667 0.986063
|
||||||
|
vt 0.722916 0.625443
|
||||||
|
vt 0.385416 0.625447
|
||||||
|
vt 0.204167 0.829274
|
||||||
|
vt 0.254436 0.629586
|
||||||
|
vt 0.311200 0.619134
|
||||||
|
vt 0.864582 0.602363
|
||||||
|
vt 0.857619 0.635895
|
||||||
|
vt 0.843749 0.521571
|
||||||
|
vt 0.266936 0.701728
|
||||||
|
vt 0.331250 0.451237
|
||||||
|
vt 0.710759 0.745051
|
||||||
|
vt 0.058333 0.494789
|
||||||
|
vt 0.006250 0.451237
|
||||||
|
vt 0.058333 0.581895
|
||||||
|
vt 0.889583 0.433782
|
||||||
|
vt 0.993750 0.851885
|
||||||
|
vt 0.993750 0.433782
|
||||||
|
vt 0.162500 0.581895
|
||||||
|
vt 0.006250 0.625447
|
||||||
|
vt 0.400513 0.697589
|
||||||
|
vt 0.400513 0.635900
|
||||||
|
vt 0.430022 0.635900
|
||||||
|
vt 0.397916 0.585068
|
||||||
|
vt 0.397916 0.523379
|
||||||
|
vt 0.427425 0.523379
|
||||||
|
vt 0.311200 0.691276
|
||||||
|
vt 0.266936 0.691276
|
||||||
|
vt 0.266936 0.629586
|
||||||
|
vt 0.725514 0.697585
|
||||||
|
vt 0.681250 0.697585
|
||||||
|
vt 0.681250 0.635895
|
||||||
|
vt 0.552083 0.869334
|
||||||
|
vt 0.447917 0.451232
|
||||||
|
vt 0.447917 0.869334
|
||||||
|
vt 0.794777 0.697585
|
||||||
|
vt 0.794777 0.635895
|
||||||
|
vt 0.824286 0.635895
|
||||||
|
vt 0.427425 0.451237
|
||||||
|
vt 0.427425 0.512926
|
||||||
|
vt 0.397916 0.512926
|
||||||
|
vt 0.738014 0.635895
|
||||||
|
vt 0.782277 0.635895
|
||||||
|
vt 0.782277 0.697585
|
||||||
|
vt 0.388013 0.697589
|
||||||
|
vt 0.343750 0.697589
|
||||||
|
vt 0.343750 0.635900
|
||||||
|
vt 0.993750 0.005226
|
||||||
|
vt 0.668750 0.869334
|
||||||
|
vt 0.889583 0.851885
|
||||||
|
vt 0.430022 0.697589
|
||||||
|
vt 0.427425 0.585068
|
||||||
|
vt 0.311200 0.629586
|
||||||
|
vt 0.725514 0.635895
|
||||||
|
vt 0.552083 0.451232
|
||||||
|
vt 0.824286 0.697585
|
||||||
|
vt 0.397916 0.451237
|
||||||
|
vt 0.738014 0.697585
|
||||||
|
vt 0.388013 0.635900
|
||||||
|
vt 0.000000 0.000000
|
||||||
|
usemtl None
|
||||||
|
s off
|
||||||
|
f 9/1 5/2 4/3
|
||||||
|
f 17/4 13/5 12/6
|
||||||
|
f 11/7 7/8 6/9
|
||||||
|
f 5/10 6/11 7/12
|
||||||
|
f 10/13 9/14 8/15
|
||||||
|
f 19/16 15/17 14/18
|
||||||
|
f 15/19 19/20 10/21
|
||||||
|
f 13/22 14/23 15/24
|
||||||
|
f 18/25 17/26 16/27
|
||||||
|
f 20/28 18/29 14/30
|
||||||
|
f 5/31 12/32 15/19
|
||||||
|
f 21/33 20/34 24/35
|
||||||
|
f 20/36 23/37 24/38
|
||||||
|
f 10/21 19/20 16/39
|
||||||
|
f 16/39 12/32 5/31
|
||||||
|
f 27/40 31/41 32/42
|
||||||
|
f 25/43 27/44 8/45
|
||||||
|
f 26/46 25/43 4/47
|
||||||
|
f 28/48 26/46 7/49
|
||||||
|
f 27/44 28/48 11/50
|
||||||
|
f 30/51 32/52 31/53
|
||||||
|
f 26/54 28/55 32/56
|
||||||
|
f 26/57 30/58 29/59
|
||||||
|
f 25/60 29/61 31/62
|
||||||
|
f 36/63 34/64 33/65
|
||||||
|
f 22/66 24/67 23/68
|
||||||
|
f 48/69 46/70 45/71
|
||||||
|
f 8/72 9/1 4/3
|
||||||
|
f 16/73 17/4 12/6
|
||||||
|
f 10/74 11/7 6/9
|
||||||
|
f 4/75 5/10 7/12
|
||||||
|
f 11/76 10/13 8/15
|
||||||
|
f 18/77 19/16 14/18
|
||||||
|
f 6/78 15/19 10/21
|
||||||
|
f 12/79 13/22 15/24
|
||||||
|
f 19/80 18/25 16/27
|
||||||
|
f 6/78 5/31 15/19
|
||||||
|
f 9/81 10/21 16/39
|
||||||
|
f 9/81 16/39 5/31
|
||||||
|
f 28/82 27/40 32/42
|
||||||
|
f 4/47 25/43 8/45
|
||||||
|
f 7/49 26/46 4/47
|
||||||
|
f 11/50 28/48 7/49
|
||||||
|
f 8/45 27/44 11/50
|
||||||
|
f 29/83 30/51 31/53
|
||||||
|
f 30/84 26/54 32/56
|
||||||
|
f 25/85 26/57 29/59
|
||||||
|
f 27/86 25/60 31/62
|
||||||
|
f 35/87 36/63 33/65
|
||||||
|
f 21/88 24/67 22/66
|
||||||
|
f 47/89 48/69 45/71
|
||||||
|
f 3/90 17/91 18/29
|
||||||
|
f 17/91 3/90 1/92
|
||||||
|
f 23/93 1/94 22/95
|
||||||
|
f 2/96 14/30 13/97
|
||||||
|
f 35/98 37/99 38/100
|
||||||
|
f 39/101 33/102 34/103
|
||||||
|
f 38/104 40/105 34/106
|
||||||
|
f 35/107 33/108 39/109
|
||||||
|
f 22/110 3/111 21/112
|
||||||
|
f 43/113 45/114 46/115
|
||||||
|
f 47/116 41/117 42/118
|
||||||
|
f 46/119 48/120 42/121
|
||||||
|
f 43/122 41/123 47/124
|
||||||
|
f 20/28 3/90 18/29
|
||||||
|
f 2/96 20/28 14/30
|
||||||
|
f 13/97 17/91 1/92
|
||||||
|
f 3/125 20/34 21/33
|
||||||
|
f 2/126 23/37 20/36
|
||||||
|
f 2/127 1/94 23/93
|
||||||
|
f 1/92 2/96 13/97
|
||||||
|
f 36/128 35/98 38/100
|
||||||
|
f 40/129 39/101 34/103
|
||||||
|
f 36/130 38/104 34/106
|
||||||
|
f 37/131 35/107 39/109
|
||||||
|
f 1/132 3/111 22/110
|
||||||
|
f 44/133 43/113 46/115
|
||||||
|
f 48/134 47/116 42/118
|
||||||
|
f 44/135 46/119 42/121
|
||||||
|
f 45/136 43/122 47/124
|
||||||
|
usemtl None_NONE
|
||||||
|
f 52/137 50/137 53/137
|
||||||
|
f 49/137 50/137 51/137
|
||||||
|
f 53/137 50/137 49/137
|
||||||
|
f 51/137 50/137 52/137
|
||||||
Reference in New Issue
Block a user