-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for GP patch to prevent claim resizes & all
- Loading branch information
Showing
3 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package me.EtienneDx.RealEstate; | ||
|
||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
|
||
import me.EtienneDx.RealEstate.Transactions.BoughtTransaction; | ||
import me.EtienneDx.RealEstate.Transactions.Transaction; | ||
import me.ryanhamshire.GriefPrevention.Claim; | ||
import me.ryanhamshire.GriefPrevention.IRealEstate; | ||
|
||
public class GP_RealEstateHook implements IRealEstate | ||
{ | ||
@Override | ||
public String allowEdit(Claim claim, Player player) | ||
{ | ||
Transaction b = RealEstate.transactionsStore.getTransaction(claim); | ||
if(b != null && b.getOwner().equals(player.getUniqueId()) && b instanceof BoughtTransaction) | ||
{ | ||
if(((BoughtTransaction)b).getBuyer() != null) | ||
return "This claim is currently involved in a transaction, you can't edit it!"; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String allowBuild(Claim claim, Player player, Material material) | ||
{ | ||
Transaction b = RealEstate.transactionsStore.getTransaction(claim); | ||
if(b != null && b.getOwner().equals(player.getUniqueId()) && b instanceof BoughtTransaction) | ||
{ | ||
if(((BoughtTransaction)b).getBuyer() != null) | ||
return "This claim is currently involved in a transaction, you can't build on it!"; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String allowAccess(Claim claim, Player player) | ||
{ | ||
Transaction b = RealEstate.transactionsStore.getTransaction(claim); | ||
if(b != null && b.getOwner().equals(player.getUniqueId()) && b instanceof BoughtTransaction) | ||
{ | ||
if(((BoughtTransaction)b).getBuyer() != null) | ||
return "This claim is currently involved in a transaction, you can't access it!"; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String allowContainers(Claim claim, Player player) | ||
{ | ||
Transaction b = RealEstate.transactionsStore.getTransaction(claim); | ||
if(b != null && b.getOwner().equals(player.getUniqueId()) && b instanceof BoughtTransaction) | ||
{ | ||
if(((BoughtTransaction)b).getBuyer() != null) | ||
return "This claim is currently involved in a transaction, you can't access it's containers!"; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String allowGrantPermission(Claim claim, Player player) | ||
{ | ||
Transaction b = RealEstate.transactionsStore.getTransaction(claim); | ||
if(b != null && b instanceof BoughtTransaction) | ||
{ | ||
if(((BoughtTransaction)b).getBuyer() != null) | ||
return "This claim is currently involved in a transaction, you can't change any permission!"; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean anyTransaction(Claim claim) | ||
{ | ||
return RealEstate.transactionsStore.anyTransaction(claim); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters