More moves and compilation fixes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user