Compiles again.

This commit is contained in:
Sebastian Hartte
2020-07-27 23:50:28 +02:00
parent 56ecda5173
commit 84e6aaa122
136 changed files with 1004 additions and 1108 deletions
@@ -22,6 +22,7 @@ import java.util.Objects;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -50,7 +51,7 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
if (!(stack.getItem() instanceof FacadeItem)) {
return originalModel;
@@ -110,7 +110,7 @@ public enum FacingToRotation implements IStringSerializable {
}
@Override
public String getName() {
public String getString() {
return name().toLowerCase();
}
}
@@ -35,8 +35,7 @@ import net.minecraft.util.math.vector.Quaternion;
import net.minecraftforge.client.IRenderHandler;
import net.minecraftforge.client.SkyRenderHandler;
//TODO https://github.com/MinecraftForge/MinecraftForge/pull/6537
public class SpatialSkyRender implements SkyRenderHandler {
public class SpatialSkyRender {
private static final SpatialSkyRender INSTANCE = new SpatialSkyRender();
@@ -48,7 +47,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
this.dspList = GL11.glGenLists(1);
}
public static IRenderHandler getInstance() {
public static SpatialSkyRender getInstance() {
return INSTANCE;
}
@@ -56,8 +55,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
new Quaternion(-90.0F, 0.0F, 0.0F, true), new Quaternion(180.0F, 0.0F, 0.0F, true),
new Quaternion(0.0F, 0.0F, 90.0F, true), new Quaternion(0.0F, 0.0F, -90.0F, true), };
@Override
public void render(int ticks, float partialTicks, MatrixStack matrixStack, ClientWorld world, Minecraft mc) {
public void render(MatrixStack matrixStack) {
final long now = System.currentTimeMillis();
if (now - this.cycle > 2000) {
this.cycle = now;
@@ -68,6 +68,12 @@ public class FacadeBlockAccess implements IBlockDisplayReader {
return world.getFluidState(pos);
}
// This is for diffuse lighting
@Override
public float func_230487_a_(Direction p_230487_1_, boolean p_230487_2_) {
return world.func_230487_a_(p_230487_1_, p_230487_2_);
}
@Override
public WorldLightManager getLightManager() {
return world.getLightManager();
@@ -10,6 +10,7 @@ import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.vector.TransformationMatrix;
@@ -112,7 +113,7 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
@Nullable
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
@Nullable LivingEntity entity) {
boolean shiftHeld = Screen.hasShiftDown();
if (shiftHeld) {
@@ -122,12 +123,12 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
IBakedModel realModel = Minecraft.getInstance().getItemRenderer().getItemModelMesher()
.getItemModel(output);
// Give the item model a chance to handle the overrides as well
realModel = realModel.getOverrides().getModelWithOverrides(realModel, output, world, entity);
realModel = realModel.getOverrides().func_239290_a_(realModel, output, world, entity);
return new ShiftHoldingModelWrapper(getBaseModel(), realModel);
}
}
return getBaseModel().getOverrides().getModelWithOverrides(originalModel, stack, world, entity);
return getBaseModel().getOverrides().func_239290_a_(originalModel, stack, world, entity);
}
}
@@ -22,6 +22,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.RedstoneParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.particles.RedstoneParticleData;
import net.minecraft.world.World;
@@ -33,7 +34,7 @@ public class ChargedOreFX extends RedstoneParticle {
private static final RedstoneParticleData PARTICLE_DATA = new RedstoneParticleData(0.21f, 0.61f, 1.0f, 1.0f);
private ChargedOreFX(World worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed,
private ChargedOreFX(ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed,
IAnimatedSprite spriteSet) {
super(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, PARTICLE_DATA, spriteSet);
}
@@ -58,8 +59,8 @@ public class ChargedOreFX extends RedstoneParticle {
}
@Override
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
return new ChargedOreFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet);
}
}
@@ -135,7 +135,7 @@ public class CraftingFx extends SpriteTexturedParticle {
}
@Override
public Particle makeParticle(BasicParticleType data, World worldIn, double x, double y, double z, double xSpeed,
public Particle makeParticle(BasicParticleType data, ClientWorld worldIn, double x, double y, double z, double xSpeed,
double ySpeed, double zSpeed) {
return new CraftingFx(worldIn, x, y, z, spriteSet);
}
@@ -24,6 +24,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -37,7 +38,7 @@ public class LightningArcFX extends LightningFX {
private final double ry;
private final double rz;
public LightningArcFX(final World w, final double x, final double y, final double z, final double ex,
public LightningArcFX(final ClientWorld w, final double x, final double y, final double z, final double ex,
final double ey, final double ez, final double r, final double g, final double b) {
super(w, x, y, z, r, g, b, 6);
@@ -75,8 +76,8 @@ public class LightningArcFX extends LightningFX {
}
@Override
public Particle makeParticle(LightningArcParticleData data, World worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
public Particle makeParticle(LightningArcParticleData data, ClientWorld worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
SpriteTexturedParticle lightningFX = new LightningArcFX(worldIn, x, y, z, data.target.x, data.target.y,
data.target.z, 0, 0, 0);
lightningFX.selectSpriteRandomly(this.spriteSet);
@@ -1,5 +1,6 @@
package appeng.client.render.effects;
import com.mojang.serialization.Codec;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.particles.ParticleType;
@@ -12,10 +13,19 @@ public final class ParticleTypes {
public static final BasicParticleType CHARGED_ORE = new BasicParticleType(false);
public static final BasicParticleType CRAFTING = new BasicParticleType(false);
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<>(false,
EnergyParticleData.DESERIALIZER);
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<>(false,
LightningArcParticleData.DESERIALIZER);
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<EnergyParticleData>(false,
EnergyParticleData.DESERIALIZER) {
public Codec<EnergyParticleData> func_230522_e_() {
return null;
}
};
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<LightningArcParticleData>(false,
LightningArcParticleData.DESERIALIZER) {
@Override
public Codec<LightningArcParticleData> func_230522_e_() {
return null;
}
};
public static final BasicParticleType LIGHTNING = new BasicParticleType(false);
public static final BasicParticleType MATTER_CANNON = new BasicParticleType(false);
public static final BasicParticleType VIBRANT = new BasicParticleType(false);
@@ -107,7 +107,7 @@ public class AutoRotatingBakedModel implements IBakedModel {
// when piping it
// to the AO lighter, thus fixing our problem.
BakedQuad packedQuad = new BakedQuad(unpackedQuad.getVertexData(), quad.getTintIndex(),
unpackedQuad.getFace(), quad.func_187508_a(), quad.shouldApplyDiffuseLighting());
unpackedQuad.getFace(), quad.func_187508_a(), quad.func_239287_f_());
rotated.add(packedQuad);
}
return rotated;
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
@@ -143,7 +144,7 @@ class BiometricCardBakedModel implements IBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
String username = "";
if (stack.getItem() instanceof IBiometricCard) {
@@ -62,7 +62,7 @@ class ColorApplicatorBakedModel implements IBakedModel {
}
BakedQuad newQuad = new BakedQuad(quad.getVertexData(), tint, quad.getFace(), quad.func_187508_a(),
quad.shouldApplyDiffuseLighting());
quad.func_239287_f_());
result.add(newQuad);
}
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
@@ -128,7 +129,7 @@ class MemoryCardBakedModel implements IBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
try {
if (stack.getItem() instanceof IMemoryCard) {
@@ -31,11 +31,11 @@ import appeng.core.AppEng;
public class MemoryCardModel implements IModelGeometry<MemoryCardModel> {
public static final ResourceLocation MODEL_BASE = new ResourceLocation(AppEng.MOD_ID, "item/memory_card_base");
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "item/memory_card_hash"));
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.singleton(TEXTURE);
}
@@ -31,6 +31,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@@ -149,7 +150,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
*/
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
@Nullable LivingEntity entity) {
// FIXME: This check prevents compasses being held by OTHERS from getting the
// rotation, BUT do we actually still need this???
@@ -159,7 +160,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
float offRads = (float) (player.rotationYaw / 180.0f * (float) Math.PI + Math.PI);
SkyCompassBakedModel.this.fallbackRotation = offRads
+ getAnimatedRotation(player.getPosition(), true);
+ getAnimatedRotation(player.func_233580_cy_(), true);
} else {
SkyCompassBakedModel.this.fallbackRotation = getAnimatedRotation(null, false);
}
@@ -144,7 +144,7 @@ public class ChestTileEntityRenderer extends TileEntityRenderer<ChestTileEntity>
for (int i = 0; i < quads.size(); i++) {
BakedQuad quad = quads.get(i);
quads.set(i, new BakedQuad(quad.getVertexData(), quad.getTintIndex(), r.rotate(quad.getFace()),
quad.func_187508_a(), quad.shouldApplyDiffuseLighting()));
quad.func_187508_a(), quad.func_239287_f_()));
}
return quads;
@@ -62,7 +62,7 @@ public class CrankTESR extends TileEntityRenderer<CrankTileEntity> {
BlockState blockState = te.getBlockState();
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
IBakedModel model = dispatcher.getModelForState(blockState);
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
IVertexBuilder buffer = buffers.getBuffer(Atlases.getCutoutBlockType());
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1,
combinedLightIn, combinedOverlayIn);
ms.pop();
@@ -55,7 +55,7 @@ public class SkyCompassTESR extends TileEntityRenderer<SkyCompassTileEntity> {
blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
}
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
IVertexBuilder buffer = buffers.getBuffer(Atlases.getCutoutBlockType());
BlockState blockState = te.getBlockState();
IBakedModel model = blockRenderer.getBlockModelShapes().getModel(blockState);