-
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.
Merge pull request #36 from EtienneDx/release/1.4.0
Release 1.4.0
- Loading branch information
Showing
20 changed files
with
1,141 additions
and
642 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ target/* | |
build.bat | ||
/bin/ | ||
/target/ | ||
.vscode |
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
# Changelog | ||
|
||
## 1.4.0 | ||
|
||
### Added | ||
* Readme and changelog files | ||
* Error messages to *messages.yml* | ||
* List messages to *messages.yml* | ||
* Info messages to *messages.yml* | ||
* Support of [GriefPrevention v16.18](https://github.com/TechFortress/GriefPrevention/releases/tag/16.18) and up | ||
* Disabled resizing of parent claims when subclaims are being rented | ||
|
||
### Modified | ||
* Changed java version to java 16 | ||
* Changed spigot version to 1.18.1 (should still support 1.17) | ||
* Removed requirement for custom GP jar file | ||
|
||
### Fixed | ||
* Sign header color formatting being lost on server restart | ||
* Fixed issue preventing to buy claims due to currencies using $ character | ||
* Fixed error with `/re list` | ||
* Fixed error regarding renewrent |
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,13 @@ | ||
# RealEstate | ||
|
||
RealEstate is a spigot plugin built on top of GriefPrevention to provide players with an ability to sell and rent claims to other players. | ||
|
||
The plugin is documented in the [GitHub wiki](https://github.com/EtienneDx/RealEstate/wiki). | ||
|
||
Please feel free to report any issue in the [GitHub Issue section](https://github.com/EtienneDx/RealEstate/issues). | ||
|
||
## GriefPrevention | ||
|
||
This plugin is dependent on GriefPrevention version 16.18 and up. | ||
|
||
GriefPrevention plugin can be found [here](https://github.com/TechFortress/GriefPrevention). |
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
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,80 @@ | ||
package me.EtienneDx.RealEstate; | ||
|
||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.plugin.PluginManager; | ||
|
||
import me.EtienneDx.RealEstate.Transactions.BoughtTransaction; | ||
import me.EtienneDx.RealEstate.Transactions.Transaction; | ||
import me.ryanhamshire.GriefPrevention.Claim; | ||
import me.ryanhamshire.GriefPrevention.ClaimPermission; | ||
import me.ryanhamshire.GriefPrevention.events.ClaimDeletedEvent; | ||
import me.ryanhamshire.GriefPrevention.events.ClaimPermissionCheckEvent; | ||
|
||
public class ClaimPermissionListener implements Listener { | ||
void registerEvents() | ||
{ | ||
PluginManager pm = RealEstate.instance.getServer().getPluginManager(); | ||
|
||
pm.registerEvents(this, RealEstate.instance); | ||
} | ||
|
||
@EventHandler | ||
public void onClaimPermission(ClaimPermissionCheckEvent event) { | ||
Transaction transaction = RealEstate.transactionsStore.getTransaction(event.getClaim()); | ||
// we only have to remove the owner's access, the rest is handled by GP | ||
if( | ||
// if there is a transaction and the player is the owner | ||
transaction != null && | ||
( | ||
event.getCheckedUUID().equals(transaction.getOwner()) || | ||
(event.getClaim().isAdminClaim() && event.getCheckedPlayer().hasPermission("griefprevention.adminclaims")) | ||
) && | ||
transaction instanceof BoughtTransaction && | ||
((BoughtTransaction)transaction).getBuyer() != null | ||
) { | ||
switch(event.getRequiredPermission()) { | ||
case Edit: | ||
event.setDenialReason(() -> Messages.getMessage(RealEstate.instance.messages.msgErrorClaimInTransactionCantEdit)); | ||
break; | ||
case Access: | ||
event.setDenialReason(() -> Messages.getMessage(RealEstate.instance.messages.msgErrorClaimInTransactionCantAccess)); | ||
break; | ||
case Build: | ||
event.setDenialReason(() -> Messages.getMessage(RealEstate.instance.messages.msgErrorClaimInTransactionCantBuild)); | ||
break; | ||
case Inventory: | ||
event.setDenialReason(() -> Messages.getMessage(RealEstate.instance.messages.msgErrorClaimInTransactionCantInventory)); | ||
break; | ||
case Manage: | ||
event.setDenialReason(() -> Messages.getMessage(RealEstate.instance.messages.msgErrorClaimInTransactionCantManage)); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
if(event.getRequiredPermission() == ClaimPermission.Edit || event.getRequiredPermission() == ClaimPermission.Manage) { | ||
for (Claim child : event.getClaim().children) { | ||
Transaction tr = RealEstate.transactionsStore.getTransaction(child); | ||
if(tr != null && | ||
tr instanceof BoughtTransaction && | ||
((BoughtTransaction)tr).getBuyer() != null | ||
) { | ||
event.setDenialReason(() -> Messages.getMessage(RealEstate.instance.messages.msgErrorSubclaimInTransaction)); | ||
} | ||
} | ||
} | ||
} | ||
|
||
// more of a safety measure, normally it shouldn't be needed | ||
@EventHandler | ||
public void onClaimDeleted(ClaimDeletedEvent event) { | ||
Transaction tr = RealEstate.transactionsStore.getTransaction(event.getClaim()); | ||
if(tr != null) tr.tryCancelTransaction(null, true); | ||
for (Claim child : event.getClaim().children) { | ||
tr = RealEstate.transactionsStore.getTransaction(child); | ||
if(tr != null) tr.tryCancelTransaction(null, true); | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.