Revert "Refactor and rename to Thresholds"
This reverts commit cd9d548806
.
This commit is contained in:
parent
cd9d548806
commit
858f359d4b
578 changed files with 215113 additions and 214942 deletions
|
@ -0,0 +1,30 @@
|
|||
package dev.zontreck.otemod.integrations;
|
||||
|
||||
import com.mojang.blaze3d.platform.InputConstants;
|
||||
|
||||
import net.minecraft.client.KeyMapping;
|
||||
import net.minecraft.client.multiplayer.ClientRegistryLayer;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public class KeyBindings {
|
||||
public static final String KEY_CATEGORY_OTEMOD = "key.category.otemod";
|
||||
public static final String KEY_OPEN_VAULT = "key.otemod.open_vault";
|
||||
|
||||
public static final KeyMapping OPEN_VAULT = createKeyMapping(KEY_OPEN_VAULT, InputConstants.KEY_V, KEY_CATEGORY_OTEMOD);
|
||||
|
||||
private static KeyMapping createKeyMapping(String name, int keycode, String category){
|
||||
final KeyMapping key = new KeyMapping(name, keycode, category);
|
||||
return key;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerKeyMappings(RegisterKeyMappingsEvent event)
|
||||
{
|
||||
event.register(OPEN_VAULT);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package dev.zontreck.otemod.integrations;
|
||||
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.util.ChatHelpers;
|
||||
import dev.zontreck.otemod.OTEMod;
|
||||
import dev.zontreck.otemod.chat.ChatServerOverride;
|
||||
import dev.zontreck.otemod.implementation.Messages;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
public class LuckPermsHelper {
|
||||
/*public static LuckPerms getLuckPerms()
|
||||
{
|
||||
return LuckPermsProvider.get();
|
||||
}
|
||||
|
||||
private static User getUserOf(Player p){
|
||||
return getLuckPerms().getPlayerAdapter(Player.class).getUser(p);
|
||||
}
|
||||
|
||||
private static boolean hasPermission(User u, String perm)
|
||||
{
|
||||
return u.getCachedData().getPermissionData().checkPermission(perm).asBoolean();
|
||||
}*/
|
||||
|
||||
public static boolean hasPermission(Player p, String perm)
|
||||
{
|
||||
//User u = getUserOf(p);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean hasGroupOrPerm(Player p, String group, String perm){
|
||||
return hasPermission(p, group) || hasPermission(p, perm);
|
||||
}
|
||||
|
||||
public static void sendNoPermissionsMessage(ServerPlayer play, String perm, String group) {
|
||||
ChatHelpers.broadcastTo(play.getUUID(), ChatHelpers.macro(Messages.OTE_PREFIX+" !Dark_Red!You do not have permission to use that command. You need permission !Gold!"+perm+" !White! or !Gold!"+group), play.server);
|
||||
}
|
||||
}
|
Reference in a new issue