pick 97420a31d The big reformat of 2020

This commit is contained in:
yueh
2020-06-16 21:41:28 +02:00
parent 5304b3febe
commit 5225ea426b
2252 changed files with 95466 additions and 118582 deletions
@@ -18,20 +18,20 @@
package appeng.client.render.tesr;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -39,36 +39,37 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import appeng.client.render.FacingToRotation;
import appeng.tile.grindstone.TileCrank;
/**
* This FastTESR only handles the animated model of the turning crank. When the crank is at rest, it is rendered using a
* normal model.
* This FastTESR only handles the animated model of the turning crank. When the
* crank is at rest, it is rendered using a normal model.
*/
@OnlyIn( Dist.CLIENT )
public class CrankTESR extends TileEntityRenderer<TileCrank>
{
@OnlyIn(Dist.CLIENT)
public class CrankTESR extends TileEntityRenderer<TileCrank> {
public CrankTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
}
public CrankTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
super(rendererDispatcherIn);
}
@Override
public void render(TileCrank te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn, int combinedOverlayIn) {
@Override
public void render(TileCrank te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn,
int combinedOverlayIn) {
// Apply GL transformations relative to the center of the block: 1) TE rotation and 2) crank rotation
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.translate( -0.5, -0.5, -0.5 );
// Apply GL transformations relative to the center of the block: 1) TE rotation
// and 2) crank rotation
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.translate(-0.5, -0.5, -0.5);
BlockState blockState = te.getWorld().getBlockState( te.getPos() ); // FIXME: i think world might be null here
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
IBakedModel model = dispatcher.getModelForState( blockState );
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1, combinedLightIn, combinedOverlayIn);
ms.pop();
BlockState blockState = te.getWorld().getBlockState(te.getPos()); // FIXME: i think world might be null here
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
IBakedModel model = dispatcher.getModelForState(blockState);
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1,
combinedLightIn, combinedOverlayIn);
ms.pop();
}
}
}