19w38b - start the port, does not compile just yet.

This commit is contained in:
modmuss50 2019-09-18 18:16:25 +01:00
parent 6b7b8bda7b
commit 7533b848b5
26 changed files with 80 additions and 80 deletions
build.gradle
fabric-item-groups-v0/src/main/java/net/fabricmc/fabric/impl/itemgroup
fabric-loot-tables-v1/src/main/java/net/fabricmc/fabric
fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry
fabric-renderer-api-v1/src/main/java/net/fabricmc/fabric
fabric-renderer-indigo/src/main/java/net/fabricmc/indigo/renderer
fabric-rendering-data-attachment-v1/src/main/java/net/fabricmc/fabric
api/rendering/data/v1
mixin/rendering/data
fabric-rendering-fluids-v1/src/main/java/net/fabricmc/fabric
api/client/render/fluid/v1
impl/client/render/fluid
mixin/client/render/fluid

View file

@ -13,8 +13,8 @@ def ENV = System.getenv()
class Globals {
static def baseVersion = "0.3.2"
static def mcVersion = "19w37a"
static def yarnVersion = "+build.1"
static def mcVersion = "19w38b"
static def yarnVersion = "+build.3"
}
import org.apache.commons.codec.digest.DigestUtils

View file

@ -60,7 +60,7 @@ public class FabricCreativeGuiComponents {
if (this.visible) {
MinecraftClient minecraftClient = MinecraftClient.getInstance();
minecraftClient.getTextureManager().bindTexture(BUTTON_TEX);
minecraftClient.getTextureManager().method_22813(BUTTON_TEX);
RenderSystem.disableLighting();
RenderSystem.color4f(1F, 1F, 1F, 1F);
this.blit(this.x, this.y, (type == Type.NEXT ? 12 : 0), (active ? 0 : 12), 12, 12);

View file

@ -16,9 +16,9 @@
package net.fabricmc.fabric.api.loot.v1;
import net.minecraft.class_4570;
import net.minecraft.world.loot.LootPool;
import net.minecraft.world.loot.LootTableRange;
import net.minecraft.world.loot.condition.LootCondition;
import net.minecraft.world.loot.entry.LootEntry;
import net.minecraft.world.loot.function.LootFunction;
@ -33,7 +33,7 @@ public interface FabricLootPool {
return (LootPool) this;
}
List<LootEntry> getEntries();
List<LootCondition> getConditions();
List<class_4570> getConditions();
List<LootFunction> getFunctions();
LootTableRange getRollsRange();
}

View file

@ -17,9 +17,9 @@
package net.fabricmc.fabric.api.loot.v1;
import net.fabricmc.fabric.mixin.loot.LootPoolBuilderHooks;
import net.minecraft.class_4570;
import net.minecraft.world.loot.LootPool;
import net.minecraft.world.loot.LootTableRange;
import net.minecraft.world.loot.condition.LootCondition;
import net.minecraft.world.loot.entry.LootEntry;
import net.minecraft.world.loot.function.LootFunction;
@ -45,7 +45,7 @@ public class FabricLootPoolBuilder extends LootPool.Builder {
}
@Override
public FabricLootPoolBuilder withCondition(LootCondition.Builder condition) {
public FabricLootPoolBuilder withCondition(class_4570.Builder condition) {
super.method_356(condition);
return this;
}
@ -61,7 +61,7 @@ public class FabricLootPoolBuilder extends LootPool.Builder {
return this;
}
public FabricLootPoolBuilder withCondition(LootCondition condition) {
public FabricLootPoolBuilder withCondition(class_4570 condition) {
extended.getConditions().add(condition);
return this;
}

View file

@ -16,8 +16,8 @@
package net.fabricmc.fabric.mixin.loot;
import net.minecraft.class_4570;
import net.minecraft.world.loot.LootPool;
import net.minecraft.world.loot.condition.LootCondition;
import net.minecraft.world.loot.entry.LootEntry;
import net.minecraft.world.loot.function.LootFunction;
import org.spongepowered.asm.mixin.Mixin;
@ -30,7 +30,7 @@ public interface LootPoolBuilderHooks {
@Accessor
List<LootEntry> getEntries();
@Accessor
List<LootCondition> getConditions();
List<class_4570> getConditions();
@Accessor
List<LootFunction> getFunctions();
}

View file

@ -17,9 +17,9 @@
package net.fabricmc.fabric.mixin.loot;
import net.fabricmc.fabric.api.loot.v1.FabricLootPool;
import net.minecraft.class_4570;
import net.minecraft.world.loot.LootPool;
import net.minecraft.world.loot.LootTableRange;
import net.minecraft.world.loot.condition.LootCondition;
import net.minecraft.world.loot.entry.LootEntry;
import net.minecraft.world.loot.function.LootFunction;
import org.spongepowered.asm.mixin.Final;
@ -34,7 +34,7 @@ import java.util.List;
public abstract class MixinLootPool implements FabricLootPool {
@Shadow @Final private LootEntry[] entries;
@Shadow @Final private LootCondition[] conditions;
@Shadow @Final private class_4570[] conditions;
@Shadow @Final private LootFunction[] functions;
@ -44,7 +44,7 @@ public abstract class MixinLootPool implements FabricLootPool {
}
@Override
public List<LootCondition> getConditions() {
public List<class_4570> getConditions() {
return Arrays.asList(conditions);
}

View file

@ -69,7 +69,7 @@ public final class RegistrySyncManager {
if (accept) {
try {
context.getTaskQueue().executeFuture(() -> {
context.getTaskQueue().supply(() -> {
if (compound == null) {
errorHandler.accept(new RemapException("Received null compound tag in sync packet!"));
return null;

View file

@ -26,7 +26,7 @@ import net.minecraft.client.render.block.BlockModelRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Interface for baked models that output meshes with enhanced rendering features.
@ -91,7 +91,7 @@ public interface FabricBakedModel {
* Will not be thread-safe. Do not cache or retain a reference.
* @param context Accepts model output.
*/
void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context);
void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context);
/**
* This method will be called during item rendering to generate both the static and

View file

@ -31,7 +31,7 @@ import net.minecraft.client.texture.Sprite;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Base class for specialized model implementations that need to wrap other baked models.
@ -42,7 +42,7 @@ public abstract class ForwardingBakedModel implements BakedModel, FabricBakedMod
protected BakedModel wrapped;
@Override
public void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
((FabricBakedModel)wrapped).emitBlockQuads(blockView, state, pos, randomSupplier, context);
}

View file

@ -29,7 +29,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Specialized model wrapper that implements a general-purpose
@ -49,7 +49,7 @@ public class DamageModel extends ForwardingBakedModel {
}
@Override
public void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
context.pushTransform(damageTransform);
((FabricBakedModel)wrapped).emitBlockQuads(blockView, state, pos, randomSupplier, context);
context.popTransform();

View file

@ -20,7 +20,7 @@ import java.util.Random;
import java.util.function.Supplier;
import net.fabricmc.fabric.api.renderer.v1.render.RenderContext;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
import org.spongepowered.asm.mixin.Mixin;
import net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel;
@ -40,7 +40,7 @@ public interface MixinBakedModel extends FabricBakedModel {
}
@Override
public default void emitBlockQuads(ExtendedBlockView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
public default void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
context.fallbackConsumer().accept((BakedModel)this);
}

View file

@ -35,7 +35,7 @@ import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.texture.Sprite;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Implements hook for block-breaking render.
@ -63,7 +63,7 @@ public abstract class MixinBlockRenderManager {
*/
@Inject(method = "tesselateDamage", cancellable = true,
at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/render/block/BlockModels;getModel(Lnet/minecraft/block/BlockState;)Lnet/minecraft/client/render/model/BakedModel;"))
private void hookTesselateDamage(BlockState blockState, BlockPos blockPos, Sprite sprite, ExtendedBlockView blockView, CallbackInfo ci) {
private void hookTesselateDamage(BlockState blockState, BlockPos blockPos, Sprite sprite, BlockRenderView blockView, CallbackInfo ci) {
MutablePair<DamageModel, BakedModel> damageState = DAMAGE_STATE.get();
if(damageState.right != null && !((FabricBakedModel)damageState.right).isVanillaAdapter()) {
damageState.left.prepare(damageState.right, sprite, blockState, blockPos);

View file

@ -45,7 +45,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Adaptation of inner, non-static class in BlockModelRenderer that serves same purpose.
@ -147,7 +147,7 @@ public class AoCalculator {
vanillaCalc.compute(blockInfo, quad, vanillaAo, vanillaLight);
for (int i = 0; i < 4; i++) {
if (light[i] != vanillaLight[i] || !MathHelper.equalsApproximate(ao[i], vanillaAo[i])) {
if (light[i] != vanillaLight[i] || !MathHelper.approximatelyEquals(ao[i], vanillaAo[i])) {
LOGGER.info(String.format("Mismatch for %s @ %s", blockInfo.blockState.toString(), blockInfo.blockPos.toString()));
LOGGER.info(String.format("Flags = %d, LightFace = %s", quad.geometryFlags(), quad.lightFace().toString()));
LOGGER.info(String.format(" Old Multiplier: %.2f, %.2f, %.2f, %.2f",
@ -234,9 +234,9 @@ public class AoCalculator {
*/
private AoFaceData gatherInsetFace(QuadViewImpl quad, int vertexIndex, Direction lightFace) {
final float w1 = AoFace.get(lightFace).depthFunc.apply(quad, vertexIndex);
if(MathHelper.equalsApproximate(w1, 0)) {
if(MathHelper.approximatelyEquals(w1, 0)) {
return computeFace(lightFace, true);
} else if(MathHelper.equalsApproximate(w1, 1)) {
} else if(MathHelper.approximatelyEquals(w1, 1)) {
return computeFace(lightFace, false);
} else {
final float w0 = 1 - w1;
@ -271,7 +271,7 @@ public class AoCalculator {
int maxSky = 0, maxBlock = 0;
final float x = normal.getX();
if(!MathHelper.equalsApproximate(0f, x)) {
if(!MathHelper.approximatelyEquals(0f, x)) {
final Direction face = x > 0 ? Direction.EAST : Direction.WEST;
final AoFaceData fd = gatherInsetFace(quad, i, face);
AoFace.get(face).weightFunc.apply(quad, i, w);
@ -288,7 +288,7 @@ public class AoCalculator {
}
final float y = normal.getY();
if(!MathHelper.equalsApproximate(0f, y)) {
if(!MathHelper.approximatelyEquals(0f, y)) {
final Direction face = y > 0 ? Direction.UP: Direction.DOWN;
final AoFaceData fd = gatherInsetFace(quad, i, face);
AoFace.get(face).weightFunc.apply(quad, i, w);
@ -305,7 +305,7 @@ public class AoCalculator {
}
final float z = normal.getZ();
if(!MathHelper.equalsApproximate(0f, z)) {
if(!MathHelper.approximatelyEquals(0f, z)) {
final Direction face = z > 0 ? Direction.SOUTH: Direction.NORTH;
final AoFaceData fd = gatherInsetFace(quad, i, face);
AoFace.get(face).weightFunc.apply(quad, i, w);
@ -341,7 +341,7 @@ public class AoCalculator {
if((completionFlags & mask) == 0) {
completionFlags |= mask;
final ExtendedBlockView world = blockInfo.blockView;
final BlockRenderView world = blockInfo.blockView;
final BlockPos pos = blockInfo.blockPos;
final BlockPos.Mutable lightPos = this.lightPos;
final BlockPos.Mutable searchPos = this.searchPos;
@ -366,16 +366,16 @@ public class AoCalculator {
// but it was actually mis-sampling and causing visible artifacts in certain situation
searchPos.set(lightPos).setOffset(aoFace.neighbors[0]);//.setOffset(lightFace);
if(!Indigo.FIX_SMOOTH_LIGHTING_OFFSET) searchPos.setOffset(lightFace);
final boolean isClear0 = world.getBlockState(searchPos).getLightSubtracted(world, searchPos) == 0;
final boolean isClear0 = world.getBlockState(searchPos).getOpacity(world, searchPos) == 0;
searchPos.set(lightPos).setOffset(aoFace.neighbors[1]);//.setOffset(lightFace);
if(!Indigo.FIX_SMOOTH_LIGHTING_OFFSET) searchPos.setOffset(lightFace);
final boolean isClear1 = world.getBlockState(searchPos).getLightSubtracted(world, searchPos) == 0;
final boolean isClear1 = world.getBlockState(searchPos).getOpacity(world, searchPos) == 0;
searchPos.set(lightPos).setOffset(aoFace.neighbors[2]);//.setOffset(lightFace);
if(!Indigo.FIX_SMOOTH_LIGHTING_OFFSET) searchPos.setOffset(lightFace);
final boolean isClear2 = world.getBlockState(searchPos).getLightSubtracted(world, searchPos) == 0;
final boolean isClear2 = world.getBlockState(searchPos).getOpacity(world, searchPos) == 0;
searchPos.set(lightPos).setOffset(aoFace.neighbors[3]);//.setOffset(lightFace);
if(!Indigo.FIX_SMOOTH_LIGHTING_OFFSET) searchPos.setOffset(lightFace);
final boolean isClear3 = world.getBlockState(searchPos).getLightSubtracted(world, searchPos) == 0;
final boolean isClear3 = world.getBlockState(searchPos).getOpacity(world, searchPos) == 0;
// c = corner - values at corners of face
int cLight0, cLight1, cLight2, cLight3;

View file

@ -30,7 +30,7 @@ import net.minecraft.util.SystemUtil;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Copy of vanilla AoCalculator modified to output to use parameterized
@ -55,7 +55,7 @@ public class VanillaAoCalc {
apply(blockInfo.blockView, blockInfo.blockState, blockInfo.blockPos, quad.lightFace(), aoBounds, bits, ao, brightness);
}
private void apply(ExtendedBlockView blockView, BlockState blockState, BlockPos blockPos, Direction side,
private void apply(BlockRenderView blockView, BlockState blockState, BlockPos blockPos, Direction side,
float[] aoBounds, BitSet bits, float[] ao, int brightness[]) {
BlockPos lightPos = bits.get(0) ? blockPos.offset(side) : blockPos;
NeighborData neighborData = NeighborData.getData(side);
@ -73,13 +73,13 @@ public class VanillaAoCalc {
int int_4 = brightnessFunc.applyAsInt(mpos);
float float_4 = aoFunc.apply(mpos);
mpos.set((Vec3i)lightPos).setOffset(neighborData.faces[0]).setOffset(side);
boolean boolean_1 = blockView.getBlockState(mpos).getLightSubtracted(blockView, mpos) == 0;
boolean boolean_1 = blockView.getBlockState(mpos).getOpacity(blockView, mpos) == 0;
mpos.set((Vec3i)lightPos).setOffset(neighborData.faces[1]).setOffset(side);
boolean boolean_2 = blockView.getBlockState(mpos).getLightSubtracted(blockView, mpos) == 0;
boolean boolean_2 = blockView.getBlockState(mpos).getOpacity(blockView, mpos) == 0;
mpos.set((Vec3i)lightPos).setOffset(neighborData.faces[2]).setOffset(side);
boolean boolean_3 = blockView.getBlockState(mpos).getLightSubtracted(blockView, mpos) == 0;
boolean boolean_3 = blockView.getBlockState(mpos).getOpacity(blockView, mpos) == 0;
mpos.set((Vec3i)lightPos).setOffset(neighborData.faces[3]).setOffset(side);
boolean boolean_4 = blockView.getBlockState(mpos).getLightSubtracted(blockView, mpos) == 0;
boolean boolean_4 = blockView.getBlockState(mpos).getOpacity(blockView, mpos) == 0;
float float_6;
int int_6;
if (!boolean_3 && !boolean_1) {
@ -303,7 +303,7 @@ public class VanillaAoCalc {
}
}
public static void updateShape(ExtendedBlockView extendedBlockView_1, BlockState blockState_1, BlockPos blockPos_1, int[] ints_1, Direction direction_1, float[] floats_1, BitSet bitSet_1) {
public static void updateShape(BlockRenderView extendedBlockView_1, BlockState blockState_1, BlockPos blockPos_1, int[] ints_1, Direction direction_1, float[] floats_1, BitSet bitSet_1) {
float float_1 = 32.0F;
float float_2 = 32.0F;
float float_3 = 32.0F;

View file

@ -16,7 +16,7 @@
package net.fabricmc.indigo.renderer.helper;
import static net.minecraft.util.math.MathHelper.equalsApproximate;
import static net.minecraft.util.math.MathHelper.approximatelyEquals;
import net.fabricmc.fabric.api.renderer.v1.mesh.QuadView;
import net.minecraft.client.render.model.BakedQuad;
@ -77,9 +77,9 @@ public abstract class GeometryHelper {
}
int i = face.getAxis().ordinal();
final float val = quad.posByIndex(0, i);
return equalsApproximate(val, quad.posByIndex(1, i))
&& equalsApproximate(val, quad.posByIndex(2, i))
&& equalsApproximate(val, quad.posByIndex(3, i));
return approximatelyEquals(val, quad.posByIndex(1, i))
&& approximatelyEquals(val, quad.posByIndex(2, i))
&& approximatelyEquals(val, quad.posByIndex(3, i));
}
/**

View file

@ -32,7 +32,7 @@ import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.block.BlockModelRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
@Mixin(BlockModelRenderer.class)
public abstract class MixinBlockModelRenderer {
@ -40,7 +40,7 @@ public abstract class MixinBlockModelRenderer {
private final ThreadLocal<BlockRenderContext> CONTEXTS = ThreadLocal.withInitial(BlockRenderContext::new);
@Inject(at = @At("HEAD"), method = "tesselate", cancellable = true)
private void hookTesselate(ExtendedBlockView blockView, BakedModel model, BlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed, CallbackInfoReturnable<Boolean> ci) {
private void hookTesselate(BlockRenderView blockView, BakedModel model, BlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed, CallbackInfoReturnable<Boolean> ci) {
if(!((FabricBakedModel)model).isVanillaAdapter()) {
BlockRenderContext context = CONTEXTS.get();
if(!context.isCallingVanilla()) {

View file

@ -41,7 +41,7 @@ import net.minecraft.client.render.chunk.ChunkRenderData;
import net.minecraft.client.render.chunk.ChunkRenderTask;
import net.minecraft.client.render.chunk.ChunkRenderer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Implements the main hooks for terrain rendering. Attempts to tread
@ -101,21 +101,21 @@ public abstract class MixinChunkRenderer implements AccessChunkRenderer{
* This is the hook that actually implements the rendering API for terrain rendering.<p>
*
* It's unusual to have a @Redirect in a Fabric library, but in this case
* it is our explicit intention that {@link BlockRenderManager#tesselateBlock(BlockState, BlockPos, ExtendedBlockView, BufferBuilder, Random)}
* it is our explicit intention that {@link BlockRenderManager#tesselateBlock(BlockState, BlockPos, BlockRenderView, BufferBuilder, Random)}
* does not execute for models that will be rendered by our renderer.<p>
*
* Any mod that wants to redirect this specific call is likely also a renderer, in which case this
* renderer should not be present, or the mod should probably instead be relying on the renderer API
* which was specifically created to provide for enhanced terrain rendering.<p>
*
* Note also that {@link BlockRenderManager#tesselateBlock(BlockState, BlockPos, ExtendedBlockView, BufferBuilder, Random)}
* Note also that {@link BlockRenderManager#tesselateBlock(BlockState, BlockPos, BlockRenderView, BufferBuilder, Random)}
* IS called if the block render type is something other than {@link BlockRenderType#MODEL}.
* Normally this does nothing but will allow mods to create rendering hooks that are
* driven off of render type. (Not recommended or encouraged, but also not prevented.)
*/
@Redirect(method = "rebuildChunk", require = 1,
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockRenderManager;tesselateBlock(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/ExtendedBlockView;Lnet/minecraft/client/render/BufferBuilder;Ljava/util/Random;)Z"))
private boolean hookChunkBuildTesselate(BlockRenderManager renderManager, BlockState blockState, BlockPos blockPos, ExtendedBlockView blockView, BufferBuilder bufferBuilder, Random random) {
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/BlockRenderManager;tesselateBlock(Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/BufferBuilder;Ljava/util/Random;)Z"))
private boolean hookChunkBuildTesselate(BlockRenderManager renderManager, BlockState blockState, BlockPos blockPos, BlockRenderView blockView, BufferBuilder bufferBuilder, Random random) {
if(blockState.getRenderType() == BlockRenderType.MODEL) {
final BakedModel model = renderManager.getModel(blockState);
if (Indigo.ALWAYS_TESSELATE_INDIGO || !((FabricBakedModel) model).isVanillaAdapter()) {

View file

@ -34,7 +34,7 @@ import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.block.BlockModelRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Context for non-terrain block rendering.
@ -66,7 +66,7 @@ public class BlockRenderContext extends AbstractRenderContext implements RenderC
}
private float aoLevel(BlockPos pos) {
final ExtendedBlockView blockView = blockInfo.blockView;
final BlockRenderView blockView = blockInfo.blockView;
return blockView == null ? 1f : AoLuminanceFix.INSTANCE.apply(blockView, pos);
}
@ -75,7 +75,7 @@ public class BlockRenderContext extends AbstractRenderContext implements RenderC
return fabricBuffer;
}
public boolean tesselate(BlockModelRenderer vanillaRenderer, ExtendedBlockView blockView, BakedModel model, BlockState state, BlockPos pos, BufferBuilder buffer, long seed) {
public boolean tesselate(BlockModelRenderer vanillaRenderer, BlockRenderView blockView, BakedModel model, BlockState state, BlockPos pos, BufferBuilder buffer, long seed) {
this.vanillaRenderer = vanillaRenderer;
this.fabricBuffer = (AccessBufferBuilder) buffer;
this.seed = seed;

View file

@ -25,7 +25,7 @@ import net.minecraft.client.MinecraftClient;
import net.minecraft.client.color.block.BlockColors;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Holds, manages and provides access to the block/world related state
@ -37,7 +37,7 @@ import net.minecraft.world.ExtendedBlockView;
public class BlockRenderInfo {
private final BlockColors blockColorMap = MinecraftClient.getInstance().getBlockColorMap();
public final Random random = new Random();
public ExtendedBlockView blockView;
public BlockRenderView blockView;
public BlockPos blockPos;
public BlockState blockState;
public long seed;
@ -55,7 +55,7 @@ public class BlockRenderInfo {
return result;
};
public void setBlockView(ExtendedBlockView blockView) {
public void setBlockView(BlockRenderView blockView) {
this.blockView = blockView;
}

View file

@ -33,7 +33,7 @@ import net.minecraft.client.render.chunk.ChunkRenderer;
import net.minecraft.client.render.chunk.ChunkRendererRegion;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Holds, manages and provides access to the chunk-related state
@ -73,7 +73,7 @@ public class ChunkRenderInfo {
ChunkRenderTask chunkTask;
ChunkRenderData chunkData;
ChunkRenderer chunkRenderer;
ExtendedBlockView blockView;
BlockRenderView blockView;
boolean [] resultFlags;
private final AccessBufferBuilder[] buffers = new AccessBufferBuilder[4];
@ -183,7 +183,7 @@ public class ChunkRenderInfo {
}
/**
* Cached values for {@link BlockState#getBlockBrightness(ExtendedBlockView, BlockPos)}.
* Cached values for {@link BlockState#getBlockBrightness(BlockRenderView, BlockPos)}.
* See also the comments for {@link #brightnessCache}.
*/
int cachedBrightness(BlockPos pos) {

View file

@ -18,7 +18,7 @@ package net.fabricmc.fabric.api.rendering.data.v1;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* BlockView-extending interface to be used by {@link net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel} for dynamic model
@ -49,7 +49,7 @@ import net.minecraft.world.ExtendedBlockView;
* This interface is only guaranteed to be present in the client environment.
*/
// XXX can not link net.fabricmc.fabric.api.renderer.v1.model.FabricBakedModel
public interface RenderAttachedBlockView extends ExtendedBlockView {
public interface RenderAttachedBlockView extends BlockRenderView {
/**
* For models associated with Block Entities that implement {@link RenderAttachmentBlockEntity}
* this will be the most recent value provided by that implementation for the given block position.<p>

View file

@ -17,11 +17,11 @@
package net.fabricmc.fabric.mixin.rendering.data;
import net.fabricmc.fabric.api.rendering.data.v1.RenderAttachedBlockView;
import net.minecraft.world.ViewableWorld;
import net.minecraft.world.BlockRenderView;
import org.spongepowered.asm.mixin.Mixin;
/** Make {@link ViewableWorld} implement {@link RenderAttachedBlockView}. */
@Mixin(ViewableWorld.class)
/** Make {@link BlockRenderView} implement {@link RenderAttachedBlockView}. */
@Mixin(BlockRenderView.class)
public interface MixinViewableWorld extends RenderAttachedBlockView {
}

View file

@ -19,7 +19,7 @@ package net.fabricmc.fabric.api.client.render.fluid.v1;
import net.minecraft.client.texture.Sprite;
import net.minecraft.fluid.FluidState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
/**
* Interface for handling the rendering of a FluidState.
@ -38,7 +38,7 @@ public interface FluidRenderHandler {
* @return An array of size two: the first entry contains the "still" sprite,
* while the second entry contains the "flowing" sprite.
*/
Sprite[] getFluidSprites(/* Nullable */ ExtendedBlockView view, /* Nullable */ BlockPos pos, FluidState state);
Sprite[] getFluidSprites(/* Nullable */ BlockRenderView view, /* Nullable */ BlockPos pos, FluidState state);
/**
* Get the tint color for a fluid being rendered at a given position.
@ -51,7 +51,7 @@ public interface FluidRenderHandler {
* @param state The current state of the fluid.
* @return The tint color of the fluid.
*/
default int getFluidColor(ExtendedBlockView view, BlockPos pos, FluidState state) {
default int getFluidColor(BlockRenderView view, BlockPos pos, FluidState state) {
return -1;
}
}

View file

@ -24,7 +24,7 @@ import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.FluidState;
import net.minecraft.fluid.Fluids;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
import net.minecraft.world.biome.Biomes;
import java.util.IdentityHashMap;
@ -56,12 +56,12 @@ public class FluidRenderHandlerRegistryImpl implements FluidRenderHandlerRegistr
public void onFluidRendererReload(Sprite[] waterSprites, Sprite[] lavaSprites) {
FluidRenderHandler waterHandler = new FluidRenderHandler() {
@Override
public Sprite[] getFluidSprites(ExtendedBlockView view, BlockPos pos, FluidState state) {
public Sprite[] getFluidSprites(BlockRenderView view, BlockPos pos, FluidState state) {
return waterSprites;
}
@Override
public int getFluidColor(ExtendedBlockView view, BlockPos pos, FluidState state) {
public int getFluidColor(BlockRenderView view, BlockPos pos, FluidState state) {
if (view != null && pos != null) {
return BiomeColors.getWaterColor(view, pos);
} else {
@ -73,7 +73,7 @@ public class FluidRenderHandlerRegistryImpl implements FluidRenderHandlerRegistr
//noinspection Convert2Lambda
FluidRenderHandler lavaHandler = new FluidRenderHandler() {
@Override
public Sprite[] getFluidSprites(ExtendedBlockView view, BlockPos pos, FluidState state) {
public Sprite[] getFluidSprites(BlockRenderView view, BlockPos pos, FluidState state) {
return lavaSprites;
}
};

View file

@ -19,10 +19,10 @@ package net.fabricmc.fabric.impl.client.render.fluid;
import net.fabricmc.fabric.api.client.render.fluid.v1.FluidRenderHandler;
import net.minecraft.fluid.FluidState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
public class FluidRendererHookContainer {
public ExtendedBlockView view;
public BlockRenderView view;
public BlockPos pos;
public FluidState state;
public FluidRenderHandler handler;

View file

@ -25,7 +25,7 @@ import net.minecraft.client.texture.Sprite;
import net.minecraft.fluid.FluidState;
import net.minecraft.tag.FluidTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ExtendedBlockView;
import net.minecraft.world.BlockRenderView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@ -49,7 +49,7 @@ public class MixinFluidRenderer {
}
@Inject(at = @At("HEAD"), method = "tesselate", cancellable = true)
public void tesselate(ExtendedBlockView view, BlockPos pos, BufferBuilder bufferBuilder, FluidState state, CallbackInfoReturnable<Boolean> info) {
public void tesselate(BlockRenderView view, BlockPos pos, BufferBuilder bufferBuilder, FluidState state, CallbackInfoReturnable<Boolean> info) {
FluidRendererHookContainer ctr = fabric_renderHandler.get();
FluidRenderHandler handler = FluidRenderHandlerRegistryImpl.INSTANCE.getOverride(state.getFluid());
if (handler == null) {
@ -69,7 +69,7 @@ public class MixinFluidRenderer {
}
@Inject(at = @At("RETURN"), method = "tesselate")
public void tesselateReturn(ExtendedBlockView view, BlockPos pos, BufferBuilder bufferBuilder, FluidState state, CallbackInfoReturnable<Boolean> info) {
public void tesselateReturn(BlockRenderView view, BlockPos pos, BufferBuilder bufferBuilder, FluidState state, CallbackInfoReturnable<Boolean> info) {
fabric_renderHandler.get().clear();
}