More moves and compilation fixes
This commit is contained in:
@@ -32,6 +32,7 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.util.Formatting;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -42,7 +43,7 @@ import net.minecraft.client.gui.widget.Widget;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.texture.SpriteAtlasTexture;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -499,7 +500,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
return Preconditions.checkNotNull(getMinecraft().player);
|
||||
}
|
||||
|
||||
protected boolean checkHotbarKeys(final InputMappings.Input input) {
|
||||
protected boolean checkHotbarKeys(final InputUtil.Key input) {
|
||||
final Slot theSlot = this.getSlotUnderMouse();
|
||||
|
||||
if (getPlayer().inventory.getItemStack().isEmpty() && theSlot != null) {
|
||||
@@ -645,10 +646,10 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
RenderSystem.disableBlend();
|
||||
final Fluid fluid = fs.getFluid();
|
||||
FluidAttributes fluidAttributes = fluid.getAttributes();
|
||||
bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE);
|
||||
bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
|
||||
Identifier fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
|
||||
final Sprite sprite = getMinecraft()
|
||||
.getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture);
|
||||
.getAtlasSpriteGetter(SpriteAtlasTexture.BLOCK_ATLAS_TEX).apply(fluidStillTexture);
|
||||
|
||||
// Set color for dynamic fluids
|
||||
// Convert int color to RGB
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.function.Consumer;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.screen.ScreenHandlerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -34,7 +34,7 @@ import appeng.tile.storage.ChestBlockEntity;
|
||||
final class AESubScreen {
|
||||
|
||||
private final AEBaseScreen<?> gui;
|
||||
private final ContainerType<?> previousContainerType;
|
||||
private final ScreenHandlerType<?> previousContainerType;
|
||||
private final ItemStack previousContainerIcon;
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.WeakHashMap;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
@@ -106,7 +107,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
final Object lineObj = this.lines.get(ex + x);
|
||||
if (lineObj instanceof ClientDCInternalInv) {
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
for (int z = 0; z < inv.getInventory().getSlots(); z++) {
|
||||
for (int z = 0; z < inv.getInventory().getSlotCount(); z++) {
|
||||
this.container.inventorySlots.add(new SlotDisconnected(inv, z, z * 18 + 8, 1 + offset));
|
||||
}
|
||||
} else if (lineObj instanceof String) {
|
||||
@@ -153,7 +154,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
|
||||
RenderSystem.color4f(1, 1, 1, 1);
|
||||
final int width = inv.getInventory().getSlots() * 18;
|
||||
final int width = inv.getInventory().getSlotCount() * 18;
|
||||
GuiUtils.drawTexturedModalRect(offsetX + 7, offsetY + offset, 7, 139, width, 18, getBlitOffset());
|
||||
}
|
||||
offset += 18;
|
||||
@@ -179,7 +180,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
InputUtil.Key input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
|
||||
if (keyCode != GLFW.GLFW_KEY_ESCAPE) {
|
||||
if (AppEng.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
|
||||
@@ -211,7 +212,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
this.refreshList = true;
|
||||
}
|
||||
|
||||
for (final Object oKey : in.keySet()) {
|
||||
for (final Object oKey : in.getKeys()) {
|
||||
final String key = (String) oKey;
|
||||
if (key.startsWith("=")) {
|
||||
try {
|
||||
@@ -220,10 +221,10 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
Text un = Text.Serializer.fromJson(invData.getString("un"));
|
||||
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
|
||||
|
||||
for (int x = 0; x < current.getInventory().getSlots(); x++) {
|
||||
for (int x = 0; x < current.getInventory().getSlotCount(); x++) {
|
||||
final String which = Integer.toString(x);
|
||||
if (invData.contains(which)) {
|
||||
current.getInventory().setStackInSlot(x, ItemStack.fromTag(invData.getCompound(which)));
|
||||
current.getInventory().setInvStack(x, ItemStack.fromTag(invData.getCompound(which)));
|
||||
}
|
||||
}
|
||||
} catch (final NumberFormatException ignored) {
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.client.gui.implementations;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
@@ -383,7 +384,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
InputUtil.Key input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
|
||||
if (keyCode != GLFW.GLFW_KEY_ESCAPE && !this.checkHotbarKeys(input)) {
|
||||
if (AppEng.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
@@ -83,7 +84,7 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
|
||||
|
||||
InputMappings.Input input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
InputUtil.Key input = InputMappings.getInputByCode(keyCode, scanCode);
|
||||
|
||||
if (keyCode != GLFW.GLFW_KEY_ESCAPE && !this.checkHotbarKeys(input)) {
|
||||
if (AppEng.proxy.isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
|
||||
|
||||
Reference in New Issue
Block a user