More moves and compilation fixes

This commit is contained in:
Sebastian Hartte
2020-06-29 02:15:31 +02:00
parent 3df93fc66d
commit 0d63f560d3
240 changed files with 2221 additions and 1926 deletions
@@ -1,22 +0,0 @@
package appeng.client;
import org.lwjgl.glfw.GLFW;
public enum ActionKey {
TOGGLE_FOCUS(GLFW.GLFW_KEY_TAB);
private final int defaultKey;
private ActionKey(int defaultKey) {
this.defaultKey = defaultKey;
}
public String getTranslationKey() {
return "key." + this.name().toLowerCase() + ".desc";
}
public int getDefaultKey() {
return this.defaultKey;
}
}
@@ -26,6 +26,7 @@ import java.util.Random;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.util.InputMappings;
import net.minecraft.client.util.InputUtil;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.Hand;
@@ -91,9 +92,6 @@ public class ClientHelper extends ServerHelper {
case Energy:
this.spawnEnergy(world, posX, posY, posZ);
return;
case Lightning:
this.spawnLightning(world, posX, posY, posZ);
return;
case LightningArc:
this.spawnLightningArc(world, posX, posY, posZ, (Vec3d) o);
return;
@@ -188,11 +186,6 @@ public class ClientHelper extends ServerHelper {
-x * 0.1, -y * 0.1, -z * 0.1);
}
private void spawnLightning(final World world, final double posX, final double posY, final double posZ) {
MinecraftClient.getInstance().particleManager.addParticle(ParticleTypes.LIGHTNING, posX, posY + 0.3f, posZ, 0.0f, 0.0f,
0.0f);
}
private void spawnLightningArc(final World world, final double posX, final double posY, final double posZ,
final Vec3d second) {
final LightningFX fx = new LightningArcFX(world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
@@ -220,7 +213,7 @@ public class ClientHelper extends ServerHelper {
}
@Override
public boolean isActionKey(ActionKey key, InputMappings.Input pressedKey) {
public boolean isActionKey(ActionKey key, InputUtil.Key pressedKey) {
return this.bindings.get(key).isActiveAndMatches(pressedKey);
}
}
@@ -1,23 +0,0 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.client;
public enum EffectType {
Energy, Lightning, Vibrant, LightningArc
}
@@ -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)) {
@@ -30,11 +30,11 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.math.AffineTransformation;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.entity.LivingEntity;
import net.minecraft.fluid.Fluids;
@@ -99,9 +99,9 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
fluidStack = new FluidVolume(Fluids.WATER, FluidAttributes.BUCKET_VOLUME);
}
FluidAttributes attributes = fluidStack.getFluid().getAttributes();
FluidAttributes attributes = fluidStack.getFluidKey().getAttributes();
Identifier stillTexture = attributes.getStillTexture(fluidStack);
Material stillMaterial = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, stillTexture);
Material stillMaterial = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX, stillTexture);
Sprite sprite = DummyFluidDispatcherBakedModel.this.bakedTextureGetter.apply(stillMaterial);
if (sprite == null) {
return new DummyFluidBakedModel(ImmutableList.of());
@@ -20,7 +20,7 @@ package appeng.client.render;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.renderer.Vector4f;
@@ -66,9 +66,9 @@ public enum FacingToRotation implements StringIdentifiable {
this.rot = rot;
this.mat = new Matrix4f();
this.mat.setIdentity();
this.mat.mul(xRot = Vector3f.XP.rotationDegrees(rot.getX()));
this.mat.mul(yRot = Vector3f.YP.rotationDegrees(rot.getY()));
this.mat.mul(zRot = Vector3f.ZP.rotationDegrees(rot.getZ()));
this.mat.mul(xRot = Vector3f.POSITIVE_X.getDegreesQuaternion(rot.getX()));
this.mat.mul(yRot = Vector3f.POSITIVE_Y.getDegreesQuaternion(rot.getY()));
this.mat.mul(zRot = Vector3f.POSITIVE_Z.getDegreesQuaternion(rot.getZ()));
}
public boolean isRedundant() {
@@ -84,9 +84,9 @@ public enum FacingToRotation implements StringIdentifiable {
}
public void push(MatrixStack mStack) {
mStack.rotate(xRot);
mStack.rotate(yRot);
mStack.rotate(zRot);
mStack.multiply(xRot);
mStack.multiply(yRot);
mStack.multiply(zRot);
}
public Direction rotate(Direction facing) {
@@ -82,7 +82,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
// The skybox is pitch black and untextured
for (Quaternion rotation : SKYBOX_SIDE_ROTATIONS) {
matrixStack.push();
matrixStack.rotate(rotation);
matrixStack.multiply(rotation);
RenderSystem.disableTexture();
VertexBuffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
@@ -47,25 +47,25 @@ public class TesrRenderHelper {
public static void rotateToFace(MatrixStack mStack, Direction face, byte spin) {
switch (face) {
case UP:
mStack.rotate(Vector3f.XP.rotationDegrees(270));
mStack.rotate(Vector3f.ZP.rotationDegrees(-spin * 90.0F));
mStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(270));
mStack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(-spin * 90.0F));
break;
case DOWN:
mStack.rotate(Vector3f.XP.rotationDegrees(90.0F));
mStack.rotate(Vector3f.ZP.rotationDegrees(spin * -90.0F));
mStack.multiply(Vector3f.POSITIVE_X.getDegreesQuaternion(90.0F));
mStack.multiply(Vector3f.POSITIVE_Z.getDegreesQuaternion(spin * -90.0F));
break;
case EAST:
mStack.rotate(Vector3f.YP.rotationDegrees(90.0F));
mStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(90.0F));
break;
case WEST:
mStack.rotate(Vector3f.YP.rotationDegrees(-90.0F));
mStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-90.0F));
break;
case NORTH:
mStack.rotate(Vector3f.YP.rotationDegrees(180.0F));
mStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(180.0F));
break;
case SOUTH:
@@ -27,7 +27,7 @@ import java.util.function.Function;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.Direction;
import net.minecraft.util.Identifier;
@@ -99,7 +99,7 @@ class CableBuilder {
throw new IllegalStateException("Cable type " + cableType + " does not support connections.");
}
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, textureFolder + color.name().toLowerCase()));
}
@@ -1,6 +1,6 @@
package appeng.client.render.cablebus;
import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.ParticleTextureSheet;
import net.minecraft.client.particle.SpriteBillboardParticle;
import net.minecraft.client.texture.Sprite;
import net.minecraft.world.World;
@@ -19,7 +19,7 @@ public class CableBusBreakingParticle extends SpriteBillboardParticle {
double speedZ, Sprite sprite) {
super(world, x, y, z, speedX, speedY, speedZ);
this.setSprite(sprite);
this.particleGravity = 1.0F;
this.gravityStrength = 1.0F;
this.particleScale /= 2.0F;
this.field_217571_C = this.rand.nextFloat() * 3.0F;
this.field_217572_F = this.rand.nextFloat() * 3.0F;
@@ -30,8 +30,8 @@ public class CableBusBreakingParticle extends SpriteBillboardParticle {
}
@Override
public IParticleRenderType getRenderType() {
return IParticleRenderType.TERRAIN_SHEET;
public ParticleTextureSheet getRenderType() {
return ParticleTextureSheet.TERRAIN_SHEET;
}
@Override
@@ -24,7 +24,7 @@ import java.util.Map;
import com.google.common.collect.ImmutableMap;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.util.Identifier;
import appeng.api.util.AECableType;
@@ -73,7 +73,7 @@ public enum CableCoreType {
}
public Material getTexture(AEColor color) {
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, this.textureFolder + "/" + color.name().toLowerCase()));
}
@@ -33,7 +33,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.client.color.block.BlockColors;
import net.minecraft.client.render.model.BakedQuad;
@@ -191,7 +191,7 @@ public class FacadeBuilder {
List<Box> holeStrips = getBoxes(facadeBox, cutOutBox, side.getAxis());
ILightReader facadeAccess = new FacadeBlockAccess(parentWorld, pos, side, blockState);
BlockRendererDispatcher dispatcher = MinecraftClient.getInstance().getBlockRendererDispatcher();
BlockRenderManager dispatcher = MinecraftClient.getInstance().getBlockRenderManager();
BakedModel model = dispatcher.getModelForState(blockState);
IModelData modelData = model.getModelData(facadeAccess, pos, blockState, EmptyModelData.INSTANCE);
@@ -13,7 +13,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -22,7 +22,7 @@ import net.minecraftforge.client.model.geometry.IModelGeometry;
import appeng.core.AppEng;
public class P2PTunnelFrequencyModel implements IModelGeometry<P2PTunnelFrequencyModel> {
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final Material TEXTURE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "parts/p2p_tunnel_frequency"));
@Override
@@ -21,7 +21,7 @@ package appeng.client.render.cablebus;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.client.util.math.Vector3f;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
@@ -22,7 +22,7 @@ import java.util.Arrays;
import java.util.function.Function;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
@@ -44,7 +44,7 @@ public class SmartCableTextures {
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_12"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_13"), //
new Identifier(AppEng.MOD_ID, "parts/cable/smart/channels_14")//
}).map(e -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, e)).toArray(Material[]::new);
}).map(e -> new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX, e)).toArray(Material[]::new);
// Textures used to display channels on smart cables. There's two sets of 5
// textures each, and
@@ -31,7 +31,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -121,7 +121,7 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
}
private static Material texture(String name) {
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "block/crafting/" + name));
}
}
@@ -1,73 +0,0 @@
package appeng.client.render.model;
import java.util.Objects;
import javax.annotation.Nullable;
import com.google.common.base.Preconditions;
import net.minecraft.util.math.Direction;
import net.minecraftforge.client.model.data.ModelProperty;
/**
* This implementation of IModelData allows us to know precisely which data is
* part of the model data. This is relevant for {@link AutoRotatingBakedModel}
* and {@link AutoRotatingCacheKey}.
*/
public class AEModelData implements IModelData {
private final Direction up;
private final Direction forward;
public AEModelData(Direction up, Direction forward) {
this.up = Preconditions.checkNotNull(up);
this.forward = Preconditions.checkNotNull(forward);
}
public Direction getUp() {
return up;
}
public Direction getForward() {
return forward;
}
public boolean isCacheable() {
return true;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AEModelData that = (AEModelData) o;
return up == that.up && forward == that.forward;
}
@Override
public int hashCode() {
return Objects.hash(up, forward);
}
@Override
public boolean hasProperty(ModelProperty<?> prop) {
return false;
}
@Nullable
@Override
public <T> T getData(ModelProperty<T> prop) {
throw new IllegalStateException();
}
@Nullable
@Override
public <T> T setData(ModelProperty<T> prop, T data) {
throw new IllegalStateException();
}
}
@@ -15,7 +15,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -30,7 +30,7 @@ import appeng.core.AppEng;
public class BiometricCardModel implements IModelGeometry<BiometricCardModel> {
public static final Identifier MODEL_BASE = new Identifier(AppEng.MOD_ID, "item/biometric_card_base");
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final Material TEXTURE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "item/biometric_card_hash"));
@Override
@@ -13,7 +13,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -30,11 +30,11 @@ public class ColorApplicatorModel implements IModelGeometry<ColorApplicatorModel
private static final Identifier MODEL_BASE = new Identifier(AppEng.MOD_ID,
"item/color_applicator_colored");
private static final Material TEXTURE_DARK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final Material TEXTURE_DARK = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "item/color_applicator_tip_dark"));
private static final Material TEXTURE_MEDIUM = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final Material TEXTURE_MEDIUM = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "item/color_applicator_tip_medium"));
private static final Material TEXTURE_BRIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final Material TEXTURE_BRIGHT = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "item/color_applicator_tip_bright"));
@Override
@@ -28,7 +28,7 @@ import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.item.Item;
import net.minecraft.util.math.Direction;
@@ -35,7 +35,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
@@ -64,13 +64,13 @@ class GlassBakedModel implements IDynamicBakedModel {
private static final byte[][][] OFFSETS = generateOffsets();
// Alternating textures based on position
static final Material TEXTURE_A = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final Material TEXTURE_A = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier("appliedenergistics2:block/glass/quartz_glass_a"));
static final Material TEXTURE_B = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final Material TEXTURE_B = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier("appliedenergistics2:block/glass/quartz_glass_b"));
static final Material TEXTURE_C = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final Material TEXTURE_C = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier("appliedenergistics2:block/glass/quartz_glass_c"));
static final Material TEXTURE_D = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final Material TEXTURE_D = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier("appliedenergistics2:block/glass/quartz_glass_d"));
// Frame texture
@@ -80,7 +80,7 @@ class GlassBakedModel implements IDynamicBakedModel {
private static Material[] generateTexturesFrame() {
return IntStream.range(1, 16).mapToObj(Integer::toBinaryString).map(s -> Strings.padStart(s, 4, '0'))
.map(s -> new Identifier("appliedenergistics2:block/glass/quartz_glass_frame" + s))
.map(rl -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, rl)).toArray(Material[]::new);
.map(rl -> new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX, rl)).toArray(Material[]::new);
}
private final Sprite[] glassTextures;
@@ -20,7 +20,7 @@ package appeng.client.render.model;
import java.util.List;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.client.renderer.Vector4f;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
@@ -15,7 +15,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -30,7 +30,7 @@ import appeng.core.AppEng;
public class MemoryCardModel implements IModelGeometry<MemoryCardModel> {
public static final Identifier MODEL_BASE = new Identifier(AppEng.MOD_ID, "item/memory_card_base");
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final Material TEXTURE = new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "item/memory_card_hash"));
@Override
@@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.render.model.json.ModelOverrideList;
@@ -34,7 +34,7 @@ import net.minecraft.client.render.model.IUnbakedModel;
import net.minecraft.client.render.model.json.ModelOverrideList;
import net.minecraft.client.render.model.Material;
import net.minecraft.client.render.model.ModelLoader;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.Identifier;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -65,7 +65,7 @@ public class SpatialPylonModel implements IModelGeometry<SpatialPylonModel> {
}
private static Material getTexturePath(SpatialPylonTextureType type) {
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
return new Material(SpriteAtlasTexture.BLOCK_ATLAS_TEX,
new Identifier(AppEng.MOD_ID, "block/spatial_pylon/" + type.name().toLowerCase()));
}
@@ -24,11 +24,11 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.util.math.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.Atlases;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
@@ -56,13 +56,13 @@ public class CrankTESR extends BlockEntityRenderer<CrankBlockEntity> {
ms.push();
ms.translate(0.5, 0.5, 0.5);
FacingToRotation.get(te.getForward(), te.getUp()).push(ms);
ms.rotate(new Quaternion(0, te.getVisibleRotation(), 0, true));
ms.multiply(new Quaternion(0, te.getVisibleRotation(), 0, true));
ms.translate(-0.5, -0.5, -0.5);
BlockState blockState = te.getCachedState();
BlockRendererDispatcher dispatcher = MinecraftClient.getInstance().getBlockRendererDispatcher();
BlockRenderManager dispatcher = MinecraftClient.getInstance().getBlockRenderManager();
BakedModel model = dispatcher.getModelForState(blockState);
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
VertexConsumer buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1,
combinedLightIn, combinedOverlayIn);
ms.pop();
@@ -3,10 +3,10 @@ package appeng.client.render.tesr;
import java.util.EnumMap;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.renderer.RenderState;
@@ -84,7 +84,7 @@ public class DriveLedTileEntityRenderer extends BlockEntityRenderer<DriveBlockEn
.getPrivateValue(RenderState.class, null, "field_228515_g_");
RenderLayer rt = RenderLayer.makeType("ae_drive_leds", DefaultVertexFormats.POSITION_COLOR, 7, 32565, false, true,
RenderLayer.State.getBuilder().transparency(TRANSLUCENT_TRANSPARENCY).build(false));
IVertexBuilder buffer = buffers.getBuffer(STATE);
VertexConsumer buffer = buffers.getBuffer(STATE);
for (int row = 0; row < 5; row++) {
for (int col = 0; col < 2; col++) {
@@ -3,11 +3,11 @@ package appeng.client.render.tesr;
import alexiil.mc.lib.attributes.item.FixedItemInv;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.texture.Sprite;
import net.minecraft.client.util.math.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Quaternion;
@@ -84,7 +84,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
final Sprite tas = TEXTURE_INSIDE.getSprite();
IVertexBuilder buffer = buffers.getBuffer(RenderLayer.getSolid());
VertexConsumer buffer = buffers.getBuffer(RenderLayer.getSolid());
// Bottom of Top Stamp
addVertex(buffer, ms, tas, TwoPx, middle + press, TwoPx, 2, 13, combinedOverlay, combinedLight, Direction.DOWN);
@@ -171,7 +171,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
ms.pop();
}
private static void addVertex(IVertexBuilder vb, MatrixStack ms, Sprite sprite, float x, float y,
private static void addVertex(VertexConsumer vb, MatrixStack ms, Sprite sprite, float x, float y,
float z, double texU, double texV, int overlayUV, int lightmapUV, Direction front) {
vb.pos(ms.getLast().getMatrix(), x, y, z);
vb.color(1.0f, 1.0f, 1.0f, 1.0f);
@@ -190,7 +190,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
ms.push();
// move to center
ms.translate(0.5f, 0.5f + o, 0.5f);
ms.rotate(new Quaternion(90, 0, 0, true));
ms.multiply(new Quaternion(90, 0, 0, true));
// set scale
ms.scale(ITEM_RENDER_SCALE, ITEM_RENDER_SCALE, ITEM_RENDER_SCALE);
@@ -20,10 +20,10 @@ package appeng.client.render.tesr;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.Atlases;
@@ -73,23 +73,23 @@ public class SkyChestTESR extends BlockEntityRenderer<SkyChestBlockEntity> {
matrixStackIn.push();
float f = tileEntityIn.getForward().getHorizontalAngle();
matrixStackIn.translate(0.5D, 0.5D, 0.5D);
matrixStackIn.rotate(Vector3f.YP.rotationDegrees(-f));
matrixStackIn.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-f));
matrixStackIn.translate(-0.5D, -0.5D, -0.5D);
float f1 = tileEntityIn.getLidAngle(partialTicks);
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
Material material = this.getMaterial(tileEntityIn);
IVertexBuilder ivertexbuilder = material.getBuffer(bufferIn, RenderLayer::getEntityCutout);
VertexConsumer ivertexbuilder = material.getBuffer(bufferIn, RenderLayer::getEntityCutout);
this.renderModels(matrixStackIn, ivertexbuilder, this.singleLid, this.singleLatch, this.singleBottom, f1,
combinedLightIn, combinedOverlayIn);
matrixStackIn.pop();
}
private void renderModels(MatrixStack matrixStackIn, IVertexBuilder bufferIn, ModelRenderer chestLid,
ModelRenderer chestLatch, ModelRenderer chestBottom, float lidAngle, int combinedLightIn,
int combinedOverlayIn) {
private void renderModels(MatrixStack matrixStackIn, VertexConsumer bufferIn, ModelRenderer chestLid,
ModelRenderer chestLatch, ModelRenderer chestBottom, float lidAngle, int combinedLightIn,
int combinedOverlayIn) {
chestLid.rotateAngleX = -(lidAngle * 1.5707964F);
chestLatch.rotateAngleX = chestLid.rotateAngleX;
chestLid.render(matrixStackIn, bufferIn, combinedLightIn, combinedOverlayIn);
@@ -19,15 +19,15 @@
package appeng.client.render.tesr;
import net.fabricmc.api.EnvType;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.util.math.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.renderer.Atlases;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.util.math.Direction;
@@ -41,7 +41,7 @@ import appeng.tile.misc.SkyCompassBlockEntity;
@Environment(EnvType.CLIENT)
public class SkyCompassTESR extends BlockEntityRenderer<SkyCompassBlockEntity> {
private static BlockRendererDispatcher blockRenderer;
private static BlockRenderManager blockRenderer;
public SkyCompassTESR(BlockEntityRenderDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
@@ -52,10 +52,10 @@ public class SkyCompassTESR extends BlockEntityRenderer<SkyCompassBlockEntity> {
int combinedLightIn, int combinedOverlayIn) {
if (blockRenderer == null) {
blockRenderer = MinecraftClient.getInstance().getBlockRendererDispatcher();
blockRenderer = MinecraftClient.getInstance().getBlockRenderManager();
}
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
VertexConsumer buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
BlockState blockState = te.getCachedState();
BakedModel model = blockRenderer.getBlockModelShapes().getModel(blockState);