Skip to content

Commit

Permalink
feature #8 cleanup items, tested and working
Browse files Browse the repository at this point in the history
  • Loading branch information
msudol committed May 14, 2020
1 parent 96ba4ec commit 881cab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/com/pwn9/PwnPlantGrowth/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public void checkBlockClick(PlayerInteractEvent e)
// bail if no item in hand
if (!e.hasItem()) return;

// bail if the item is a block
//if (e.isBlockInHand()) return;

// get action
Action action = e.getAction();

Expand All @@ -47,9 +44,8 @@ public void checkBlockClick(PlayerInteractEvent e)

Block block = e.getClickedBlock();

if (block.getType() == Material.FARMLAND || block.getType() == Material.DIRT || block.getType() == Material.GRASS)
if (block.getType() == Material.FARMLAND || block.getType() == Material.DIRT || block.getType() == Material.GRASS_BLOCK || block.getType() == Material.JUNGLE_LOG || block.getType() == Material.SAND || block.getType() == Material.SOUL_SAND)
{
// is this the material in their hand?
Material m = e.getMaterial();

if(PwnPlantGrowth.plantTypes.contains(m.toString())) {
Expand All @@ -61,7 +57,7 @@ else if(PwnPlantGrowth.seedTypes.contains(m.toString())) {

String msg = "";

if (m == Material.BEETROOT_SEEDS) {
if (m == Material.BEETROOT_SEEDS || m == Material.BEETROOT) {
int a = PwnPlantGrowth.instance.getConfig().getInt("BEETROOTS.Growth");
msg = "BEETROOT: " + a;
}
Expand Down Expand Up @@ -99,8 +95,6 @@ else if (m == Material.WHEAT_SEEDS) {
}
}
}


}

}
2 changes: 1 addition & 1 deletion src/com/pwn9/PwnPlantGrowth/PwnPlantGrowth.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void onEnable()
PwnPlantGrowth.uvFound = " UV found, allowing false light growth.";

// Load all possible plant types
String sArray[] = new String[] { "BAMBOO", "BAMBOO_SAPLING", "BEETROOTS", "CACTUS", "CARROTS", "CHORUS_FLOWER", "COCOA", "GRASS", "KELP", "MELON", "MELON_STEM", "NETHER_WART", "POTATOES", "PUMPKIN", "PUMPKIN_STEM", "SUGAR_CANE", "SWEET_BERRY_BUSH", "WEHAT", "ACACIA_SAPLING", "BIRCH_SAPLING", "DARK_OAK_SAPLING", "JUNGLE_SAPLING", "OAK_SAPLING", "SPRUCE_SAPLING", "RED_MUSHROOM", "BROWN_MUSHROOM"};
String sArray[] = new String[] { "BAMBOO", "BAMBOO_SAPLING", "BEETROOTS", "CACTUS", "CARROTS", "CHORUS_FLOWER", "COCOA", "GRASS", "KELP", "MELON", "MELON_STEM", "NETHER_WART", "POTATOES", "PUMPKIN", "PUMPKIN_STEM", "SUGAR_CANE", "SWEET_BERRY_BUSH", "WHEAT", "ACACIA_SAPLING", "BIRCH_SAPLING", "DARK_OAK_SAPLING", "JUNGLE_SAPLING", "OAK_SAPLING", "SPRUCE_SAPLING", "RED_MUSHROOM", "BROWN_MUSHROOM"};
PwnPlantGrowth.plantTypes = Arrays.asList(sArray);

// Load all possible seed types not in plant types, the items that plant a plant
Expand Down

0 comments on commit 881cab8

Please sign in to comment.