Removed some limitations on hoppers and mine carts.
No longer needed - building at the bottom of a claim now extends the claim downward, so no important blocks (like chests) will be thievable by hoppers or hopper mine carts except in extremely rare, not-manufacturable situations.
This commit is contained in:
parent
cabcebe807
commit
3f33679424
|
|
@ -176,40 +176,7 @@ public class BlockEventHandler implements Listener
|
||||||
{
|
{
|
||||||
playerData.lastClaim = claim;
|
playerData.lastClaim = claim;
|
||||||
|
|
||||||
//FEATURE: prevent theft from container using a hopper when the container is at the very bottom of a land claim
|
//warn about TNT not destroying claimed blocks
|
||||||
|
|
||||||
if(block.getType() == Material.HOPPER)
|
|
||||||
{
|
|
||||||
//is the above block inside the land claim?
|
|
||||||
Block aboveBlock = block.getRelative(BlockFace.UP);
|
|
||||||
if(claim.contains(aboveBlock.getLocation(), false, false))
|
|
||||||
{
|
|
||||||
//then the player needs container trust to place the hopper
|
|
||||||
String failureMessage = claim.allowContainers(player);
|
|
||||||
if(failureMessage != null)
|
|
||||||
{
|
|
||||||
placeEvent.setCancelled(true);
|
|
||||||
GriefPrevention.sendMessage(player, TextMode.Err, failureMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//rails can't be placed ANYWHERE under a claim, because they could be pushed up to the
|
|
||||||
//target container using pistons
|
|
||||||
if(block.getType().name().contains("RAIL"))
|
|
||||||
{
|
|
||||||
//then the player needs container trust to place the hopper
|
|
||||||
String failureMessage = claim.allowContainers(player);
|
|
||||||
if(failureMessage != null)
|
|
||||||
{
|
|
||||||
placeEvent.setCancelled(true);
|
|
||||||
GriefPrevention.sendMessage(player, TextMode.Err, failureMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//warn about TNT not destroying claimed blocks
|
|
||||||
if(block.getType() == Material.TNT && !claim.areExplosivesAllowed)
|
if(block.getType() == Material.TNT && !claim.areExplosivesAllowed)
|
||||||
{
|
{
|
||||||
GriefPrevention.sendMessage(player, TextMode.Warn, Messages.NoTNTDamageClaims);
|
GriefPrevention.sendMessage(player, TextMode.Warn, Messages.NoTNTDamageClaims);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user