mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-24 11:54:35 +08:00
parent
25c7ebcf39
commit
dc2462c277
@ -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 New Issue
Block a user