mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
parent
25c7ebcf39
commit
dc2462c277
1 changed files with 16 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
|
@ -11,9 +12,23 @@ public class SignDisposal extends EssentialsSign {
|
|||
super("Disposal");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(ISign sign, User player, String username, IEssentials ess) throws SignException, ChargeException {
|
||||
if (!player.isAuthorized("essentials.signs.disposal.name")) {
|
||||
sign.setLine(1, "");
|
||||
sign.setLine(2, "");
|
||||
sign.setLine(3, "");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
player.getBase().openInventory(ess.getServer().createInventory(player.getBase(), 36, tl("disposal")));
|
||||
String title = (sign.getLine(1) + " " + sign.getLine(2) + " " + sign.getLine(3)).trim();
|
||||
if (title.isEmpty()) {
|
||||
title = tl("disposal");
|
||||
}
|
||||
player.getBase().openInventory(ess.getServer().createInventory(player.getBase(), 36, title));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue