Keybindings optimisations (#5389)

* Shift keybinds to a builder pattern to avoid the array length issue, use Bitsets for the boolean arrays, remove unused and redundant constructor

* Use proper lang keys for KeyBinding creation instead of pre-localising

* WIP tidy keyhandler tick method

* more key handler tidying

* tweak handler to use translation placeholders so languages can reconfigure the foo: bar display

* add todo

* move tank, bow & flamethrower keys to use string format placeholders

* fix NPE on configurator changes

* nullable annotations

* prefix keybind lang keys with modid

* make datafixers into their own thing

* make a datafixer base class

* remove keybind fixer, options datafixers dont work

* Revert "remove keybind fixer, options datafixers dont work"

This reverts commit c57f6c1b05ed6b26e7fb7774bada4ca53f6c655e.

* datafix the keybinds to the new format

* documentation

* Remove unused import and extra dash from runClient args
This commit is contained in:
Xander authored and Richard Freimer committed 2019-05-10 16:58:57 -04:00
1 parent b570ef7110
commit 31b06c0ab0
39 files changed
+572 -248

No files matched your search

@@ -1,6 +1,7 @@
package mekanism.client.render.tileentity;
import java.util.HashMap;
import java.util.Objects;
import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.render.MekanismRenderer.DisplayInteger;
@@ -15,6 +16,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
@@ -44,11 +46,12 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
ItemStack itemStack = player.inventory.getCurrentItem();
RayTraceResult pos = player.rayTrace(8.0D, 1.0F);
if (pos != null && !itemStack.isEmpty() && itemStack.getItem() instanceof ItemConfigurator
&& ((ItemConfigurator) itemStack.getItem()).getState(itemStack).isConfigurating()) {
Item item = itemStack.getItem();
if (pos != null && !itemStack.isEmpty() && item instanceof ItemConfigurator
&& ((ItemConfigurator) item).getState(itemStack).isConfigurating()) {
BlockPos bp = pos.getBlockPos();
TransmissionType type = ((ItemConfigurator) itemStack.getItem()).getState(itemStack).getTransmission();
TransmissionType type = Objects.requireNonNull(((ItemConfigurator) item).getState(itemStack).getTransmission(), "Configurating state requires transmission type");
if (configurable.getConfig().supports(type)) {
if (bp.equals(configurable.getPos())) {