Compare commits

...
Author SHA1 Message Date
RecursivePineapple c4ad460f34 Update (#899) 2025-03-09 23:04:46 +00:00
Glease 2a8404c6c2 add an API to retrieve world instance from WorldSlice (#897) 2025-03-08 23:00:58 -08:00
ah-OOG-ah 108db9031b Add an option to disable terrain fog (#896)
* Add an option to disable terrain fog

* forgot a remap = false
2025-03-09 05:38:30 +00:00
amyandJason Mitchell d6d8a5dad6 Catch CancellationException while building chunks (#889)
Co-authored-by: Jason Mitchell <[email protected]>
2025-03-08 20:45:10 -08:00
RecursivePineappleandJason Mitchell ad2b73edf9 Fix hologlasses crash (#891)
Co-authored-by: Jason Mitchell <[email protected]>
2025-03-08 20:44:36 -08:00
glowredman bb5526598e Various Mixin-related Fixes (#890)
* Update deps

* Remove dead code

* Add missing `@Override` annotations

* Fix generics

* Add `serialVersionUID`s

* Address deprecation warnings

* Use `@WrapWithCondition` v2

* Misc cleanup

* Use AccessTransformers if possible

* Fix mixin conflicts

* Add `@Mutable` annotations

* Fix injection targets

* Update deps
2025-03-08 20:41:47 -08:00
RecursivePineapple 611bbf02c8 Optimize NEI rendering 2025-02-28 11:32:26 -08:00
OBlankenship ca16036604 Update GTNHLib dependency version in README (#885) 2025-02-27 09:22:04 +01:00
Caedis f118211257 Fix IC2 universal cell rendering w/offhand (#876) 2025-02-18 10:49:29 -08:00
RecursivePineapple 81d03ea552 Fix PBR specular & normal textures getting ignored (#874)
* Fix PBR textures not loading

- Stack was being overfilled by MemoryStack
- Added tons of logging for ignored important exceptions
- Added missing interface on mixin (should it be moved to gtnhlib?)

* Move PBR debug to angelica config

* Free malloc'd memory
2025-02-18 18:34:38 +00:00
RecursivePineapple 67c8628aeb Fix a handful of broken animations (#868)
* Fix warning

* Improve animated sprite tracking

* Fix NPE in animation code

* Fix animations for abnormally rendered items

* Swap Stack for ArrayDeque
2025-02-18 18:28:54 +00:00
embeddedt f9b9873637 Avoid checking frustum visibility of infinite bounding boxes 2025-02-18 10:24:09 -08:00
DarkShadow44 c66bf8658e Fix issue with dynamic lights world mixin not respecting opaque blocks (#872) 2025-02-17 10:36:34 -06:00
DarkShadow44 052824017d Fix crash when keycode is negative (#871) 2025-02-16 21:43:15 +00:00
181 changed files with 502 additions and 680 deletions

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
# Required Dependencies
* [UniMixins](https://github.com/LegacyModdingMC/UniMixins/releases) >= 0.1.19
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.5.20
* [GTNHLib](https://github.com/GTNewHorizons/GTNHLib/releases) >= 0.6.6
* NOTE: Some mods are not required, but a specific version is required if present - see: `Permanent Incompatibilities` below.
# Known (temporary) Incompatibilities
+8 -8
View File
@@ -49,7 +49,7 @@ configurations {
}
dependencies {
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.23")
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.30")
compileOnly("com.gtnewhorizons.retrofuturabootstrap:RetroFuturaBootstrap:1.0.7") { transitive = false }
@@ -57,11 +57,11 @@ dependencies {
annotationProcessor("org.projectlombok:lombok:1.18.34")
// Use modern models+textures to inject QuadProviders
devOnlyNonPublishable('com.github.GTNewHorizons:TX-Loader:1.8.0:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:TX-Loader:1.8.2:dev')
// Iris Shaders
compileOnly('org.jetbrains:annotations:26.0.2')
api("com.github.GTNewHorizons:GTNHLib:0.6.8:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.13:dev")
shadowImplementation("org.anarres:jcpp:1.4.14") // Apache 2.0
shadowImplementation("org.taumc:glsl-transformation-lib:0.2.0-4.g6b42bca") {
exclude module: "antlr4" // we only want to shadow the runtime module
@@ -70,21 +70,21 @@ dependencies {
compileOnly "org.apache.ant:ant:1.8.2"
// Because who doesn't want NEI
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.27-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.29-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:CodeChickenCore:1.4.1:dev')
// Notfine Deps
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:Baubles:1.0.4:dev")
compileOnly("com.github.GTNewHorizons:twilightforest:2.7.4:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:twilightforest:2.7.5:dev") { transitive = false }
compileOnly(rfg.deobf('curse.maven:witchery-69673:2234410'))
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.13.8-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.13.10-GTNH:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Natura:2.8.2:dev")
compileOnly("com.github.GTNewHorizons:ThaumicHorizons:1.7.1:dev")
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.2:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:Backhand:1.6.9') { transitive = false }
compileOnly('com.github.GTNewHorizons:Backhand:1.6.11') { transitive = false }
compileOnly("com.falsepattern:chunkapi-mc1.7.10:0.5.1:api") { transitive = false }
compileOnly("com.falsepattern:endlessids-mc1.7.10:1.5-beta0003:dev") { transitive = false }
@@ -100,7 +100,7 @@ dependencies {
compileOnly(rfg.deobf("curse.maven:campfirebackport-387444:4611675"))
compileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5060684"))
compileOnly("com.github.GTNewHorizons:HoloInventory:2.5.0-GTNH:dev")
compileOnly("com.github.GTNewHorizons:HoloInventory:2.5.1-GTNH:dev")
runtimeOnlyNonPublishable(rfg.deobf("CoreTweaks:CoreTweaks:0.3.3.2"))
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+2 -3
View File
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
+1 -1
View File
@@ -16,5 +16,5 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.32'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.37'
}
@@ -0,0 +1,8 @@
package com.gtnewhorizons.angelica.api;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public interface IBlockAccessExtended extends IBlockAccess {
World getWorld();
}
@@ -42,8 +42,6 @@ public class BatchingFontRenderer {
private int[] colorCode;
/** Location of the primary font atlas to bind. */
protected final ResourceLocation locationFontTexture;
/** The RenderEngine used to load and setup glyph textures. */
private final TextureManager renderEngine;
private final RandomXoshiro256StarStar fontRandom = new RandomXoshiro256StarStar();
/** The full list of characters present in the default Minecraft font, excluding the Unicode font */
@@ -74,14 +72,13 @@ public class BatchingFontRenderer {
}
public BatchingFontRenderer(FontRenderer underlying, ResourceLocation[] unicodePageLocations, int[] charWidth,
byte[] glyphWidth, int[] colorCode, ResourceLocation locationFontTexture, TextureManager renderEngine) {
byte[] glyphWidth, int[] colorCode, ResourceLocation locationFontTexture) {
this.underlying = underlying;
this.unicodePageLocations = unicodePageLocations;
this.charWidth = charWidth;
this.glyphWidth = glyphWidth;
this.colorCode = colorCode;
this.locationFontTexture = locationFontTexture;
this.renderEngine = renderEngine;
for (int i = 0; i < 64; i++) {
batchCommandPool.add(new FontDrawCmd());
@@ -1,8 +1,6 @@
package com.gtnewhorizons.angelica.compat;
import com.falsepattern.chunk.api.DataRegistry;
import com.gtnewhorizons.angelica.mixins.interfaces.ExtendedBlockStorageAccessor;
import com.gtnewhorizons.angelica.mixins.interfaces.ExtendedNibbleArray;
import com.gtnewhorizons.neid.mixins.interfaces.IExtendedBlockStorageMixin;
import net.minecraft.world.chunk.Chunk;
@@ -19,7 +17,7 @@ public class ExtendedBlockStorageExt extends ExtendedBlockStorage {
}
public ExtendedBlockStorageExt(Chunk chunk, ExtendedBlockStorage storage) {
super(((ExtendedBlockStorageAccessor) storage).getYBase(), storage.getSkylightArray() != null);
super(storage.yBase, storage.getSkylightArray() != null);
if (ModStatus.isChunkAPILoaded) {
if (storage.getSkylightArray() != null) {
@@ -33,7 +31,7 @@ public class ExtendedBlockStorageExt extends ExtendedBlockStorage {
System.arraycopy(((IExtendedBlockStorageMixin)(Object)storage).getBlock16BArray(), 0, block16BArray, 0, block16BArray.length);
if(storage.getBlockMSBArray() != null) {
this.setBlockMSBArray(new NibbleArray(block16BArray.length, 4));
copyNibbleArray((ExtendedNibbleArray) storage.getBlockMSBArray(), (ExtendedNibbleArray) this.getBlockMSBArray());
copyNibbleArray(storage.getBlockMSBArray(), this.getBlockMSBArray());
}
arrayLen = block16BArray.length;
if (ModStatus.isNEIDMetadataExtended) {
@@ -52,31 +50,31 @@ public class ExtendedBlockStorageExt extends ExtendedBlockStorage {
System.arraycopy(storage.getBlockLSBArray(), 0, blockLSBArray, 0, blockLSBArray.length);
if(storage.getBlockMSBArray() != null) {
this.setBlockMSBArray(new NibbleArray(blockLSBArray.length, 4));
copyNibbleArray((ExtendedNibbleArray) storage.getBlockMSBArray(), (ExtendedNibbleArray) this.getBlockMSBArray());
copyNibbleArray(storage.getBlockMSBArray(), this.getBlockMSBArray());
}
arrayLen = blockLSBArray.length;
}
if (!ModStatus.isNEIDMetadataExtended) copyNibbleArray((ExtendedNibbleArray) storage.getMetadataArray(), (ExtendedNibbleArray)this.getMetadataArray());
copyNibbleArray((ExtendedNibbleArray) storage.getBlocklightArray(), (ExtendedNibbleArray)this.getBlocklightArray());
if (!ModStatus.isNEIDMetadataExtended) copyNibbleArray(storage.getMetadataArray(), this.getMetadataArray());
copyNibbleArray(storage.getBlocklightArray(), this.getBlocklightArray());
if(storage.getSkylightArray() != null) {
hasSky = true;
if(this.getSkylightArray() == null) {
this.setSkylightArray(new NibbleArray(arrayLen, 4));
}
copyNibbleArray((ExtendedNibbleArray) storage.getSkylightArray(), (ExtendedNibbleArray) this.getSkylightArray());
copyNibbleArray(storage.getSkylightArray(), this.getSkylightArray());
}
}
((ExtendedBlockStorageAccessor) this).setBlockRefCount(((ExtendedBlockStorageAccessor) storage).getBlockRefCount());
this.blockRefCount = storage.blockRefCount;
}
private static void copyNibbleArray(ExtendedNibbleArray srcArray, ExtendedNibbleArray dstArray) {
private static void copyNibbleArray(NibbleArray srcArray, NibbleArray dstArray) {
if (srcArray == null || dstArray == null) {
throw new RuntimeException("NibbleArray is null src: " + (srcArray == null) + " dst: " + (dstArray == null));
}
final byte[] data = srcArray.getData();
System.arraycopy(data, 0, dstArray.getData(), 0, data.length);
final byte[] data = srcArray.data;
System.arraycopy(data, 0, dstArray.data, 0, data.length);
}
}
@@ -2,7 +2,6 @@ package com.gtnewhorizons.angelica.compat;
import com.gtnewhorizons.angelica.helpers.LoadControllerHelper;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.versioning.ArtifactVersion;
import cpw.mods.fml.common.versioning.DefaultArtifactVersion;
import mods.battlegear2.Battlegear;
import net.dries007.holoInventory.HoloInventory;
@@ -15,6 +15,7 @@ public class ByteBufferBackedInputStream extends InputStream {
this.buf = buf;
}
@Override
public int read() throws IOException {
if (!buf.hasRemaining()) {
return -1;
@@ -40,6 +40,7 @@ public class ChunkPos {
return (long)x & 4294967295L | ((long)z & 4294967295L) << 32;
}
@Override
public int hashCode()
{
final int i = 1664525 * this.x + 1013904223;
@@ -47,6 +48,7 @@ public class ChunkPos {
return i ^ j;
}
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
@@ -1,7 +1,5 @@
package com.gtnewhorizons.angelica.compat.mojang;
import static com.gtnewhorizon.gtnhlib.bytebuf.MemoryStack.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
@@ -10,7 +8,7 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import javax.imageio.ImageIO;
import com.gtnewhorizon.gtnhlib.bytebuf.MemoryStack;
import com.gtnewhorizon.gtnhlib.bytebuf.MemoryUtilities;
import lombok.Getter;
import net.coderbot.iris.Iris;
import org.lwjgl.opengl.GL11;
@@ -61,15 +59,20 @@ public class NativeImage extends BufferedImage {
// final int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_WIDTH);
// final int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT);
try (final MemoryStack stack = stackPush()) {
final IntBuffer buffer = stack.mallocInt(size);
final IntBuffer buffer = MemoryUtilities.memAllocInt(size);
try {
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, level, format.glFormat, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
int[] data = new int[size];
buffer.get(data);
setRGB(0, 0, width, height, data, 0, width);
} finally {
MemoryUtilities.memFree(buffer);
}
}
public void writeToFile(File file) throws IOException{
try {
ImageIO.write(this, "png", file);
@@ -107,18 +110,15 @@ public class NativeImage extends BufferedImage {
public enum Format {
RGBA(4, GL11.GL_RGBA, BufferedImage.TYPE_INT_ARGB),
RGB(3, GL11.GL_RGB, BufferedImage.TYPE_INT_RGB);
RGBA(4, GL11.GL_RGBA),
RGB(3, GL11.GL_RGB);
private final int components;
private final int glFormat;
private final int imageType;
Format(int components, int glFormat, int imageType) {
Format(int components, int glFormat) {
this.components = components;
this.glFormat = glFormat;
this.imageType = imageType;
}
}
@@ -72,7 +72,6 @@ public abstract class RenderLayer extends RenderPhase { // Aka: RenderType (Iris
private final MultiPhaseParameters phases;
private final int hash;
private final Optional<RenderLayer> affectedOutline;
private final boolean outline;
private MultiPhase(String name, VertexFormat vertexFormat, int drawMode, int expectedBufferSize, boolean hasCrumbling, boolean translucent, MultiPhaseParameters phases) {
super(name, vertexFormat, drawMode, expectedBufferSize, () -> {
@@ -84,7 +83,6 @@ public abstract class RenderLayer extends RenderPhase { // Aka: RenderType (Iris
this.affectedOutline = phases.outlineMode == RenderLayer.OutlineMode.AFFECTS_OUTLINE ? phases.texture.getId().map((arg2) -> {
return getOutline(arg2, phases.cull);
}) : Optional.empty();
this.outline = phases.outlineMode == RenderLayer.OutlineMode.IS_OUTLINE;
this.hash = Objects.hash(new Object[]{super.hashCode(), phases});
}
@@ -97,20 +95,23 @@ public abstract class RenderLayer extends RenderPhase { // Aka: RenderType (Iris
return this.affectedOutline;
}
@Override
public boolean equals(@Nullable Object object) {
return this == object;
}
@Override
public int hashCode() {
return this.hash;
}
@Override
public String toString() {
return "RenderType[" + this.phases + ']';
}
static {
CACHE = new ObjectOpenCustomHashSet(RenderLayer.MultiPhase.HashStrategy.INSTANCE);
CACHE = new ObjectOpenCustomHashSet<>(RenderLayer.MultiPhase.HashStrategy.INSTANCE);
}
static enum HashStrategy implements Hash.Strategy<MultiPhase> {
@@ -168,6 +169,7 @@ public abstract class RenderLayer extends RenderPhase { // Aka: RenderType (Iris
this.phases = ImmutableList.of(this.texture, this.transparency, this.diffuseLighting, this.shadeModel, this.alpha, this.depthTest, this.cull, this.lightmap, this.fog, this.layering, this.target, this.texturing, this.writeMaskState);
}
@Override
public boolean equals(Object object) {
if (this == object) {
return true;
@@ -179,10 +181,12 @@ public abstract class RenderLayer extends RenderPhase { // Aka: RenderType (Iris
}
}
@Override
public int hashCode() {
return Objects.hash(new Object[]{this.phases, this.outlineMode});
}
@Override
public String toString() {
return "CompositeState[" + this.phases + ", outlineProperty=" + this.outlineMode + ']';
}
@@ -293,6 +297,7 @@ public abstract class RenderLayer extends RenderPhase { // Aka: RenderType (Iris
this.name = name;
}
@Override
public String toString() {
return this.name;
}
@@ -11,7 +11,6 @@ import org.lwjgl.opengl.GL11;
import javax.annotation.Nullable;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalDouble;
public abstract class RenderPhase {
@@ -98,6 +97,7 @@ public abstract class RenderPhase {
this.endAction.run();
}
@Override
public boolean equals(@Nullable Object object) {
if (this == object) {
return true;
@@ -109,10 +109,12 @@ public abstract class RenderPhase {
}
}
@Override
public int hashCode() {
return this.name.hashCode();
}
@Override
public String toString() {
return this.name;
}
@@ -133,6 +133,11 @@ public class AngelicaConfig {
@Config.RequiresMcRestart
public static boolean enableDebugLogging;
@Config.Comment("Enables PBR atlas dumping")
@Config.DefaultBoolean(false)
@Config.Name("Enable PBR Debug")
public static boolean enablePBRDebug;
@Config.Comment("Enable Zoom")
@Config.DefaultBoolean(true)
@Config.RequiresMcRestart
@@ -18,7 +18,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
@@ -7,9 +7,11 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -19,21 +21,25 @@ public class Feature {
GL13.GL_MULTISAMPLE_BIT, GL11.GL_PIXEL_MODE_BIT, GL11.GL_POINT_BIT, GL11.GL_POLYGON_BIT, GL11.GL_POLYGON_STIPPLE_BIT, GL11.GL_SCISSOR_BIT,
GL11.GL_STENCIL_BUFFER_BIT, GL11.GL_TEXTURE_BIT, GL11.GL_TRANSFORM_BIT, GL11.GL_VIEWPORT_BIT };
static final Int2ObjectMap<Set<IStateStack<?>>> maskToFeaturesMap = new Int2ObjectOpenHashMap<>();
static final Int2ObjectMap<List<IStateStack<?>>> maskToFeaturesMap = new Int2ObjectOpenHashMap<>();
static Set<IStateStack<?>> maskToFeatures(int mask) {
static List<IStateStack<?>> maskToFeatures(int mask) {
if(maskToFeaturesMap.containsKey(mask)) {
return maskToFeaturesMap.get(mask);
}
final Set<IStateStack<?>> features = new HashSet<>();
for(int attrib : Feature.supportedAttribs) {
if((mask & attrib) == attrib) {
features.addAll(getFeatures(attrib));
}
}
maskToFeaturesMap.put(mask, features);
return features;
final List<IStateStack<?>> asList = new ArrayList<>(features);
maskToFeaturesMap.put(mask, asList);
return asList;
}
private static final Map<Integer, Set<IStateStack<?>>> attribToFeatures = new HashMap<>();
@@ -26,6 +26,7 @@ import com.gtnewhorizons.angelica.glsm.texture.TextureInfoCache;
import com.gtnewhorizons.angelica.glsm.texture.TextureTracker;
import com.gtnewhorizons.angelica.hudcaching.HUDCaching;
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
import cpw.mods.fml.relauncher.ReflectionHelper;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
@@ -35,6 +36,7 @@ import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap;
import it.unimi.dsi.fastutil.objects.ObjectArraySet;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import net.coderbot.iris.Iris;
import net.coderbot.iris.gbuffer_overrides.state.StateTracker;
import net.coderbot.iris.gl.blending.AlphaTestStorage;
@@ -65,12 +67,16 @@ import org.lwjgl.opengl.GLContext;
import org.lwjgl.opengl.KHRDebug;
import java.lang.Math;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
import java.util.AbstractMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.IntSupplier;
@@ -134,11 +140,21 @@ public class GLStateManager {
@Getter protected static final MaterialStateStack frontMaterial = new MaterialStateStack(GL11.GL_FRONT);
@Getter protected static final MaterialStateStack backMaterial = new MaterialStateStack(GL11.GL_BACK);
private static final MethodHandle MAT4_STACK_CURR_DEPTH;
static {
for (int i = 0; i < lightStates.length; i ++) {
lightStates[i] = new BooleanStateStack(GL11.GL_LIGHT0 + i);
lightDataStates[i] = new LightStateStack(GL11.GL_LIGHT0 + i);
}
try {
Field curr = ReflectionHelper.findField(Matrix4fStack.class, "curr");
curr.setAccessible(true);
MAT4_STACK_CURR_DEPTH = MethodHandles.lookup().unreflectGetter(curr);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
@Getter protected static final ViewPortStateStack viewportState = new ViewPortStateStack();
@@ -150,11 +166,18 @@ public class GLStateManager {
while(!attribs.isEmpty()) {
attribs.popInt();
}
for(IStateStack<?> stack : Feature.maskToFeatures(GL11.GL_ALL_ATTRIB_BITS)) {
List<IStateStack<?>> stacks = Feature.maskToFeatures(GL11.GL_ALL_ATTRIB_BITS);
int size = stacks.size();
for(int i = 0; i < size; i++) {
IStateStack<?> stack = stacks.get(i);
while(!stack.isEmpty()) {
stack.pop();
}
}
modelViewMatrix.clear();
projectionMatrix.clear();
}
@@ -181,6 +204,9 @@ public class GLStateManager {
public static class GLFeatureSet extends IntOpenHashSet {
private static final long serialVersionUID = 8558779940775721010L;
public GLFeatureSet addFeature(int feature) {
super.add(feature);
return this;
@@ -399,6 +425,11 @@ public class GLStateManager {
}
}
@SneakyThrows
public static int getMatrixStackDepth(Matrix4fStack stack) {
return (int) MAT4_STACK_CURR_DEPTH.invokeExact(stack);
}
public static int glGetInteger(int pname) {
if(shouldBypassCache()) {
return GL11.glGetInteger(pname);
@@ -418,6 +449,8 @@ public class GLStateManager {
case GL11.GL_COLOR_MATERIAL_FACE -> colorMaterialFace.getValue();
case GL11.GL_COLOR_MATERIAL_PARAMETER -> colorMaterialParameter.getValue();
case GL20.GL_CURRENT_PROGRAM -> activeProgram;
case GL11.GL_MODELVIEW_STACK_DEPTH -> getMatrixStackDepth(modelViewMatrix);
case GL11.GL_PROJECTION_STACK_DEPTH -> getMatrixStackDepth(projectionMatrix);
default -> GL11.glGetInteger(pname);
};
@@ -1212,13 +1245,21 @@ public class GLStateManager {
glListNesting += 1;
return;
}
glListId = list;
glListMode = mode;
GL11.glNewList(list, mode);
for(IStateStack<?> stack : Feature.maskToFeatures(GL11.GL_ALL_ATTRIB_BITS)) {
List<IStateStack<?>> stacks = Feature.maskToFeatures(GL11.GL_ALL_ATTRIB_BITS);
int size = stacks.size();
for(int i = 0; i < size; i++) {
IStateStack<?> stack = stacks.get(i);
// Feature Stack, copy of current feature state
glListStates.put(stack, (ISettableState<?>) ((ISettableState<?>)stack).copy());
}
if(glListMode == GL11.GL_COMPILE) {
pushState(GL11.GL_ALL_ATTRIB_BITS);
}
@@ -1274,15 +1315,23 @@ public class GLStateManager {
public static void pushState(int mask) {
attribs.push(mask);
for(IStateStack<?> stack : Feature.maskToFeatures(mask)) {
stack.push();
}
List<IStateStack<?>> stacks = Feature.maskToFeatures(mask);
int size = stacks.size();
for(int i = 0; i < size; i++) {
stacks.get(i).push();
}
}
public static void popState() {
final int mask = attribs.popInt();
for(IStateStack<?> stack : Feature.maskToFeatures(mask)) {
stack.pop();
List<IStateStack<?>> stacks = Feature.maskToFeatures(mask);
int size = stacks.size();
for(int i = 0; i < size; i++) {
stacks.get(i).pop();
}
}
@@ -30,7 +30,6 @@ import java.nio.IntBuffer;
public class RenderSystem {
private static final Logger LOGGER = LogManager.getLogger("RenderSystem");
private static DSAAccess dsaState;
private static boolean hasMultibind;
private static boolean supportsCompute;
private RenderSystem() {}
@@ -41,7 +40,6 @@ public class RenderSystem {
dsaState = new DSACore();
LOGGER.info("OpenGL 4.5 detected, enabling DSA.");
}
hasMultibind = GLStateManager.capabilities.OpenGL45;
} catch (NoSuchFieldError ignored) {}
try {
@@ -55,10 +53,6 @@ public class RenderSystem {
LOGGER.info("No DSA support detected, falling back to legacy OpenGL.");
}
try {
hasMultibind |= GLStateManager.capabilities.GL_ARB_multi_bind;
} catch (NoSuchFieldError ignored) {}
supportsCompute = supportsCompute();
}
@@ -2,6 +2,7 @@ package com.gtnewhorizons.angelica.glsm.states;
public interface ISettableState<T> extends Cloneable {
T set(T state);
@SuppressWarnings("unchecked")
default void set(ISettableState<?> value) {
set((T) value);
}
@@ -18,7 +18,6 @@ public class LightState implements ISettableState<LightState> {
private static final Vector4i vector4i = new Vector4i();
private static final Vector4f vector4f = new Vector4f();
private static final Vector3i vector3i = new Vector3i();
private static final Vector3f vector3f = new Vector3f();
private static final Matrix3f matrix3f = new Matrix3f();
public int light;
@@ -1,8 +1,5 @@
package com.gtnewhorizons.angelica.hudcaching;
import java.util.ArrayList;
import java.util.List;
import com.gtnewhorizon.gtnhlib.client.renderer.TessellatorManager;
import com.gtnewhorizons.angelica.compat.ModStatus;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
@@ -34,7 +31,7 @@ import xaero.common.core.XaeroMinimapCore;
import static com.gtnewhorizons.angelica.loading.AngelicaTweaker.LOGGER;
// See LICENSE+HUDCaching.md for license information.
// See LICENSE-HUDCaching.md for license information.
public class HUDCaching {
@@ -59,7 +56,7 @@ public class HUDCaching {
public static boolean renderCrosshairsCaptured;
private final static RenderGameOverlayEvent fakeTextEvent = new RenderGameOverlayEvent.Text(new RenderGameOverlayEvent(0, null, 0, 0), null, null);
private final static RenderGameOverlayEvent fakePreEvent = new RenderGameOverlayEvent.Pre(new RenderGameOverlayEvent(0, null, 0, 0), RenderGameOverlayEvent.ElementType.HELMET);
private final static RenderGameOverlayEvent.Post fakePostEvent = new RenderGameOverlayEvent.Post(new RenderGameOverlayEvent(0, null, 0, 0), RenderGameOverlayEvent.ElementType.HELMET);
public static final HUDCaching INSTANCE = new HUDCaching();
@@ -125,11 +122,11 @@ public class HUDCaching {
GuiIngameForgeAccessor guiForge = ((GuiIngameForgeAccessor) ingame);
if (renderHelmetCaptured) {
guiForge.callRenderHelmet(resolution, partialTicks, hasScreen, mouseX, mouseY);
if (ModStatus.isHoloInventoryLoaded){
if (ModStatus.isHoloInventoryLoaded) {
Renderer.INSTANCE.angelicaOverride = false;
// only settings the partial ticks as mouseX and mouseY are not used in renderEvent
((RenderGameOverlayEventAccessor) fakePreEvent).setPartialTicks(partialTicks);
Renderer.INSTANCE.renderEvent(fakePreEvent);
((RenderGameOverlayEventAccessor) fakePostEvent).setPartialTicks(partialTicks);
Renderer.INSTANCE.renderEvent(fakePostEvent);
}
}
if (renderPortalCapturedTicks > 0) {
@@ -1,6 +1,5 @@
package com.gtnewhorizons.angelica.loading;
import com.google.common.collect.ImmutableMap;
import com.gtnewhorizon.gtnhlib.asm.ASMUtil;
import com.gtnewhorizon.gtnhlib.config.ConfigException;
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
@@ -153,18 +152,5 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader {
}
}
private static final ImmutableMap<String, TargetedMod> MODS_BY_CLASS = ImmutableMap.<String, TargetedMod>builder()
.put("optifine.OptiFineForgeTweaker", TargetedMod.OPTIFINE)
.put("fastcraft.Tweaker", TargetedMod.FASTCRAFT)
.put("cofh.asm.LoadingPlugin", TargetedMod.COFHCORE)
.build();
public static final Set<TargetedMod> coreMods = new HashSet<>();
private static void detectCoreMods(Set<String> loadedCoreMods) {
MODS_BY_CLASS.forEach((key, value) -> {
if (loadedCoreMods.contains(key))
coreMods.add(value);
});
}
}
@@ -91,8 +91,8 @@ public enum Mixins {
)
),
ARCHAIC_CORE(new Builder("Archaic Core").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
.setPhase(Phase.EARLY).addMixinClasses(
ARCHAIC_CORE(new Builder("Archaic Core").addTargetedMod(TargetedMod.VANILLA).addExcludedMod(TargetedMod.ARCHAICFIX)
.setSide(Side.CLIENT).setPhase(Phase.EARLY).addMixinClasses(
"angelica.archaic.MixinBlockFence"
,"angelica.archaic.MixinFMLClientHandler"
,"angelica.archaic.MixinGuiIngameForge"
@@ -124,15 +124,12 @@ public enum Mixins {
,"sodium.MixinEntity_RenderDist"
,"sodium.MixinEntityItem_RenderDist"
,"sodium.MixinRenderManager"
,"sodium.MixinExtendedBlockStorage"
,"sodium.MixinEntityRenderer"
,"sodium.MixinFMLClientHandler"
,"sodium.MixinForgeHooksClient"
,"sodium.MixinGameSettings"
,"sodium.MixinFrustrum"
,"sodium.MixinMaterial"
,"sodium.MixinMinecraft"
,"sodium.MixinNibbleArray"
,"sodium.MixinRenderBlocks"
,"sodium.MixinRenderGlobal"
,"sodium.MixinWorldClient"
@@ -175,14 +172,7 @@ public enum Mixins {
),
IRIS_ACCESSORS(new Builder("Iris Accessors").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableIris).addMixinClasses(
"shaders.accessors.MixinMinecraft"
,"shaders.accessors.MixinEntityRenderer"
,"shaders.accessors.MixinSimpleTexture"
,"shaders.accessors.MixinTextureAtlasSprite"
,"shaders.accessors.MixinTextureMap"
,"shaders.accessors.MixinAnimationMetadataSection"
)
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableIris).addMixinClasses("shaders.accessors.MixinEntityRenderer")
),
ANGELICA_TEXTURE(new Builder("Textures").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
@@ -1,14 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
public interface AnimationMetadataSectionAccessor {
int getFrameWidth();
void setFrameWidth(int frameWidth);
int getFrameHeight();
void setFrameHeight(int frameHeight);
}
@@ -1,9 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
import org.spongepowered.asm.mixin.gen.Accessor;
public interface ExtendedBlockStorageAccessor {
int getYBase();
int getBlockRefCount();
void setBlockRefCount(int blockRefCount);
}
@@ -1,7 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
public interface ExtendedNibbleArray {
public byte[] getData();
public int getDepthBits();
public int getDepthBitsPlusFour();
}
@@ -8,4 +8,5 @@ public interface ITexturesCache {
Set<IIcon> getRenderedTextures();
void enableTextureTracking();
void track(IPatchedTextureAtlasSprite sprite);
}
@@ -1,7 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
import net.minecraft.util.Timer;
public interface MinecraftAccessor {
Timer getTimer();
}
@@ -1,7 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
import net.minecraft.util.ResourceLocation;
public interface SimpleTextureAccessor {
ResourceLocation getLocation();
}
@@ -1,21 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
import net.minecraft.client.resources.data.AnimationMetadataSection;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.List;
public interface TextureAtlasSpriteAccessor {
AnimationMetadataSection getMetadata();
List<int[][]> getFramesTextureData();
int getFrame();
void setFrame(int frame);
int getSubFrame();
void setSubFrame(int subFrame);
}
@@ -1,16 +0,0 @@
package com.gtnewhorizons.angelica.mixins.interfaces;
import net.minecraft.util.ResourceLocation;
import org.spongepowered.asm.mixin.gen.Accessor;
import java.util.Map;
public interface TextureMapAccessor {
Map getMapUploadedSprites();
int getAnisotropicFiltering();
int getMipmapLevels();
ResourceLocation getLocationBlocksTexture();
}
@@ -1,6 +1,5 @@
package com.gtnewhorizons.angelica.models;
import com.gtnewhorizon.gtnhlib.blockpos.BlockPos;
import com.gtnewhorizon.gtnhlib.blockpos.IBlockPos;
import com.gtnewhorizon.gtnhlib.client.model.ModelLoader;
import com.gtnewhorizon.gtnhlib.client.model.Variant;
@@ -47,6 +47,7 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.util.Direction;
@@ -152,7 +153,7 @@ public class ClientProxy extends CommonProxy {
@SubscribeEvent
public void onKeypress(TickEvent.ClientTickEvent event) {
final boolean isPressed = glsmKeyBinding.getKeyCode() != 0 && Keyboard.isKeyDown(glsmKeyBinding.getKeyCode());
final boolean isPressed = glsmKeyBinding.getKeyCode() != 0 && GameSettings.isKeyDown(glsmKeyBinding);
if (isPressed && !wasGLSMKeyPressed) {
OpenGLDebugging.checkGLSM();
}
@@ -1,12 +1,10 @@
package com.gtnewhorizons.angelica.rendering;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import lombok.Getter;
import lombok.Setter;
import org.joml.Matrix4f;
import org.joml.Vector3d;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.GL11;
import java.nio.FloatBuffer;
@@ -76,7 +76,6 @@ public class RedirectorTransformer implements IClassTransformer {
"com.gtnewhorizons.angelica.transform",
"me.eigenraven.lwjgl3ify"
);
private static int remaps = 0;
private static final Set<String> moddedBlockSubclasses = Collections.newSetFromMap(new ConcurrentHashMap<>());
// Block owners we *shouldn't* redirect because they shadow one of our fields
@@ -348,7 +347,6 @@ public class RedirectorTransformer implements IClassTransformer {
}
changed = true;
redirectInMethod = true;
remaps++;
} else if (mNode.owner.startsWith(Drawable) && mNode.name.equals("makeCurrent")) {
mNode.setOpcode(Opcodes.INVOKESTATIC);
mNode.owner = GLStateManager;
@@ -369,7 +367,6 @@ public class RedirectorTransformer implements IClassTransformer {
mNode.name = redirects.get(mNode.name);
changed = true;
redirectInMethod = true;
remaps++;
}
}
}
@@ -423,6 +420,9 @@ public class RedirectorTransformer implements IClassTransformer {
}
private static class RedirectMap<K> extends HashMap<K, K> {
private static final long serialVersionUID = 1712218575345511543L;
public static RedirectMap<String> newMap() {
return new RedirectMap<>();
}
@@ -1,7 +1,6 @@
package com.gtnewhorizons.angelica.transform.compat.handlers;
import com.gtnewhorizons.angelica.config.CompatConfig;
import lombok.Getter;
import java.util.ArrayList;
import java.util.List;
@@ -1,5 +1,7 @@
package com.gtnewhorizons.angelica.utils;
import java.util.ArrayDeque;
import com.gtnewhorizons.angelica.mixins.interfaces.IPatchedTextureAtlasSprite;
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
import net.minecraft.client.Minecraft;
@@ -28,4 +30,26 @@ public class AnimationsRenderUtils {
}
}
}
private final static ThreadLocal<ArrayDeque<ITexturesCache>> TEXTURE_CACHE_STACK = ThreadLocal.withInitial(ArrayDeque::new);
public static void onSpriteUsed(IPatchedTextureAtlasSprite sprite) {
ArrayDeque<ITexturesCache> stack = TEXTURE_CACHE_STACK.get();
if (stack == null || stack.isEmpty()) {
// icon was used outside of chunk building, it's probably an item in an inventory or something
sprite.markNeedsAnimationUpdate();
return;
}
stack.peek().track(sprite);
}
public static void pushCache(ITexturesCache cache) {
TEXTURE_CACHE_STACK.get().push(cache);
}
public static void popCache() {
TEXTURE_CACHE_STACK.get().pop();
}
}
@@ -172,6 +172,8 @@ public class MCLogger {
private static class ErrorLevel extends Level {
private static final long serialVersionUID = 3987750897854233321L;
protected ErrorLevel() {
super("ERROR", (Level.WARNING.intValue() + Level.SEVERE.intValue()) / 2);
}
@@ -221,7 +221,7 @@ public class CITUtils {
List<T> list = overrides.get(item);
if (list != null) {
int[] enchantmentLevels = getEnchantmentLevels(item, itemStack.getTagCompound());
boolean hasEffect = itemStack.hasEffect();
boolean hasEffect = itemStack.hasEffect(0);
for (T override : list) {
if (override.match(itemStack, enchantmentLevels, hasEffect)) {
return override;
@@ -49,7 +49,7 @@ final class EnchantmentList {
Map<Integer, Layer> tmpLayers = new HashMap<>();
Item item = itemStack.getItem();
int[] enchantmentLevels = CITUtils.getEnchantmentLevels(item, itemStack.getTagCompound());
boolean hasEffect = itemStack.hasEffect();
boolean hasEffect = itemStack.hasEffect(0);
List<Enchantment> list = enchantments.get(item);
if (list == null) {
list = allItemEnchantments;
@@ -32,8 +32,6 @@ abstract class TileOverride implements Comparable<TileOverride> {
private static final MCLogger logger = MCLogger.getLogger(MCLogger.Category.CONNECTED_TEXTURES, "CTM");
private static final int META_MASK = 0xffff;
private final PropertiesFile properties;
private final String baseFilename;
private final TileLoader tileLoader;
@@ -41,7 +39,6 @@ abstract class TileOverride implements Comparable<TileOverride> {
private final int weight;
private final List<BlockStateMatcher> matchBlocks;
private final Set<String> matchTiles;
private final int defaultMetaMask;
private final BlockFaceMatcher faceMatcher;
private final int connectType;
private final boolean innerSeams;
@@ -50,7 +47,6 @@ abstract class TileOverride implements Comparable<TileOverride> {
private final List<ResourceLocation> tileNames = new ArrayList<>();
protected IIcon[] icons;
private int matchMetadata = META_MASK;
static TileOverride create(ResourceLocation propertiesFile, TileLoader tileLoader) {
if (propertiesFile == null) {
@@ -133,11 +129,6 @@ abstract class TileOverride implements Comparable<TileOverride> {
if (matchBlocks.isEmpty() && matchTiles.isEmpty()) {
matchTiles.add(baseFilename);
}
int bits = 0;
for (int i : properties.getIntList("metadata", 0, 15, "0-15")) {
bits |= 1 << i;
}
defaultMetaMask = bits;
faceMatcher = BlockFaceMatcher.create(properties.getString("faces", ""));
@@ -170,6 +170,7 @@ public class FancyDial {
static void registerAnimations() {
ITextureObject texture = TexturePackAPI.getTextureObject(TexturePackAPI.ITEMS_PNG);
if (texture instanceof TextureMap map) {
@SuppressWarnings("unchecked")
List<TextureAtlasSprite> animations = map.listAnimatedSprites;
for (FancyDial instance : instances.values()) {
instance.registerAnimation(animations);
@@ -32,7 +32,6 @@ abstract public class ColorMap implements IColorMap {
private static final int BIOME_HEIGHT = 2;
private static final int COLORMAP_WIDTH = 256;
private static final int COLORMAP_HEIGHT = 256;
public static final String BLOCK_COLORMAP_DIR = TexturePackAPI.MCPATCHER_SUBDIR + "colormap/blocks";
public static final List<ResourceLocation> unusedPNGs = new ArrayList<>();
@@ -10,8 +10,6 @@ import java.util.Map;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.prupe.mcpatcher.MCPatcherUtils;
import com.prupe.mcpatcher.mal.resource.PropertiesFile;
@@ -21,6 +19,7 @@ import cpw.mods.fml.common.registry.GameData;
public class BlockAPI {
@SuppressWarnings("unchecked")
BlockAPI(FMLControlledNamespacedRegistry<Block> registry) {
File outputFile = new File("blocks17.txt");
if (outputFile.isFile()) {
@@ -61,6 +61,7 @@ public class BlockStateMatcher {
threadLocal.set(data);
}
@Override
final public String toString() {
return fullString;
}
@@ -13,6 +13,7 @@ import cpw.mods.fml.common.registry.GameData;
public class ItemAPI {
@SuppressWarnings("unchecked")
ItemAPI() {
File outputFile = new File("items17.txt");
if (outputFile.isFile()) {
@@ -120,7 +120,7 @@ final public class PropertiesFile {
@SuppressWarnings("unchecked")
public Set<Map.Entry<String, String>> entrySet() {
return (Set<Map.Entry<String, String>>) (Set) properties.entrySet();
return (Set<Map.Entry<String, String>>) (Set<?>) properties.entrySet();
}
public ResourceLocation getResource() {
@@ -110,6 +110,7 @@ public class ResourceList {
MCPatcherUtils.close(zipFile);
}
}
@SuppressWarnings("unchecked")
Map<String, File> map = resourcePack.field_152781_b; // map
if (map != null) {
for (Map.Entry<String, File> entry : map.entrySet()) {
@@ -51,6 +51,7 @@ public class TexturePackAPI {
List<IResourcePack> resourcePacks = new ArrayList<>();
IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager();
if (resourceManager instanceof SimpleReloadableResourceManager) {
@SuppressWarnings("unchecked")
Set<Map.Entry<String, FallbackResourceManager>> entrySet = ((SimpleReloadableResourceManager) resourceManager).domainResourceManagers
.entrySet();
for (Map.Entry<String, FallbackResourceManager> entry : entrySet) {
@@ -66,6 +67,7 @@ public class TexturePackAPI {
return resourcePacks;
}
@SuppressWarnings("unchecked")
public static Set<String> getNamespaces() {
Set<String> namespaces = new HashSet<>();
namespaces.add(DEFAULT_NAMESPACE);
@@ -310,6 +312,7 @@ public class TexturePackAPI {
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
if (textureManager != null) {
Set<ResourceLocation> texturesToUnload = new HashSet<>();
@SuppressWarnings("unchecked")
Set<Map.Entry<ResourceLocation, ITextureObject>> entrySet = textureManager.mapTextureObjects.entrySet();
for (Map.Entry<ResourceLocation, ITextureObject> entry : entrySet) {
ResourceLocation resource = entry.getKey();
@@ -13,6 +13,7 @@ import jss.notfine.asm.mappings.Names.Meth;
public class NamerMcp extends NamerSrg {
@Override
public void setNames() {
setNamesSrg();
final String confPath = System.getProperty("net.minecraftforge.gradle.GradleStart.csvDir", "../conf") + "/";
+4 -3
View File
@@ -48,7 +48,7 @@ public enum Settings {
}
},
DYNAMIC_FOV(new NotFineOptionTickBox(true, null)),
DYNAMIC_LIGHTS(new NotFineOptionCycling(DynamicLightsMode.FANCY, OptionImpact.VARIES)){
DYNAMIC_LIGHTS(new NotFineOptionCycling<>(DynamicLightsMode.FANCY, OptionImpact.VARIES)){
@Override
public void applyChanges() {
DynamicLights.Mode = (DynamicLightsMode) this.option.getStore();
@@ -60,6 +60,7 @@ public enum Settings {
DynamicLights.ShaderForce = (boolean) this.option.getStore();
}
},
FOG_DISABLE(new NotFineOptionTickBox(false, OptionImpact.LOW)),
FOG_NEAR_DISTANCE(new NotFineOptionSliderPercentage(75, 1, 100, 1, OptionImpact.LOW)),
GUI_BACKGROUND(new NotFineOptionCycling<>(BackgroundSelect.DEFAULT, null)) {
@Override
@@ -132,9 +133,9 @@ public enum Settings {
},
VOID_FOG(new NotFineOptionTickBox(false, OptionImpact.LOW));
public final NotFineOption option;
public final NotFineOption<?> option;
Settings(NotFineOption option) {
Settings(NotFineOption<?> option) {
this.option = option;
}
@@ -26,10 +26,10 @@ public class GuiCustomOptionsRowList extends GuiListExtended {
field_148163_i = false;
for(OptionGroup optionGroup : optionPage.getGroups()) {
Iterator settings = optionGroup.getOptions().stream().iterator();
Iterator<Option<?>> settings = optionGroup.getOptions().stream().iterator();
while(settings.hasNext()) {
Option optionOne = (Option)settings.next();
Option optionTwo = settings.hasNext() ? (Option)settings.next() : null;
Option<?> optionOne = settings.next();
Option<?> optionTwo = settings.hasNext() ? settings.next() : null;
GuiButton buttonOne = (GuiButton)optionOne.getControl().createElement(new Dim2i(width / 2 - 155,0,150,20), factory);
GuiButton buttonTwo = optionTwo == null ? null : (GuiButton)optionTwo.getControl().createElement(new Dim2i(width / 2 - 155 + 160,0,150,20), factory);
settingsList.add(new GuiCustomOptionsRowList.Row(buttonOne, buttonTwo));
@@ -213,6 +213,7 @@ public class NotFineGameOptionPages {
.add(Settings.MODE_CLOUD_TRANSLUCENCY.option)
.add(Settings.MODE_STARS.option)
.add(Settings.TOTAL_STARS.option)
.add(Settings.FOG_DISABLE.option)
.add(Settings.FOG_NEAR_DISTANCE.option)
.build());
return new OptionPage(I18n.format("options.button.sky"), ImmutableList.copyOf(groups));
@@ -22,6 +22,7 @@ public class CyclingControlElement<T extends Enum<T>> extends NotFineControlElem
}
}
@Override
public String getLabel() {
Enum<T> value = option.getValue();
return super.getLabel() + names[value.ordinal()];
@@ -9,17 +9,17 @@ import me.jellysquid.mods.sodium.client.util.Dim2i;
public class NotFineControlElementFactory implements ControlElementFactory {
@Override
public <T extends Enum<T>> ControlElement cyclingControlElement(Option<T> option, Dim2i dim, T[] allowedValues, String[] names) {
return new CyclingControlElement(option, dim, allowedValues, names);
public <T extends Enum<T>> ControlElement<T> cyclingControlElement(Option<T> option, Dim2i dim, T[] allowedValues, String[] names) {
return new CyclingControlElement<>(option, dim, allowedValues, names);
}
@Override
public ControlElement sliderControlElement(Option<Integer> option, Dim2i dim, int min, int max, int interval, ControlValueFormatter formatter) {
public ControlElement<Integer> sliderControlElement(Option<Integer> option, Dim2i dim, int min, int max, int interval, ControlValueFormatter formatter) {
return new SliderControlElement(option, dim, min, max, interval, formatter);
}
@Override
public ControlElement tickBoxElement(Option<Boolean> option, Dim2i dim) {
public ControlElement<Boolean> tickBoxElement(Option<Boolean> option, Dim2i dim) {
return new TickBoxControlElement(option, dim);
}
@@ -26,6 +26,7 @@ public class SliderControlElement extends NotFineControlElement<Integer> {
value = MathHelper.clamp_float((value - min) / (max - min), 0f, 1f);
}
@Override
public String getLabel() {
return super.getLabel() + formatter.format(option.getValue());
}
@@ -10,6 +10,7 @@ public class TickBoxControlElement extends NotFineControlElement<Boolean> {
super(option, dim);
}
@Override
public String getLabel() {
return super.getLabel() + I18n.format(option.getValue() ? "options.on" : "options.off");
}
@@ -1,7 +1,6 @@
package jss.notfine.util.itembreakparticles;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public interface IWorldSpawnItemBreakParticle {
@@ -1,7 +1,10 @@
package kroppeb.stareval.exception;
public class MissingTokenException extends ParseException {
public MissingTokenException(String message, int index) {
private static final long serialVersionUID = -2096321911994168858L;
public MissingTokenException(String message, int index) {
super(message + " at index " + index);
}
}
@@ -1,7 +1,10 @@
package kroppeb.stareval.exception;
public abstract class ParseException extends Exception{
public ParseException() {
private static final long serialVersionUID = -5014053641238717471L;
public ParseException() {
}
public ParseException(String message) {
@@ -1,7 +1,10 @@
package kroppeb.stareval.exception;
public class UnexpectedCharacterException extends ParseException {
public UnexpectedCharacterException(char expected, char actual, int index) {
private static final long serialVersionUID = -3886198952263126846L;
public UnexpectedCharacterException(char expected, char actual, int index) {
this("Expected to read '" + expected + "' but got '" + actual + "' at index " + index);
}
@@ -1,7 +1,10 @@
package kroppeb.stareval.exception;
public class UnexpectedEndingException extends ParseException {
public UnexpectedEndingException() {
private static final long serialVersionUID = -3704913315979481520L;
public UnexpectedEndingException() {
this("Expected to read more text, but the string has ended");
}
@@ -1,7 +1,10 @@
package kroppeb.stareval.exception;
public class UnexpectedTokenException extends ParseException {
public UnexpectedTokenException(String message, int index) {
private static final long serialVersionUID = 689385399380177588L;
public UnexpectedTokenException(String message, int index) {
super(message + " at index " + index);
}
}
@@ -10,7 +10,6 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import lombok.Getter;
import me.jellysquid.mods.sodium.client.gui.SodiumGameOptions;
import me.jellysquid.mods.sodium.proxy.CommonProxy;
import net.minecraft.client.Minecraft;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -89,6 +89,7 @@ public class SodiumGameOptionPages {
.add(Settings.MODE_CLOUD_TRANSLUCENCY.option)
.add(Settings.MODE_STARS.option)
.add(Settings.TOTAL_STARS.option)
.add(Settings.FOG_DISABLE.option)
.add(Settings.FOG_NEAR_DISTANCE.option)
.add(Settings.VOID_FOG.option);
groups.add(firstGroupBuilder.build());
@@ -7,10 +7,10 @@ import me.jellysquid.mods.sodium.client.util.Dim2i;
public interface ControlElementFactory {
<T extends Enum<T>> ControlElement cyclingControlElement(Option<T> option, Dim2i dim, T[] allowedValues, String[] names);
<T extends Enum<T>> ControlElement<T> cyclingControlElement(Option<T> option, Dim2i dim, T[] allowedValues, String[] names);
ControlElement sliderControlElement(Option<Integer> option, Dim2i dim, int min, int max, int interval, ControlValueFormatter formatter);
ControlElement<Integer> sliderControlElement(Option<Integer> option, Dim2i dim, int min, int max, int interval, ControlValueFormatter formatter);
ControlElement tickBoxElement(Option<Boolean> option, Dim2i dim);
ControlElement<Boolean> tickBoxElement(Option<Boolean> option, Dim2i dim);
}
@@ -10,17 +10,17 @@ import net.minecraft.util.MathHelper;
public class SodiumControlElementFactory implements ControlElementFactory {
@Override
public <T extends Enum<T>> ControlElement cyclingControlElement(Option<T> option, Dim2i dim, T[] allowedValues, String[] names) {
return new CyclingControlElement(option, dim, allowedValues, names);
public <T extends Enum<T>> ControlElement<T> cyclingControlElement(Option<T> option, Dim2i dim, T[] allowedValues, String[] names) {
return new CyclingControlElement<>(option, dim, allowedValues, names);
}
@Override
public ControlElement sliderControlElement(Option<Integer> option, Dim2i dim, int min, int max, int interval, ControlValueFormatter formatter) {
public ControlElement<Integer> sliderControlElement(Option<Integer> option, Dim2i dim, int min, int max, int interval, ControlValueFormatter formatter) {
return new SliderControlElement(option, dim, min, max, interval, formatter);
}
@Override
public ControlElement tickBoxElement(Option<Boolean> option, Dim2i dim) {
public ControlElement<Boolean> tickBoxElement(Option<Boolean> option, Dim2i dim) {
return new TickBoxControlElement(option, dim);
}
@@ -3,7 +3,6 @@ package me.jellysquid.mods.sodium.client.model.vertex.buffer;
import static com.gtnewhorizon.gtnhlib.bytebuf.MemoryUtilities.*;
import me.jellysquid.mods.sodium.client.gl.attribute.BufferVertexFormat;
import org.lwjgl.BufferUtils;
import java.nio.ByteBuffer;
@@ -1,15 +1,12 @@
package me.jellysquid.mods.sodium.client.render;
import com.gtnewhorizons.angelica.compat.mojang.Camera;
import com.gtnewhorizons.angelica.compat.mojang.ChunkPos;
import com.gtnewhorizons.angelica.compat.toremove.MatrixStack;
import com.gtnewhorizons.angelica.compat.toremove.RenderLayer;
import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
import com.gtnewhorizons.angelica.glsm.GLStateManager;
import com.gtnewhorizons.angelica.rendering.RenderingState;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
import it.unimi.dsi.fastutil.longs.LongSet;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import jss.notfine.core.SettingsManager;
import lombok.Getter;
@@ -29,7 +26,6 @@ import me.jellysquid.mods.sodium.client.render.chunk.map.ChunkTrackerHolder;
import me.jellysquid.mods.sodium.client.render.chunk.passes.BlockRenderPass;
import me.jellysquid.mods.sodium.client.render.pipeline.context.ChunkRenderCacheShared;
import me.jellysquid.mods.sodium.client.util.math.FrustumExtended;
import me.jellysquid.mods.sodium.client.world.ChunkStatusListener;
import me.jellysquid.mods.sodium.common.util.ListUtil;
import net.coderbot.iris.block_rendering.BlockRenderingSettings;
import net.coderbot.iris.layer.GbufferPrograms;
@@ -76,7 +72,6 @@ public class SodiumWorldRenderer {
private boolean useEntityCulling;
private final LongSet loadedChunkPositions = new LongOpenHashSet();
private final Set<TileEntity> globalTileEntities = new ObjectOpenHashSet<>();
@@ -348,7 +343,11 @@ public class SodiumWorldRenderer {
}
private boolean checkBEVisibility(TileEntity entity) {
return frustum.isBoundingBoxInFrustum(entity.getRenderBoundingBox());
var aabb = entity.getRenderBoundingBox();
if (aabb == TileEntity.INFINITE_EXTENT_AABB) {
return true;
}
return frustum.isBoundingBoxInFrustum(aabb);
}
private void renderTE(TileEntity tileEntity, int pass, float partialTicks) {
@@ -48,6 +48,7 @@ public class ChunkRenderContainer<T extends ChunkGraphicsState> {
private boolean rebuildableForTranslucents;
@SuppressWarnings("unchecked")
public ChunkRenderContainer(ChunkRenderBackend<T> backend, SodiumWorldRenderer worldRenderer, int chunkX, int chunkY, int chunkZ, ChunkRenderColumn<T> column) {
this.worldRenderer = worldRenderer;
@@ -123,8 +123,6 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
private boolean dirtySwap;
private static final ObjectArrayFIFOQueue<?> EMPTY_QUEUE = new ObjectArrayFIFOQueue<>();
private static final ThreadLocal<BlockRenderPass> threadLocalRenderPass = ThreadLocal.withInitial(() -> BlockRenderPass.CUTOUT_MIPPED);
public static int getWorldRenderPass() {
return threadLocalRenderPass.get().ordinal();
@@ -133,6 +131,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
threadLocalRenderPass.set(pass);
}
@SuppressWarnings("unchecked")
public ChunkRenderManager(SodiumWorldRenderer renderer, ChunkRenderBackend<T> backend, WorldClient world, int renderDistance) {
this.backend = backend;
this.renderer = renderer;
@@ -212,6 +211,7 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> implements ChunkSt
for(Object o : this.renders.getElements()) {
if(o == null)
continue;
@SuppressWarnings("unchecked")
ChunkRenderContainer<T> render = (ChunkRenderContainer<T>)o;
if(render.getData().isEmpty())
continue;
@@ -72,6 +72,7 @@ public class ChunkOneshotGraphicsState extends ChunkGraphicsState {
commandList.uploadData(this.vertexBuffer, vertexData);
@SuppressWarnings("unchecked")
GlVertexFormat<ChunkMeshAttribute> vertexFormat = (GlVertexFormat<ChunkMeshAttribute>) vertexData.format;
this.tessellation = commandList.createTessellation(GlPrimitiveType.QUADS, new TessellationBinding[] {
@@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.Deque;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -457,8 +458,10 @@ public class ChunkBuilder<T extends ChunkGraphicsState> {
this.task = task;
this.future = new CompletableFuture<>();
this.future.exceptionally(e -> {
LOGGER.info("Exception thrown while building chunk", e);
// e.printStackTrace();
if (!(e instanceof CancellationException)) {
LOGGER.info("Exception thrown while building chunk", e);
}
return null;
});
}
@@ -29,7 +29,7 @@ public class ChunkGraphCuller implements ChunkCuller {
private boolean useOcclusionCulling;
private int activeFrame = 0;
private int centerChunkX, centerChunkY, centerChunkZ;
private int centerChunkX, centerChunkZ;
public ChunkGraphCuller(World world, int renderDistance) {
this.world = world;
@@ -83,7 +83,6 @@ public class ChunkGraphCuller implements ChunkCuller {
final int chunkZ = origin.getZ() >> 4;
this.centerChunkX = chunkX;
this.centerChunkY = chunkY;
this.centerChunkZ = chunkZ;
final ChunkGraphNode rootNode = this.getNode(chunkX, chunkY, chunkZ);
@@ -73,7 +73,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
return new GlShader(device, type, name, transformations.toString(), ShaderConstants.fromStringList(constants));
} else {
return ShaderLoader.loadShader(device, type, name, constants);
return ShaderLoader.loadShader(device, type, name, ShaderConstants.fromStringList(constants));
}
}
@@ -92,7 +92,7 @@ public abstract class ChunkRenderShaderBackend<T extends ChunkGraphicsState> imp
GlShader vertShader = loadShaderRedirect(device, ShaderType.VERTEX, new ResourceLocation("sodium", "chunk_gl20"), fogMode.getDefines());
GlShader fragShader = ShaderLoader.loadShader(device, ShaderType.FRAGMENT, new ResourceLocation("sodium", "chunk_gl20"), fogMode.getDefines());
GlShader fragShader = ShaderLoader.loadShader(device, ShaderType.FRAGMENT, new ResourceLocation("sodium", "chunk_gl20"), ShaderConstants.fromStringList(fogMode.getDefines()));
try {
return GlProgram.builder(new ResourceLocation("sodium", "chunk_shader"))
@@ -8,6 +8,7 @@ import com.gtnewhorizons.angelica.config.AngelicaConfig;
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
import com.gtnewhorizons.angelica.rendering.AngelicaBlockSafetyRegistry;
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
import com.gtnewhorizons.angelica.utils.AnimationsRenderUtils;
import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
import me.jellysquid.mods.sodium.client.SodiumClientMod;
import me.jellysquid.mods.sodium.client.render.chunk.ChunkGraphicsState;
@@ -132,7 +133,10 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
final WorldSlice slice = cache.getWorldSlice();
final RenderBlocks renderBlocks = new RenderBlocks(slice);
if(renderBlocks instanceof ITexturesCache) ((ITexturesCache)renderBlocks).enableTextureTracking();
if(renderBlocks instanceof ITexturesCache textureCache) {
textureCache.enableTextureTracking();
AnimationsRenderUtils.pushCache(textureCache);
}
final int baseX = this.render.getOriginX();
final int baseY = this.render.getOriginY();
@@ -217,6 +221,10 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
}
}
if(renderBlocks instanceof ITexturesCache) {
AnimationsRenderUtils.popCache();
}
handleRenderBlocksTextures(renderBlocks, renderData);
if(hasMainThreadBlocks) {
@@ -263,7 +271,10 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
final int baseZ = this.render.getOriginZ();
final BlockPos renderOffset = this.offset;
final RenderBlocks rb = new RenderBlocks(slice.getWorld());
if(rb instanceof ITexturesCache) ((ITexturesCache)rb).enableTextureTracking();
if(rb instanceof ITexturesCache textureCache) {
textureCache.enableTextureTracking();
AnimationsRenderUtils.pushCache(textureCache);
}
while(!mainThreadBlocks.isEmpty()) {
final long longPos = mainThreadBlocks.dequeueLong();
if (cancellationSource.isCancelled()) {
@@ -303,6 +314,10 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
if(AngelicaConfig.enableIris) buffers.iris$resetBlockContext();
}
if(rb instanceof ITexturesCache) {
AnimationsRenderUtils.popCache();
}
handleRenderBlocksTextures(rb, renderData);
}
@@ -10,7 +10,6 @@ public class BlockOcclusionCache {
private static final byte UNCACHED_VALUE = (byte) 127;
private final Object2ByteLinkedOpenHashMap<CachedOcclusionShapeTest> map;
private final CachedOcclusionShapeTest cachedTest = new CachedOcclusionShapeTest();
private final BlockPos cpos = new BlockPos();
public BlockOcclusionCache() {
@@ -40,29 +39,6 @@ public class BlockOcclusionCache {
// TODO: Use VoxelShape occlusion from modern
}
private boolean calculate(Block selfShape, Block adjShape) {
final CachedOcclusionShapeTest cache = this.cachedTest;
cache.a = selfShape;
cache.b = adjShape;
cache.updateHash();
final byte cached = this.map.getByte(cache);
if (cached != UNCACHED_VALUE) {
return cached == 1;
}
final boolean ret = adjShape.isOpaqueCube() && selfShape.isOpaqueCube();
this.map.put(cache.copy(), (byte) (ret ? 1 : 0));
if (this.map.size() > 2048) {
this.map.removeFirstByte();
}
return ret;
}
private static final class CachedOcclusionShapeTest {
private Block a, b;
private int hashCode;
@@ -77,17 +53,6 @@ public class BlockOcclusionCache {
this.hashCode = hashCode;
}
public void updateHash() {
int result = System.identityHashCode(this.a);
result = 31 * result + System.identityHashCode(this.b);
this.hashCode = result;
}
public CachedOcclusionShapeTest copy() {
return new CachedOcclusionShapeTest(this.a, this.b, this.hashCode);
}
@Override
public boolean equals(Object o) {
if (o instanceof CachedOcclusionShapeTest that) {
@@ -50,7 +50,6 @@ public class BlockRenderer {
private final LightPipelineProvider lighters;
private final BlockOcclusionCache occlusionCache;
private Object Quad;
private final ObjectPooler<QuadView> quadPool = new ObjectPooler<>(Quad::new);
// TODO: Use modern model API, and store them here
@@ -183,13 +182,7 @@ public class BlockRenderer {
renderData.addSprite(sprite);
}
}
private LightMode getLightingMode(Block block) {
if (this.useAmbientOcclusion && block.getAmbientOcclusionLightValue() != 1.0F && block.getLightValue() == 0) {
return LightMode.SMOOTH;
} else {
return LightMode.FLAT;
}
}
public static class Flags {
boolean hasTexture;
public boolean hasBrightness;
@@ -6,7 +6,6 @@ import me.jellysquid.mods.sodium.client.model.light.cache.HashLightDataCache;
import me.jellysquid.mods.sodium.client.render.pipeline.BlockRenderer;
import me.jellysquid.mods.sodium.client.render.pipeline.ChunkRenderCache;
import me.jellysquid.mods.sodium.client.world.WorldSlice;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.world.World;
@@ -19,8 +18,6 @@ public class ChunkRenderCacheShared extends ChunkRenderCache {
private final HashLightDataCache lightCache;
private ChunkRenderCacheShared(WorldSlice world) {
Minecraft client = Minecraft.getMinecraft();
this.lightCache = new HashLightDataCache(world);
LightPipelineProvider lightPipelineProvider = new LightPipelineProvider(this.lightCache);
@@ -2,6 +2,7 @@ package me.jellysquid.mods.sodium.client.world;
import java.util.Arrays;
import com.gtnewhorizons.angelica.api.IBlockAccessExtended;
import com.gtnewhorizons.angelica.compat.mojang.ChunkSectionPos;
import com.gtnewhorizons.angelica.compat.mojang.CompatMathHelper;
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
@@ -34,7 +35,7 @@ import net.minecraftforge.common.util.ForgeDirection;
*
* Object pooling should be used to avoid huge allocations as this class contains many large arrays.
*/
public class WorldSlice implements IBlockAccess {
public class WorldSlice implements IBlockAccessExtended {
private static final EnumSkyBlock[] LIGHT_TYPES = EnumSkyBlock.values();
// The number of blocks on each axis in a section.
@@ -406,6 +407,7 @@ public class WorldSlice implements IBlockAccess {
};
}
@Override
public World getWorld() {
return this.world;
}
@@ -15,12 +15,11 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.NibbleArray;
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
import net.minecraft.world.gen.structure.StructureBoundingBox;
import java.util.concurrent.atomic.AtomicInteger;
public class ClonedChunkSection {
private static final EnumSkyBlock[] LIGHT_TYPES = EnumSkyBlock.values();
private static final ExtendedBlockStorage EMPTY_SECTION = new ExtendedBlockStorage(0, false);
private final AtomicInteger referenceCount = new AtomicInteger(0);
@@ -68,8 +67,6 @@ public class ClonedChunkSection {
}
this.biomeData = new BiomeGenBase[bArrLength];
StructureBoundingBox box = new StructureBoundingBox(pos.getMinX(), pos.getMinY(), pos.getMinZ(), pos.getMaxX(), pos.getMaxY(), pos.getMaxZ());
this.tileEntities.clear();
// Check for tile entities
@@ -8,7 +8,6 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import jss.notfine.gui.GuiCustomMenu;
import jss.notfine.gui.NotFineGameOptionPages;
import me.flashyreese.mods.reeses_sodium_options.client.gui.ReeseSodiumVideoOptionsScreen;
import me.jellysquid.mods.sodium.client.gui.SodiumGameOptionPages;
import me.jellysquid.mods.sodium.client.gui.SodiumOptionsGUI;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
+2 -1
View File
@@ -306,7 +306,8 @@ public class Iris {
return false;
}
final Map<String, String> changedConfigs = tryReadConfigProperties(shaderPackConfigTxt).map(properties -> (Map<String, String>) (Map) properties)
@SuppressWarnings("unchecked")
final Map<String, String> changedConfigs = tryReadConfigProperties(shaderPackConfigTxt).map(properties -> (Map<String, String>) (Map<?, ?>) properties)
.orElse(new HashMap<>());
changedConfigs.putAll(shaderPackOptionQueue);
@@ -102,7 +102,8 @@ public class GlFramebuffer extends GlResource {
OpenGlHelper.func_153171_g/*glBindFramebuffer*/(GL30.GL_DRAW_FRAMEBUFFER, getGlId());
}
protected void destroyInternal() {
@Override
protected void destroyInternal() {
OpenGlHelper.func_153184_g/*glDeleteFramebuffers*/(getGlId());
}
@@ -75,7 +75,8 @@ public final class ComputeProgram extends GlResource {
GL20.glUseProgram(0);
}
public void destroyInternal() {
@Override
public void destroyInternal() {
GL20.glDeleteProgram(getGlId());
}
@@ -30,7 +30,8 @@ public final class Program extends GlResource {
GL20.glUseProgram(0);
}
public void destroyInternal() {
@Override
public void destroyInternal() {
GL20.glDeleteProgram(getGlId());
}
@@ -148,9 +148,6 @@ public class ProgramUniforms {
@Override
public Builder addUniform(UniformUpdateFrequency updateFrequency, Uniform uniform) {
Objects.requireNonNull(uniform);
if(uniform == null) {
throw new NullPointerException("uniform");
}
switch (updateFrequency) {
case ONCE:
@@ -2,23 +2,18 @@ package net.coderbot.iris.gui;
import lombok.Getter;
import net.coderbot.iris.gui.element.ShaderPackOptionList;
import net.coderbot.iris.shaderpack.option.menu.OptionMenuContainer;
import java.util.ArrayDeque;
import java.util.Deque;
public class NavigationController {
private final OptionMenuContainer container;
private ShaderPackOptionList optionList;
@Getter
private String currentScreen = null;
private final Deque<String> history = new ArrayDeque<>();
public NavigationController(OptionMenuContainer container) {
this.container = container;
}
public void back() {
if (history.size() > 0) {
history.removeLast();
@@ -153,7 +153,8 @@ public class IrisElementRow {
this.onClick = onClick;
}
@Override
@SuppressWarnings("unchecked")
@Override
public boolean mouseClicked(double mx, double my, int button) {
if (this.disabled) {
return false;
@@ -67,7 +67,7 @@ public class ShaderPackOptionList extends IrisGuiSlot {
row.add(element);
if (row.size() >= columns) {
this.addEntry(new ElementRowEntry(screen, this.navigation, row));
this.addEntry(new ElementRowEntry(this.navigation, row));
row = new ArrayList<>(); // Clearing the list would affect the row entry created above
}
}
@@ -77,7 +77,7 @@ public class ShaderPackOptionList extends IrisGuiSlot {
row.add(AbstractElementWidget.EMPTY);
}
this.addEntry(new ElementRowEntry(screen, this.navigation, row));
this.addEntry(new ElementRowEntry(this.navigation, row));
}
}
@@ -81,7 +81,7 @@ public class ShaderPackSelectionList extends IrisGuiSlot {
}
public void addPackEntry(int index, String name) {
final ShaderPackEntry entry = new ShaderPackEntry(index, this, name);
final ShaderPackEntry entry = new ShaderPackEntry(this, name);
Iris.getIrisConfig().getShaderPackName().ifPresent(currentPackName -> {
if (name.equals(currentPackName)) {
@@ -11,15 +11,12 @@ import java.util.List;
public class ElementRowEntry extends BaseEntry {
private final List<AbstractElementWidget<?>> widgets;
private final ShaderPackScreen screen;
private int cachedWidth;
private int cachedPosX;
public ElementRowEntry(ShaderPackScreen screen, NavigationController navigation, List<AbstractElementWidget<?>> widgets) {
public ElementRowEntry(NavigationController navigation, List<AbstractElementWidget<?>> widgets) {
super(navigation);
this.screen = screen;
this.widgets = widgets;
}
@@ -51,10 +48,12 @@ public class ElementRowEntry extends BaseEntry {
return MathHelper.clamp_int((int) Math.floor(widgets.size() * positionAcrossWidget), 0, widgets.size() - 1);
}
@Override
public boolean mouseClicked(int mouseX, int mouseY, int button) {
return this.widgets.get(getHoveredWidget(mouseX)).mouseClicked(mouseX, mouseY, button);
}
@Override
public boolean mouseReleased(int mouseX, int mouseY, int button) {
return this.widgets.get(getHoveredWidget(mouseX)).mouseReleased(mouseX, mouseY, button);
}
@@ -58,6 +58,7 @@ public class HeaderEntry extends BaseEntry {
this.text = text;
}
@Override
public void drawEntry(ShaderPackScreen screen, int index, int x, int y, int slotWidth, int slotHeight, Tessellator tessellator, int mouseX, int mouseY, boolean isMouseOver) {
// Draw dividing line
// fill(x - 3, (y + slotHeight) - 2, x + slotWidth, (y + slotHeight) - 1, 0x66BEBEBE);
@@ -101,6 +102,7 @@ public class HeaderEntry extends BaseEntry {
ShaderPackScreen.TOP_LAYER_RENDER_QUEUE.add(() -> GuiUtil.drawTextPanel(font, text, x - (font.getStringWidth(text) + 10), y - 16));
}
@Override
public boolean mouseClicked(int mouseX, int mouseY, int button) {
final boolean backButtonResult = backButton != null && backButton.mouseClicked(mouseX, mouseY, button);
final boolean utilButtonResult = utilityButtons.mouseClicked(mouseX, mouseY, button);
@@ -10,13 +10,11 @@ import net.minecraft.util.EnumChatFormatting;
public class ShaderPackEntry extends BaseEntry {
@Getter private final String packName;
private final ShaderPackSelectionList shaderPackSelectionList;
private final int index;
public ShaderPackEntry(int index, ShaderPackSelectionList list, String packName) {
public ShaderPackEntry(ShaderPackSelectionList list, String packName) {
super(list);
this.packName = packName;
this.shaderPackSelectionList = list;
this.index = index;
}
public boolean isApplied() {
@@ -55,6 +55,7 @@ public class TopButtonRowEntry extends BaseEntry {
this.shaderPackSelectionList.getScreen().refreshScreenSwitchButton();
}
@Override
public void drawEntry(ShaderPackScreen screen, int index, int x, int y, int listWidth, Tessellator tessellator, int mouseX, int mouseY, boolean isMouseOver) {
this.buttons.setWidth(this.enableDisableButton, (listWidth - 1) - REFRESH_BUTTON_WIDTH);
this.enableDisableButton.centerX = x + (int)(listWidth * 0.5);
@@ -3,7 +3,6 @@ package net.coderbot.iris.gui.element.widget;
import net.minecraft.client.gui.GuiButton;
import java.util.function.Consumer;
import java.util.function.Function;
public class IrisButton extends GuiButton {
protected final Consumer<IrisButton> onPress;
@@ -1,11 +1,6 @@
package net.coderbot.iris.gui.option;
import java.io.IOException;
import net.coderbot.iris.Iris;
import net.coderbot.iris.pipeline.WorldRenderingPipeline;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
public class IrisVideoSettings {
public static int shadowDistance = 32;
@@ -22,7 +22,6 @@ import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
@@ -66,7 +65,6 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
private boolean optionMenuOpen = false;
private boolean dropChanges = false;
private static final String development = "Development Environment";
private String developmentComponent;
private String updateComponent;
@@ -235,10 +233,6 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
}
if (inWorld) {
final String showOrHide = this.guiHidden
? I18n.format("options.iris.gui.show")
: I18n.format("options.iris.gui.hide");
final float endOfLastButton = this.width / 2.0f + 154.0f;
final float freeSpace = this.width - endOfLastButton;
final int x;
@@ -320,7 +314,7 @@ public class ShaderPackScreen extends GuiScreen implements HudHideable {
if (Iris.getCurrentPack().isPresent()) {
final ShaderPack currentPack = Iris.getCurrentPack().get();
this.navigation = new NavigationController(currentPack.getMenuContainer());
this.navigation = new NavigationController();
if (this.shaderOptionList != null) {
this.shaderOptionList.applyShaderPack(currentPack);
Loaded 100 of 181 files, more files were not shown because too many files have changed in this diff. Show more