mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Add new signs for recently added virtual commands (#3961)
Co-authored-by: MD <1917406+mdcfe@users.noreply.github.com> Closes #3919.
This commit is contained in:
parent
8cbd9b7935
commit
f3c347424b
@ -0,0 +1,27 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class SignAnvil extends EssentialsSign {
|
||||
public SignAnvil() {
|
||||
super("Anvil");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
if (ess.getContainerProvider() == null) {
|
||||
player.sendMessage(tl("unsupportedBrand"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
ess.getContainerProvider().openAnvil(player.getBase());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class SignCartography extends EssentialsSign {
|
||||
public SignCartography() {
|
||||
super("Cartography");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
if (ess.getContainerProvider() == null) {
|
||||
player.sendMessage(tl("unsupportedBrand"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
ess.getContainerProvider().openCartographyTable(player.getBase());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class SignGrindstone extends EssentialsSign {
|
||||
public SignGrindstone() {
|
||||
super("Grindstone");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
if (ess.getContainerProvider() == null) {
|
||||
player.sendMessage(tl("unsupportedBrand"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
ess.getContainerProvider().openGrindstone(player.getBase());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class SignLoom extends EssentialsSign {
|
||||
public SignLoom() {
|
||||
super("Loom");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
if (ess.getContainerProvider() == null) {
|
||||
player.sendMessage(tl("unsupportedBrand"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
ess.getContainerProvider().openLoom(player.getBase());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
public class SignSmithing extends EssentialsSign {
|
||||
public SignSmithing() {
|
||||
super("Smithing");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignCreate(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
if (ess.getContainerProvider() == null) {
|
||||
player.sendMessage(tl("unsupportedBrand"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
ess.getContainerProvider().openSmithingTable(player.getBase());
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
public class SignWorkbench extends EssentialsSign {
|
||||
public SignWorkbench() {
|
||||
super("Workbench");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) {
|
||||
player.getBase().openWorkbench(null, true);
|
||||
return true;
|
||||
}
|
||||
}
|
@ -2,24 +2,30 @@ package com.earth2me.essentials.signs;
|
||||
|
||||
//This enum is used when checking to see what signs are enabled
|
||||
public enum Signs {
|
||||
ANVIL(new SignAnvil()),
|
||||
BALANCE(new SignBalance()),
|
||||
BUY(new SignBuy()),
|
||||
CARTOGRAPHY(new SignCartography()),
|
||||
DISPOSAL(new SignDisposal()),
|
||||
ENCHANT(new SignEnchant()),
|
||||
FREE(new SignFree()),
|
||||
GAMEMODE(new SignGameMode()),
|
||||
GRINDSTONE(new SignGrindstone()),
|
||||
HEAL(new SignHeal()),
|
||||
INFO(new SignInfo()),
|
||||
KIT(new SignKit()),
|
||||
LOOM(new SignLoom()),
|
||||
MAIL(new SignMail()),
|
||||
PROTECTION(new SignProtection()),
|
||||
REPAIR(new SignRepair()),
|
||||
SELL(new SignSell()),
|
||||
SMITHING(new SignSmithing()),
|
||||
SPAWNMOB(new SignSpawnmob()),
|
||||
TIME(new SignTime()),
|
||||
TRADE(new SignTrade()),
|
||||
WARP(new SignWarp()),
|
||||
WEATHER(new SignWeather());
|
||||
WEATHER(new SignWeather()),
|
||||
WORKBENCH(new SignWorkbench());
|
||||
private final EssentialsSign sign;
|
||||
|
||||
Signs(final EssentialsSign sign) {
|
||||
|
@ -347,7 +347,6 @@ enabledSigns:
|
||||
#- sell
|
||||
#- trade
|
||||
#- free
|
||||
#- disposal
|
||||
#- warp
|
||||
#- kit
|
||||
#- mail
|
||||
@ -359,6 +358,13 @@ enabledSigns:
|
||||
#- repair
|
||||
#- time
|
||||
#- weather
|
||||
#- anvil
|
||||
#- cartography
|
||||
#- disposal
|
||||
#- grindstone
|
||||
#- loom
|
||||
#- smithing
|
||||
#- workbench
|
||||
|
||||
# How many times per second can Essentials signs be interacted with per player.
|
||||
# Values should be between 1-20, 20 being virtually no lag protection.
|
||||
|
Loading…
Reference in New Issue
Block a user