From 50abc5534081ef5c02ffc29b55cccb1b4a9766fe Mon Sep 17 00:00:00 2001 From: PoutineQc Date: Fri, 27 May 2016 01:33:50 -0400 Subject: [PATCH] No Damage Bug --- Bukkit_1.8/plugin.yml | 2 +- Bukkit_1.8/src/me/poutineqc/cuberunner/games/Arena.java | 9 ++++----- Bukkit_1.9/plugin.yml | 2 +- Bukkit_1.9/src/me/poutineqc/cuberunner/games/Arena.java | 9 ++++----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Bukkit_1.8/plugin.yml b/Bukkit_1.8/plugin.yml index 05913fa..4f06072 100644 --- a/Bukkit_1.8/plugin.yml +++ b/Bukkit_1.8/plugin.yml @@ -1,6 +1,6 @@ name: CubeRunner main : me.poutineqc.cuberunner.CubeRunner -version: 2.1.1 +version: 2.1 description: Blocks are falling over your head! Can you outrun them? load: startup author: PoutineQc diff --git a/Bukkit_1.8/src/me/poutineqc/cuberunner/games/Arena.java b/Bukkit_1.8/src/me/poutineqc/cuberunner/games/Arena.java index 256cbfd..c5b586d 100644 --- a/Bukkit_1.8/src/me/poutineqc/cuberunner/games/Arena.java +++ b/Bukkit_1.8/src/me/poutineqc/cuberunner/games/Arena.java @@ -15,7 +15,7 @@ import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; -import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.FallingSand; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; @@ -42,6 +42,7 @@ import net.minecraft.server.v1_8_R3.PacketPlayOutTitle.EnumTitleAction; import net.minecraft.server.v1_8_R3.PlayerConnection; +@SuppressWarnings("deprecation") public class Arena { private static CubeRunner plugin; @@ -671,7 +672,6 @@ protected void startGame() { } - @SuppressWarnings("deprecation") private void resetArena() { for (int x = minPoint.getBlockX(); x <= maxPoint.getBlockX(); x++) for (int y = maxPoint.getBlockY(); y >= minPoint.getBlockY(); y--) @@ -691,7 +691,6 @@ private void resetArena() { } } - @SuppressWarnings("deprecation") public void resetArena(ItemStack item) { for (int x = minPoint.getBlockX(); x <= maxPoint.getBlockX(); x++) for (int y = maxPoint.getBlockY(); y >= minPoint.getBlockY(); y--) @@ -774,11 +773,11 @@ public void run() { ItemStackManager fallingBlock = arena.colorManager.getRandomAvailableBlock(); - @SuppressWarnings("deprecation") - FallingBlock clay = (FallingBlock) player.getWorld().spawnFallingBlock(l, + FallingSand clay = (FallingSand) player.getWorld().spawnFallingBlock(l, fallingBlock.getMaterial(), (byte) fallingBlock.getData()); clay.setDropItem(false); + clay.setHurtEntities(true); clay.setCustomName(user.getUUID()); clay.setCustomNameVisible(false); diff --git a/Bukkit_1.9/plugin.yml b/Bukkit_1.9/plugin.yml index be71743..4f06072 100644 --- a/Bukkit_1.9/plugin.yml +++ b/Bukkit_1.9/plugin.yml @@ -1,6 +1,6 @@ name: CubeRunner main : me.poutineqc.cuberunner.CubeRunner -version: 2.1.2 +version: 2.1 description: Blocks are falling over your head! Can you outrun them? load: startup author: PoutineQc diff --git a/Bukkit_1.9/src/me/poutineqc/cuberunner/games/Arena.java b/Bukkit_1.9/src/me/poutineqc/cuberunner/games/Arena.java index 9257f0c..a55527f 100644 --- a/Bukkit_1.9/src/me/poutineqc/cuberunner/games/Arena.java +++ b/Bukkit_1.9/src/me/poutineqc/cuberunner/games/Arena.java @@ -15,7 +15,7 @@ import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_9_R1.entity.CraftPlayer; -import org.bukkit.entity.FallingBlock; +import org.bukkit.entity.FallingSand; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; @@ -42,6 +42,7 @@ import net.minecraft.server.v1_9_R1.PacketPlayOutTitle.EnumTitleAction; import net.minecraft.server.v1_9_R1.PlayerConnection; +@SuppressWarnings("deprecation") public class Arena { private static CubeRunner plugin; @@ -671,7 +672,6 @@ protected void startGame() { } - @SuppressWarnings("deprecation") private void resetArena() { for (int x = minPoint.getBlockX(); x <= maxPoint.getBlockX(); x++) for (int y = maxPoint.getBlockY(); y >= minPoint.getBlockY(); y--) @@ -691,7 +691,6 @@ private void resetArena() { } } - @SuppressWarnings("deprecation") public void resetArena(ItemStack item) { for (int x = minPoint.getBlockX(); x <= maxPoint.getBlockX(); x++) for (int y = maxPoint.getBlockY(); y >= minPoint.getBlockY(); y--) @@ -774,11 +773,11 @@ public void run() { ItemStackManager fallingBlock = arena.colorManager.getRandomAvailableBlock(); - @SuppressWarnings("deprecation") - FallingBlock clay = (FallingBlock) player.getWorld().spawnFallingBlock(l, + FallingSand clay = (FallingSand) player.getWorld().spawnFallingBlock(l, fallingBlock.getMaterial(), (byte) fallingBlock.getData()); clay.setDropItem(false); + clay.setHurtEntities(true); clay.setCustomName(user.getUUID()); clay.setCustomNameVisible(false);