mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
More tweaks to GT
This commit is contained in:
parent
a598796c99
commit
95c403a467
@ -140,12 +140,19 @@ public class HerbalismManager extends SkillManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check if the plant was recently replanted
|
//Check if the plant was recently replanted
|
||||||
if(blockBreakEvent.getBlock().getMetadata(mcMMO.REPLANT_META_KEY).size() >= 1) {
|
if(blockBreakEvent.getBlock().getBlockData() instanceof Ageable) {
|
||||||
if(blockBreakEvent.getBlock().getMetadata(mcMMO.REPLANT_META_KEY).get(0).asBoolean()) {
|
Ageable ageableCrop = (Ageable) blockBreakEvent.getBlock().getBlockData();
|
||||||
//Crop is recently replanted to back out of destroying it
|
|
||||||
blockBreakEvent.setCancelled(true);
|
|
||||||
|
|
||||||
return;
|
if(blockBreakEvent.getBlock().getMetadata(mcMMO.REPLANT_META_KEY).size() >= 1) {
|
||||||
|
if(blockBreakEvent.getBlock().getMetadata(mcMMO.REPLANT_META_KEY).get(0).asBoolean()) {
|
||||||
|
if(isAgeableMature(ageableCrop)) {
|
||||||
|
blockBreakEvent.getBlock().removeMetadata(mcMMO.REPLANT_META_KEY, mcMMO.p);
|
||||||
|
} else {
|
||||||
|
//Crop is recently replanted to back out of destroying it
|
||||||
|
blockBreakEvent.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -756,9 +763,10 @@ public class HerbalismManager extends SkillManager {
|
|||||||
|
|
||||||
//Immature plants will start over at 0
|
//Immature plants will start over at 0
|
||||||
if(!isAgeableMature(ageable)) {
|
if(!isAgeableMature(ageable)) {
|
||||||
blockBreakEvent.setCancelled(true);
|
// blockBreakEvent.setCancelled(true);
|
||||||
startReplantTask(0, blockBreakEvent, blockState, true);
|
startReplantTask(0, blockBreakEvent, blockState, true);
|
||||||
blockState.setType(Material.AIR);
|
// blockState.setType(Material.AIR);
|
||||||
|
blockBreakEvent.setDropItems(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user