mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-17 11:05:04 +00:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd78f63f12 | ||
|
|
6cf119dfee | ||
|
|
8c5f4d2543 | ||
|
|
9e1fa7b80f | ||
|
|
6c99872459 | ||
|
|
f0809410ee | ||
|
|
98299b69d2 | ||
|
|
fed0aa77c5 | ||
|
|
f7fb3186c8 | ||
|
|
ab243bb936 | ||
|
|
60cce7ea1d | ||
|
|
b837b0571d | ||
|
|
7abc6213f5 | ||
|
|
b46643ae8c | ||
|
|
e3d1fedd48 | ||
|
|
ebcee499eb | ||
|
|
ad26b1ad6f |
No files matched your search
@@ -48,6 +48,28 @@ body:
|
||||
- Mesa/Software
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: shaders
|
||||
attributes:
|
||||
label: Shaders
|
||||
description: Do you have Iris/Shaders enabled?
|
||||
options:
|
||||
- "No: Go ahead and create an issue"
|
||||
- "Yes: I will not create an issue"
|
||||
- "Yes: I don't read and shouldn't be creating an issue"
|
||||
validations:
|
||||
required: true
|
||||
- type: dropdown
|
||||
id: mcpf
|
||||
attributes:
|
||||
label: MCPF or other features disabled by default
|
||||
description: Do you have MCPF or any other features that are disabled by default enabled?
|
||||
options:
|
||||
- "No: Go ahead and create an issue"
|
||||
- "Yes: I will not create an issue"
|
||||
- "Yes: I don't read and shouldn't be creating an issue"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: report
|
||||
attributes:
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
* OptiFine [Disabled, won't fix]
|
||||
* FastCraft [Disabled, won't fix]
|
||||
* BetterFPS [Disabled, won't fix]
|
||||
* Amazing Trophies 1.2.1 and below - use 1.2.2+
|
||||
* LWJGL3ify 1.5.4 and below - Use the latest version available, 1.5.7+
|
||||
* ArchaicFix 0.6.2 and below - Use 0.7.0 or above
|
||||
* Hodgepodge 2.4.3 and below - [Use 2.4.4 or above](https://github.com/GTNewHorizons/Hodgepodge/releases)
|
||||
* [Amazing Trophies 1.2.1 and below](https://github.com/GTNewHorizons/Amazing-Trophies/releases) - use 1.2.2+
|
||||
* [LWJGL3ify 1.5.4 and below](https://github.com/GTNewHorizons/lwjgl3ify/releases/) - Use the latest version available, 1.5.7+
|
||||
* [ArchaicFix 0.6.2 and below](https://www.curseforge.com/minecraft/mc-mods/archaicfix/files/all?page=1&pageSize=20) - Use 0.7.0 or above
|
||||
* [Hodgepodge 2.4.3 and below](https://github.com/GTNewHorizons/Hodgepodge/releases) - Use 2.4.4 or above
|
||||
* CodeChicken[Core](https://github.com/GTNewHorizons/CodeChickenCore/releases)/[Lib](https://github.com/GTNewHorizons/CodeChickenLib/releases) <1.2.0 - Threading issues, use 1.3.0+
|
||||
* Neodymium - Untested, but unlikely to be compatible. (Chunk Meshing is definitely incompatible, other features might work depending on config)
|
||||
|
||||
|
||||
+11
-14
@@ -49,7 +49,7 @@ configurations {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.4.31")
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.71")
|
||||
|
||||
compileOnly("com.gtnewhorizons.retrofuturabootstrap:RetroFuturaBootstrap:0.4.0") { transitive = false }
|
||||
|
||||
@@ -61,7 +61,7 @@ dependencies {
|
||||
|
||||
// Iris Shaders
|
||||
compileOnly('org.jetbrains:annotations:24.0.1')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.4.2:dev")
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.5.12:dev")
|
||||
shadowImplementation("org.anarres:jcpp:1.4.14") // Apache 2.0
|
||||
implementation("io.github.douira:glsl-transformer:1.0.0")
|
||||
shadowImplementation("io.github.douira:glsl-transformer:1.0.0") { // glsl-transformer Noncommercial License 1.0.0
|
||||
@@ -70,23 +70,20 @@ dependencies {
|
||||
compileOnly "org.apache.ant:ant:1.8.2"
|
||||
|
||||
// Because who doesn't want NEI
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.4.9-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:CodeChickenCore:1.2.0:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.39-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:CodeChickenCore:1.3.7: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.5.16:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:twilightforest:2.6.34:dev") { transitive = false }
|
||||
compileOnly(rfg.deobf('curse.maven:witchery-69673:2234410'))
|
||||
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.0-GTNH:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Natura:2.6.1:dev")
|
||||
compileOnly("com.github.GTNewHorizons:TinkersConstruct:1.12.10-GTNH:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Natura:2.7.3:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:ThaumicHorizons:1.6.1:dev")
|
||||
compileOnly("com.github.GTNewHorizons:ThaumicHorizons:1.6.3:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.0:dev") { transitive = false }
|
||||
compileOnly(rfg.deobf('maven.modrinth:backhand:1.4.1')) { transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.0:dev") { transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.1:dev") { transitive = false }
|
||||
compileOnly(rfg.deobf('maven.modrinth:backhand:1.4.1')) { transitive = false }
|
||||
|
||||
compileOnly("com.falsepattern:chunkapi-mc1.7.10:0.5.1:api") { transitive = false }
|
||||
@@ -97,7 +94,7 @@ dependencies {
|
||||
|
||||
compileOnly("curse.maven:minefactory-reloaded-66672:2277486")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughIds:2.0.3:dev") // Mixin Version
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughIds:2.1.6:dev") // Mixin Version
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughIds-Legacy:1.4.7:dev") // ASM Version
|
||||
|
||||
compileOnly(rfg.deobf("curse.maven:campfirebackport-387444:4611675"))
|
||||
@@ -105,7 +102,7 @@ dependencies {
|
||||
compileOnly(rfg.deobf("curse.maven:journeymap-32274:2367915"))
|
||||
compileOnly(rfg.deobf("curse.maven:xaeros-minimap-263420:5060684"))
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:HoloInventory:2.4.4-GTNH:dev")
|
||||
compileOnly("com.github.GTNewHorizons:HoloInventory:2.4.12-GTNH:dev")
|
||||
|
||||
runtimeOnlyNonPublishable(rfg.deobf("CoreTweaks:CoreTweaks:0.3.3.2"))
|
||||
|
||||
|
||||
+7
-1
@@ -122,9 +122,15 @@ minimizeShadowedDependencies = true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+1
-1
@@ -16,5 +16,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.26'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gtnewhorizons.angelica;
|
||||
|
||||
import com.gtnewhorizons.angelica.common.BlockError;
|
||||
import com.gtnewhorizons.angelica.compat.ModStatus;
|
||||
import com.gtnewhorizons.angelica.proxy.CommonProxy;
|
||||
import com.gtnewhorizons.angelica.utils.AnimationMode;
|
||||
@@ -27,10 +28,13 @@ public class AngelicaMod {
|
||||
|
||||
public static final ManagedEnum<AnimationMode> animationsMode = new ManagedEnum<>(AnimationMode.VISIBLE_ONLY);
|
||||
|
||||
public static BlockError blockError;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
ModStatus.preInit();
|
||||
proxy.preInit(event);
|
||||
blockError = new BlockError();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
||||
@@ -357,7 +357,7 @@ public class BatchingFontRenderer {
|
||||
final float underlineY = anchorY + underlying.FONT_HEIGHT - 1.0f;
|
||||
float underlineStartX = 0.0f;
|
||||
float underlineEndX = 0.0f;
|
||||
final float strikethroughY = anchorY + (float) (underlying.FONT_HEIGHT / 2);
|
||||
final float strikethroughY = anchorY + (float) (underlying.FONT_HEIGHT / 2) - 1.0F;
|
||||
float strikethroughStartX = 0.0f;
|
||||
float strikethroughEndX = 0.0f;
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.gtnewhorizons.angelica.common;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
/**
|
||||
* This Block is not actually getting registered. A static instance is created in AngelicaMod.
|
||||
* In order to register the texture for it, there is a mixin to TextureMap which injects a call
|
||||
* to this instance's registerBlocKIcons method. Actually registering the block on the client but
|
||||
* not the server can cause block IDs to different between client/server, which is not good.
|
||||
|
||||
* We're essentially injecting the block's texture, so that we may use this block as if it were
|
||||
* any normal block for rendering purposes with RenderBlocks and such, but not have to actually
|
||||
* register it as a block.
|
||||
*/
|
||||
|
||||
public class BlockError extends Block {
|
||||
|
||||
public BlockError() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg)
|
||||
{
|
||||
this.blockIcon = reg.registerIcon("angelica:error_block");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ 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;
|
||||
import xonin.backhand.Backhand;
|
||||
|
||||
@@ -52,6 +53,14 @@ public class ModStatus {
|
||||
) <= 0;
|
||||
}
|
||||
|
||||
// remove compat with original release of BG2
|
||||
if (isBattlegearLoaded){
|
||||
isBattlegearLoaded = new DefaultArtifactVersion("1.2.0")
|
||||
.compareTo(
|
||||
LoadControllerHelper.getOwningMod(Battlegear.class).getProcessedVersion()
|
||||
) <= 0;
|
||||
}
|
||||
|
||||
if (isBackhandLoaded){
|
||||
isBackhandLoaded = new DefaultArtifactVersion("1.4.1")
|
||||
.compareTo(
|
||||
|
||||
@@ -127,6 +127,17 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean fixFluidRendererCheckingBlockAgain;
|
||||
|
||||
@Config.Comment("Dynamically modifies the render distance of dropped items entities to preserve performance."
|
||||
+ " It starts reducing the render distance when exceeding the threshold set below.")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean dynamicItemRenderDistance;
|
||||
|
||||
@Config.Comment("Max amount of dropped item rendered")
|
||||
@Config.DefaultInt(256)
|
||||
@Config.RangeInt(min = 32, max = 2048)
|
||||
public static int droppedItemLimit;
|
||||
|
||||
@Config.Comment("Enable Debug Logging")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
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;
|
||||
import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader;
|
||||
@@ -21,22 +22,28 @@ import org.spongepowered.asm.launch.GlobalProperties;
|
||||
import org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
// ================== Important ==================
|
||||
// Due to a bug caused by this class both implementing
|
||||
// IFMLLoadingPlugin and IEarlyMixinLoader,
|
||||
// the IClassTransformer registered in this class
|
||||
// will not respect the sorting index defined.
|
||||
// They will instead use default index 0 which means they will see
|
||||
// obfuscated mappings and not SRG mappings when running outside of dev env.
|
||||
// ===============================================
|
||||
//@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE - 5)
|
||||
@IFMLLoadingPlugin.MCVersion("1.7.10")
|
||||
@IFMLLoadingPlugin.TransformerExclusions(
|
||||
{
|
||||
@IFMLLoadingPlugin.TransformerExclusions({
|
||||
"com.gtnewhorizons.angelica.transform.RedirectorTransformer",
|
||||
"com.gtnewhorizons.angelica.glsm.GLStateManager"
|
||||
}
|
||||
)
|
||||
@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE - 5)
|
||||
"com.gtnewhorizons.angelica.glsm.GLStateManager"})
|
||||
public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader {
|
||||
|
||||
private static final boolean DUMP_CLASSES = Boolean.parseBoolean(System.getProperty("angelica.dumpClass", "false"));
|
||||
private static boolean OBF_ENV;
|
||||
public static final Logger LOGGER = LogManager.getLogger("Angelica");
|
||||
|
||||
private String[] transformerClasses;
|
||||
@@ -68,18 +75,11 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader {
|
||||
if (mixinTweakClasses != null) {
|
||||
mixinTweakClasses.add(MixinCompatHackTweaker.class.getName());
|
||||
}
|
||||
|
||||
// Return any others here
|
||||
if (transformerClasses == null) {
|
||||
|
||||
//Mod Compat transformers
|
||||
final List<String> transformers = new ArrayList<>();
|
||||
transformers.addAll(CompatASMTransformers.getTransformers());
|
||||
|
||||
//NotFine transformers
|
||||
Namer.initNames();
|
||||
transformers.addAll(Arrays.asList(AsmTransformers.getTransformers()));
|
||||
|
||||
final List<String> transformers = new ArrayList<>(CompatASMTransformers.getTransformers());
|
||||
final List<String> notFineTransformers = AsmTransformers.getTransformers();
|
||||
if (!notFineTransformers.isEmpty()) Namer.initNames();
|
||||
transformers.addAll(notFineTransformers);
|
||||
transformerClasses = transformers.toArray(new String[0]);
|
||||
}
|
||||
return transformerClasses;
|
||||
@@ -97,7 +97,7 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader {
|
||||
|
||||
@Override
|
||||
public void injectData(Map<String, Object> data) {
|
||||
// no-op
|
||||
OBF_ENV = (boolean) data.get("runtimeDeobfuscationEnabled");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,6 +115,24 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader {
|
||||
return Mixins.getEarlyMixins(loadedCoreMods);
|
||||
}
|
||||
|
||||
public static boolean DUMP_CLASSES() {
|
||||
return DUMP_CLASSES || !OBF_ENV;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if we are in an obfuscated environment, returns false in dev environment.
|
||||
*/
|
||||
public static boolean isObfEnv() {
|
||||
return OBF_ENV;
|
||||
}
|
||||
|
||||
public static void dumpClass(String className, byte[] originalBytes, byte[] transformedBytes, Object transformer) {
|
||||
if (AngelicaTweaker.DUMP_CLASSES()) {
|
||||
ASMUtil.saveAsRawClassFile(originalBytes, className + "_PRE", transformer);
|
||||
ASMUtil.saveAsRawClassFile(transformedBytes, className + "_POST", transformer);
|
||||
}
|
||||
}
|
||||
|
||||
private static final ImmutableMap<String, TargetedMod> MODS_BY_CLASS = ImmutableMap.<String, TargetedMod>builder()
|
||||
.put("optifine.OptiFineForgeTweaker", TargetedMod.OPTIFINE)
|
||||
.put("fastcraft.Tweaker", TargetedMod.FASTCRAFT)
|
||||
|
||||
@@ -29,6 +29,7 @@ public enum Mixins {
|
||||
,"angelica.MixinMinecraft"
|
||||
,"angelica.optimizations.MixinRendererLivingEntity"
|
||||
,"angelica.MixinFMLClientHandler"
|
||||
,"angelica.MixinTextureMap"
|
||||
)
|
||||
),
|
||||
ANGELICA_VBO(
|
||||
@@ -69,6 +70,11 @@ public enum Mixins {
|
||||
.setApplyIf(() -> AngelicaConfig.fixFluidRendererCheckingBlockAgain)
|
||||
.addTargetedMod(TargetedMod.VANILLA)),
|
||||
|
||||
ANGELICA_LIMIT_DROPPED_ITEM_ENTITIES(new Builder("Dynamically modifies the render distance of dropped items entities to preserve performance")
|
||||
.setPhase(Phase.EARLY).addMixinClasses("angelica.optimizations.MixinRenderGlobal_ItemRenderDist").setSide(Side.CLIENT)
|
||||
.setApplyIf(() -> AngelicaConfig.dynamicItemRenderDistance)
|
||||
.addTargetedMod(TargetedMod.VANILLA)),
|
||||
|
||||
// Not compatible with the lwjgl debug callbacks, so disable if that's enabled
|
||||
ARCHAIC_SPLASH(new Builder("ArchaicFix Splash").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.showSplashMemoryBar && !AngelicaMod.lwjglDebug).addMixinClasses(
|
||||
@@ -100,15 +106,15 @@ public enum Mixins {
|
||||
|
||||
SODIUM(new Builder("Sodium").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableSodium).addMixinClasses(
|
||||
"sodium.MixinChunkProviderClient"
|
||||
,"sodium.MixinBlock"
|
||||
"sodium.MixinBlock"
|
||||
,"sodium.MixinBlockFluidBase"
|
||||
,"sodium.AccessorBiomeColorEvent"
|
||||
,"sodium.MixinBiomeGenBase"
|
||||
,"sodium.MixinChunk"
|
||||
,"sodium.MixinChunkProviderServer"
|
||||
,"sodium.MixinClientRegistry"
|
||||
,"sodium.MixinEntity"
|
||||
,"sodium.MixinEntity_RenderDist"
|
||||
,"sodium.MixinEntityItem_RenderDist"
|
||||
,"sodium.MixinRenderManager"
|
||||
,"sodium.MixinExtendedBlockStorage"
|
||||
,"sodium.MixinEntityRenderer"
|
||||
@@ -131,11 +137,6 @@ public enum Mixins {
|
||||
)
|
||||
),
|
||||
|
||||
// Required for Sodium's FluidRenderer, so it treats vanilla liquids as IFluidBlocks
|
||||
SODIUM_WISHLIST(new Builder("Sodiumer").addTargetedMod(TargetedMod.VANILLA).setSide(Side.BOTH)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableSodiumFluidRendering).addMixinClasses(
|
||||
"sodium.MixinBlockLiquid")),
|
||||
|
||||
IRIS_RENDERING(new Builder("Iris Shaders").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableIris).addMixinClasses(
|
||||
"shaders.MixinEntityRenderer"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gtnewhorizons.angelica.transform;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
@@ -10,9 +11,8 @@ import org.objectweb.asm.tree.ClassNode;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockTransformer implements IClassTransformer {
|
||||
public static final String BlockClass = "net/minecraft/block/Block";
|
||||
public static final String BlockPackage = BlockClass.substring(0, BlockClass.lastIndexOf('/') + 1);
|
||||
private static final String BlockClassFriendly = BlockClass.replace('/', '.');
|
||||
|
||||
private static final String BlockClassFriendly = "net.minecraft.block.Block";
|
||||
public static final List<Pair<String, String>> BlockBoundsFields = ImmutableList.of(
|
||||
Pair.of("minX", "field_149759_B"),
|
||||
Pair.of("minY", "field_149760_C"),
|
||||
@@ -28,18 +28,18 @@ public class BlockTransformer implements IClassTransformer {
|
||||
*/
|
||||
@Override
|
||||
public byte[] transform(String name, String transformedName, byte[] basicClass) {
|
||||
if(basicClass != null && transformedName.equals(BlockClassFriendly)) {
|
||||
if (basicClass != null && BlockClassFriendly.equals(transformedName)) {
|
||||
final ClassReader cr = new ClassReader(basicClass);
|
||||
final ClassNode cn = new ClassNode();
|
||||
cr.accept(cn, 0);
|
||||
|
||||
cn.fields.removeIf(node -> BlockBoundsFields.stream().anyMatch(pair -> node.name.equals(pair.getLeft()) || node.name.equals(pair.getRight())));
|
||||
|
||||
cn.fields.removeIf(field -> BlockBoundsFields.stream().anyMatch(pair -> field.name.equals(pair.getLeft()) || field.name.equals(pair.getRight())));
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
cn.accept(cw);
|
||||
basicClass = cw.toByteArray();
|
||||
final byte[] bytes = cw.toByteArray();
|
||||
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,8 +4,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.spongepowered.asm.lib.ClassReader;
|
||||
import org.spongepowered.asm.lib.ClassWriter;
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
@@ -18,19 +16,14 @@ import org.spongepowered.asm.lib.tree.MethodInsnNode;
|
||||
import org.spongepowered.asm.lib.tree.MethodNode;
|
||||
import org.spongepowered.asm.transformers.MixinClassWriter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class HUDCachingTransformer implements IClassTransformer, Opcodes {
|
||||
static final String HUDCaching = "com/gtnewhorizons/angelica/hudcaching/HUDCaching$HUDCachingHooks";
|
||||
private static final boolean DUMP_CLASSES = Boolean.parseBoolean(System.getProperty("angelica.dumpClass", "false"));
|
||||
|
||||
static final Map<String, List<String>> ReturnEarlyMethods = ImmutableMap.of(
|
||||
private static final String HUDCaching = "com/gtnewhorizons/angelica/hudcaching/HUDCaching$HUDCachingHooks";
|
||||
private static final Map<String, List<String>> ReturnEarlyMethods = ImmutableMap.of(
|
||||
"thaumcraft.client.lib.RenderEventHandler", ImmutableList.of("renderOverlay"),
|
||||
"com.kentington.thaumichorizons.client.lib.RenderEventHandler", ImmutableList.of("renderOverlay")
|
||||
);
|
||||
@@ -70,43 +63,10 @@ public class HUDCachingTransformer implements IClassTransformer, Opcodes {
|
||||
MixinClassWriter cw = new MixinClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
|
||||
cn.accept(cw);
|
||||
final byte[] bytes = cw.toByteArray();
|
||||
saveTransformedClass(bytes, transformedName);
|
||||
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
private File outputDir = null;
|
||||
private void saveTransformedClass(final byte[] data, final String transformedName) {
|
||||
if (!DUMP_CLASSES) {
|
||||
return;
|
||||
}
|
||||
if (outputDir == null) {
|
||||
outputDir = new File(Launch.minecraftHome, "ASM_HUD_CACHING");
|
||||
try {
|
||||
FileUtils.deleteDirectory(outputDir);
|
||||
} catch (IOException ignored) {}
|
||||
if (!outputDir.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
outputDir.mkdirs();
|
||||
}
|
||||
}
|
||||
final String fileName = transformedName.replace('.', File.separatorChar);
|
||||
final File classFile = new File(outputDir, fileName + ".class");
|
||||
final File outDir = classFile.getParentFile();
|
||||
if (!outDir.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
outDir.mkdirs();
|
||||
}
|
||||
if (classFile.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
classFile.delete();
|
||||
}
|
||||
try (final OutputStream output = Files.newOutputStream(classFile.toPath())) {
|
||||
output.write(data);
|
||||
} catch (IOException e) {
|
||||
AngelicaTweaker.LOGGER.error("Could not save transformed class (byte[]) " + transformedName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,10 @@ package com.gtnewhorizons.angelica.transform;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.gtnewhorizon.gtnhlib.asm.ClassConstantPoolParser;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import net.coderbot.iris.IrisLogging;
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraft.launchwrapper.LaunchClassLoader;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
@@ -23,12 +20,8 @@ import org.objectweb.asm.tree.LdcInsnNode;
|
||||
import org.objectweb.asm.tree.MethodInsnNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -38,17 +31,12 @@ import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gtnewhorizons.angelica.transform.BlockTransformer.BlockBoundsFields;
|
||||
import static com.gtnewhorizons.angelica.transform.BlockTransformer.BlockClass;
|
||||
import static com.gtnewhorizons.angelica.transform.BlockTransformer.BlockPackage;
|
||||
|
||||
/**
|
||||
* This transformer redirects many GL calls to our custom GLStateManager
|
||||
*/
|
||||
public class RedirectorTransformer implements IClassTransformer {
|
||||
|
||||
private static final boolean ASSERT_MAIN_THREAD = Boolean.parseBoolean(System.getProperty("angelica.assertMainThread", "false"));
|
||||
private static final boolean DUMP_CLASSES = Boolean.parseBoolean(System.getProperty("angelica.dumpClass", "false"));
|
||||
private static final String Drawable = "org/lwjgl/opengl/Drawable";
|
||||
private static final String GLStateManager = "com/gtnewhorizons/angelica/glsm/GLStateManager";
|
||||
private static final String GL11 = "org/lwjgl/opengl/GL11";
|
||||
@@ -57,6 +45,9 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
private static final String GL20 = "org/lwjgl/opengl/GL20";
|
||||
private static final String Project = "org/lwjgl/util/glu/Project";
|
||||
|
||||
private static final String BlockClass = "net/minecraft/block/Block";
|
||||
private static final String BlockPackage = "net/minecraft/block/Block";
|
||||
|
||||
private static final String OpenGlHelper = "net/minecraft/client/renderer/OpenGlHelper";
|
||||
private static final String EXTBlendFunc = "org/lwjgl/opengl/EXTBlendFuncSeparate";
|
||||
private static final String ARBMultiTexture = "org/lwjgl/opengl/ARBMultitexture";
|
||||
@@ -233,9 +224,9 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
}
|
||||
|
||||
private boolean isVanillaBlockSubclass(String className) {
|
||||
if(className.startsWith(BlockTransformer.BlockPackage)) {
|
||||
for(String exclusion : VanillaBlockExclusions) {
|
||||
if(className.startsWith(exclusion)) {
|
||||
if (className.startsWith(BlockPackage)) {
|
||||
for (String exclusion : VanillaBlockExclusions) {
|
||||
if (className.startsWith(exclusion)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -281,7 +272,7 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
cn.accept(cw);
|
||||
final byte[] bytes = cw.toByteArray();
|
||||
saveTransformedClass(bytes, transformedName);
|
||||
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
|
||||
return bytes;
|
||||
}
|
||||
return basicClass;
|
||||
@@ -309,9 +300,9 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
} else {
|
||||
// Check if we declare any known field names
|
||||
Set<String> fieldsDeclaredByClass = cn.fields.stream().map(f -> f.name).collect(Collectors.toSet());
|
||||
doWeShadow = BlockBoundsFields.stream().anyMatch(pair -> fieldsDeclaredByClass.contains(pair.getLeft()) || fieldsDeclaredByClass.contains(pair.getRight()));
|
||||
doWeShadow = BlockTransformer.BlockBoundsFields.stream().anyMatch(pair -> fieldsDeclaredByClass.contains(pair.getLeft()) || fieldsDeclaredByClass.contains(pair.getRight()));
|
||||
}
|
||||
if(doWeShadow) {
|
||||
if (doWeShadow) {
|
||||
AngelicaTweaker.LOGGER.info("Class '{}' shadows one or more block bounds fields, these accesses won't be redirected!", cn.name);
|
||||
blockOwnerExclusions.add(cn.name);
|
||||
}
|
||||
@@ -383,13 +374,13 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
else if ((node.getOpcode() == Opcodes.GETFIELD || node.getOpcode() == Opcodes.PUTFIELD) && node instanceof FieldInsnNode fNode) {
|
||||
if(!blockOwnerExclusions.contains(fNode.owner) && isBlockSubclass(fNode.owner) && isSodiumEnabled()) {
|
||||
Pair<String, String> fieldToRedirect = null;
|
||||
for(Pair<String, String> blockPairs : BlockBoundsFields) {
|
||||
for(Pair<String, String> blockPairs : BlockTransformer.BlockBoundsFields) {
|
||||
if(fNode.name.equals(blockPairs.getLeft()) || fNode.name.equals(blockPairs.getRight())) {
|
||||
fieldToRedirect = blockPairs;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(fieldToRedirect != null) {
|
||||
if (fieldToRedirect != null) {
|
||||
if (IrisLogging.ENABLE_SPAM) {
|
||||
AngelicaTweaker.LOGGER.info("Redirecting Block.{} in {} to thread-safe wrapper", fNode.name, transformedName);
|
||||
}
|
||||
@@ -398,9 +389,9 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
fNode.owner = ThreadedBlockData;
|
||||
// Inject getter before the field access, to turn Block -> ThreadedBlockData
|
||||
final MethodInsnNode getter = new MethodInsnNode(Opcodes.INVOKESTATIC, ThreadedBlockData, "get", "(L" + BlockClass + ";)L" + ThreadedBlockData + ";", false);
|
||||
if(node.getOpcode() == Opcodes.GETFIELD) {
|
||||
if (node.getOpcode() == Opcodes.GETFIELD) {
|
||||
mn.instructions.insertBefore(fNode, getter);
|
||||
} else if(node.getOpcode() == Opcodes.PUTFIELD) {
|
||||
} else if (node.getOpcode() == Opcodes.PUTFIELD) {
|
||||
// FIXME: this code assumes doubles
|
||||
// Stack: Block, double
|
||||
final InsnList beforePut = new InsnList();
|
||||
@@ -418,7 +409,6 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
}
|
||||
changed = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,40 +420,6 @@ public class RedirectorTransformer implements IClassTransformer {
|
||||
return changed;
|
||||
}
|
||||
|
||||
private File outputDir = null;
|
||||
|
||||
private void saveTransformedClass(final byte[] data, final String transformedName) {
|
||||
if (!DUMP_CLASSES) {
|
||||
return;
|
||||
}
|
||||
if (outputDir == null) {
|
||||
outputDir = new File(Launch.minecraftHome, "ASM_REDIRECTOR");
|
||||
try {
|
||||
FileUtils.deleteDirectory(outputDir);
|
||||
} catch (IOException ignored) {}
|
||||
if (!outputDir.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
outputDir.mkdirs();
|
||||
}
|
||||
}
|
||||
final String fileName = transformedName.replace('.', File.separatorChar);
|
||||
final File classFile = new File(outputDir, fileName + ".class");
|
||||
final File outDir = classFile.getParentFile();
|
||||
if (!outDir.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
outDir.mkdirs();
|
||||
}
|
||||
if (classFile.exists()) {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
classFile.delete();
|
||||
}
|
||||
try (final OutputStream output = Files.newOutputStream(classFile.toPath())) {
|
||||
output.write(data);
|
||||
} catch (IOException e) {
|
||||
AngelicaTweaker.LOGGER.error("Could not save transformed class (byte[]) " + transformedName, e);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RedirectMap<K> extends HashMap<K, K> {
|
||||
public static RedirectMap<String> newMap() {
|
||||
return new RedirectMap<>();
|
||||
|
||||
+3
-1
@@ -51,7 +51,9 @@ public class ExtraUtilsTransformer implements IClassTransformer {
|
||||
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
cn.accept(cw);
|
||||
return cw.toByteArray();
|
||||
final byte[] bytes = cw.toByteArray();
|
||||
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
public void addThreadSafeISBRHAnnotation(String transformedName, ClassNode cn) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public enum AsmTransformers {
|
||||
.isClient());
|
||||
}
|
||||
|
||||
public static String[] getTransformers() {
|
||||
public static List<String> getTransformers() {
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (AsmTransformers transformer : values()) {
|
||||
if (transformer.shouldBeLoaded()) {
|
||||
@@ -55,7 +55,7 @@ public enum AsmTransformers {
|
||||
AngelicaTweaker.LOGGER.info("Not loading transformer {}", (Object[]) transformer.transformerClasses);
|
||||
}
|
||||
}
|
||||
return list.toArray(new String[0]);
|
||||
return list;
|
||||
}
|
||||
|
||||
private enum Side {
|
||||
|
||||
@@ -2,6 +2,7 @@ package jss.notfine.asm;
|
||||
|
||||
import static jss.notfine.asm.ASMUtils.matchesNodeSequence;
|
||||
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@@ -32,9 +33,10 @@ public class RenderBlocksTransformer implements IClassTransformer {
|
||||
|
||||
public byte[] transform(String name, String transformedName, byte[] basicClass) {
|
||||
if ("net.minecraft.client.renderer.RenderBlocks".equals(transformedName)) {
|
||||
return patchRenderBlocks(basicClass);
|
||||
final byte[] bytes = patchRenderBlocks(basicClass);
|
||||
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package jss.notfine.asm;
|
||||
|
||||
import static jss.notfine.asm.ASMUtils.matchesNodeSequence;
|
||||
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@@ -26,9 +27,10 @@ public class WorldRendererTransformer implements IClassTransformer {
|
||||
|
||||
public byte[] transform(String name, String transformedName, byte[] basicClass) {
|
||||
if ("net.minecraft.client.renderer.WorldRenderer".equals(transformedName)) {
|
||||
return patchWorldRenderer(basicClass);
|
||||
final byte[] bytes = patchWorldRenderer(basicClass);
|
||||
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,6 @@ public class Namer {
|
||||
final boolean obfuscated = !(Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
||||
AngelicaTweaker.LOGGER.info("Environment obfuscated: {}", obfuscated);
|
||||
if (obfuscated) {
|
||||
// due to mixin bug we can't use sortingIndex meaning we will run too early to use srg
|
||||
// new NamerSrg().setNames();
|
||||
//TODO: check if this is still the case in Angelica
|
||||
new NamerObf().setNames();
|
||||
} else {
|
||||
new NamerMcp().setNames();
|
||||
|
||||
@@ -48,7 +48,7 @@ public enum Settings {
|
||||
}
|
||||
},
|
||||
DYNAMIC_FOV(new NotFineOptionTickBox(true, null)),
|
||||
DYNAMIC_LIGHTS(new NotFineOptionCycling(DynamicLightsMode.OFF, OptionImpact.VARIES)){
|
||||
DYNAMIC_LIGHTS(new NotFineOptionCycling(DynamicLightsMode.FANCY, OptionImpact.VARIES)){
|
||||
@Override
|
||||
public void applyChanges() {
|
||||
DynamicLights.Mode = (DynamicLightsMode) DYNAMIC_LIGHTS.option.getStore();
|
||||
|
||||
@@ -19,6 +19,7 @@ import me.jellysquid.mods.sodium.client.gui.options.named.GraphicsMode;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.named.GraphicsQuality;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.named.LightingQuality;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.named.ParticleMode;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.storage.AngelicaOptionsStorage;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.storage.MinecraftOptionsStorage;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.storage.SodiumOptionsStorage;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.backends.multidraw.MultidrawChunkRenderBackend;
|
||||
@@ -36,6 +37,7 @@ import java.util.List;
|
||||
public class SodiumGameOptionPages {
|
||||
private static final SodiumOptionsStorage sodiumOpts = new SodiumOptionsStorage();
|
||||
private static final MinecraftOptionsStorage vanillaOpts = new MinecraftOptionsStorage();
|
||||
private static final AngelicaOptionsStorage angelicaOpts = new AngelicaOptionsStorage();
|
||||
|
||||
public static OptionPage general() {
|
||||
final List<OptionGroup> groups = new ArrayList<>();
|
||||
@@ -153,6 +155,15 @@ public class SodiumGameOptionPages {
|
||||
.add(Settings.DYNAMIC_FOV.option)
|
||||
.add(Settings.MODE_WATER.option)
|
||||
.add(Settings.MODE_DROPPED_ITEMS.option)
|
||||
.add(
|
||||
OptionImpl.createBuilder(int.class, angelicaOpts)
|
||||
.setName(I18n.format("options.angelica.droppedItemLimit"))
|
||||
.setTooltip(I18n.format("options.angelica.droppedItemLimit.tooltip"))
|
||||
.setControl(option -> new SliderControl(option, 32, 2048, 32, ControlValueFormatter.droppedItemLimitLimit()))
|
||||
.setBinding((options, value) -> AngelicaConfig.droppedItemLimit = value, options -> AngelicaConfig.droppedItemLimit)
|
||||
.setImpact(OptionImpact.MEDIUM)
|
||||
.build()
|
||||
)
|
||||
.build());
|
||||
|
||||
return new OptionPage(I18n.format("stat.generalButton"), ImmutableList.copyOf(groups));
|
||||
@@ -246,7 +257,7 @@ public class SodiumGameOptionPages {
|
||||
.build())
|
||||
.build());
|
||||
groups.add(OptionGroup.createBuilder()
|
||||
.add(Settings.MODE_GLINT_INV.option)
|
||||
.add(Settings.MODE_GLINT_INV.option)
|
||||
.add(Settings.MODE_GLINT_WORLD.option)
|
||||
.build());
|
||||
|
||||
|
||||
+3
@@ -10,6 +10,9 @@ public interface ControlValueFormatter {
|
||||
static ControlValueFormatter fpsLimit() {
|
||||
return (v) -> (v == 260) ? I18n.format("options.framerateLimit.max") : I18n.format("options.framerate", v);
|
||||
}
|
||||
static ControlValueFormatter droppedItemLimitLimit() {
|
||||
return (v) -> (v == 2048) ? I18n.format("options.droppedItems.max") : I18n.format("options.droppedItems", v);
|
||||
}
|
||||
|
||||
static ControlValueFormatter brightness() {
|
||||
return (v) -> {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package me.jellysquid.mods.sodium.client.gui.options.storage;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
|
||||
public class AngelicaOptionsStorage implements OptionStorage<AngelicaConfig> {
|
||||
|
||||
public AngelicaOptionsStorage() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AngelicaConfig getData() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
ConfigurationManager.save(AngelicaConfig.class);
|
||||
SodiumClientMod.logger().info("Flushed changes to Angelica configuration");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -25,6 +25,6 @@ public class SodiumOptionsStorage implements OptionStorage<SodiumGameOptions> {
|
||||
throw new RuntimeException("Couldn't save configuration changes", e);
|
||||
}
|
||||
|
||||
SodiumClientMod.logger().info("Flushed changes to Rubidium configuration");
|
||||
SodiumClientMod.logger().info("Flushed changes to Angelica configuration");
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,8 @@ import me.jellysquid.mods.sodium.client.render.chunk.backends.multidraw.Multidra
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.backends.oneshot.ChunkRenderBackendOneshot;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.data.ChunkRenderData;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.format.DefaultModelVertexFormats;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.map.ChunkTracker;
|
||||
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;
|
||||
@@ -59,7 +61,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Provides an extension to vanilla's {@link WorldRenderer}.
|
||||
*/
|
||||
public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
public class SodiumWorldRenderer {
|
||||
private static SodiumWorldRenderer instance;
|
||||
|
||||
private final Minecraft client;
|
||||
@@ -155,7 +157,6 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
this.chunkRenderBackend = null;
|
||||
}
|
||||
|
||||
this.loadedChunkPositions.clear();
|
||||
this.globalTileEntities.clear();
|
||||
|
||||
this.world = null;
|
||||
@@ -194,6 +195,8 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
public void updateChunks(Camera camera, Frustrum frustum, boolean hasForcedFrustum, int frame, boolean spectator) {
|
||||
this.frustum = frustum;
|
||||
|
||||
this.processChunkEvents();
|
||||
|
||||
this.useEntityCulling = SodiumClientMod.options().advanced.useEntityCulling;
|
||||
|
||||
if (this.client.gameSettings.renderDistanceChunks != this.renderDistance) {
|
||||
@@ -265,6 +268,11 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
private void processChunkEvents() {
|
||||
var tracker = ChunkTrackerHolder.get(this.world);
|
||||
tracker.forEachEvent(this.chunkRenderManager::onChunkAdded, this.chunkRenderManager::onChunkRemoved);
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs a render pass for the given {@link RenderLayer} and draws all visible chunks for it.
|
||||
*/
|
||||
@@ -324,7 +332,9 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
this.chunkRenderBackend.createShaders(device);
|
||||
|
||||
this.chunkRenderManager = new ChunkRenderManager<>(this, this.chunkRenderBackend, this.world, this.renderDistance);
|
||||
this.chunkRenderManager.restoreChunks(this.loadedChunkPositions);
|
||||
|
||||
var tracker = ChunkTrackerHolder.get(this.world);
|
||||
ChunkTracker.forEachChunk(tracker.getReadyChunks(), this.chunkRenderManager::onChunkAdded);
|
||||
}
|
||||
|
||||
private static ChunkRenderBackend<?> createChunkRenderBackend(RenderDevice device, SodiumGameOptions options, ChunkVertexType vertexFormat) {
|
||||
@@ -379,18 +389,6 @@ public class SodiumWorldRenderer implements ChunkStatusListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkAdded(int x, int z) {
|
||||
this.loadedChunkPositions.add(ChunkPos.toLong(x, z));
|
||||
this.chunkRenderManager.onChunkAdded(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkRemoved(int x, int z) {
|
||||
this.loadedChunkPositions.remove(ChunkPos.toLong(x, z));
|
||||
this.chunkRenderManager.onChunkRemoved(x, z);
|
||||
}
|
||||
|
||||
public void onChunkRenderUpdated(int x, int y, int z, ChunkRenderData meshBefore, ChunkRenderData meshAfter) {
|
||||
ListUtil.updateList(this.globalTileEntities, meshBefore.getGlobalTileEntities(), meshAfter.getGlobalTileEntities());
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.map;
|
||||
|
||||
public class ChunkStatus {
|
||||
public static final int FLAG_HAS_BLOCK_DATA = 1;
|
||||
public static final int FLAG_HAS_LIGHT_DATA = 2;
|
||||
public static final int FLAG_ALL = FLAG_HAS_BLOCK_DATA | FLAG_HAS_LIGHT_DATA;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.map;
|
||||
|
||||
import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.longs.LongCollection;
|
||||
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.longs.LongSet;
|
||||
import it.unimi.dsi.fastutil.longs.LongSets;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
|
||||
public class ChunkTracker implements ClientChunkEventListener {
|
||||
private final Long2IntOpenHashMap chunkStatus = new Long2IntOpenHashMap();
|
||||
private final LongOpenHashSet chunkReady = new LongOpenHashSet();
|
||||
|
||||
private final LongSet unloadQueue = new LongOpenHashSet();
|
||||
private final LongSet loadQueue = new LongOpenHashSet();
|
||||
|
||||
public ChunkTracker() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMapCenter(int chunkX, int chunkZ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLoadDistance(int loadDistance) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkStatusAdded(int x, int z, int flags) {
|
||||
var key = ChunkCoordIntPair.chunkXZ2Int(x, z);
|
||||
|
||||
var prev = this.chunkStatus.get(key);
|
||||
var cur = prev | flags;
|
||||
|
||||
if (prev == cur) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.chunkStatus.put(key, cur);
|
||||
|
||||
this.updateNeighbors(x, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkStatusRemoved(int x, int z, int flags) {
|
||||
var key = ChunkCoordIntPair.chunkXZ2Int(x, z);
|
||||
|
||||
var prev = this.chunkStatus.get(key);
|
||||
int cur = prev & ~flags;
|
||||
|
||||
if (prev == cur) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur == this.chunkStatus.defaultReturnValue()) {
|
||||
this.chunkStatus.remove(key);
|
||||
} else {
|
||||
this.chunkStatus.put(key, cur);
|
||||
}
|
||||
|
||||
this.updateNeighbors(x, z);
|
||||
}
|
||||
|
||||
private void updateNeighbors(int x, int z) {
|
||||
for (int ox = -1; ox <= 1; ox++) {
|
||||
for (int oz = -1; oz <= 1; oz++) {
|
||||
this.updateMerged(ox + x, oz + z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMerged(int x, int z) {
|
||||
long key = ChunkCoordIntPair.chunkXZ2Int(x, z);
|
||||
|
||||
int flags = this.chunkStatus.get(key);
|
||||
|
||||
for (int ox = -1; ox <= 1; ox++) {
|
||||
for (int oz = -1; oz <= 1; oz++) {
|
||||
flags &= this.chunkStatus.get(ChunkCoordIntPair.chunkXZ2Int(ox + x, oz + z));
|
||||
}
|
||||
}
|
||||
|
||||
if (flags == ChunkStatus.FLAG_ALL) {
|
||||
if (this.chunkReady.add(key) && !this.unloadQueue.remove(key)) {
|
||||
this.loadQueue.add(key);
|
||||
}
|
||||
} else {
|
||||
if (this.chunkReady.remove(key) && !this.loadQueue.remove(key)) {
|
||||
this.unloadQueue.add(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public LongCollection getReadyChunks() {
|
||||
return LongSets.unmodifiable(this.chunkReady);
|
||||
}
|
||||
|
||||
public void forEachEvent(ChunkEventHandler loadEventHandler, ChunkEventHandler unloadEventHandler) {
|
||||
forEachChunk(this.unloadQueue, unloadEventHandler);
|
||||
this.unloadQueue.clear();
|
||||
|
||||
forEachChunk(this.loadQueue, loadEventHandler);
|
||||
this.loadQueue.clear();
|
||||
}
|
||||
|
||||
public static void forEachChunk(LongCollection queue, ChunkEventHandler handler) {
|
||||
var iterator = queue.iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
var pos = iterator.nextLong();
|
||||
|
||||
var x = (int)(pos & 4294967295L);
|
||||
var z = (int)((pos >> 32L) & 4294967295L);
|
||||
|
||||
handler.apply(x, z);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ChunkEventHandler {
|
||||
void apply(int x, int z);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.map;
|
||||
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
|
||||
public interface ChunkTrackerHolder {
|
||||
static ChunkTracker get(WorldClient world) {
|
||||
return ((ChunkTrackerHolder) world).sodium$getTracker();
|
||||
}
|
||||
|
||||
ChunkTracker sodium$getTracker();
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.map;
|
||||
|
||||
public interface ClientChunkEventListener {
|
||||
void updateMapCenter(int chunkX, int chunkZ);
|
||||
|
||||
void updateLoadDistance(int loadDistance);
|
||||
|
||||
void onChunkStatusAdded(int x, int z, int flags);
|
||||
void onChunkStatusRemoved(int x, int z, int flags);
|
||||
}
|
||||
+8
-4
@@ -1,6 +1,7 @@
|
||||
package me.jellysquid.mods.sodium.client.render.chunk.tasks;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.blockpos.BlockPos;
|
||||
import com.gtnewhorizon.gtnhlib.client.renderer.util.WorldUtil;
|
||||
import com.gtnewhorizons.angelica.compat.mojang.ChunkOcclusionDataBuilder;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
|
||||
@@ -32,7 +33,6 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -153,7 +153,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
if (rendersOffThread(block)) {
|
||||
// Do regular block rendering
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && (!AngelicaConfig.enableSodiumFluidRendering || !(block instanceof IFluidBlock))) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && !shouldUseSodiumFluidRendering(block)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
final long seed = MathUtil.hashPos(pos.x, pos.y, pos.z);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
@@ -169,7 +169,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
}
|
||||
|
||||
// Do fluid rendering without RenderBlocks
|
||||
if (AngelicaConfig.enableSodiumFluidRendering && block instanceof IFluidBlock) {
|
||||
if (shouldUseSodiumFluidRendering(block)) {
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (block.canRenderInPass(pass.ordinal())) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
@@ -273,7 +273,7 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
|
||||
// Do regular block rendering
|
||||
for (BlockRenderPass pass : BlockRenderPass.VALUES) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && (!AngelicaConfig.enableSodiumFluidRendering || !(block instanceof IFluidBlock))) {
|
||||
if (block.canRenderInPass(pass.ordinal()) && !shouldUseSodiumFluidRendering(block)) {
|
||||
ChunkRenderManager.setWorldRenderPass(pass);
|
||||
final long seed = MathUtil.hashPos(pos.x, pos.y, pos.z);
|
||||
if(AngelicaConfig.enableIris) buffers.iris$setMaterialId(block, ExtendedDataHelper.BLOCK_RENDER_TYPE);
|
||||
@@ -306,4 +306,8 @@ public class ChunkRenderRebuildTask<T extends ChunkGraphicsState> extends ChunkR
|
||||
+ translucencySorting
|
||||
+ '}';
|
||||
}
|
||||
|
||||
private static boolean shouldUseSodiumFluidRendering(Block block) {
|
||||
return AngelicaConfig.enableSodiumFluidRendering && WorldUtil.isFluidBlock(block);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -96,7 +95,8 @@ public class FluidRenderer {
|
||||
int posY = pos.y;
|
||||
int posZ = pos.z;
|
||||
|
||||
Fluid fluid = ((IFluidBlock) block).getFluid();
|
||||
|
||||
Fluid fluid = WorldUtil.getFluid(block);
|
||||
if (fluid == null) return false;
|
||||
|
||||
// Check for occluded sides; if everything is occluded, don't render
|
||||
@@ -437,7 +437,7 @@ public class FluidRenderer {
|
||||
|
||||
Block block = world.getBlock(x2, y + 1, z2);
|
||||
|
||||
if (block instanceof IFluidBlock && ((IFluidBlock) block).getFluid() == fluid) {
|
||||
if (WorldUtil.getFluid(block) == fluid) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ public class FluidRenderer {
|
||||
|
||||
block = world.getBlock(pos.x, pos.y, pos.z);
|
||||
int meta = world.getBlockMetadata(pos.x, pos.y, pos.z);
|
||||
Fluid fluid2 = block instanceof IFluidBlock ? ((IFluidBlock) world.getBlock(pos.x, pos.y, pos.z)).getFluid() : null;
|
||||
Fluid fluid2 = WorldUtil.getFluid(block);
|
||||
|
||||
if (fluid2 == fluid) {
|
||||
float height = WorldUtil.getFluidHeight(fluid2, meta);
|
||||
|
||||
@@ -2,6 +2,8 @@ options.button.shader=Shaders...
|
||||
|
||||
options.chunks=%s chunks
|
||||
options.entityShadows=Entity Shadows
|
||||
options.droppedItems=%s items
|
||||
options.droppedItems.max=Unlimited
|
||||
sodium.option_impact.low=Low
|
||||
sodium.option_impact.medium=Medium
|
||||
sodium.option_impact.high=High
|
||||
@@ -124,12 +126,15 @@ options.iris.setToDefault=Set option to default value?
|
||||
options.iris.profile=Profile
|
||||
options.iris.profile.custom=Custom
|
||||
options.iris.shadowDistance=Max Shadow Distance
|
||||
options.iris.shadowDistance.sodium_tooltip=Max Shadow Distance
|
||||
options.iris.shadowDistance.enabled=Allows you to change the maximum distance for shadows. Terrain and entities beyond this distance will not cast shadows. Lowering the shadow distance can significantly increase performance.
|
||||
options.iris.shadowDistance.disabled=Your current shader pack has already set a render distance for shadows; you cannot change it.
|
||||
options.iris.gui.hide=Hide GUI
|
||||
options.iris.gui.show=Show GUI
|
||||
options.dynamic_lights=Dynamic Lights
|
||||
options.dynamic_lights.tooltip=Enables dynamic lights. Modes: OFF - off, FASTEST - 500ms delay, FAST - 250ms delay, FANCY - no delay. Disabled if shaders are in use.
|
||||
options.angelica.droppedItemLimit=Dropped Item Render Limit
|
||||
options.angelica.droppedItemLimit.tooltip=The maximum number of dropped items that will be rendered. Lower values can improve performance.
|
||||
pack.iris.select.title=Select
|
||||
pack.iris.configure.title=Configure
|
||||
label.iris.true=On
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
@@ -11,33 +11,52 @@ options.graphics.ultra=Ultra
|
||||
options.off=Off
|
||||
options.on=On
|
||||
options.cloud_height=Cloud Elevation
|
||||
options.cloud_height.tooltip=Cloud Elevation
|
||||
options.cloud_scale=Cloud Scale
|
||||
options.cloud_scale.tooltip=Cloud Scale
|
||||
options.gui_background=Background
|
||||
options.downfall_distance=Weather Effects
|
||||
options.dynamic_fov=Dynamic FOV
|
||||
options.dynamic_fov.tooltip=If enabled, the game's field of view will change based on the player's speed.
|
||||
options.fog_near_distance=Near Fog Distance
|
||||
options.fog_near_distance.tooltip=Near Fog Distance
|
||||
options.mode_cloud_translucency=Cloud Translucency
|
||||
options.mode_cloud_translucency.tooltip=Cloud Translucency
|
||||
options.mode_clouds=Clouds
|
||||
options.mode_clouds.tooltip=Clouds
|
||||
options.mode_dropped_items=Dropped Items
|
||||
options.mode_dropped_items.tooltip=Dropped Items Rendering Quality
|
||||
options.mode_glint_inv=GUI Enchant VFX
|
||||
options.mode_glint_inv.tooltip=GUI Enchant VFX
|
||||
options.mode_glint_world=World Enchant VFX
|
||||
options.mode_glint_world.tooltip=World Enchant VFX
|
||||
options.mode_gui_background=Menu Backgrounds
|
||||
options.mode_leaves=Foliage
|
||||
options.mode_light_flicker=Light Flicker
|
||||
options.mode_light_flicker.tooltip=Light Flicker
|
||||
options.mode_shadows=Entity Shadows
|
||||
options.mode_sky=Sky
|
||||
options.mode_sky.tooltip=Render the Sky
|
||||
options.mode_sun_moon=Sun & Moon
|
||||
options.mode_sun_moon.tooltip=Render Sun & Moon
|
||||
options.mode_stars=Stars
|
||||
options.mode_stars.tooltip=Render Stars
|
||||
options.mode_water=Water
|
||||
options.mode_water.tooltip=Water
|
||||
options.mode_vignette=Vignette
|
||||
options.mode_vignette.tooltip=Vignette
|
||||
options.particles_enc_table=Enchantment Particles
|
||||
options.particles_enc_table.tooltip=Enchantment Particles
|
||||
options.particles_void=Void Particles
|
||||
options.particles_void.tooltip=Void Particles
|
||||
options.render_distance_clouds=Minimum Cloud Distance
|
||||
options.render_distance_clouds.tooltip=Minimum Cloud Distance
|
||||
options.title.detail=Detail Settings
|
||||
options.title.other=Other Settings
|
||||
options.title.particle=Particle Settings
|
||||
options.title.sky=Atmosphere Settings
|
||||
options.title.video=Video Settings
|
||||
options.total_stars=Star Density
|
||||
options.total_stars.tooltip=Star Density
|
||||
options.void_fog=Void Fog
|
||||
options.void_fog.tooltip=Void Fog
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.angelica;
|
||||
|
||||
import com.gtnewhorizons.angelica.AngelicaMod;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(TextureMap.class)
|
||||
public class MixinTextureMap {
|
||||
|
||||
@Inject(method = "registerIcons", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;getMinecraft()Lnet/minecraft/client/Minecraft;"))
|
||||
private void angelica$registerErrorBlockIcon(CallbackInfo ci) {
|
||||
TextureMap thisObject = (TextureMap)(Object)this;
|
||||
AngelicaMod.blockError.registerBlockIcons(thisObject);
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.angelica.optimizations;
|
||||
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(RenderGlobal.class)
|
||||
public class MixinRenderGlobal_ItemRenderDist {
|
||||
|
||||
@Unique private static final int[] sodium$entityItemCount = new int[256];
|
||||
@Unique private static int sodium$itemRenderDist = 255;
|
||||
|
||||
@Inject(method = "renderEntities", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/RenderGlobal;countEntitiesRendered:I", ordinal = 0))
|
||||
private void sodium$resetEntitycount(CallbackInfo ci) {
|
||||
int entityCount = 0;
|
||||
boolean reachedLimit = false;
|
||||
final int itemLimit = AngelicaConfig.droppedItemLimit == 2048 ? Integer.MAX_VALUE : AngelicaConfig.droppedItemLimit;
|
||||
for (int i = 0; i < sodium$entityItemCount.length; i++) {
|
||||
entityCount += sodium$entityItemCount[i];
|
||||
sodium$entityItemCount[i] = 0;
|
||||
if (!reachedLimit && entityCount > itemLimit) {
|
||||
reachedLimit = true;
|
||||
sodium$itemRenderDist = i == 0 ? 1 : i;
|
||||
}
|
||||
}
|
||||
if (!reachedLimit) {
|
||||
sodium$itemRenderDist = 255;
|
||||
}
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "renderEntities", at = @At(value = "STORE", ordinal = 0), ordinal = 0, name = "flag")
|
||||
private boolean sodium$renderEntityItems(boolean flag,
|
||||
@Local(ordinal = 0, name = "entity") Entity entity,
|
||||
@Local(ordinal = 0, name = "d0") double d0,
|
||||
@Local(ordinal = 1, name = "d1") double d1,
|
||||
@Local(ordinal = 2, name = "d2") double d2) {
|
||||
if (flag && entity instanceof EntityItem) {
|
||||
final int i = Math.min((int) (entity.getDistanceSq(d0, d1, d2) / 4.0D), 255);
|
||||
sodium$entityItemCount[i]++;
|
||||
return i <= sodium$itemRenderDist;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(BlockLiquid.class)
|
||||
public abstract class MixinBlockLiquid implements IFluidBlock {
|
||||
|
||||
@Shadow
|
||||
public abstract int getBlockColor();
|
||||
|
||||
@Override
|
||||
public Fluid getFluid() {
|
||||
return ((Block) (Object) this).getMaterial() == Material.water ? FluidRegistry.WATER : FluidRegistry.LAVA;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFilledPercentage(World world, int x, int y, int z) {
|
||||
return getFluid() == null ? 0 : 1 - BlockLiquid.getLiquidHeightPercent(world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer;
|
||||
import net.minecraft.client.multiplayer.ChunkProviderClient;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ChunkProviderClient.class)
|
||||
public abstract class MixinChunkProviderClient {
|
||||
|
||||
@Inject(method="unloadChunk", at=@At("TAIL"))
|
||||
private void sodium$unloadChunk(int x, int z, CallbackInfo ci) {
|
||||
SodiumWorldRenderer.getInstance().onChunkRemoved(x, z);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import me.jellysquid.mods.sodium.client.gui.SodiumGameOptions;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public abstract class MixinEntity {
|
||||
|
||||
@Shadow
|
||||
public abstract boolean isInRangeToRenderDist(double dist);
|
||||
|
||||
@Inject(method ="isInRangeToRender3d", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isInRangeToRenderDist(D)Z"), cancellable = true)
|
||||
private void sodium$afterDistCalc(CallbackInfoReturnable<Boolean> ci, @Local(ordinal = 6) double d6) {
|
||||
ci.setReturnValue(this.isInRangeToRenderDist(d6/(SodiumGameOptions.EntityRenderDistance.entityRenderDistanceMultiplier * SodiumGameOptions.EntityRenderDistance.entityRenderDistanceMultiplier)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(EntityItem.class)
|
||||
public abstract class MixinEntityItem_RenderDist extends Entity {
|
||||
|
||||
public MixinEntityItem_RenderDist(World worldIn) {
|
||||
super(worldIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInRangeToRender3d(double x, double y, double z) {
|
||||
double d3 = this.posX - x;
|
||||
double d4 = this.posY - y;
|
||||
double d5 = this.posZ - z;
|
||||
double d6 = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
// set render distance to 32 blocks
|
||||
return this.isInRangeToRenderDist(d6 / 4.0D);
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.gui.SodiumGameOptions;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
@Mixin(Entity.class)
|
||||
public abstract class MixinEntity_RenderDist {
|
||||
|
||||
@ModifyArg(method = "isInRangeToRender3d", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;isInRangeToRenderDist(D)Z"))
|
||||
private double sodium$afterDistCalc(double d6) {
|
||||
final double mult = SodiumGameOptions.EntityRenderDistance.entityRenderDistanceMultiplier;
|
||||
return d6 / (mult * mult);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import com.gtnewhorizons.angelica.AngelicaMod;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import net.coderbot.iris.block_rendering.BlockRenderingSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -28,6 +32,54 @@ public abstract class MixinRenderBlocks {
|
||||
this.isRenderingByType = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This mixin and the one below(wrapRenderWorldBlockDeobfuscated) achieve the same goal. The goal is to wrap ISBRH rendering in a try/catch
|
||||
* to ignore NPE, as mods commonly like to not null-guard the tile entity casting, and Sodium introduces a race condition where when a block
|
||||
* is broken, the TE can be removed from the world before the render thread gets to it, but the block data is deep copied to the thread, so
|
||||
* it still tries to render the block.
|
||||
|
||||
* The reason there's two mixins to the same thing for this, is because FMLRenderAccessLibrary is an old Forge remnant of Optifine compat
|
||||
* whereby they provided this class for Optifine to be able to access Forge's rendering methods. For some reason, in a deobfuscated environment,
|
||||
* that class lives in net.minecraft.src.FMLRenderAccessLibrary. However in an obfuscated prod environment, it gets moved into the root unnamed
|
||||
* package. So basically, only one of these two redirects will actually end up getting applied, and the other will fail, based on what environment
|
||||
* you're running in.
|
||||
*/
|
||||
@Redirect(
|
||||
method = "renderBlockByRenderType",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "LFMLRenderAccessLibrary;renderWorldBlock(Lnet/minecraft/client/renderer/RenderBlocks;Lnet/minecraft/world/IBlockAccess;IIILnet/minecraft/block/Block;I)Z",
|
||||
remap = false
|
||||
),
|
||||
expect = 0
|
||||
)
|
||||
private boolean wrapRenderWorldBlockObfuscated(RenderBlocks rb, IBlockAccess world, int x, int y, int z, Block block, int modelId) {
|
||||
try {
|
||||
return RenderingRegistry.instance().renderWorldBlock(rb, world, x, y, z, block, modelId);
|
||||
} catch (NullPointerException ignored) {
|
||||
rb.renderStandardBlock(AngelicaMod.blockError, x, y, z);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "renderBlockByRenderType",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/src/FMLRenderAccessLibrary;renderWorldBlock(Lnet/minecraft/client/renderer/RenderBlocks;Lnet/minecraft/world/IBlockAccess;IIILnet/minecraft/block/Block;I)Z",
|
||||
remap = false
|
||||
),
|
||||
expect = 0
|
||||
)
|
||||
private boolean wrapRenderWorldBlockDeobfuscated(RenderBlocks rb, IBlockAccess world, int x, int y, int z, Block block, int modelId) {
|
||||
try {
|
||||
return RenderingRegistry.instance().renderWorldBlock(rb, world, x, y, z, block, modelId);
|
||||
} catch (NullPointerException ignored) {
|
||||
rb.renderStandardBlock(AngelicaMod.blockError, x, y, z);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Redirect(method = "renderStandardBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;isAmbientOcclusionEnabled()Z"))
|
||||
private boolean checkAOEnabled() {
|
||||
if ((this.isRenderingByType && Minecraft.isAmbientOcclusionEnabled() && SodiumClientMod.options().quality.useSodiumAO) ||
|
||||
|
||||
+16
-3
@@ -1,6 +1,9 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.map.ChunkStatus;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.map.ChunkTracker;
|
||||
import me.jellysquid.mods.sodium.client.render.chunk.map.ChunkTrackerHolder;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -8,10 +11,20 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(WorldClient.class)
|
||||
public class MixinWorldClient {
|
||||
public class MixinWorldClient implements ChunkTrackerHolder {
|
||||
private final ChunkTracker angelica$tracker = new ChunkTracker();
|
||||
|
||||
@Inject(method = "doPreChunk", at = @At("TAIL"))
|
||||
private void sodium$loadChunk(int x, int z, boolean load, CallbackInfo ci) {
|
||||
if(load)
|
||||
SodiumWorldRenderer.getInstance().onChunkAdded(x, z);
|
||||
if(load) {
|
||||
this.angelica$tracker.onChunkStatusAdded(x, z, ChunkStatus.FLAG_ALL);
|
||||
} else {
|
||||
this.angelica$tracker.onChunkStatusRemoved(x, z, ChunkStatus.FLAG_ALL);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkTracker sodium$getTracker() {
|
||||
return this.angelica$tracker;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user