This commit is contained in:
gnembon committed 2019-09-27 16:35:41 -05:00
1 parent 5d25dd9c9d
commit 1195b95d0d
7 files changed
+27 -18

No files matched your search

@@ -17,7 +17,7 @@ import org.spongepowered.asm.mixin.Shadow;
@Mixin(BlockEntityRenderDispatcher.class)
public abstract class BlockEntityRenderDispatcher_movableTEMixin implements BlockEntityRenderDispatcherInterface
{
{/*
@Shadow
public static double renderOffsetX;
@Shadow
@@ -41,11 +41,11 @@ public abstract class BlockEntityRenderDispatcher_movableTEMixin implements Bloc
}
}
@Shadow
public abstract <T extends BlockEntity> BlockEntityRenderer<T> get(/*@Nullable*/ BlockEntity blockEntity_1);
public abstract <T extends BlockEntity> BlockEntityRenderer<T> get(/@Nullable/ BlockEntity blockEntity_1);
/**
* @author 2No2Name
*/
/
@author 2No2Name
/
//Renders the BlockEntity offset by the amount specified in the arguments xOffset yOffset zOffset (the moving block moved in the animation by this)
//Code copied and modified from BlockEntityRenderDispatcher::render(BlockEntity blockEntity_1, float float_1, int int_1, BlockRenderLayer blockRenderLayer_1, BufferBuilder bufferBuilder_1)
public void renderBlockEntityOffset(BlockEntity blockEntity_1, float partialTicks, int destroyStage, BlockRenderLayer blockRenderLayer_1, BufferBuilder bufferBuilder_1, double xOffset,
@@ -67,5 +67,5 @@ public abstract class BlockEntityRenderDispatcher_movableTEMixin implements Bloc
}
}
}
}
}*/
}
@@ -1,14 +1,11 @@
package carpet.mixins;
import carpet.settings.CarpetSettings;
import carpet.fakes.BlockEntityRenderDispatcherInterface;
import carpet.fakes.PistonBlockEntityInterface;
import net.minecraft.block.BlockRenderLayer;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.PistonBlockEntity;
import net.minecraft.class_4587;
import net.minecraft.class_4597;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.PistonBlockEntityRenderer;
@@ -21,6 +18,11 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(PistonBlockEntityRenderer.class)
public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEntityRenderer<PistonBlockEntity>
{
public PistonBlockEntityRenderer_movableTEMixin(BlockEntityRenderDispatcher blockEntityRenderDispatcher_1)
{
super(blockEntityRenderDispatcher_1);
}
@Inject(method = "method_3576", at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/render/block/entity/PistonBlockEntityRenderer;method_3575(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/class_4587;Lnet/minecraft/class_4597;Lnet/minecraft/world/World;Z)V", ordinal = 3))
private void updateRenderBool(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, class_4587 class_4587_1, class_4597 class_4597_1, int int_1, CallbackInfo ci)
@@ -31,7 +33,7 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti
@Inject(method = "method_3576", at = @At("RETURN"), locals = LocalCapture.NO_CAPTURE)
private void endMethod3576(PistonBlockEntity pistonBlockEntity_1, double double_1, double double_2, double double_3, float float_1, int int_1, BlockRenderLayer blockRenderLayer_1, BufferBuilder bufferBuilder_1, int int_2, int int_3, CallbackInfo ci)
private void endMethod3576(PistonBlockEntity pistonBlockEntity_1, double xOffset, double yOffset, double zOffset, float partialTicks, class_4587 transform, class_4597 bufferWrapper, int int_1, CallbackInfo ci)
{
if (((PistonBlockEntityInterface) pistonBlockEntity_1).getRenderCarriedBlockEntity())
{
@@ -39,7 +41,14 @@ public abstract class PistonBlockEntityRenderer_movableTEMixin extends BlockEnti
if (carriedBlockEntity != null)
{
carriedBlockEntity.setPos(pistonBlockEntity_1.getPos());
((BlockEntityRenderDispatcherInterface) BlockEntityRenderDispatcher.INSTANCE).renderBlockEntityOffset(carriedBlockEntity, float_1, int_1, BlockRenderLayer.field_20799, bufferBuilder_1, pistonBlockEntity_1.getRenderOffsetX(float_1), pistonBlockEntity_1.getRenderOffsetY(float_1), pistonBlockEntity_1.getRenderOffsetZ(float_1));
//((BlockEntityRenderDispatcherInterface) BlockEntityRenderDispatcher.INSTANCE).renderBlockEntityOffset(carriedBlockEntity, float_1, int_1, BlockRenderLayer.field_20799, bufferBuilder_1, pistonBlockEntity_1.getRenderOffsetX(float_1), pistonBlockEntity_1.getRenderOffsetY(float_1), pistonBlockEntity_1.getRenderOffsetZ(float_1));
transform.method_22904( // translate
pistonBlockEntity_1.getRenderOffsetX(partialTicks),
pistonBlockEntity_1.getRenderOffsetY(partialTicks),
pistonBlockEntity_1.getRenderOffsetZ(partialTicks)
);
BlockEntityRenderDispatcher.INSTANCE.render(carriedBlockEntity, partialTicks, transform, bufferWrapper, xOffset, yOffset, zOffset);
}
}
}
@@ -105,7 +105,7 @@ public abstract class RedstoneWireBlockMixin implements RedstoneWireBlockInterfa
if (blockState_3.isSimpleFullBlock(world_1, blockPos_2) && !world_1.getBlockState(blockPos_3).isSimpleFullBlock(world_1, blockPos_3)) {
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.up()));
} else if (!blockState_3.isSimpleFullBlock(world_1, blockPos_2)) {
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.down(1)));
int_3 = this.increasePower(int_3, world_1.getBlockState(blockPos_2.method_10074()));
}
}
}