Utils ported
This commit is contained in:
@@ -115,9 +115,9 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
public BakedModel getModelWithOverrides(BakedModel originalModel, ItemStack stack, @Nullable World world,
|
||||
@Nullable LivingEntity entity) {
|
||||
boolean shiftHeld = Screen.hasShiftDown();
|
||||
if (shiftHeld) {
|
||||
if (shiftHeld && world != null) {
|
||||
EncodedPatternItem iep = (EncodedPatternItem) stack.getItem();
|
||||
ItemStack output = iep.getOutput(stack);
|
||||
ItemStack output = iep.getOutput(world, stack);
|
||||
if (!output.isEmpty()) {
|
||||
BakedModel realModel = MinecraftClient.getInstance().getItemRenderer().getItemModelMesher()
|
||||
.getItemModel(output);
|
||||
|
||||
@@ -62,9 +62,9 @@ public class EnergyFx extends SpriteTexturedParticle {
|
||||
|
||||
@Override
|
||||
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
|
||||
float x = (float) (this.prevPosX + (this.posX - this.prevPosX) * partialTicks);
|
||||
float y = (float) (this.prevPosY + (this.posY - this.prevPosY) * partialTicks);
|
||||
float z = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * partialTicks);
|
||||
float x = (float) (this.prevX + (this.posX - this.prevX) * partialTicks);
|
||||
float y = (float) (this.prevY + (this.posY - this.prevY) * partialTicks);
|
||||
float z = (float) (this.prevZ + (this.posZ - this.prevZ) * partialTicks);
|
||||
|
||||
final int blkX = MathHelper.floor(x);
|
||||
final int blkY = MathHelper.floor(y);
|
||||
|
||||
@@ -91,9 +91,9 @@ public class LightningFX extends SpriteTexturedParticle {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevX = this.posX;
|
||||
this.prevY = this.posY;
|
||||
this.prevZ = this.posZ;
|
||||
|
||||
if (this.age++ >= this.maxAge) {
|
||||
this.setExpired();
|
||||
@@ -109,9 +109,9 @@ public class LightningFX extends SpriteTexturedParticle {
|
||||
@Override
|
||||
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
|
||||
Vec3d vec3d = renderInfo.getProjectedView();
|
||||
float centerX = (float) (MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - vec3d.getX());
|
||||
float centerY = (float) (MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - vec3d.getY());
|
||||
float centerZ = (float) (MathHelper.lerp(partialTicks, this.prevPosZ, this.posZ) - vec3d.getZ());
|
||||
float centerX = (float) (MathHelper.lerp(partialTicks, this.prevX, this.posX) - vec3d.getX());
|
||||
float centerY = (float) (MathHelper.lerp(partialTicks, this.prevY, this.posY) - vec3d.getY());
|
||||
float centerZ = (float) (MathHelper.lerp(partialTicks, this.prevZ, this.posZ) - vec3d.getZ());
|
||||
|
||||
final float j = 1.0f;
|
||||
float red = this.particleRed * j * 0.9f;
|
||||
|
||||
@@ -54,9 +54,9 @@ public class MatterCannonFX extends SpriteTexturedParticle {
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevX = this.posX;
|
||||
this.prevY = this.posY;
|
||||
this.prevZ = this.posZ;
|
||||
|
||||
if (this.age++ >= this.maxAge) {
|
||||
this.setExpired();
|
||||
|
||||
@@ -44,9 +44,9 @@ public class VibrantFX extends SpriteTexturedParticle {
|
||||
this.motionX = 0.0D;
|
||||
this.motionY = 0.0D;
|
||||
this.motionZ = 0.0D;
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevX = this.posX;
|
||||
this.prevY = this.posY;
|
||||
this.prevZ = this.posZ;
|
||||
this.maxAge = (int) (20.0D / (Math.random() * 0.8D + 0.1D));
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ public class VibrantFX extends SpriteTexturedParticle {
|
||||
*/
|
||||
@Override
|
||||
public void tick() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
this.prevX = this.posX;
|
||||
this.prevY = this.posY;
|
||||
this.prevZ = this.posZ;
|
||||
// this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.particleScale *= 0.95;
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
|
||||
if (world != null && entity instanceof ClientPlayerEntity) {
|
||||
PlayerEntity player = (PlayerEntity) entity;
|
||||
|
||||
float offRads = (float) (player.rotationYaw / 180.0f * (float) Math.PI + Math.PI);
|
||||
float offRads = (float) (player.yaw / 180.0f * (float) Math.PI + Math.PI);
|
||||
|
||||
SkyCompassBakedModel.this.fallbackRotation = offRads
|
||||
+ getAnimatedRotation(player.getPosition(), true);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
package appeng.client.render.tesr;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
import alexiil.mc.lib.attributes.item.FixedItemInv;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.VertexConsumerProvider;
|
||||
import net.minecraft.client.render.model.json.ModelTransformation;
|
||||
@@ -126,16 +126,16 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
|
||||
// render items.
|
||||
|
||||
ItemTransferable tileInv = tile.getInternalInventory();
|
||||
FixedItemInv tileInv = tile.getInternalInventory();
|
||||
|
||||
int items = 0;
|
||||
if (!tileInv.getStackInSlot(0).isEmpty()) {
|
||||
if (!tileInv.getInvStack(0).isEmpty()) {
|
||||
items++;
|
||||
}
|
||||
if (!tileInv.getStackInSlot(1).isEmpty()) {
|
||||
if (!tileInv.getInvStack(1).isEmpty()) {
|
||||
items++;
|
||||
}
|
||||
if (!tileInv.getStackInSlot(2).isEmpty()) {
|
||||
if (!tileInv.getInvStack(2).isEmpty()) {
|
||||
items++;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
// consumed, see below)
|
||||
renderPresses = false;
|
||||
|
||||
ItemStack is = tileInv.getStackInSlot(3);
|
||||
ItemStack is = tileInv.getInvStack(3);
|
||||
|
||||
if (is.isEmpty()) {
|
||||
final InscriberRecipe ir = tile.getTask();
|
||||
@@ -160,12 +160,12 @@ public final class InscriberTESR extends BlockEntityRenderer<InscriberBlockEntit
|
||||
this.renderItem(ms, is, 0.0f, buffers, combinedLight, combinedOverlay);
|
||||
} else {
|
||||
renderPresses = true;
|
||||
this.renderItem(ms, tileInv.getStackInSlot(2), 0.0f, buffers, combinedLight, combinedOverlay);
|
||||
this.renderItem(ms, tileInv.getInvStack(2), 0.0f, buffers, combinedLight, combinedOverlay);
|
||||
}
|
||||
|
||||
if (renderPresses) {
|
||||
this.renderItem(ms, tileInv.getStackInSlot(0), press, buffers, combinedLight, combinedOverlay);
|
||||
this.renderItem(ms, tileInv.getStackInSlot(1), -press, buffers, combinedLight, combinedOverlay);
|
||||
this.renderItem(ms, tileInv.getInvStack(0), press, buffers, combinedLight, combinedOverlay);
|
||||
this.renderItem(ms, tileInv.getInvStack(1), -press, buffers, combinedLight, combinedOverlay);
|
||||
}
|
||||
|
||||
ms.pop();
|
||||
|
||||
Reference in New Issue
Block a user