diff --git a/app/bin/main/net/xuyezo/main/Generator.class b/app/bin/main/net/xuyezo/main/Generator.class index ab13915..5522a55 100644 Binary files a/app/bin/main/net/xuyezo/main/Generator.class and b/app/bin/main/net/xuyezo/main/Generator.class differ diff --git a/app/bin/main/net/xuyezo/main/Handler.class b/app/bin/main/net/xuyezo/main/Handler.class index 982cf2a..2a9be82 100644 Binary files a/app/bin/main/net/xuyezo/main/Handler.class and b/app/bin/main/net/xuyezo/main/Handler.class differ diff --git a/app/bin/main/net/xuyezo/main/Main.class b/app/bin/main/net/xuyezo/main/Main.class index 71dc429..24cfd00 100644 Binary files a/app/bin/main/net/xuyezo/main/Main.class and b/app/bin/main/net/xuyezo/main/Main.class differ diff --git a/app/src/main/java/net/xuyezo/main/Generator.java b/app/src/main/java/net/xuyezo/main/Generator.java index 2fb8ca1..e11e6df 100644 --- a/app/src/main/java/net/xuyezo/main/Generator.java +++ b/app/src/main/java/net/xuyezo/main/Generator.java @@ -31,8 +31,8 @@ public class Generator extends ChunkGenerator { int z2 = chunkZ * 16 + z; if ((((x2 * 223) ^ (z2 * 82395) ^ (x2 * 9634) ^ (z2 * 23958)) & 0xFF3) == (y & (y * 7))) { - for (int a = 0; a < 2; a++) { - for (int b = 0; b < 2; b++) { + for (int a = 0; a < 3; a++) { + for (int b = 0; b < 3; b++) { chunkData.setBlock((x+a)%16, y, (z+b)%16, Material.STONE); } } diff --git a/app/src/main/java/net/xuyezo/main/Handler.java b/app/src/main/java/net/xuyezo/main/Handler.java index 0b9c9cd..97280ea 100644 --- a/app/src/main/java/net/xuyezo/main/Handler.java +++ b/app/src/main/java/net/xuyezo/main/Handler.java @@ -10,9 +10,45 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockExplodeEvent; import org.bukkit.inventory.ItemStack; public class Handler implements Listener { + + @EventHandler + private void onBlockExplode(BlockExplodeEvent e) { + for (Block b : e.blockList()) { + Location loc = b.getLocation(); + if (b.getType() == Material.STONE) { + b.setType(Material.LAVA); + } else if (b.getType() == Material.COBBLESTONE) { + Material[] items = { + Material.COPPER_ORE, + Material.COPPER_ORE, + Material.COPPER_ORE, + Material.IRON_ORE, + + Material.COPPER_ORE, + Material.COPPER_ORE, + Material.COPPER_ORE, + Material.IRON_ORE, + + Material.COPPER_ORE, + Material.COPPER_ORE, + Material.COPPER_ORE, + Material.IRON_ORE, + + Material.GOLD_ORE + }; + + b.setType(items[new Random().nextInt(items.length)]); + } else if (b.getType() == Material.GRAVEL) { + b.setType(Material.AIR); + b.getWorld().dropItem(loc, new ItemStack(Material.QUARTZ)); + } + } + } + @EventHandler private void onBlockBreak(BlockBreakEvent e) { Block b = e.getBlock(); @@ -56,7 +92,6 @@ public class Handler implements Listener { Material.IRON_NUGGET }; - for (int j = 0; j < 3; j++) { Material r = items[new Random().nextInt(items.length)]; b.getWorld().dropItem(loc, new ItemStack(r)); diff --git a/app/src/main/java/net/xuyezo/main/Main.java b/app/src/main/java/net/xuyezo/main/Main.java index 66f2b77..c50c481 100644 --- a/app/src/main/java/net/xuyezo/main/Main.java +++ b/app/src/main/java/net/xuyezo/main/Main.java @@ -55,6 +55,7 @@ public class Main extends JavaPlugin { recipe.shape("AA ", "AA ", " "); recipe.setIngredient('A', Material.COBBLESTONE); + getServer().addRecipe(recipe); key = new NamespacedKey(this, "CobbledStone"); item = new ItemStack(Material.COBBLESTONE);