mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Fishing TNT traps should not destroy blocks
This commit is contained in:
parent
800786111c
commit
67e9d9c535
@ -459,6 +459,22 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Monitor EntityExplode events.
|
||||
*
|
||||
* @param event The event to monitor
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onEnitityExplodeMonitor(EntityExplodeEvent event) {
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!entity.hasMetadata(mcMMO.tntsafeMetadataKey)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.blockList().clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle FoodLevelChange events that involve modifying the event.
|
||||
*
|
||||
|
@ -91,6 +91,7 @@ public class mcMMO extends JavaPlugin {
|
||||
public final static String blockMetadataKey = "mcMMO: Piston Tracking";
|
||||
public final static String furnaceMetadataKey = "mcMMO: Tracked Furnace";
|
||||
public final static String tntMetadataKey = "mcMMO: Tracked TNT";
|
||||
public final static String tntsafeMetadataKey = "mcMMO: Safe TNT";
|
||||
public final static String customNameKey = "mcMMO: Custom Name";
|
||||
public final static String customVisibleKey = "mcMMO: Name Visibility";
|
||||
public final static String droppedItemKey = "mcMMO: Tracked Item";
|
||||
|
@ -499,6 +499,7 @@ public class FishingManager extends SkillManager {
|
||||
double magnitude = velocity.length();
|
||||
fishingCatch.setVelocity(velocity.multiply((magnitude + 1) / magnitude));
|
||||
|
||||
tnt.setMetadata(mcMMO.tntsafeMetadataKey, mcMMO.metadataValue);
|
||||
tnt.setFuseTicks(3 * Misc.TICK_CONVERSION_FACTOR);
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user