cannon mods
This commit is contained in:
Binary file not shown.
@@ -3,7 +3,7 @@
|
|||||||
"modid": "kitsumedievalcraft",
|
"modid": "kitsumedievalcraft",
|
||||||
"name": "ForgeCraft",
|
"name": "ForgeCraft",
|
||||||
"description": "ForgeCraft",
|
"description": "ForgeCraft",
|
||||||
"version": "{2.4.0}",
|
"version": "{2.4.1}",
|
||||||
"mcversion": "{1.7.10}",
|
"mcversion": "{1.7.10}",
|
||||||
"url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2296334-wip-kitsus-forgecraft-blacksmith-style-forging",
|
"url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2296334-wip-kitsus-forgecraft-blacksmith-style-forging",
|
||||||
"updateUrl": "https://bitbucket.org/kitsushadow/kitsus-forgecraft/downloads",
|
"updateUrl": "https://bitbucket.org/kitsushadow/kitsus-forgecraft/downloads",
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import com.kitsu.medievalcraft.events.BucketHandle;
|
|||||||
import com.kitsu.medievalcraft.events.EventHandle;
|
import com.kitsu.medievalcraft.events.EventHandle;
|
||||||
import com.kitsu.medievalcraft.gui.GuiHandler;
|
import com.kitsu.medievalcraft.gui.GuiHandler;
|
||||||
import com.kitsu.medievalcraft.item.ModItems;
|
import com.kitsu.medievalcraft.item.ModItems;
|
||||||
import com.kitsu.medievalcraft.packethandle.cannon.MsgHandleCannon;
|
|
||||||
import com.kitsu.medievalcraft.packethandle.cannon.MsgPacketCannon;
|
|
||||||
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgHandleCuredLeatherX;
|
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgHandleCuredLeatherX;
|
||||||
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgHandleCuredLeatherY;
|
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgHandleCuredLeatherY;
|
||||||
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgHandleCuredLeatherZ;
|
import com.kitsu.medievalcraft.packethandle.curedLeather.MsgHandleCuredLeatherZ;
|
||||||
@@ -60,7 +58,7 @@ public class Main {
|
|||||||
|
|
||||||
public static final String MODID = "kitsumedievalcraft";
|
public static final String MODID = "kitsumedievalcraft";
|
||||||
public static final String MODNAME = "ForgeCraft";
|
public static final String MODNAME = "ForgeCraft";
|
||||||
public static final String VERSION = "2.4.0";
|
public static final String VERSION = "2.4.1";
|
||||||
|
|
||||||
public static SimpleNetworkWrapper sNet;
|
public static SimpleNetworkWrapper sNet;
|
||||||
|
|
||||||
@@ -90,8 +88,8 @@ public class Main {
|
|||||||
sNet.registerMessage(MsgHandleCuredLeatherZ.class, MsgPacketCuredLeatherZ.class, 8, Side.SERVER);
|
sNet.registerMessage(MsgHandleCuredLeatherZ.class, MsgPacketCuredLeatherZ.class, 8, Side.SERVER);
|
||||||
sNet.registerMessage(MsgHandleShelfCase.class, MsgPacketShelfCase.class, 9, Side.SERVER);
|
sNet.registerMessage(MsgHandleShelfCase.class, MsgPacketShelfCase.class, 9, Side.SERVER);
|
||||||
sNet.registerMessage(MsgHandleForge.class, MsgPacketForge.class, 10, Side.SERVER);
|
sNet.registerMessage(MsgHandleForge.class, MsgPacketForge.class, 10, Side.SERVER);
|
||||||
sNet.registerMessage(MsgHandleCannon.class, MsgPacketCannon.class, 11, Side.CLIENT);
|
//sNet.registerMessage(MsgHandleCannon.class, MsgPacketCannon.class, 11, Side.CLIENT);
|
||||||
sNet.registerMessage(MsgHandleCannon.class, MsgPacketCannon.class, 12, Side.SERVER);
|
//sNet.registerMessage(MsgHandleCannon.class, MsgPacketCannon.class, 12, Side.SERVER);
|
||||||
//sNet.registerMessage(MsgHandleCannonX.class, MsgPacketCannonX.class, 12, Side.CLIENT);
|
//sNet.registerMessage(MsgHandleCannonX.class, MsgPacketCannonX.class, 12, Side.CLIENT);
|
||||||
//sNet.registerMessage(MsgHandleCannonY.class, MsgPacketCannonY.class, 13, Side.CLIENT);
|
//sNet.registerMessage(MsgHandleCannonY.class, MsgPacketCannonY.class, 13, Side.CLIENT);
|
||||||
//sNet.registerMessage(MsgHandleCannonZ.class, MsgPacketCannonZ.class, 14, Side.CLIENT);
|
//sNet.registerMessage(MsgHandleCannonZ.class, MsgPacketCannonZ.class, 14, Side.CLIENT);
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ public class Cannon_28 extends BlockContainer implements CannonUtil{
|
|||||||
//this.isFlammable(world, x, y, z, face);
|
//this.isFlammable(world, x, y, z, face);
|
||||||
//(xmin, ymin, zmin,
|
//(xmin, ymin, zmin,
|
||||||
// xmax, ymax, zmax)
|
// xmax, ymax, zmax)
|
||||||
this.setBlockBounds(0.0F, 0.00F, 0.0F,
|
this.setBlockBounds(0.0F, 0.0F, 0.0F,
|
||||||
1.0F, 1.00F, 1.0F);
|
1.0F, 0.85F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -97,13 +97,13 @@ public class Cannon_28 extends BlockContainer implements CannonUtil{
|
|||||||
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*(Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])))), (double)y+0.5, (double)z+(2*(Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])))), null);
|
cannonball = new EntityCannonBall(world, (double)x+((Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])))/2), (double)y+0.5, (double)z+((Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])))/2), null);
|
||||||
//System.out.println(angles[world.getBlockMetadata(x, y, z)]);
|
//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.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)])));
|
||||||
//System.out.println(Math.sin(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)));
|
//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)));
|
||||||
cannonball.motionX = ((tile.getStackInSlot(0).stackSize*(Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))))-(world.rand.nextFloat()/4));
|
cannonball.motionX = ((tile.getStackInSlot(0).stackSize*(Math.sin(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))))-(world.rand.nextFloat()/4));
|
||||||
cannonball.motionY = 0.25;
|
cannonball.motionY = 0.02;
|
||||||
cannonball.motionZ = ((tile.getStackInSlot(0).stackSize*(Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))))-(world.rand.nextFloat()/4));
|
cannonball.motionZ = ((tile.getStackInSlot(0).stackSize*(Math.cos(Math.toRadians(angles[world.getBlockMetadata(x, y, z)]))))-(world.rand.nextFloat()/4));
|
||||||
tile.setInventorySlotContents(0, null);
|
tile.setInventorySlotContents(0, null);
|
||||||
tile.markForUpdate();
|
tile.markForUpdate();
|
||||||
@@ -161,7 +161,7 @@ public class Cannon_28 extends BlockContainer implements CannonUtil{
|
|||||||
/**
|
/**
|
||||||
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
||||||
*/
|
*/
|
||||||
@Override
|
/*@Override
|
||||||
public void setBlockBoundsBasedOnState(IBlockAccess iBlock, int x, int y, int z)
|
public void setBlockBoundsBasedOnState(IBlockAccess iBlock, int x, int y, int z)
|
||||||
{
|
{
|
||||||
int l = iBlock.getBlockMetadata(x, y, z) & 7;
|
int l = iBlock.getBlockMetadata(x, y, z) & 7;
|
||||||
@@ -184,18 +184,18 @@ public class Cannon_28 extends BlockContainer implements CannonUtil{
|
|||||||
case 5:
|
case 5:
|
||||||
this.setBlockBounds(0F, 0.0F, 0F, 1F, 1F, 1F);
|
this.setBlockBounds(0F, 0.0F, 0F, 1F, 1F, 1F);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
||||||
* cleared to be reused)
|
* cleared to be reused)
|
||||||
*/
|
*/
|
||||||
@Override
|
/*@Override
|
||||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
||||||
{
|
{
|
||||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||||
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
return super.getCollisionBoundingBoxFromPool(world, x, y, z);
|
||||||
}
|
}*/
|
||||||
/**
|
/**
|
||||||
* Called when the block is placed in the world.
|
* Called when the block is placed in the world.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public class EntityCannonBall extends Entity implements CannonUtil{
|
|||||||
private int field_145791_d = -1;
|
private int field_145791_d = -1;
|
||||||
private int field_145792_e = -1;
|
private int field_145792_e = -1;
|
||||||
private int field_145789_f = -1;
|
private int field_145789_f = -1;
|
||||||
|
private int h;
|
||||||
public Entity shootingEntity;
|
public Entity shootingEntity;
|
||||||
private boolean smoke = true;
|
private boolean smoke = true;
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ public class EntityCannonBall extends Entity implements CannonUtil{
|
|||||||
this.preventEntitySpawning = true;
|
this.preventEntitySpawning = true;
|
||||||
this.setSize(0.5F, 0.5F);
|
this.setSize(0.5F, 0.5F);
|
||||||
//this.yOffset = this.height / 2.0F;
|
//this.yOffset = this.height / 2.0F;
|
||||||
this.boundingBox.setBounds(0.3, 0.3, 0.3, 0.7, 0.7, 0.7);
|
this.boundingBox.setBounds(0.49, 0.49, 0.49, 0.51, 0.51, 0.51);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ public class EntityCannonBall extends Entity implements CannonUtil{
|
|||||||
this.setPosition(x, y, z);
|
this.setPosition(x, y, z);
|
||||||
float f = (float)(Math.random() * Math.PI * 2.0D);
|
float f = (float)(Math.random() * Math.PI * 2.0D);
|
||||||
this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
|
this.motionX = (double)(-((float)Math.sin((double)f)) * 0.02F);
|
||||||
this.motionY = 0.20000000298023224D;
|
this.motionY = 0.05D;
|
||||||
this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
|
this.motionZ = (double)(-((float)Math.cos((double)f)) * 0.02F);
|
||||||
this.prevPosX = x;
|
this.prevPosX = x;
|
||||||
this.prevPosY = y;
|
this.prevPosY = y;
|
||||||
@@ -61,12 +62,16 @@ public class EntityCannonBall extends Entity implements CannonUtil{
|
|||||||
|
|
||||||
public void onUpdate()
|
public void onUpdate()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(h > 0 && h < 2){
|
||||||
if(this.smoke==true){
|
if(this.smoke==true){
|
||||||
for(int g = 0; g < 20; g++){
|
for(int g = 0; g < 50; g++){
|
||||||
this.worldObj.spawnParticle("explode", this.posX + worldObj.rand.nextFloat()*2 - 1, this.posY + worldObj.rand.nextFloat()*2 - 1, this.posZ + worldObj.rand.nextFloat()*2 - 1,0.0, 0.0, 0.0);
|
this.worldObj.spawnParticle("explode", this.posX + (worldObj.rand.nextFloat()*2 - 1), this.posY + (worldObj.rand.nextFloat()*2 - 1), (this.posZ + worldObj.rand.nextFloat()*2 - 1),0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
this.smoke=false;
|
this.smoke=false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
h++;
|
||||||
/*double x = this.posX;
|
/*double x = this.posX;
|
||||||
double y = this.posY;
|
double y = this.posY;
|
||||||
double z = this.posZ;
|
double z = this.posZ;
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
package com.kitsu.medievalcraft.packethandle.cannon;
|
|
||||||
|
|
||||||
import com.kitsu.medievalcraft.tileents.cannon.TileCannon_28;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
|
||||||
|
|
||||||
public class MsgHandleCannon implements IMessageHandler<MsgPacketCannon, IMessage>{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IMessage onMessage(MsgPacketCannon message, MessageContext ctx) {
|
|
||||||
TileCannon_28.smoke = message.fired;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
package com.kitsu.medievalcraft.packethandle.cannon;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
|
||||||
import io.netty.buffer.ByteBuf;
|
|
||||||
|
|
||||||
public class MsgPacketCannon implements IMessage {
|
|
||||||
|
|
||||||
public boolean fired;
|
|
||||||
|
|
||||||
public MsgPacketCannon() {}
|
|
||||||
|
|
||||||
public MsgPacketCannon(boolean x){
|
|
||||||
this.fired = x;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void fromBytes(ByteBuf buf) {
|
|
||||||
this.fired = buf.readBoolean();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void toBytes(ByteBuf buf) {
|
|
||||||
buf.writeBoolean(this.fired);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -3,21 +3,21 @@
|
|||||||
mtllib cannon_mount.mtl
|
mtllib cannon_mount.mtl
|
||||||
o Cube
|
o Cube
|
||||||
v -0.413288 -0.407050 0.966262
|
v -0.413288 -0.407050 0.966262
|
||||||
v -0.413288 -0.407050 -0.666261
|
v -0.413288 -0.407050 -0.448567
|
||||||
v 0.400811 -0.407050 0.966262
|
v 0.400811 -0.407050 0.966262
|
||||||
v -0.413288 -0.342950 0.966262
|
v -0.413288 -0.342950 0.966262
|
||||||
v 0.400811 -0.342950 0.966262
|
v 0.400811 -0.342950 0.966262
|
||||||
v -0.291173 -0.342950 -0.666261
|
v -0.291173 -0.342950 -0.448567
|
||||||
v -0.291173 -0.342950 0.966262
|
v -0.291173 -0.342950 0.966262
|
||||||
v -0.413288 -0.066373 0.966262
|
v -0.413288 -0.066373 0.966262
|
||||||
v -0.413288 -0.066373 -0.666261
|
v -0.413288 -0.066373 -0.448567
|
||||||
v -0.291173 -0.066373 -0.666261
|
v -0.291173 -0.066373 -0.448567
|
||||||
v -0.291173 -0.066373 0.966262
|
v -0.291173 -0.066373 0.966262
|
||||||
v -0.413288 -0.066373 -0.055968
|
v -0.413288 -0.066373 -0.055968
|
||||||
v -0.291173 -0.066373 0.074468
|
v -0.291173 -0.066373 0.074468
|
||||||
v -0.291173 -0.066373 -0.055968
|
v -0.291173 -0.066373 -0.055968
|
||||||
v -0.413288 0.058627 -0.666261
|
v -0.413288 0.058627 -0.448567
|
||||||
v -0.291173 0.058627 -0.666261
|
v -0.291173 0.058627 -0.448567
|
||||||
v -0.413288 0.058627 -0.055968
|
v -0.413288 0.058627 -0.055968
|
||||||
v -0.291173 0.058627 -0.055968
|
v -0.291173 0.058627 -0.055968
|
||||||
v -0.413288 -0.066373 0.074468
|
v -0.413288 -0.066373 0.074468
|
||||||
@@ -26,18 +26,18 @@ v -0.413288 -0.066373 0.074468
|
|||||||
v -0.291173 0.058627 0.074468
|
v -0.291173 0.058627 0.074468
|
||||||
v -0.413288 0.058627 0.074468
|
v -0.413288 0.058627 0.074468
|
||||||
v 0.278889 -0.342950 0.966262
|
v 0.278889 -0.342950 0.966262
|
||||||
v 0.278889 -0.342950 -0.666261
|
v 0.278889 -0.342950 -0.448567
|
||||||
v 0.401004 -0.407050 -0.666261
|
v 0.401004 -0.407050 -0.448567
|
||||||
v 0.401004 -0.342950 0.966262
|
v 0.401004 -0.342950 0.966262
|
||||||
v 0.278889 -0.066373 0.966262
|
v 0.278889 -0.066373 0.966262
|
||||||
v 0.278889 -0.066373 -0.666261
|
v 0.278889 -0.066373 -0.448567
|
||||||
v 0.401004 -0.066373 -0.666261
|
v 0.401004 -0.066373 -0.448567
|
||||||
v 0.401004 -0.066373 0.966262
|
v 0.401004 -0.066373 0.966262
|
||||||
v 0.278889 -0.066373 -0.055968
|
v 0.278889 -0.066373 -0.055968
|
||||||
v 0.401004 -0.066373 0.074468
|
v 0.401004 -0.066373 0.074468
|
||||||
v 0.401004 -0.066373 -0.055968
|
v 0.401004 -0.066373 -0.055968
|
||||||
v 0.278889 0.058627 -0.666261
|
v 0.278889 0.058627 -0.448567
|
||||||
v 0.401004 0.058627 -0.666261
|
v 0.401004 0.058627 -0.448567
|
||||||
v 0.278889 0.058627 -0.055968
|
v 0.278889 0.058627 -0.055968
|
||||||
v 0.401004 0.058627 -0.055968
|
v 0.401004 0.058627 -0.055968
|
||||||
v 0.278889 -0.066373 0.074468
|
v 0.278889 -0.066373 0.074468
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"modid": "kitsumedievalcraft",
|
"modid": "kitsumedievalcraft",
|
||||||
"name": "ForgeCraft",
|
"name": "ForgeCraft",
|
||||||
"description": "ForgeCraft",
|
"description": "ForgeCraft",
|
||||||
"version": "{2.4.0}",
|
"version": "{2.4.1}",
|
||||||
"mcversion": "{1.7.10}",
|
"mcversion": "{1.7.10}",
|
||||||
"url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2296334-wip-kitsus-forgecraft-blacksmith-style-forging",
|
"url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2296334-wip-kitsus-forgecraft-blacksmith-style-forging",
|
||||||
"updateUrl": "https://bitbucket.org/kitsushadow/kitsus-forgecraft/downloads",
|
"updateUrl": "https://bitbucket.org/kitsushadow/kitsus-forgecraft/downloads",
|
||||||
|
|||||||
Reference in New Issue
Block a user