Permalink
Browse files

Fixed: Restored botanical stuff. WIP.

  • Loading branch information...
timbru31 committed May 12, 2012
1 parent 1ecbeff commit 13a360ef7df4a29655c76c412c4b78b1349a49e8
@@ -592,7 +592,7 @@ private void setupBlockLists() {
public void loadConfig() {
config.options().header("For help and support visit please: http://bit.ly/bogbukkitdev or http://bit.ly/bogbukkit");
config.addDefault("permissions", true);
- config.addDefault("botanical", true);
+ config.addDefault("botanical", false);
config.addDefault("tweaks.noMelt", true);
config.addDefault("blocks.glass", true);
config.addDefault("blocks.ice", true);
@@ -49,6 +49,10 @@ public void onPlayerInteract(PlayerInteractEvent event) {
if (blockMaterial == Material.CHEST && plugin.config.getBoolean("blocks.chest") == true) {
event.setUseInteractedBlock(Event.Result.DENY);
event.setUseItemInHand(Event.Result.ALLOW);
+// if (itemMaterial == Material.SIGN) {
+// player.sendMessage("HI");
+// Inventory inv = (Inventory) itemMaterial.getData();
+// }
}
// Furnace
if ((blockMaterial == Material.FURNACE || blockMaterial == Material.BURNING_FURNACE) && plugin.config.getBoolean("blocks.furnace") == true) {
@@ -31,21 +31,26 @@ public Block setSound(StepSound stepsound) {
public boolean f(World world, int i, int j, int k) {
int l = world.getTypeId(i, j - 1, k);
- if (l == Block.CACTUS.id || l == Block.SAND.id) {
- if (world.getMaterial(i - 1, j, k).isBuildable()) {
+ if ((l == Block.CACTUS.id) || (l == Block.SAND.id)) {
+ if (world.getMaterial(i - 1, j, k).isBuildable())
return false;
- } else if (world.getMaterial(i + 1, j, k).isBuildable()) {
+ if (world.getMaterial(i + 1, j, k).isBuildable())
return false;
- } else if (world.getMaterial(i, j, k - 1).isBuildable()) {
+ if (world.getMaterial(i, j, k - 1).isBuildable())
return false;
- } else if (world.getMaterial(i, j, k + 1).isBuildable()) {
+ if (world.getMaterial(i, j, k + 1).isBuildable()) {
return false;
}
- else {
- return l == Block.CACTUS.id || l == Block.SAND.id;
- }
+
+ return (l == Block.CACTUS.id) || (l == Block.SAND.id);
}
- return true;
+ return (l == Block.GLOWSTONE.id) || (l == Block.GLASS.id) || (l == Block.LEAVES.id) ||
+ (l == Block.FENCE.id) || (l == Block.NETHER_FENCE.id) || (l == Block.TNT.id) ||
+ (l == Block.THIN_GLASS.id) || (l == Block.IRON_FENCE.id) || (l == Block.STEP.id) ||
+ (l == Block.ICE.id) || (l == Block.CACTUS.id) || (l == Block.BRICK_STAIRS.id) ||
+ (l == Block.WOOD_STAIRS.id) || (l == Block.NETHER_BRICK_STAIRS.id) || (l == Block.BRICK_STAIRS.id) ||
+ (l == Block.COBBLESTONE_STAIRS.id) || (l == Block.PISTON.id) || (l == Block.PISTON_STICKY.id) ||
+ (l == Block.PISTON_EXTENSION.id) || (l == Block.PISTON_MOVING.id);
}
}
@@ -11,9 +11,16 @@ public CustomDeadBush(int i, int j) {
}
protected boolean d(int i) {
- return true;
+ return (i == Block.SAND.id) ||
+ (i == Block.GLOWSTONE.id) || (i == Block.GLASS.id) || (i == Block.LEAVES.id) ||
+ (i == Block.FENCE.id) || (i == Block.NETHER_FENCE.id) || (i == Block.TNT.id) ||
+ (i == Block.THIN_GLASS.id) || (i == Block.IRON_FENCE.id) || (i == Block.STEP.id) ||
+ (i == Block.ICE.id) || (i == Block.CACTUS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.WOOD_STAIRS.id) || (i == Block.NETHER_BRICK_STAIRS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.COBBLESTONE_STAIRS.id) || (i == Block.PISTON.id) || (i == Block.PISTON_STICKY.id) ||
+ (i == Block.PISTON_EXTENSION.id) || (i == Block.PISTON_MOVING.id);
}
-
+
public CustomDeadBush setHardness(float f) {
this.strength = f;
if (this.durability < f * 5.0F) {
@@ -3,7 +3,6 @@
import net.minecraft.server.Block;
import net.minecraft.server.BlockFlower;
import net.minecraft.server.StepSound;
-import net.minecraft.server.World;
public class CustomFlowers extends BlockFlower {
@@ -23,13 +22,15 @@ public Block setSound(StepSound stepsound) {
this.stepSound = stepsound;
return this;
}
-
- public boolean canPlace(World world, int i, int j, int k) {
- if (world.getTypeId(i, j - 1, k) == org.bukkit.Material.AIR.getId()) return false;
- return true;
- }
-
- public boolean f(World world, int i, int j, int k) {
- return world.isChunkLoaded(i, j, k);
- }
+
+ protected boolean d(int i) {
+ return (i == Block.GRASS.id) || (i == Block.DIRT.id) || (i == Block.SOIL.id) ||
+ (i == Block.GLOWSTONE.id) || (i == Block.GLASS.id) || (i == Block.LEAVES.id) ||
+ (i == Block.FENCE.id) || (i == Block.NETHER_FENCE.id) || (i == Block.TNT.id) ||
+ (i == Block.THIN_GLASS.id) || (i == Block.IRON_FENCE.id) || (i == Block.STEP.id) ||
+ (i == Block.ICE.id) || (i == Block.CACTUS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.WOOD_STAIRS.id) || (i == Block.NETHER_BRICK_STAIRS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.COBBLESTONE_STAIRS.id) || (i == Block.PISTON.id) || (i == Block.PISTON_STICKY.id) ||
+ (i == Block.PISTON_EXTENSION.id) || (i == Block.PISTON_MOVING.id);
+ }
}
@@ -23,24 +23,36 @@ public Block setSound(StepSound stepsound) {
this.stepSound = stepsound;
return this;
}
-
+
public CustomMushroom setLightValue(float f) {
lightEmission[this.id] = (int)(15.0F * f);
return this;
}
-
- public boolean canPlace(World world, int i, int j, int k) {
- if (world.getTypeId(i, j - 1, k) == org.bukkit.Material.AIR.getId()) return false;
- return true;
- }
-
- public boolean f(World world, int i, int j, int k) {
- if (j >= 0 && j < 256) {
- int l = world.getTypeId(i, j - 1, k);
- if (l == Block.MYCEL.id) return l == Block.MYCEL.id || world.m(i, j, k) < 13 && this.d(l);
- else return true;
- } else {
- return false;
- }
- }
+
+ protected boolean d(int i) {
+ return (Block.n[i]) ||
+ (i == Block.GLOWSTONE.id) || (i == Block.GLASS.id) || (i == Block.LEAVES.id) ||
+ (i == Block.FENCE.id) || (i == Block.NETHER_FENCE.id) || (i == Block.TNT.id) ||
+ (i == Block.THIN_GLASS.id) || (i == Block.IRON_FENCE.id) || (i == Block.STEP.id) ||
+ (i == Block.ICE.id) || (i == Block.CACTUS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.WOOD_STAIRS.id) || (i == Block.NETHER_BRICK_STAIRS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.COBBLESTONE_STAIRS.id) || (i == Block.PISTON.id) || (i == Block.PISTON_STICKY.id) ||
+ (i == Block.PISTON_EXTENSION.id) || (i == Block.PISTON_MOVING.id);
+ }
+
+ public boolean f(World world, int i, int j, int k) {
+ if ((j >= 0) && (j < 256)) {
+ int l = world.getTypeId(i, j - 1, k);
+
+ return (l == Block.MYCEL.id) || ((world.m(i, j, k) < 13) && (d(l))) ||
+ (l == Block.GLOWSTONE.id) || (l == Block.GLASS.id) || (l == Block.LEAVES.id) ||
+ (l == Block.FENCE.id) || (l == Block.NETHER_FENCE.id) || (l == Block.TNT.id) ||
+ (l == Block.THIN_GLASS.id) || (l == Block.IRON_FENCE.id) || (l == Block.STEP.id) ||
+ (l == Block.ICE.id) || (l == Block.CACTUS.id) || (l == Block.BRICK_STAIRS.id) ||
+ (l == Block.WOOD_STAIRS.id) || (l == Block.NETHER_BRICK_STAIRS.id) || (l == Block.BRICK_STAIRS.id) ||
+ (l == Block.COBBLESTONE_STAIRS.id) || (l == Block.PISTON.id) || (l == Block.PISTON_STICKY.id) ||
+ (l == Block.PISTON_EXTENSION.id) || (l == Block.PISTON_MOVING.id);
+ }
+ return false;
+ }
}
@@ -3,7 +3,6 @@
import net.minecraft.server.Block;
import net.minecraft.server.BlockReed;
import net.minecraft.server.StepSound;
-import net.minecraft.server.World;
public class CustomReed extends BlockReed {
@@ -23,13 +22,4 @@ public Block setSound(StepSound stepsound) {
this.stepSound = stepsound;
return this;
}
-
- public boolean canPlace(World world, int i, int j, int k) {
- if (world.getTypeId(i, j - 1, k) == org.bukkit.Material.AIR.getId()) return false;
- return true;
- }
-
- public boolean f(World world, int i, int j, int k) {
- return true;
- }
}
@@ -23,16 +23,22 @@ public Block setSound(StepSound stepsound) {
this.stepSound = stepsound;
return this;
}
-
- public boolean canPlace(World world, int i, int j, int k) {
- if (world.getTypeId(i, j - 1, k) == org.bukkit.Material.AIR.getId()) return false;
- return true;
- }
-
- public boolean f(World world, int i, int j, int k) {
- if (j >= 0 && j < 256) {
- return world.getData(i, j - 1, k) == 0;
- }
- else return false;
- }
+
+ protected boolean d(int i) {
+ return (i == Block.STATIONARY_WATER.id) ||
+ (i == Block.GLOWSTONE.id) || (i == Block.GLASS.id) || (i == Block.LEAVES.id) ||
+ (i == Block.FENCE.id) || (i == Block.NETHER_FENCE.id) || (i == Block.TNT.id) ||
+ (i == Block.THIN_GLASS.id) || (i == Block.IRON_FENCE.id) || (i == Block.STEP.id) ||
+ (i == Block.ICE.id) || (i == Block.CACTUS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.WOOD_STAIRS.id) || (i == Block.NETHER_BRICK_STAIRS.id) || (i == Block.BRICK_STAIRS.id) ||
+ (i == Block.COBBLESTONE_STAIRS.id) || (i == Block.PISTON.id) || (i == Block.PISTON_STICKY.id) ||
+ (i == Block.PISTON_EXTENSION.id) || (i == Block.PISTON_MOVING.id);
+ }
+
+ public boolean f(World world, int i, int j, int k) {
+ if (j >= 0 && j < 256) {
+ return world.getData(i, j - 1, k) == 0;
+ }
+ else return false;
+ }
}

0 comments on commit 13a360e

Please sign in to comment.