Fixed building and started some more work on 1.16.5

This commit is contained in:
coolGi2007
2022-04-05 16:11:46 +09:30
parent 2e54f2166d
commit 5c17e9599b
11 changed files with 33 additions and 10 deletions
@@ -112,10 +112,12 @@ public class TintGetterOverrideFast implements BlockAndTintGetter {
return parent.getBlockStates(aABB);
}
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
@Override
public BlockHitResult isBlockInLine(ClipBlockStateContext clipBlockStateContext) {
return parent.isBlockInLine(clipBlockStateContext);
}
#endif
@Override
public BlockHitResult clip(ClipContext clipContext) {
@@ -137,10 +137,12 @@ public class TintGetterOverrideSmooth implements BlockAndTintGetter {
return parent.getBlockStates(aABB);
}
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
@Override
public BlockHitResult isBlockInLine(ClipBlockStateContext clipBlockStateContext) {
return parent.isBlockInLine(clipBlockStateContext);
}
#endif
@Override
public BlockHitResult clip(ClipContext clipContext) {
@@ -129,7 +129,11 @@ public class ChunkPosWrapper extends AbstractChunkPosWrapper
public AbstractBlockPosWrapper getWorldPosition()
{
// the parameter here is the y position
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
BlockPos blockPos = chunkPos.getMiddleBlockPosition(0);
#elif MC_VERSION_1_16_5
BlockPos blockPos = chunkPos.getWorldPosition();
#endif
return new BlockPosWrapper(blockPos.getX(), blockPos.getY(), blockPos.getZ());
}
@@ -2,6 +2,7 @@ package com.seibel.lod.common.wrappers.config;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.ImageButton;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component;
@@ -11,9 +12,12 @@ import net.minecraft.resources.ResourceLocation;
* Creates a button with a texture on it
*/
public class TexturedButtonWidget extends ImageButton {
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, ResourceLocation texture, OnPress pressAction) {
super(x, y, width, height, u, v, texture, pressAction);
}
#endif
public TexturedButtonWidget(int x, int y, int width, int height, int u, int v, int hoveredVOffset, ResourceLocation texture, int textureWidth, int textureHeight, OnPress pressAction) {
super(x, y, width, height, u, v, hoveredVOffset, texture, textureWidth, textureHeight, pressAction);
}
@@ -28,9 +32,15 @@ public class TexturedButtonWidget extends ImageButton {
@Override
public void renderButton(PoseStack matrices, int mouseX, int mouseY, float delta) {
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, WIDGETS_LOCATION);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha);
#elif MC_VERSION_1_16_5
Minecraft.getInstance().getTextureManager().bind(WIDGETS_LOCATION);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
#endif
int i = this.getYImage(this.isHovered);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
@@ -222,7 +222,11 @@ public class MinecraftClientWrapper implements IMinecraftClientWrapper
@Override
public ChunkPosWrapper getPlayerChunkPos()
{
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
ChunkPos playerPos = getPlayer().chunkPosition();
#elif MC_VERSION_1_16_5
ChunkPos playerPos = new ChunkPos(getPlayer().blockPosition());
#endif
return new ChunkPosWrapper(playerPos.x, playerPos.z);
}
@@ -138,7 +138,11 @@ public class WorldWrapper implements IWorldWrapper
@Override
public short getMinHeight()
{
#if MC_VERSION_1_17_1 || MC_VERSION_1_18_1 || MC_VERSION_1_18_2
return (short) world.getMinBuildHeight();
#elif MC_VERSION_1_16_5
return (short) 0;
#endif
}
/** @throws UnsupportedOperationException if the WorldWrapper isn't for a ServerWorld */
@@ -368,8 +368,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
}
if (chunkData == null)
{
return new ProtoChunk(chunkPos, UpgradeData.EMPTY
#if MC_VERSION_1_17_1, level #endif
return new ProtoChunk(chunkPos, UpgradeData.EMPTY, level
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2, level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), null #endif
);
}
@@ -379,8 +378,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
return ChunkLoader.read(level, lightEngine, chunkPos, chunkData);
} catch (Exception e) {
LOAD_LOGGER.error("DistantHorizons: Couldn't load chunk {}", chunkPos, e);
return new ProtoChunk(chunkPos, UpgradeData.EMPTY
#if MC_VERSION_1_17_1, level #endif
return new ProtoChunk(chunkPos, UpgradeData.EMPTY, level
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2, level.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), null #endif
);
}
@@ -420,8 +418,7 @@ public final class BatchGenerationEnvironment extends AbstractBatchGenerationEnv
// Continue...
}
if (target == null)
target = new ProtoChunk(chunkPos, UpgradeData.EMPTY
#if MC_VERSION_1_17_1, params.level #endif
target = new ProtoChunk(chunkPos, UpgradeData.EMPTY, params.level
#if MC_VERSION_1_18_1 || MC_VERSION_1_18_2, params.biomes, null #endif
);
return target;
@@ -9,13 +9,14 @@ accessible field com/mojang/blaze3d/vertex/VertexBuffer vertextBufferId I
accessible method net/minecraft/client/renderer/GameRenderer getFov (Lnet/minecraft/client/Camera;FZ)D
# pre-render setup
accessible field net/minecraft/client/renderer/LevelRenderer renderChunks Lit/unimi/dsi/fastutil/objects/ObjectArrayList;
accessible field net/minecraft/client/renderer/LevelRenderer renderChunks Lit/unimi/dsi/fastutil/objects/ObjectList;
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
# used for grabbing vanilla rendered chunks
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
#accessible field net/minecraft/world/entity/Entity blockPosition Lnet/minecraft/core/BlockPos;
# lighting
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage;
+1 -1
Submodule core updated: 8296b006b4...29aa95437e
@@ -41,7 +41,6 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.data.ModelDataMap;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.ExtensionPoint;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
+1 -1
View File
@@ -18,4 +18,4 @@ toml_version=3.6.4
manifold_version=2022.1.7
##### FOR IDE SUPPORT AND TELL IDE TO USE CERTIAN MC VERSION: SWITCH THIS:
mcVer=1.16.5
mcVer=1.18.2