Added spotless back and reformatted

This commit is contained in:
Sebastian Hartte
2020-07-27 20:07:27 +02:00
parent 49296915c9
commit 780f68952b
593 changed files with 4192 additions and 3969 deletions
@@ -20,28 +20,27 @@ package appeng.tile.crafting;
import java.util.Random;
import appeng.mixins.RenderPhaseMixin;
import org.lwjgl.opengl.GL11;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.*;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.client.util.math.MatrixStack;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.item.BlockItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import net.fabricmc.api.Environment;
import appeng.client.render.effects.ParticleTypes;
import appeng.core.AppEng;
import appeng.mixins.RenderPhaseMixin;
/**
* Renders the item currently being crafted by the molecular assembler, as well
@@ -50,8 +49,8 @@ import appeng.core.AppEng;
@Environment(EnvType.CLIENT)
public class MolecularAssemblerRenderer extends BlockEntityRenderer<MolecularAssemblerBlockEntity> {
public static final ModelIdentifier LIGHTS_MODEL = new ModelIdentifier(AppEng.makeId(
"block/molecular_assembler_lights"), "");
public static final ModelIdentifier LIGHTS_MODEL = new ModelIdentifier(
AppEng.makeId("block/molecular_assembler_lights"), "");
private static final RenderLayer MC_161917_RENDERTYPE_FIX = createRenderType();
@@ -63,7 +62,7 @@ public class MolecularAssemblerRenderer extends BlockEntityRenderer<MolecularAss
@Override
public void render(MolecularAssemblerBlockEntity molecularAssembler, float partialTicks, MatrixStack ms,
VertexConsumerProvider bufferIn, int combinedLightIn, int combinedOverlayIn) {
VertexConsumerProvider bufferIn, int combinedLightIn, int combinedOverlayIn) {
AssemblerAnimationStatus status = molecularAssembler.getAnimationStatus();
if (status != null) {
@@ -85,7 +84,7 @@ public class MolecularAssemblerRenderer extends BlockEntityRenderer<MolecularAss
}
private void renderPowerLight(MatrixStack ms, VertexConsumerProvider bufferIn, int combinedLightIn,
int combinedOverlayIn) {
int combinedOverlayIn) {
// Render the translucent light overlay here instead of in the block, because
// thanks to the following MC
// bug, our particles would otherwise not be visible (because the glass pane
@@ -96,12 +95,12 @@ public class MolecularAssemblerRenderer extends BlockEntityRenderer<MolecularAss
BakedModel lightsModel = minecraft.getBakedModelManager().getModel(LIGHTS_MODEL);
VertexConsumer buffer = bufferIn.getBuffer(MC_161917_RENDERTYPE_FIX);
minecraft.getBlockRenderManager().getModelRenderer().render(ms.peek(), buffer, null,
lightsModel, 1, 1, 1, combinedLightIn, combinedOverlayIn);
minecraft.getBlockRenderManager().getModelRenderer().render(ms.peek(), buffer, null, lightsModel, 1, 1, 1,
combinedLightIn, combinedOverlayIn);
}
private void renderStatus(MolecularAssemblerBlockEntity molecularAssembler, MatrixStack ms,
VertexConsumerProvider bufferIn, int combinedLightIn, AssemblerAnimationStatus status) {
VertexConsumerProvider bufferIn, int combinedLightIn, AssemblerAnimationStatus status) {
double centerX = molecularAssembler.getPos().getX() + 0.5f;
double centerY = molecularAssembler.getPos().getY() + 0.5f;
double centerZ = molecularAssembler.getPos().getZ() + 0.5f;
@@ -130,28 +129,27 @@ public class MolecularAssemblerRenderer extends BlockEntityRenderer<MolecularAss
ms.translate(0, -0.2f, 0);
}
itemRenderer.renderItem(is, ModelTransformation.Mode.GROUND, combinedLightIn,
OverlayTexture.DEFAULT_UV, ms, bufferIn);
itemRenderer.renderItem(is, ModelTransformation.Mode.GROUND, combinedLightIn, OverlayTexture.DEFAULT_UV, ms,
bufferIn);
ms.pop();
}
/**
* See above for when this can be removed. It creates a RenderType that is
* equivalent to {@link RenderLayer#getTranslucent()}, but enables alpha testing.
* This prevents the fully transparents parts of the rendered block model from
* occluding our particles.
* equivalent to {@link RenderLayer#getTranslucent()}, but enables alpha
* testing. This prevents the fully transparents parts of the rendered block
* model from occluding our particles.
*/
private static RenderLayer createRenderType() {
RenderPhase.Texture mipmapBlockAtlasTexture = new RenderPhase.Texture(
SpriteAtlasTexture.BLOCK_ATLAS_TEX, false, true);
RenderPhase.Texture mipmapBlockAtlasTexture = new RenderPhase.Texture(SpriteAtlasTexture.BLOCK_ATLAS_TEX, false,
true);
RenderPhase.Lightmap disableLightmap = new RenderPhase.Lightmap(false);
RenderLayer.MultiPhaseParameters glState = RenderLayer.MultiPhaseParameters.builder()
.texture(mipmapBlockAtlasTexture)
.transparency(RenderPhaseMixin.getTranslucentTransparency()).alpha(new RenderPhase.Alpha(0.05F))
.lightmap(disableLightmap).build(true);
.texture(mipmapBlockAtlasTexture).transparency(RenderPhaseMixin.getTranslucentTransparency())
.alpha(new RenderPhase.Alpha(0.05F)).lightmap(disableLightmap).build(true);
return RenderLayer.of("ae2_translucent_alphatest", VertexFormats.POSITION_COLOR_TEXTURE_LIGHT,
GL11.GL_QUADS, 256, glState);
return RenderLayer.of("ae2_translucent_alphatest", VertexFormats.POSITION_COLOR_TEXTURE_LIGHT, GL11.GL_QUADS,
256, glState);
}
}