aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordohyun22 <michael0702@naver.com>2017-03-24 12:24:02 +0900
committerGitHub <noreply@github.com>2017-03-24 12:24:02 +0900
commit945a13d4ae4c4f1cd47e481a0f3d3f980e353ae5 (patch)
tree5654f8804f8fd7fd1c8a03e335fa06a2d7aaad42 /src
parent5a7e797883be698c59b8702c2a3cda2d41d220b4 (diff)
downloadGT5-Unofficial-945a13d4ae4c4f1cd47e481a0f3d3f980e353ae5.tar.gz
GT5-Unofficial-945a13d4ae4c4f1cd47e481a0f3d3f980e353ae5.tar.bz2
GT5-Unofficial-945a13d4ae4c4f1cd47e481a0f3d3f980e353ae5.zip
Fixed various Bugs on the Powderbarrel.
Fixed PrimedTNT Entity being spawned on client side when destroyed by player. Fixed PrimedTNT Entity spawning at misplaced location (about 0.5m from the center of the block). Fixed fuse sound not being played when ignited. Fixed Powderbarrel not being able to spawn PrimedTNT Entity when destroyed by explosion.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
index 860760a789..40d2d1a5fe 100644
--- a/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
+++ b/src/main/java/gregtech/common/blocks/GT_Block_Reinforced.java
@@ -215,10 +215,10 @@ public class GT_Block_Reinforced extends GT_Generic_Block {
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z)
{
- if(world.getBlockMetadata(x, y, z)==5){
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, player == null ? null : player);
+ if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, player == null ? null : player);
world.spawnEntityInWorld(entitytntprimed);
- world.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F);
+ world.playSoundAtEntity(entitytntprimed, "game.tnt.primed", 1.0F, 1.0F);
world.setBlockToAir(x, y, z);
return false;
@@ -241,12 +241,13 @@ public class GT_Block_Reinforced extends GT_Generic_Block {
}
}
- public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
- {
- if(!world.isRemote && world.getBlockMetadata(x, y, z)==5){
- EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x, y, z, explosion.getExplosivePlacedBy());
- entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8);
- world.spawnEntityInWorld(entitytntprimed);}
+ public void onBlockExploded(World world, int x, int y, int z, Explosion explosion) {
+ if (!world.isRemote && world.getBlockMetadata(x, y, z)==5){
+ EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(world, x + 0.5F, y + 0.5F, z + 0.5F, explosion.getExplosivePlacedBy());
+ entitytntprimed.fuse = (world.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8);
+ world.spawnEntityInWorld(entitytntprimed);
+ }
+ super.onBlockExploded(world, x, y, z, explosion);
}
public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset)