parent
c8a9ce9277
commit
32a5b41cca
5 changed files with 15 additions and 8 deletions
|
@ -8,16 +8,12 @@ import com.atsuishio.superbwarfare.config.ServerConfig;
|
||||||
import com.atsuishio.superbwarfare.init.*;
|
import com.atsuishio.superbwarfare.init.*;
|
||||||
import com.atsuishio.superbwarfare.network.NetworkRegistry;
|
import com.atsuishio.superbwarfare.network.NetworkRegistry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.neoforged.api.distmarker.Dist;
|
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.bus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.neoforged.fml.ModContainer;
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.neoforged.fml.config.ModConfig;
|
import net.neoforged.fml.config.ModConfig;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
||||||
import net.neoforged.fml.loading.FMLEnvironment;
|
|
||||||
import net.neoforged.neoforge.client.event.ClientTickEvent;
|
import net.neoforged.neoforge.client.event.ClientTickEvent;
|
||||||
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
|
|
||||||
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
import net.neoforged.neoforge.event.tick.ServerTickEvent;
|
import net.neoforged.neoforge.event.tick.ServerTickEvent;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
@ -62,15 +58,12 @@ public class Mod {
|
||||||
ModCriteriaTriggers.REGISTRY.register(bus);
|
ModCriteriaTriggers.REGISTRY.register(bus);
|
||||||
ModAttachments.ATTACHMENT_TYPES.register(bus);
|
ModAttachments.ATTACHMENT_TYPES.register(bus);
|
||||||
|
|
||||||
|
// bus.addListener(this::onCommonSetup);
|
||||||
bus.addListener(this::onClientSetup);
|
bus.addListener(this::onClientSetup);
|
||||||
bus.addListener(ModItems::registerDispenserBehavior);
|
bus.addListener(ModItems::registerDispenserBehavior);
|
||||||
|
|
||||||
bus.addListener(NetworkRegistry::register);
|
bus.addListener(NetworkRegistry::register);
|
||||||
|
|
||||||
if (FMLEnvironment.dist == Dist.CLIENT) {
|
|
||||||
container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
|
|
||||||
}
|
|
||||||
|
|
||||||
NeoForge.EVENT_BUS.register(this);
|
NeoForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,6 +71,7 @@ public class Mod {
|
||||||
return ResourceLocation.fromNamespaceAndPath(MODID, path);
|
return ResourceLocation.fromNamespaceAndPath(MODID, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> workQueue = new ConcurrentLinkedQueue<>();
|
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> workQueue = new ConcurrentLinkedQueue<>();
|
||||||
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> workQueueC = new ConcurrentLinkedQueue<>();
|
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> workQueueC = new ConcurrentLinkedQueue<>();
|
||||||
|
|
||||||
|
|
|
@ -204,6 +204,11 @@ public class ClickHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO do we need cloth config?
|
||||||
|
// if (key == ModKeyMappings.CONFIG.getKey().getValue() && ModKeyMappings.CONFIG.getKeyModifier().isActive(KeyConflictContext.IN_GAME)) {
|
||||||
|
// handleConfigScreen(player);
|
||||||
|
// }
|
||||||
|
|
||||||
if (key == ModKeyMappings.RELOAD.getKey().getValue()) {
|
if (key == ModKeyMappings.RELOAD.getKey().getValue()) {
|
||||||
ClientEventHandler.burstFireAmount = 0;
|
ClientEventHandler.burstFireAmount = 0;
|
||||||
PacketDistributor.sendToServer(new ReloadMessage(0));
|
PacketDistributor.sendToServer(new ReloadMessage(0));
|
||||||
|
|
|
@ -22,6 +22,9 @@ public class ModKeyMappings {
|
||||||
public static final KeyMapping DISMOUNT = new KeyMapping("key.superbwarfare.dismount", GLFW.GLFW_KEY_LEFT_ALT, "key.categories.superbwarfare");
|
public static final KeyMapping DISMOUNT = new KeyMapping("key.superbwarfare.dismount", GLFW.GLFW_KEY_LEFT_ALT, "key.categories.superbwarfare");
|
||||||
public static final KeyMapping BREATH = new KeyMapping("key.superbwarfare.breath", GLFW.GLFW_KEY_LEFT_CONTROL, "key.categories.superbwarfare");
|
public static final KeyMapping BREATH = new KeyMapping("key.superbwarfare.breath", GLFW.GLFW_KEY_LEFT_CONTROL, "key.categories.superbwarfare");
|
||||||
|
|
||||||
|
public static final KeyMapping CONFIG = new KeyMapping("key.superbwarfare.config", KeyConflictContext.IN_GAME,
|
||||||
|
KeyModifier.ALT, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, "key.categories.superbwarfare");
|
||||||
|
|
||||||
public static final KeyMapping EDIT_MODE = new KeyMapping("key.superbwarfare.edit_mode", GLFW.GLFW_KEY_H, "key.categories.superbwarfare");
|
public static final KeyMapping EDIT_MODE = new KeyMapping("key.superbwarfare.edit_mode", GLFW.GLFW_KEY_H, "key.categories.superbwarfare");
|
||||||
public static final KeyMapping EDIT_SCOPE = new KeyMapping("key.superbwarfare.edit_scope", GLFW.GLFW_KEY_UP, "key.categories.superbwarfare");
|
public static final KeyMapping EDIT_SCOPE = new KeyMapping("key.superbwarfare.edit_scope", GLFW.GLFW_KEY_UP, "key.categories.superbwarfare");
|
||||||
public static final KeyMapping EDIT_BARREL = new KeyMapping("key.superbwarfare.edit_barrel", GLFW.GLFW_KEY_LEFT, "key.categories.superbwarfare");
|
public static final KeyMapping EDIT_BARREL = new KeyMapping("key.superbwarfare.edit_barrel", GLFW.GLFW_KEY_LEFT, "key.categories.superbwarfare");
|
||||||
|
@ -46,6 +49,7 @@ public class ModKeyMappings {
|
||||||
event.register(INTERACT);
|
event.register(INTERACT);
|
||||||
event.register(DISMOUNT);
|
event.register(DISMOUNT);
|
||||||
event.register(BREATH);
|
event.register(BREATH);
|
||||||
|
event.register(CONFIG);
|
||||||
event.register(EDIT_MODE);
|
event.register(EDIT_MODE);
|
||||||
event.register(EDIT_SCOPE);
|
event.register(EDIT_SCOPE);
|
||||||
event.register(EDIT_BARREL);
|
event.register(EDIT_BARREL);
|
||||||
|
|
|
@ -455,6 +455,7 @@
|
||||||
"key.superbwarfare.interact": "Interact",
|
"key.superbwarfare.interact": "Interact",
|
||||||
"key.superbwarfare.dismount": "Dismount",
|
"key.superbwarfare.dismount": "Dismount",
|
||||||
"key.superbwarfare.breath": "Breathe",
|
"key.superbwarfare.breath": "Breathe",
|
||||||
|
"key.superbwarfare.config": "Open Config Screen",
|
||||||
"key.superbwarfare.edit_mode": "Edit Weapon",
|
"key.superbwarfare.edit_mode": "Edit Weapon",
|
||||||
"key.superbwarfare.edit_scope": "Switch Scope",
|
"key.superbwarfare.edit_scope": "Switch Scope",
|
||||||
"key.superbwarfare.edit_barrel": "Switch Barrel",
|
"key.superbwarfare.edit_barrel": "Switch Barrel",
|
||||||
|
@ -492,6 +493,7 @@
|
||||||
"tips.superbwarfare.monitor.already_linked": "This monitor has been connected!",
|
"tips.superbwarfare.monitor.already_linked": "This monitor has been connected!",
|
||||||
"tips.superbwarfare.drone.already_linked": "This device has been connected!",
|
"tips.superbwarfare.drone.already_linked": "This device has been connected!",
|
||||||
"tips.superbwarfare.monitor.unlinked": "Disconnect!",
|
"tips.superbwarfare.monitor.unlinked": "Disconnect!",
|
||||||
|
"tips.superbwarfare.no_cloth_config": "You have not installed Cloth Config API, cannot open the config interface",
|
||||||
"tips.superbwarfare.drone.distance": "DISTANCE:",
|
"tips.superbwarfare.drone.distance": "DISTANCE:",
|
||||||
"tips.superbwarfare.drone.health": "HEALTH:",
|
"tips.superbwarfare.drone.health": "HEALTH:",
|
||||||
"tips.superbwarfare.drone.ammo": "AMMO:",
|
"tips.superbwarfare.drone.ammo": "AMMO:",
|
||||||
|
|
|
@ -453,6 +453,7 @@
|
||||||
"key.superbwarfare.interact": "交互",
|
"key.superbwarfare.interact": "交互",
|
||||||
"key.superbwarfare.dismount": "离开载具",
|
"key.superbwarfare.dismount": "离开载具",
|
||||||
"key.superbwarfare.breath": "屏息",
|
"key.superbwarfare.breath": "屏息",
|
||||||
|
"key.superbwarfare.config": "打开配置界面",
|
||||||
"key.superbwarfare.edit_mode": "改装",
|
"key.superbwarfare.edit_mode": "改装",
|
||||||
"key.superbwarfare.edit_scope": "切换瞄准镜",
|
"key.superbwarfare.edit_scope": "切换瞄准镜",
|
||||||
"key.superbwarfare.edit_barrel": "切换枪管配件",
|
"key.superbwarfare.edit_barrel": "切换枪管配件",
|
||||||
|
@ -490,6 +491,7 @@
|
||||||
"tips.superbwarfare.monitor.already_linked": "这个遥控器已连接到一个设备!",
|
"tips.superbwarfare.monitor.already_linked": "这个遥控器已连接到一个设备!",
|
||||||
"tips.superbwarfare.drone.already_linked": "这个设备已被连接!",
|
"tips.superbwarfare.drone.already_linked": "这个设备已被连接!",
|
||||||
"tips.superbwarfare.monitor.unlinked": "断开连接!",
|
"tips.superbwarfare.monitor.unlinked": "断开连接!",
|
||||||
|
"tips.superbwarfare.no_cloth_config": "您尚未安装 Cloth Config API,无法打开配置界面",
|
||||||
"tips.superbwarfare.drone.distance": "飞手距离:",
|
"tips.superbwarfare.drone.distance": "飞手距离:",
|
||||||
"tips.superbwarfare.drone.health": "耐久值:",
|
"tips.superbwarfare.drone.health": "耐久值:",
|
||||||
"tips.superbwarfare.drone.ammo": "弹药:",
|
"tips.superbwarfare.drone.ammo": "弹药:",
|
||||||
|
|
Loading…
Add table
Reference in a new issue