Added support for GP patch to prevent claim resizes & all
This commit is contained in:
parent
72617e650a
commit
6a9ed1447e
12
pom.xml
12
pom.xml
@ -93,12 +93,6 @@
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.TechFortress</groupId>
|
||||
<artifactId>GriefPrevention</artifactId>
|
||||
<version>16.11.6</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>co.aikar</groupId>
|
||||
<artifactId>acf-bukkit</artifactId>
|
||||
@ -110,5 +104,11 @@
|
||||
<version>2.16.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.EtienneDx</groupId>
|
||||
<artifactId>GriefPrevention</artifactId>
|
||||
<version>master-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
78
src/me/EtienneDx/RealEstate/GP_RealEstateHook.java
Normal file
78
src/me/EtienneDx/RealEstate/GP_RealEstateHook.java
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
@ -94,6 +94,8 @@ public class RealEstate extends JavaPlugin
|
||||
manager.enableUnstableAPI("help");
|
||||
registerConditions();
|
||||
manager.registerCommand(new RECommand());
|
||||
|
||||
GriefPrevention.realEstate = new GP_RealEstateHook();
|
||||
}
|
||||
|
||||
private void registerConditions()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user