mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-16 18:54:45 +00:00
Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a73dc9bfd | ||
|
|
f01cdfda4b | ||
|
|
daa1405ba4 | ||
|
|
846d70f0c0 | ||
|
|
e59e41bfdb | ||
|
|
eb8a826419 | ||
|
|
efe7c16c50 | ||
|
|
c4b4b79f6c | ||
|
|
2e5ce0abdb | ||
|
|
d317b05f5b | ||
|
|
cc51a464f1 | ||
|
|
3e6aa461c6 | ||
|
|
d236689e6a | ||
|
|
d15bbb56ee | ||
|
|
f4355bd4c4 | ||
|
|
5dbd244d72 | ||
|
|
367c82a225 | ||
|
|
852bcbb38b | ||
|
|
464af945b2 | ||
|
|
996b3df9cb | ||
|
|
22d28abce6 | ||
|
|
636b616f64 | ||
|
|
14b7178419 | ||
|
|
22bf48c093 | ||
|
|
4600bca2d0 | ||
|
|
fcb9536d93 | ||
|
|
51a6a72ae5 |
No files matched your search
@@ -1,4 +1,7 @@
|
||||
# Angelica
|
||||
# Angelica<img src="img/logo-readme.png" align="right">
|
||||
|
||||
<sup>**[CurseForge](https://www.curseforge.com/minecraft/mc-mods/angelica) | [Modrinth](https://modrinth.com/mod/angelica)**</sup>
|
||||
|
||||
* The little Angle [sic] that supports shaders while saving your fps from a certain death -boubou
|
||||
* Is it obtuse, or accute? -Caedis
|
||||
* It's a cute angle -mitchej123
|
||||
|
||||
@@ -88,6 +88,9 @@ dependencies {
|
||||
compileOnly(rfg.deobf("curse.maven:campfirebackport-387444:4611675"))
|
||||
// HMMMMM
|
||||
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")
|
||||
|
||||
runtimeOnlyNonPublishable(rfg.deobf("CoreTweaks:CoreTweaks:0.3.3.2"))
|
||||
|
||||
|
||||
+5
-5
@@ -117,7 +117,7 @@ minimizeShadowedDependencies = true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
|
||||
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
@@ -132,7 +132,7 @@ usesMavenPublishing = true
|
||||
#
|
||||
# The project's ID on Modrinth. Can be either the slug or the ID.
|
||||
# Leave this empty if you don't want to publish to Modrinth.
|
||||
modrinthProjectId =
|
||||
modrinthProjectId = angelica
|
||||
|
||||
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
|
||||
# Syntax: scope1-type1:name1;scope2-type2:name2;...
|
||||
@@ -141,13 +141,13 @@ modrinthProjectId =
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
modrinthRelations =
|
||||
modrinthRelations = required-project\:gtnhlib
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
#
|
||||
# The project's numeric ID on CurseForge. You can find this in the About Project box.
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
curseForgeProjectId = 988067
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
@@ -155,7 +155,7 @@ curseForgeProjectId =
|
||||
# and the name is the CurseForge project slug of the other mod.
|
||||
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
curseForgeRelations =
|
||||
curseForgeRelations = requiredDependency\:gtnhlib
|
||||
|
||||
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
|
||||
# projects. New projects should not use this parameter.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Executable
+2
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
magick convert logo-1x.png -scale 200% \( +clone -background black -shadow 60x6+0+0 \) +swap -background none -layers merge logo-readme.png
|
||||
+1
-1
@@ -16,5 +16,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21'
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
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 net.dries007.holoInventory.HoloInventory;
|
||||
|
||||
public class ModStatus {
|
||||
/**
|
||||
@@ -16,6 +20,8 @@ public class ModStatus {
|
||||
public static boolean isLotrLoaded;
|
||||
public static boolean isChunkAPILoaded;
|
||||
public static boolean isEIDBiomeLoaded;
|
||||
public static boolean isXaerosMinimapLoaded;
|
||||
public static boolean isHoloInventoryLoaded;
|
||||
|
||||
public static void preInit(){
|
||||
isNEIDLoaded = Loader.isModLoaded("neid");
|
||||
@@ -23,6 +29,16 @@ public class ModStatus {
|
||||
isLotrLoaded = Loader.isModLoaded("lotr");
|
||||
isChunkAPILoaded = Loader.isModLoaded("chunkapi");
|
||||
isEIDBiomeLoaded = Loader.isModLoaded("endlessids_biome");
|
||||
isXaerosMinimapLoaded = Loader.isModLoaded("XaeroMinimap");
|
||||
isHoloInventoryLoaded = Loader.isModLoaded("holoinventory");
|
||||
|
||||
if (isHoloInventoryLoaded){
|
||||
isHoloInventoryLoaded = new DefaultArtifactVersion("2.4.4-GTNH")
|
||||
.compareTo(
|
||||
LoadControllerHelper.getOwningMod(HoloInventory.class).getProcessedVersion()
|
||||
) <= 0;
|
||||
}
|
||||
|
||||
|
||||
isNEIDMetadataExtended = false;
|
||||
if (isNEIDLoaded) {
|
||||
|
||||
@@ -24,8 +24,8 @@ public class VertexFormatElement {
|
||||
this.byteSize = type.getSize() * count;
|
||||
}
|
||||
|
||||
public void setupBufferState(long l, int i) {
|
||||
this.usage.setupBufferState(this.count, this.type.getGlType(), i, l, this.index);
|
||||
public void setupBufferState(long offset, int stride) {
|
||||
this.usage.setupBufferState(this.count, this.type.getGlType(), stride, offset, this.index);
|
||||
}
|
||||
|
||||
public void clearBufferState() {
|
||||
@@ -33,32 +33,32 @@ public class VertexFormatElement {
|
||||
}
|
||||
|
||||
public enum Usage {
|
||||
POSITION("Position", (i, j, k, l, m) -> {
|
||||
GL11.glVertexPointer(i, j, k, l);
|
||||
POSITION("Position", (size, type, stride, pointer, index) -> {
|
||||
GL11.glVertexPointer(size, type, stride, pointer);
|
||||
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
}, (i) -> GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY)),
|
||||
NORMAL("Normal", (i, j, k, l, m) -> {
|
||||
GL11.glNormalPointer(j, k, l);
|
||||
}, index -> GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY)),
|
||||
NORMAL("Normal", (size, type, stride, pointer, index) -> {
|
||||
GL11.glNormalPointer(type, stride, pointer);
|
||||
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
|
||||
}, (i) -> GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY)),
|
||||
COLOR("Vertex Color", (i, j, k, l, m) -> {
|
||||
GL11.glColorPointer(i, j, k, l);
|
||||
}, index -> GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY)),
|
||||
COLOR("Vertex Color", (size, type, stride, pointer, index) -> {
|
||||
GL11.glColorPointer(size, type, stride, pointer);
|
||||
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
|
||||
}, i -> GL11.glDisableClientState(GL11.GL_COLOR_ARRAY)),
|
||||
UV("UV", (i, j, k, l, m) -> {
|
||||
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + m);
|
||||
GL11.glTexCoordPointer(i, j, k, l);
|
||||
}, index -> GL11.glDisableClientState(GL11.GL_COLOR_ARRAY)),
|
||||
UV("UV", (size, type, stride, pointer, index) -> {
|
||||
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + index);
|
||||
GL11.glTexCoordPointer(size, type, stride, pointer);
|
||||
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
||||
GL13.glClientActiveTexture(GL13.GL_TEXTURE0);
|
||||
}, i -> {
|
||||
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + i);
|
||||
}, index -> {
|
||||
GL13.glClientActiveTexture(GL13.GL_TEXTURE0 + index);
|
||||
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
||||
GL13.glClientActiveTexture(GL13.GL_TEXTURE0);
|
||||
}),
|
||||
PADDING("Padding", (i, j, k, l, m) -> {}, i-> {}),
|
||||
GENERIC("Generic", (i, j, k, l, m) -> {
|
||||
GL20.glEnableVertexAttribArray(m);
|
||||
GL20.glVertexAttribPointer(m, i, j, false, k, l);
|
||||
PADDING("Padding", (size, type, stride, pointer, index) -> {}, index-> {}),
|
||||
GENERIC("Generic", (size, type, stride, pointer, index) -> {
|
||||
GL20.glEnableVertexAttribArray(index);
|
||||
GL20.glVertexAttribPointer(index, size, type, false, stride, pointer);
|
||||
}, GL20::glDisableVertexAttribArray);
|
||||
|
||||
@Getter private final String name;
|
||||
@@ -71,16 +71,16 @@ public class VertexFormatElement {
|
||||
this.clearState = clearState;
|
||||
}
|
||||
|
||||
private void setupBufferState(int i, int j, int k, long l, int m) {
|
||||
this.setupState.setupBufferState(i, j, k, l, m);
|
||||
private void setupBufferState(int size, int type, int stride, long pointer, int index) {
|
||||
this.setupState.setupBufferState(size, type, stride, pointer, index);
|
||||
}
|
||||
|
||||
public void clearBufferState(int i) {
|
||||
this.clearState.accept(i);
|
||||
public void clearBufferState(int index) {
|
||||
this.clearState.accept(index);
|
||||
}
|
||||
|
||||
interface SetupState {
|
||||
void setupBufferState(int i, int j, int k, long l, int m);
|
||||
void setupBufferState(int size, int type, int stride, long pointer, int index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.gtnewhorizons.angelica.compat.toremove;
|
||||
import com.google.common.collect.Queues;
|
||||
import org.joml.Matrix3f;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
import java.util.Deque;
|
||||
|
||||
@@ -79,6 +80,27 @@ public class MatrixStack {
|
||||
|
||||
}
|
||||
|
||||
public void multiply(Quaternionf quaternion) {
|
||||
MatrixStack.Entry entry = this.matrixStack.getLast();
|
||||
entry.model.rotate(quaternion);
|
||||
entry.normal.rotate(quaternion);
|
||||
}
|
||||
|
||||
public void multiply(Quaternionf quaternion, float originX, float originY, float originZ) {
|
||||
MatrixStack.Entry entry = this.matrixStack.getLast();
|
||||
entry.model.rotateAround(quaternion, originX, originY, originZ);
|
||||
entry.normal.rotate(quaternion);
|
||||
}
|
||||
|
||||
public void loadIdentity() {
|
||||
MatrixStack.Entry entry = this.matrixStack.getLast();
|
||||
entry.model.identity();
|
||||
entry.normal.identity();
|
||||
}
|
||||
|
||||
public void multiplyPositionMatrix(Matrix4f matrix) {
|
||||
this.matrixStack.getLast().model.mul(matrix);
|
||||
}
|
||||
|
||||
private static float invSqrt(float x) {
|
||||
float xhalf = 0.5f * x;
|
||||
|
||||
@@ -9,6 +9,10 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean enableSodium;
|
||||
|
||||
@Config.Comment("Enable NotFine Options")
|
||||
@Config.DefaultBoolean(false)
|
||||
public static boolean enableNotFineOptions;
|
||||
|
||||
@Config.Comment("Enable Reese's Sodium Options")
|
||||
@Config.DefaultBoolean(true)
|
||||
public static boolean enableReesesSodiumOptions;
|
||||
@@ -40,11 +44,6 @@ public class AngelicaConfig {
|
||||
@Config.Ignore()
|
||||
public static boolean enableMCPatcherForgeFeatures;
|
||||
|
||||
@Config.Comment("Enable NotFine optimizations")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean enableNotFineOptimizations;
|
||||
|
||||
@Config.Comment("Replace some vanilla render paths with more optimized versions. Disable if you encounter mixin conflicts.")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
@@ -102,6 +101,11 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean fixLotrSodiumCompat;
|
||||
|
||||
@Config.Comment("Fix thread-safety in Extra Utilities rendering")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean fixExtraUtilsSodiumCompat;
|
||||
|
||||
@Config.Comment("Enable Debug Logging")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
|
||||
@@ -1112,8 +1112,8 @@ public class GLStateManager {
|
||||
}
|
||||
|
||||
public static void glLoadMatrix(DoubleBuffer m) {
|
||||
conersionMatrix4d.set(m);
|
||||
getMatrixStack().set(conersionMatrix4d);
|
||||
conversionMatrix4d.set(m);
|
||||
getMatrixStack().set(conversionMatrix4d);
|
||||
GL11.glLoadMatrix(m);
|
||||
}
|
||||
|
||||
@@ -1160,16 +1160,16 @@ public class GLStateManager {
|
||||
public static void glMultMatrix(FloatBuffer floatBuffer) {
|
||||
GL11.glMultMatrix(floatBuffer);
|
||||
tempMatrix4f.set(floatBuffer);
|
||||
getMatrixStack().mul(conersionMatrix4f);
|
||||
getMatrixStack().mul(tempMatrix4f);
|
||||
}
|
||||
|
||||
public static final Matrix4d conersionMatrix4d = new Matrix4d();
|
||||
public static final Matrix4f conersionMatrix4f = new Matrix4f();
|
||||
public static final Matrix4d conversionMatrix4d = new Matrix4d();
|
||||
public static final Matrix4f conversionMatrix4f = new Matrix4f();
|
||||
public static void glMultMatrix(DoubleBuffer matrix) {
|
||||
GL11.glMultMatrix(matrix);
|
||||
conersionMatrix4d.set(matrix);
|
||||
conersionMatrix4f.set(conersionMatrix4d);
|
||||
getMatrixStack().mul(conersionMatrix4f);
|
||||
conversionMatrix4d.set(matrix);
|
||||
conversionMatrix4f.set(conversionMatrix4d);
|
||||
getMatrixStack().mul(conversionMatrix4f);
|
||||
}
|
||||
|
||||
private static final Vector3f rotation = new Vector3f();
|
||||
|
||||
@@ -3,6 +3,12 @@ package com.gtnewhorizons.angelica.hudcaching;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.gtnewhorizons.angelica.compat.ModStatus;
|
||||
import com.gtnewhorizons.angelica.mixins.early.angelica.hudcaching.RenderGameOverlayEventAccessor;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import net.dries007.holoInventory.client.Renderer;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
|
||||
@@ -26,6 +32,9 @@ import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.shader.Framebuffer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.client.GuiIngameForge;
|
||||
import xaero.common.core.XaeroMinimapCore;
|
||||
|
||||
import static com.gtnewhorizons.angelica.loading.AngelicaTweaker.LOGGER;
|
||||
|
||||
// See LICENSE+HUDCaching.md for license information.
|
||||
|
||||
@@ -33,10 +42,6 @@ public class HUDCaching {
|
||||
|
||||
private static final Minecraft mc = Minecraft.getMinecraft();
|
||||
public static Framebuffer framebuffer;
|
||||
static {
|
||||
framebuffer = new Framebuffer(0, 0, true);
|
||||
framebuffer.setFramebufferColor(0, 0, 0, 0);
|
||||
}
|
||||
private static boolean dirty = true;
|
||||
|
||||
public static boolean renderingCacheOverride;
|
||||
@@ -54,6 +59,8 @@ public class HUDCaching {
|
||||
// Crosshairs need to be blended with the scene
|
||||
public static boolean renderCrosshairsCaptured;
|
||||
|
||||
private static RenderGameOverlayEvent fakeHoloInventoryEvent = new RenderGameOverlayEvent.Pre(new RenderGameOverlayEvent(0, null, 0, 0), RenderGameOverlayEvent.ElementType.HELMET);
|
||||
|
||||
public static final HUDCaching INSTANCE = new HUDCaching();
|
||||
|
||||
|
||||
@@ -63,9 +70,13 @@ public class HUDCaching {
|
||||
|
||||
private final List<Long> updateTimeList = new ArrayList<>(21);
|
||||
private static boolean isEnabled = true;
|
||||
private static final KeyBinding toggle = new KeyBinding("Toggle HUDCaching", 0, "Debug");
|
||||
|
||||
// moved initialization to when its registered to avoid an empty Debug category, which can cause crashes when
|
||||
// opening the controls menu and hudcaching is disabled in the config
|
||||
private static KeyBinding toggle;
|
||||
|
||||
public static void registerKeyBindings() {
|
||||
toggle = new KeyBinding("Toggle HUDCaching", 0, "Debug");
|
||||
ClientRegistry.registerKeyBinding(toggle);
|
||||
}
|
||||
|
||||
@@ -86,7 +97,7 @@ public class HUDCaching {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKeypress(InputEvent.KeyInputEvent event) {
|
||||
if (toggle.isPressed()) {
|
||||
if (toggle != null && toggle.isPressed()) {
|
||||
isEnabled = !isEnabled;
|
||||
final String msg = isEnabled ? "Enabled HUDCaching" : "Disabled HUDCaching";
|
||||
if (mc.thePlayer != null) mc.thePlayer.addChatMessage(new ChatComponentText(msg));
|
||||
@@ -102,10 +113,25 @@ public class HUDCaching {
|
||||
}
|
||||
}
|
||||
|
||||
// highest so it runs before the GLSM load event
|
||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void onJoinWorld(WorldEvent.Load event) {
|
||||
if (event.world.isRemote){
|
||||
LOGGER.info("World loaded - Initializing HUDCaching");
|
||||
HUDCaching.framebuffer = new Framebuffer(0, 0, true);
|
||||
HUDCaching.framebuffer.setFramebufferColor(0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static void renderCachedHud(EntityRenderer renderer, GuiIngame ingame, float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
|
||||
|
||||
if (!OpenGlHelper.isFramebufferEnabled() || !isEnabled) {
|
||||
if (ModStatus.isXaerosMinimapLoaded && ingame instanceof GuiIngameForge) {
|
||||
// this used to be called by asming into renderGameOverlay, but we removed it
|
||||
XaeroMinimapCore.beforeIngameGuiRender(partialTicks);
|
||||
}
|
||||
|
||||
if (!OpenGlHelper.isFramebufferEnabled() || !isEnabled || framebuffer == null) {
|
||||
ingame.renderGameOverlay(partialTicks, hasScreen, mouseX, mouseY);
|
||||
return;
|
||||
}
|
||||
@@ -138,11 +164,16 @@ public class HUDCaching {
|
||||
} else {
|
||||
GLStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
}
|
||||
|
||||
if (ingame instanceof GuiIngameForge) {
|
||||
GuiIngameForgeAccessor guiForge = ((GuiIngameForgeAccessor) ingame);
|
||||
if (renderHelmetCaptured) {
|
||||
guiForge.callRenderHelmet(resolution, partialTicks, hasScreen, mouseX, mouseY);
|
||||
if (ModStatus.isHoloInventoryLoaded){
|
||||
Renderer.INSTANCE.angelicaOverride = false;
|
||||
// only settings the partial ticks as mouseX and mouseY are not used in renderEvent
|
||||
((RenderGameOverlayEventAccessor) fakeHoloInventoryEvent).setPartialTicks(partialTicks);
|
||||
Renderer.INSTANCE.renderEvent(fakeHoloInventoryEvent);
|
||||
}
|
||||
}
|
||||
if (renderPortalCapturedTicks > 0) {
|
||||
guiForge.callRenderPortal(width, height, partialTicks);
|
||||
@@ -150,6 +181,7 @@ public class HUDCaching {
|
||||
if (renderCrosshairsCaptured) {
|
||||
guiForge.callRenderCrosshairs(width, height);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (renderHelmetCaptured)
|
||||
{
|
||||
@@ -213,4 +245,11 @@ public class HUDCaching {
|
||||
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
|
||||
}
|
||||
|
||||
// moved to here due to the method being called from a mixin
|
||||
public static void disableHoloInventory() {
|
||||
if (ModStatus.isHoloInventoryLoaded){
|
||||
Renderer.INSTANCE.angelicaOverride = isEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,9 +7,10 @@ import com.gtnewhorizon.gtnhmixins.IEarlyMixinLoader;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.Mixins;
|
||||
import com.gtnewhorizons.angelica.mixins.TargetedMod;
|
||||
import com.gtnewhorizons.angelica.transform.compat.CompatASMTransformers;
|
||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
||||
import mist475.mcpatcherforge.asm.AsmTransformers;
|
||||
import mist475.mcpatcherforge.asm.mappings.Namer;
|
||||
import jss.notfine.asm.AsmTransformers;
|
||||
import jss.notfine.asm.mappings.Namer;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -19,6 +20,8 @@ import org.apache.logging.log4j.core.config.LoggerConfig;
|
||||
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;
|
||||
@@ -67,10 +70,17 @@ public class AngelicaTweaker implements IFMLLoadingPlugin, IEarlyMixinLoader {
|
||||
}
|
||||
|
||||
// Return any others here
|
||||
|
||||
if (transformerClasses == null) {
|
||||
|
||||
//Mod Compat transformers
|
||||
List<String> transformers = new ArrayList<String>();
|
||||
transformers.addAll(CompatASMTransformers.getTransformers());
|
||||
|
||||
//NotFine transformers
|
||||
Namer.initNames();
|
||||
transformerClasses = AsmTransformers.getTransformers();
|
||||
transformers.addAll(Arrays.asList(AsmTransformers.getTransformers()));
|
||||
|
||||
transformerClasses = transformers.toArray(new String[0]);
|
||||
}
|
||||
return transformerClasses;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ public class MixinCompatHackTweaker implements ITweaker {
|
||||
LOGGER.info("Disabling Optifine and Fastcraft (if present)");
|
||||
disableOptifineAndFastcraft();
|
||||
}
|
||||
|
||||
if (AngelicaConfig.enableHudCaching){
|
||||
disableXaerosMinimapWaypointTransformer();
|
||||
}
|
||||
}
|
||||
|
||||
private void verifyDependencies() {
|
||||
@@ -34,6 +38,25 @@ public class MixinCompatHackTweaker implements ITweaker {
|
||||
}
|
||||
}
|
||||
|
||||
private void disableXaerosMinimapWaypointTransformer(){
|
||||
try {
|
||||
LaunchClassLoader lcl = Launch.classLoader;
|
||||
Field xformersField = lcl.getClass().getDeclaredField("transformers");
|
||||
xformersField.setAccessible(true);
|
||||
@SuppressWarnings("unchecked")
|
||||
List<IClassTransformer> xformers = (List<IClassTransformer>) xformersField.get(lcl);
|
||||
for (int idx = xformers.size() - 1; idx >= 0; idx--) {
|
||||
final String name = xformers.get(idx).getClass().getName();
|
||||
if (name.startsWith("xaero.common.core.transformer.GuiIngameForgeTransformer")) {
|
||||
LOGGER.info("Removing transformer " + name);
|
||||
xformers.remove(idx);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void disableOptifineAndFastcraft() {
|
||||
// Remove Optifine and Fastcraft transformers & Mod Containers
|
||||
try {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.gtnewhorizons.angelica.mixins;
|
||||
|
||||
import com.gtnewhorizons.angelica.AngelicaMod;
|
||||
import com.gtnewhorizons.angelica.compat.ModStatus;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.NotFineConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -107,19 +109,11 @@ public enum Mixins {
|
||||
,"sodium.MixinWorldClient"
|
||||
,"sodium.MixinTessellator"
|
||||
,"sodium.MixinTileEntity"
|
||||
,"sodium.MixinGuiIngameForge"
|
||||
,"sodium.MixinEffectRenderer"
|
||||
,"sodium.MixinTileEntityRendererDispatcher"
|
||||
,"sodium.MixinLongHashMap"
|
||||
,"sodium.MixinRender"
|
||||
,"sodium.MixinRenderingRegistry"
|
||||
)
|
||||
),
|
||||
|
||||
SODIUM_DYN_SURROUND(new Builder("Sodium without Dynamic Surroundings").addTargetedMod(TargetedMod.VANILLA)
|
||||
.addExcludedMod(TargetedMod.DYNAMIC_SURROUNDINGS_MIST).addExcludedMod(TargetedMod.DYNAMIC_SURROUNDINGS_ORIGINAL).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableSodium).addMixinClasses(
|
||||
"sodium.MixinEntityRenderer$WeatherQuality"
|
||||
,"sodium.MixinPlayerManager"
|
||||
)
|
||||
),
|
||||
|
||||
@@ -163,6 +157,7 @@ public enum Mixins {
|
||||
.setApplyIf(() -> AngelicaConfig.enableHudCaching).addMixinClasses(
|
||||
"angelica.hudcaching.GuiIngameAccessor",
|
||||
"angelica.hudcaching.GuiIngameForgeAccessor",
|
||||
"angelica.hudcaching.RenderGameOverlayEventAccessor",
|
||||
"angelica.hudcaching.MixinEntityRenderer_HUDCaching",
|
||||
"angelica.hudcaching.MixinFramebuffer_HUDCaching",
|
||||
"angelica.hudcaching.MixinGuiIngame_HUDCaching",
|
||||
@@ -189,6 +184,14 @@ public enum Mixins {
|
||||
"angelica.animation.MixinWorldRenderer",
|
||||
"angelica.animation.MixinRenderItem")),
|
||||
|
||||
EXTRA_UTILITIES_THREAD_SAFETY(new Builder("Enable thread safety fixes in Extra Utilities").setPhase(Phase.LATE)
|
||||
.addTargetedMod(TargetedMod.EXTRAUTILS).setSide(Side.CLIENT)
|
||||
.setApplyIf(() -> AngelicaConfig.fixExtraUtilsSodiumCompat)
|
||||
.addMixinClasses(
|
||||
"client.extrautils.MixinRenderBlockConnectedTextures",
|
||||
"client.extrautils.MixinRenderBlockConnectedTexturesEthereal",
|
||||
"client.extrautils.MixinIconConnectedTexture")),
|
||||
|
||||
SPEEDUP_CAMPFIRE_BACKPORT_ANIMATIONS(new Builder("Add animation speedup support to Campfire Backport").setPhase(Phase.LATE)
|
||||
.addTargetedMod(TargetedMod.CAMPFIRE_BACKPORT).setSide(Side.CLIENT)
|
||||
.setApplyIf(() -> AngelicaConfig.speedupAnimations)
|
||||
@@ -202,108 +205,134 @@ public enum Mixins {
|
||||
.addMixinClasses("angelica.textures.MixinTextureUtil_OptimizeMipmap").addTargetedMod(TargetedMod.VANILLA)
|
||||
.setApplyIf(() -> AngelicaConfig.optimizeTextureLoading).setSide(Side.CLIENT)),
|
||||
|
||||
NOTFINE_OPTIMIZATION(new Builder("NotFine Optimizations").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableNotFineOptimizations).addMixinClasses(
|
||||
"notfine.faceculling.MixinBlock"
|
||||
,"notfine.faceculling.MixinBlockSlab"
|
||||
,"notfine.faceculling.MixinBlockSnow"
|
||||
,"notfine.faceculling.MixinBlockStairs"
|
||||
)),
|
||||
//From NotFine
|
||||
NOTFINE_BASE_MOD(new Builder("NotFine")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix("notfine.",
|
||||
"clouds.MixinEntityRenderer",
|
||||
"clouds.MixinGameSettings",
|
||||
//"clouds.MixinRenderGlobal",
|
||||
"clouds.MixinWorldType",
|
||||
|
||||
NOTFINE_FEATURES(new Builder("NotFine Features").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures).addMixinClasses(
|
||||
//"notfine.clouds.MixinEntityRenderer"
|
||||
//,"notfine.clouds.MixinGameSettings"
|
||||
//,"notfine.clouds.MixinRenderGlobal"
|
||||
//,"notfine.clouds.MixinWorldType"
|
||||
"notfine.fix.MixinRenderItem"
|
||||
,"notfine.glint.MixinRenderBiped"
|
||||
,"notfine.glint.MixinRenderPlayer"
|
||||
,"notfine.gui.MixinGuiSlot"
|
||||
,"notfine.leaves.MixinBlockLeaves"
|
||||
,"notfine.leaves.MixinBlockLeavesBase"
|
||||
//,"notfine.particles.MixinBlockEnchantmentTable"
|
||||
//,"notfine.particles.MixinEffectRenderer"
|
||||
//,"notfine.particles.MixinWorldClient"
|
||||
//,"notfine.particles.MixinWorldProvider"
|
||||
,"notfine.renderer.MixinRenderGlobal"
|
||||
//,"notfine.toggle.MixinGuiIngame"
|
||||
//,"notfine.toggle.MixinEntityRenderer"
|
||||
//,"notfine.toggle.MixinRender" --> No Sodium below
|
||||
//,"notfine.toggle.MixinRenderItem"
|
||||
)),
|
||||
"fix.MixinRenderItem",
|
||||
|
||||
NOTFINE_FEATURES_NO_SODIUM(new Builder("NotFine Features").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures && !AngelicaConfig.enableSodium).addMixinClasses(
|
||||
"notfine.toggle.MixinRender"
|
||||
)),
|
||||
"gui.MixinGuiSlot",
|
||||
|
||||
NOTFINE_FEATURES_NO_MCPF_CIT(new Builder("NotFine Features which clash with mcpf cit (compat handled in MCPF_NF mixin)").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures &&
|
||||
!(AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
).addMixinClasses(
|
||||
"notfine.glint.MixinItemRenderer"
|
||||
,"notfine.glint.MixinRenderItem"
|
||||
)),
|
||||
"glint.MixinRenderBiped",
|
||||
"glint.MixinRenderPlayer",
|
||||
|
||||
NOTFINE_LATE_TWILIGHT_FOREST_LEAVES(new Builder("NotFine Mod Leaves").addTargetedMod(TargetedMod.TWILIGHT_FOREST).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.LATE).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures).addMixinClasses(
|
||||
"notfine.leaves.twilightforest.MixinBlockTFLeaves"
|
||||
,"notfine.leaves.twilightforest.MixinBlockTFLeaves3"
|
||||
"optimization.MixinRenderItemFrame",
|
||||
|
||||
"leaves.MixinBlockLeaves",
|
||||
"leaves.MixinBlockLeavesBase",
|
||||
|
||||
"particles.MixinBlockEnchantmentTable",
|
||||
"particles.MixinEffectRenderer",
|
||||
"particles.MixinWorldClient",
|
||||
|
||||
"renderer.MixinRenderGlobal",
|
||||
|
||||
"toggle.MixinEntityRenderer",
|
||||
"toggle.MixinGuiIngame",
|
||||
"toggle.MixinRender",
|
||||
"toggle.MixinRenderItem"
|
||||
))
|
||||
),
|
||||
BETTER_FACE_CULLING(new Builder("Better face culling")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> NotFineConfig.betterBlockFaceCulling)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix("notfine.faceculling.",
|
||||
"MixinBlock",
|
||||
"MixinBlockCactus",
|
||||
"MixinBlockCarpet",
|
||||
"MixinBlockFarmland",
|
||||
"MixinBlockSlab",
|
||||
"MixinBlockSnow",
|
||||
"MixinBlockStairs",
|
||||
"MixinRenderBlocks"
|
||||
))
|
||||
),
|
||||
NOTFINE_NO_DYNAMIC_SURROUNDINGS(new Builder("NotFine no Dynamic Surroundings")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> true)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addExcludedMod(TargetedMod.DYNAMIC_SURROUNDINGS_MIST)
|
||||
.addExcludedMod(TargetedMod.DYNAMIC_SURROUNDINGS_ORIGINAL)
|
||||
.addMixinClasses("notfine.toggle.MixinEntityRenderer$RenderRainSnow")
|
||||
),
|
||||
NOTFINE_NO_CUSTOM_ITEM_TEXTURES(new Builder("NotFine no Custom Item Textures")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> !AngelicaConfig.enableMCPatcherForgeFeatures || !MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix("notfine.glint.",
|
||||
"MixinItemRenderer",
|
||||
"MixinRenderItem"
|
||||
))
|
||||
),
|
||||
NOTFINE_THAUMCRAFT(new Builder("NotFine Thaumcraft compat")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.LATE)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures)
|
||||
.addTargetedMod(TargetedMod.THAUMCRAFT)
|
||||
.addMixinClasses("notfine.leaves.thaumcraft.MixinBlockMagicalLeaves")
|
||||
),
|
||||
THAUMCRAFT_BETTER_FACE_CULLING(new Builder("Better face culling Thaumcraft compat")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.LATE)
|
||||
.setApplyIf(() -> NotFineConfig.betterBlockFaceCulling)
|
||||
.addTargetedMod(TargetedMod.THAUMCRAFT)
|
||||
.addMixinClasses(addPrefix("notfine.faceculling.thaumcraft.",
|
||||
"MixinBlockWoodenDevice",
|
||||
"MixinBlockStoneDevice",
|
||||
"MixinBlockTable"
|
||||
))
|
||||
),
|
||||
NOTFINE_WITCHERY(new Builder("NotFine Witchery compat")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.LATE)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures)
|
||||
.addTargetedMod(TargetedMod.WITCHERY)
|
||||
.addMixinClasses("notfine.leaves.witchery.MixinBlockWitchLeaves")
|
||||
),
|
||||
NOTFINE_TWILIGHT_FOREST(new Builder("NotFine Twilight Forest compat")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.LATE)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures)
|
||||
.addTargetedMod(TargetedMod.TWILIGHT_FOREST)
|
||||
.addMixinClasses(addPrefix("notfine.leaves.twilightforest.",
|
||||
"MixinBlockTFLeaves",
|
||||
"MixinBlockTFLeaves3",
|
||||
// TODO: Verify 2.3.8.18 or later to support non NH builds?
|
||||
,"notfine.leaves.twilightforest.MixinBlockTFMagicLeaves"
|
||||
)),
|
||||
NOTFINE_LATE_THAUMCRAFT_LEAVES(new Builder("NotFine Mod Leaves").addTargetedMod(TargetedMod.THAUMCRAFT).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.LATE).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures).addMixinClasses(
|
||||
"notfine.leaves.thaumcraft.MixinBlockMagicalLeaves"
|
||||
)),
|
||||
NOTFINE_LATE_WITCHERY_LEAVES(new Builder("NotFine Mod Leaves").addTargetedMod(TargetedMod.WITCHERY).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.LATE).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures).addMixinClasses(
|
||||
"notfine.leaves.witchery.MixinBlockWitchLeaves"
|
||||
)),
|
||||
|
||||
MCPATCHERFORGE_NOTFINE_COMPAT(new Builder("Notfine features and MCPF features where the 2 would clash").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.enableNotFineFeatures &&
|
||||
AngelicaConfig.enableMCPatcherForgeFeatures &&
|
||||
MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
.addMixinClasses(addPrefix(
|
||||
"notfine_mcpf_compat.",
|
||||
"MixinRenderItem",
|
||||
"MixinItemRenderer"))),
|
||||
|
||||
MCPATCHERFORGE_BASE_MOD(new Builder("Base MCPatcher mixins").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
"MixinBlockTFMagicLeaves"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE(new Builder("MCPatcher Forge")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix(
|
||||
"mcpatcherforge.",
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.",
|
||||
"base.MixinBlockGrass",
|
||||
"base.MixinBlockMycelium",
|
||||
"base.MixinBlockMycelium",
|
||||
|
||||
"base.MixinAbstractTexture",
|
||||
"base.MixinTextureAtlasSprite",
|
||||
"base.MixinAbstractTexture",
|
||||
"base.MixinTextureAtlasSprite",
|
||||
|
||||
"base.MixinSimpleReloadableResourceManager",
|
||||
"base.MixinSimpleReloadableResourceManager",
|
||||
|
||||
"base.MixinMinecraft"
|
||||
"base.MixinMinecraft"
|
||||
|
||||
// TODO merge renderpass changes into Sodium renderer
|
||||
// "renderpass.MixinEntityRenderer",
|
||||
// "renderpass.MixinRenderBlocks",
|
||||
// "renderpass.MixinRenderGlobal",
|
||||
// "renderpass.MixinWorldRenderer"
|
||||
|
||||
)
|
||||
)),
|
||||
|
||||
MCPATCHERFORGE_CUSTOM_COLOURS(new Builder("Custom colors").setSide(Mixins.Side.CLIENT)
|
||||
.setPhase(Mixins.Phase.EARLY)
|
||||
// TODO merge renderpass changes into Sodium renderer
|
||||
// "renderpass.MixinEntityRenderer",
|
||||
// "renderpass.MixinRenderBlocks",
|
||||
// "renderpass.MixinRenderGlobal",
|
||||
// "renderpass.MixinWorldRenderer"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE_CUSTOM_COLORS(new Builder("MCP:F Custom Colors")
|
||||
.setSide(Mixins.Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().customColorsEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(
|
||||
addPrefix(
|
||||
"mcpatcherforge.cc.",
|
||||
"block.material.MixinMapColor",
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.cc.",
|
||||
"block.material.MixinMapColor",
|
||||
|
||||
"block.MixinBlock",
|
||||
"block.MixinBlockDoublePlant",
|
||||
@@ -351,55 +380,56 @@ public enum Mixins {
|
||||
"world.MixinWorld",
|
||||
"world.MixinWorldProvider",
|
||||
"world.MixinWorldProviderEnd",
|
||||
"world.MixinWorldProviderHell"))),
|
||||
|
||||
MCPATCHERFORGE_CUSTOM_ITEM_TEXTURES(new Mixins.Builder("Custom Item Textures").setSide(Mixins.Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
"world.MixinWorldProviderHell"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE_CUSTOM_ITEM_TEXTURES(new Builder("MCP:F Custom Item Textures")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures && MCPatcherForgeConfig.instance().customItemTexturesEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(
|
||||
addPrefix(
|
||||
"mcpatcherforge.cit.",
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.cit.",
|
||||
"client.renderer.entity.MixinRenderBiped",
|
||||
"client.renderer.entity.MixinRenderEntityLiving",
|
||||
"client.renderer.entity.MixinRenderItem",
|
||||
"client.renderer.entity.MixinRenderPlayer",
|
||||
"client.renderer.entity.MixinRenderSnowball",
|
||||
"client.renderer.MixinItemRenderer",
|
||||
"client.renderer.MixinRenderGlobal",
|
||||
"entity.MixinEntityLivingBase",
|
||||
"item.MixinItem",
|
||||
"nbt.MixinNBTTagCompound",
|
||||
"nbt.MixinNBTTagList"))),
|
||||
|
||||
MCPATCHERFORGE_CUSTOM_ITEM_TEXTURES_NO_NF(new Mixins.Builder("Custom Item Textures without notfine features").setSide(Mixins.Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> (AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().customItemTexturesEnabled) && !AngelicaConfig.enableNotFineFeatures)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix(
|
||||
"mcpatcherforge.cit.client.renderer.",
|
||||
"entity.MixinRenderItemRenderDroppedItem",
|
||||
"MixinItemRenderer_NO_NF"
|
||||
))),
|
||||
|
||||
MCPATCHERFORGE_CONNECTED_TEXTURES(new Builder("Connected Textures").setSide(Side.CLIENT)
|
||||
.setPhase(Mixins.Phase.EARLY)
|
||||
"nbt.MixinNBTTagList",
|
||||
"world.MixinWorld"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE_CONNECTED_TEXTURES(new Builder("MCP:F Connected Textures")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().connectedTexturesEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses("mcpatcherforge.ctm.MixinRenderBlocks")),
|
||||
|
||||
MCPATCHERFORGE_EXTENDED_HD(new Builder("Extended hd").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled)
|
||||
.addMixinClasses("mcpatcherforge.ctm.MixinRenderBlocks")
|
||||
),
|
||||
MCPATCHER_FORGE_EXTENDED_HD(new Builder("MCP:F Extended hd")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableNotFineFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(
|
||||
addPrefix("mcpatcherforge.hd.", "MixinFontRenderer", "MixinTextureClock", "MixinTextureCompass", "MixinTextureManager"))),
|
||||
|
||||
MCPATCHERFORGE_RANDOM_MOBS(new Builder("Random Mobs").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.hd.",
|
||||
"MixinTextureClock",
|
||||
"MixinTextureCompass",
|
||||
"MixinTextureManager"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE_EXTENDED_HD_FONT(new Builder("MCP:F Extended HD Font")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> (AngelicaConfig.enableNotFineFeatures && MCPatcherForgeConfig.instance().extendedHDEnabled && MCPatcherForgeConfig.instance().hdFont))
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addExcludedMod(TargetedMod.COFHCORE)
|
||||
.addMixinClasses("mcpatcherforge.hd.MixinFontRenderer")
|
||||
),
|
||||
MCPATCHER_FORGE_RANDOM_MOBS(new Builder("MCP:F Random Mobs")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().randomMobsEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(
|
||||
addPrefix(
|
||||
"mcpatcherforge.mob.",
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.mob.",
|
||||
"MixinRender",
|
||||
"MixinRenderEnderman",
|
||||
"MixinRenderFish",
|
||||
@@ -409,50 +439,51 @@ public enum Mixins {
|
||||
"MixinRenderSnowMan",
|
||||
"MixinRenderSpider",
|
||||
"MixinRenderWolf",
|
||||
"MixinEntityLivingBase"))),
|
||||
|
||||
MCPATCHERFORGE_SKY(new Builder("Sky").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
"MixinEntityLivingBase"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE_SKY(new Builder("MCP:F Sky")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures && MCPatcherForgeConfig.instance().betterSkiesEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.sky.", "MixinEffectRenderer", "MixinRenderGlobal"
|
||||
))),
|
||||
|
||||
MCPATCHERFORGE_CC_NO_CTM(new Builder("Custom colors, no connected textures").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(
|
||||
() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& (!MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
&& MCPatcherForgeConfig.instance().customColorsEnabled))
|
||||
.addMixinClasses(addPrefix("mcpatcherforge.sky.",
|
||||
"MixinEffectRenderer",
|
||||
"MixinRenderGlobal"
|
||||
))
|
||||
),
|
||||
MCPATCHER_FORGE_CC_NO_CTM(new Builder("MCP:F Custom Colors, no Connected Textures")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& !MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
&& MCPatcherForgeConfig.instance().customColorsEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinRenderBlocksNoCTM")),
|
||||
|
||||
MCPATCHERFORGE_CTM_AND_CC(new Builder("Connected textures and Custom Colors enabled").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(
|
||||
() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
&& MCPatcherForgeConfig.instance().customColorsEnabled)
|
||||
.addMixinClasses("mcpatcherforge.cc_ctm.MixinRenderBlocksNoCTM")
|
||||
),
|
||||
MCPATCHER_FORGE_CTM_NO_CC(new Builder("MCP:F Connected Textures, no Custom Colours")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
&& !MCPatcherForgeConfig.instance().customColorsEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinRenderBlocks")),
|
||||
|
||||
MCPATCHERFORGE_CTM_NO_CC(new Builder("Connected textures, no custom colours").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(
|
||||
() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& (MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
&& !MCPatcherForgeConfig.instance().customColorsEnabled))
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinRenderBlocksNoCC")
|
||||
),
|
||||
MCPATCHER_FORGE_CTM_AND_CC(new Builder("MCP:F Connected Textures and Custom Colors")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
&& MCPatcherForgeConfig.instance().customColorsEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinRenderBlocksNoCC")),
|
||||
|
||||
MCPATCHERFORGE_CTM_OR_CC(new Builder("Connected textures or Custom Colors enabled").setSide(Side.CLIENT)
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(
|
||||
() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& (MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
|| MCPatcherForgeConfig.instance().customColorsEnabled))
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinRenderBlocks")
|
||||
),
|
||||
MCPATCHER_FORGE_CTM_OR_CC(new Builder("MCP:F Connected Textures or Custom Colors")
|
||||
.setSide(Side.CLIENT).setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> AngelicaConfig.enableMCPatcherForgeFeatures
|
||||
&& MCPatcherForgeConfig.instance().connectedTexturesEnabled
|
||||
|| MCPatcherForgeConfig.instance().customColorsEnabled)
|
||||
.addTargetedMod(TargetedMod.VANILLA)
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinTextureMap")),
|
||||
.addMixinClasses("mcpatcherforge.ctm_cc.MixinTextureMap")
|
||||
),
|
||||
//End from NotFine
|
||||
|
||||
NOVIS_OCULIS(new Builder("Non-Tessellator Quad provider")
|
||||
.setSide(Side.CLIENT)
|
||||
@@ -490,6 +521,15 @@ public enum Mixins {
|
||||
}
|
||||
|
||||
public static List<String> getEarlyMixins(Set<String> loadedCoreMods) {
|
||||
NotFineConfig.loadSettings();
|
||||
//These will probably break hard with Angelica.
|
||||
//AdvancedOpenGL even breaks hard on its own.
|
||||
NotFineConfig.allowAdvancedOpenGL = false;
|
||||
NotFineConfig.allowToggleFBO = false;
|
||||
//This may be possible to handle differently or fix.
|
||||
if(loadedCoreMods.contains("cofh.asm.LoadingPlugin")) {
|
||||
MCPatcherForgeConfig.instance().hdFont = false;
|
||||
}
|
||||
final List<String> mixins = new ArrayList<>();
|
||||
final List<String> notLoading = new ArrayList<>();
|
||||
for (Mixins mixin : Mixins.values()) {
|
||||
|
||||
+1
@@ -22,4 +22,5 @@ public abstract class MixinEntityRenderer {
|
||||
viewEntity.lastTickPosZ + (viewEntity.posZ - viewEntity.lastTickPosZ) * partialTicks
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
+5
@@ -18,4 +18,9 @@ public class MixinChunkCache implements ITexturesCache {
|
||||
public HashSet<IIcon> getRenderedTextures() {
|
||||
return renderedIcons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableTextureTracking() {
|
||||
|
||||
}
|
||||
}
|
||||
+18
-7
@@ -2,7 +2,7 @@ package com.gtnewhorizons.angelica.mixins.early.angelica.animation;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.ITexturesCache;
|
||||
import com.gtnewhorizons.angelica.utils.AnimationsRenderUtils;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFire;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
@@ -27,7 +27,8 @@ public class MixinRenderBlocks implements ITexturesCache {
|
||||
@Shadow
|
||||
public IIcon overrideBlockTexture;
|
||||
|
||||
private Set<IIcon> renderedSprites = new ObjectOpenHashSet<>();
|
||||
private Set<IIcon> renderedSprites = new ReferenceOpenHashSet<>();
|
||||
private boolean enableSpriteTracking;
|
||||
|
||||
/**
|
||||
* @author laetansky Here where things get very tricky. We can't just mark blocks textures for update because this
|
||||
@@ -46,14 +47,17 @@ public class MixinRenderBlocks implements ITexturesCache {
|
||||
|
||||
AnimationsRenderUtils.markBlockTextureForUpdate(icon, blockAccess);
|
||||
|
||||
this.renderedSprites.add(icon);
|
||||
if(this.enableSpriteTracking)
|
||||
this.renderedSprites.add(icon);
|
||||
}
|
||||
|
||||
@Inject(method = "renderBlockFire", at = @At("HEAD"))
|
||||
public void angelica$markFireBlockAnimationForUpdate(BlockFire instance, int x, int y, int z,
|
||||
CallbackInfoReturnable<Boolean> cir) {
|
||||
this.renderedSprites.add(instance.getFireIcon(0));
|
||||
this.renderedSprites.add(instance.getFireIcon(1));
|
||||
if(this.enableSpriteTracking) {
|
||||
this.renderedSprites.add(instance.getFireIcon(0));
|
||||
this.renderedSprites.add(instance.getFireIcon(1));
|
||||
}
|
||||
AnimationsRenderUtils.markBlockTextureForUpdate(instance.getFireIcon(0), blockAccess);
|
||||
AnimationsRenderUtils.markBlockTextureForUpdate(instance.getFireIcon(1), blockAccess);
|
||||
}
|
||||
@@ -62,7 +66,8 @@ public class MixinRenderBlocks implements ITexturesCache {
|
||||
public IIcon angelica$markFluidAnimationForUpdate(IIcon icon) {
|
||||
AnimationsRenderUtils.markBlockTextureForUpdate(icon, blockAccess);
|
||||
|
||||
this.renderedSprites.add(icon);
|
||||
if(this.enableSpriteTracking)
|
||||
this.renderedSprites.add(icon);
|
||||
|
||||
return icon;
|
||||
}
|
||||
@@ -72,11 +77,17 @@ public class MixinRenderBlocks implements ITexturesCache {
|
||||
CallbackInfo ci) {
|
||||
AnimationsRenderUtils.markBlockTextureForUpdate(icon, blockAccess);
|
||||
|
||||
this.renderedSprites.add(icon);
|
||||
if(this.enableSpriteTracking)
|
||||
this.renderedSprites.add(icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<IIcon> getRenderedTextures() {
|
||||
return renderedSprites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableTextureTracking() {
|
||||
enableSpriteTracking = true;
|
||||
}
|
||||
}
|
||||
+6
@@ -26,6 +26,7 @@ public class MixinWorldRenderer implements ITexturesCache {
|
||||
|
||||
@ModifyArg(method = "updateRenderer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderBlocks;<init>(Lnet/minecraft/world/IBlockAccess;)V"))
|
||||
private IBlockAccess angelica$onUpdateRenderer(IBlockAccess chunkCache) {
|
||||
((ITexturesCache) chunkCache).enableTextureTracking();
|
||||
renderedIcons = ((ITexturesCache) chunkCache).getRenderedTextures();
|
||||
return chunkCache;
|
||||
}
|
||||
@@ -43,4 +44,9 @@ public class MixinWorldRenderer implements ITexturesCache {
|
||||
public Set<IIcon> getRenderedTextures() {
|
||||
return renderedIcons;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableTextureTracking() {
|
||||
|
||||
}
|
||||
}
|
||||
+8
-5
@@ -1,5 +1,6 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.angelica.hudcaching;
|
||||
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
@@ -21,7 +22,7 @@ public class MixinGuiIngameForge_HUDCaching {
|
||||
HUDCaching.renderCrosshairsCaptured = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "renderCrosshairs", at = @At("HEAD"), cancellable = true, remap = false)
|
||||
private void angelica$captureRenderCrosshair(CallbackInfo ci) {
|
||||
if (HUDCaching.renderingCacheOverride) {
|
||||
@@ -30,15 +31,17 @@ public class MixinGuiIngameForge_HUDCaching {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "renderHelmet", at = @At("HEAD"), cancellable = true, remap = false)
|
||||
private void angelica$captureRenderHelmet(CallbackInfo ci) {
|
||||
private void angelica$captureRenderHelmet(ScaledResolution res, float partialTicks, boolean hasScreen, int mouseX, int mouseY, CallbackInfo ci) {
|
||||
if (HUDCaching.renderingCacheOverride) {
|
||||
HUDCaching.renderHelmetCaptured = true;
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
HUDCaching.disableHoloInventory();
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "renderPortal", at = @At("HEAD"), cancellable = true, remap = false)
|
||||
private void angelica$captureRenderPortal(int width, int height, float partialTicks, CallbackInfo ci) {
|
||||
if (HUDCaching.renderingCacheOverride) {
|
||||
@@ -46,7 +49,7 @@ public class MixinGuiIngameForge_HUDCaching {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Inject(method = "renderBossHealth", at = @At("HEAD"))
|
||||
private void angelica$bindBossHealthTexture(CallbackInfo ci) {
|
||||
// boss health texture is bind in renderCrosshairs
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.angelica.hudcaching;
|
||||
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.event.terraingen.BiomeEvent;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(RenderGameOverlayEvent.class)
|
||||
public interface RenderGameOverlayEventAccessor {
|
||||
@Accessor(value = "partialTicks", remap = false)
|
||||
void setPartialTicks(float value);
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.AbstractTextureExpansion;
|
||||
import jss.notfine.util.AbstractTextureExpansion;
|
||||
|
||||
@Mixin(AbstractTexture.class)
|
||||
public abstract class MixinAbstractTexture implements AbstractTextureExpansion {
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import com.prupe.mcpatcher.mal.resource.TexturePackChangeHandler;
|
||||
import com.prupe.mcpatcher.mal.tile.TileLoader;
|
||||
import com.prupe.mcpatcher.mob.MobRandomizer;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
@Mixin(Minecraft.class)
|
||||
public abstract class MixinMinecraft {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.MapColorExpansion;
|
||||
import jss.notfine.util.MapColorExpansion;
|
||||
|
||||
@Mixin(MapColor.class)
|
||||
public abstract class MixinMapColor implements MapColorExpansion {
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
import com.prupe.mcpatcher.cc.ColorizeEntity;
|
||||
import com.prupe.mcpatcher.cc.Colorizer;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.EntityAuraFXExpansion;
|
||||
import jss.notfine.util.EntityAuraFXExpansion;
|
||||
|
||||
@Mixin(EntityAuraFX.class)
|
||||
public abstract class MixinEntityAuraFX extends EntityFX implements EntityAuraFXExpansion {
|
||||
|
||||
+3
-11
@@ -36,7 +36,7 @@ public abstract class MixinEntityDropParticleFX extends EntityFX {
|
||||
at = @At("RETURN"))
|
||||
private void modifyConstructor(World worldIn, double x, double y, double z, Material material, CallbackInfo ci) {
|
||||
if (material == Material.water) {
|
||||
if (ColorizeBlock.computeWaterColor(true, (int) this.posX, (int) this.posY, (int) this.posZ)) {
|
||||
if (ColorizeBlock.computeWaterColor(false, (int) this.posX, (int) this.posY, (int) this.posZ)) {
|
||||
this.particleRed = Colorizer.setColor[0];
|
||||
this.particleGreen = Colorizer.setColor[1];
|
||||
this.particleBlue = Colorizer.setColor[2];
|
||||
@@ -45,10 +45,6 @@ public abstract class MixinEntityDropParticleFX extends EntityFX {
|
||||
this.particleGreen = 0.3f;
|
||||
this.particleBlue = 1.0f;
|
||||
}
|
||||
} else {
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 0.0F;
|
||||
this.particleBlue = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +59,8 @@ public abstract class MixinEntityDropParticleFX extends EntityFX {
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
// Patch start
|
||||
if (this.materialType != Material.water) {
|
||||
// Patch start
|
||||
if (ColorizeEntity.computeLavaDropColor(40 - this.bobTimer)) {
|
||||
this.particleRed = Colorizer.setColor[0];
|
||||
this.particleGreen = Colorizer.setColor[1];
|
||||
@@ -74,12 +70,8 @@ public abstract class MixinEntityDropParticleFX extends EntityFX {
|
||||
this.particleGreen = 16.0f / (40 - this.bobTimer + 16);
|
||||
this.particleBlue = 4.0f / (40 - this.bobTimer + 8);
|
||||
}
|
||||
// Patch end
|
||||
} else {
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 16.0F / (float) (40 - this.bobTimer + 16);
|
||||
this.particleBlue = 4.0F / (float) (40 - this.bobTimer + 8);
|
||||
}
|
||||
// Patch end
|
||||
|
||||
this.motionY -= this.particleGravity;
|
||||
|
||||
|
||||
+5
@@ -26,6 +26,11 @@ public abstract class MixinEntitySplashFX extends EntityFX {
|
||||
this.particleRed = Colorizer.setColor[0];
|
||||
this.particleGreen = Colorizer.setColor[1];
|
||||
this.particleBlue = Colorizer.setColor[2];
|
||||
} else {
|
||||
this.particleRed = 0.2f;
|
||||
this.particleGreen = 0.3f;
|
||||
this.particleBlue = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import com.prupe.mcpatcher.cc.ColorizeItem;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.PotionExpansion;
|
||||
import jss.notfine.util.PotionExpansion;
|
||||
|
||||
@Mixin(Potion.class)
|
||||
public abstract class MixinPotion implements PotionExpansion {
|
||||
|
||||
+1
@@ -63,6 +63,7 @@ public abstract class MixinWorld {
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
@SuppressWarnings("InvalidInjectorMethodSignature")
|
||||
@ModifyVariable(
|
||||
method = "getSkyColorBody(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/util/Vec3;",
|
||||
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.client.renderer;
|
||||
|
||||
import com.prupe.mcpatcher.cit.CITUtils;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(ItemRenderer.class)
|
||||
public class MixinItemRenderer_NO_NF {
|
||||
|
||||
@Redirect(
|
||||
method = "renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;hasEffect(I)Z"),
|
||||
remap = false)
|
||||
private boolean modifyRenderItem3(ItemStack item, int pass, EntityLivingBase entity, ItemStack itemStack,
|
||||
int renderPass) {
|
||||
return !CITUtils.renderEnchantmentHeld(item, renderPass) && item.hasEffect(pass);
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.client.renderer;
|
||||
|
||||
import com.prupe.mcpatcher.cit.CITUtils;
|
||||
import jss.notfine.util.itembreakparticles.IRenderGlobalSpawnItemBreakParticle;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.particle.EntityBreakingFX;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.RenderGlobal;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(value = RenderGlobal.class)
|
||||
public abstract class MixinRenderGlobal implements IRenderGlobalSpawnItemBreakParticle {
|
||||
|
||||
public EntityFX spawnItemBreakParticle(ItemStack itemStack, final double x, final double y, final double z, double velocityX, double velocityY, double velocityZ) {
|
||||
int i = mc.gameSettings.particleSetting;
|
||||
|
||||
if (i == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||
i = 2;
|
||||
}
|
||||
if (i > 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
double relX = this.mc.renderViewEntity.posX - x;
|
||||
double relY = this.mc.renderViewEntity.posY - y;
|
||||
double relZ = this.mc.renderViewEntity.posZ - z;
|
||||
|
||||
double distance = 16.0D;
|
||||
|
||||
if (relX * relX + relY * relY + relZ * relZ > distance * distance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Item item = itemStack.getItem();
|
||||
int meta = itemStack.getItemDamage();
|
||||
EntityFX entityfx = new EntityBreakingFX(theWorld, x, y, z, velocityX, velocityY, velocityZ, item, meta);
|
||||
entityfx.particleIcon = CITUtils.getIcon(item.getIconFromDamage(meta), itemStack, 0);
|
||||
mc.effectRenderer.addEffect(entityfx);
|
||||
return entityfx;
|
||||
}
|
||||
|
||||
@Shadow
|
||||
private Minecraft mc;
|
||||
@Shadow
|
||||
private WorldClient theWorld;
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.entity;
|
||||
|
||||
import jss.notfine.NotFine;
|
||||
import jss.notfine.util.itembreakparticles.IWorldSpawnItemBreakParticle;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
@Mixin(value = EntityLivingBase.class)
|
||||
public abstract class MixinEntityLivingBase extends Entity {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason Fix item break particles
|
||||
*/
|
||||
@Overwrite
|
||||
public void renderBrokenItemStack(ItemStack itemStack) {
|
||||
playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F);
|
||||
|
||||
for(int i = 0; i < 5; ++i) {
|
||||
Vec3 vec3 = Vec3.createVectorHelper(((double)rand.nextFloat() - 0.5) * 0.1, Math.random() * 0.1 + 0.1, 0.0);
|
||||
vec3.rotateAroundX(-rotationPitch * 3.1415927F / 180.0F);
|
||||
vec3.rotateAroundY(-rotationYaw * 3.1415927F / 180.0F);
|
||||
Vec3 vec31 = Vec3.createVectorHelper(((double)rand.nextFloat() - 0.5) * 0.3, (double)(-rand.nextFloat()) * 0.6 - 0.3, 0.6);
|
||||
vec31.rotateAroundX(-rotationPitch * 3.1415927F / 180.0F);
|
||||
vec31.rotateAroundY(-rotationYaw * 3.1415927F / 180.0F);
|
||||
vec31 = vec31.addVector(posX, posY + (double)getEyeHeight(), posZ);
|
||||
NotFine.logger.info("Item broken, calling IWorldSpawnItemBreakParticle spawnItemBreakParticle");
|
||||
((IWorldSpawnItemBreakParticle)worldObj).spawnItemBreakParticle(itemStack,
|
||||
"iconcrack_" + Item.getIdFromItem(itemStack.getItem()),
|
||||
vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05, vec3.zCoord);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private MixinEntityLivingBase(World world) { super(world); }
|
||||
|
||||
}
|
||||
+1
-1
@@ -9,7 +9,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.NBTTagCompoundExpansion;
|
||||
import jss.notfine.util.NBTTagCompoundExpansion;
|
||||
|
||||
@Mixin(NBTTagCompound.class)
|
||||
public abstract class MixinNBTTagCompound implements NBTTagCompoundExpansion {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.NBTTagListExpansion;
|
||||
import jss.notfine.util.NBTTagListExpansion;
|
||||
|
||||
@Mixin(NBTTagList.class)
|
||||
public class MixinNBTTagList implements NBTTagListExpansion {
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.mcpatcherforge.cit.world;
|
||||
|
||||
import jss.notfine.util.itembreakparticles.IRenderGlobalSpawnItemBreakParticle;
|
||||
import jss.notfine.util.itembreakparticles.IWorldSpawnItemBreakParticle;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IWorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(value = World.class)
|
||||
public abstract class MixinWorld implements IWorldSpawnItemBreakParticle {
|
||||
|
||||
public void spawnItemBreakParticle(ItemStack itemStack, String particleName, double x, double y, double z, double velocityX, double velocityY, double velocityZ) {
|
||||
for (int i = 0; i < worldAccesses.size(); ++i) {
|
||||
IWorldAccess access = (IWorldAccess)worldAccesses.get(i);
|
||||
if (access instanceof IRenderGlobalSpawnItemBreakParticle) {
|
||||
((IRenderGlobalSpawnItemBreakParticle)access).spawnItemBreakParticle(itemStack, x, y, z, velocityX, velocityY, velocityZ);
|
||||
} else {
|
||||
access.spawnParticle(particleName, x, y, z, velocityX, velocityY, velocityZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Shadow
|
||||
protected List worldAccesses;
|
||||
|
||||
}
|
||||
+6
-3
@@ -67,11 +67,14 @@ public abstract class MixinRenderBlocks {
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = { "renderBlockVine(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderBlockLilyPad(Lnet/minecraft/block/Block;III)Z", "renderBlockLadder(Lnet/minecraft/block/Block;III)Z",
|
||||
method = {
|
||||
"renderBlockVine(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderBlockLilyPad(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderBlockLadder(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderBlockTripWireSource(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderBlockLever(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderBlockTripWire(Lnet/minecraft/block/Block;III)Z", },
|
||||
"renderBlockTripWire(Lnet/minecraft/block/Block;III)Z"
|
||||
},
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/renderer/RenderBlocks;getBlockIconFromSide(Lnet/minecraft/block/Block;I)Lnet/minecraft/util/IIcon;"))
|
||||
|
||||
-13
@@ -8,7 +8,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@@ -33,18 +32,6 @@ public abstract class MixinRenderBlocks {
|
||||
@Shadow
|
||||
public abstract IIcon getBlockIconFromSideAndMetadata(Block block, int side, int meta);
|
||||
|
||||
@Unique
|
||||
private int mcpatcherforge$neededSideRenderBlockLiquid;
|
||||
|
||||
@Unique
|
||||
private float mcpatcherforge$neededFloat1;
|
||||
|
||||
@Unique
|
||||
private float mcpatcherforge$neededFloat2;
|
||||
|
||||
@Unique
|
||||
private float mcpatcherforge$neededFloat3;
|
||||
|
||||
// Redirect calls to this.getBlockIcon when possible
|
||||
|
||||
@Redirect(
|
||||
|
||||
+1
@@ -12,6 +12,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(RenderBlocks.class)
|
||||
public abstract class MixinRenderBlocksNoCC {
|
||||
|
||||
@Shadow
|
||||
public IBlockAccess blockAccess;
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ import com.llamalad7.mixinextras.sugar.ref.LocalIntRef;
|
||||
import com.prupe.mcpatcher.cc.ColorizeWorld;
|
||||
import com.prupe.mcpatcher.hd.FontUtils;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.FontRendererExpansion;
|
||||
import jss.notfine.util.FontRendererExpansion;
|
||||
|
||||
@Mixin(FontRenderer.class)
|
||||
public abstract class MixinFontRenderer implements FontRendererExpansion {
|
||||
|
||||
+2
-2
@@ -39,7 +39,8 @@ public abstract class MixinEntityRenderer {
|
||||
return RenderPass.setAmbientOcclusion(this.mc.gameSettings.ambientOcclusion != 0);
|
||||
}
|
||||
|
||||
@WrapOperation(method = "renderWorld(FJ)V",
|
||||
@WrapOperation(
|
||||
method = "renderWorld(FJ)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/renderer/RenderGlobal;sortAndRender(Lnet/minecraft/entity/EntityLivingBase;ID)I",
|
||||
@@ -58,5 +59,4 @@ public abstract class MixinEntityRenderer {
|
||||
this.renderRainSnow(partialTickTime);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
-6
@@ -5,18 +5,14 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
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.Redirect;
|
||||
|
||||
import com.prupe.mcpatcher.renderpass.RenderPass;
|
||||
|
||||
@Mixin(RenderBlocks.class)
|
||||
@Mixin(value = RenderBlocks.class)
|
||||
public abstract class MixinRenderBlocks {
|
||||
|
||||
@Shadow
|
||||
public IBlockAccess blockAccess;
|
||||
|
||||
@Redirect(
|
||||
method = { "renderBlockBed(Lnet/minecraft/block/Block;III)Z",
|
||||
"renderStandardBlockWithAmbientOcclusion(Lnet/minecraft/block/Block;IIIFFF)Z",
|
||||
@@ -31,5 +27,4 @@ public abstract class MixinRenderBlocks {
|
||||
return RenderPass.shouldSideBeRendered(block, worldIn, x, y, z, side);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-1
@@ -79,5 +79,4 @@ public abstract class MixinRenderGlobal implements IWorldAccess {
|
||||
RenderPass.enableDisableLightmap(instance, partialTick);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-3
@@ -1,7 +1,5 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.faceculling;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -17,7 +15,6 @@ public abstract class MixinBlock {
|
||||
* @reason More accurate face culling.
|
||||
*/
|
||||
@Overwrite()
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
//Check if side is touching another block
|
||||
switch(side) {
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.faceculling;
|
||||
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCactus;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(value = BlockCactus.class)
|
||||
public abstract class MixinBlockCactus extends Block implements IFaceObstructionCheckHelper {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason More accurate face culling.
|
||||
*/
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
//If is not top or bottom
|
||||
if(side > 1) {
|
||||
return true;
|
||||
}
|
||||
//Check if other block is solid
|
||||
Block otherBlock = worldIn.getBlock(x, y, z);
|
||||
if(otherBlock.isOpaqueCube()) {
|
||||
return false;
|
||||
}
|
||||
//Check for IFaceObstructionCheckHelper
|
||||
if(otherBlock instanceof IFaceObstructionCheckHelper target) {
|
||||
return target.isFaceNonObstructing(worldIn, x, y, z, side, 0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F);
|
||||
}
|
||||
//Default
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFaceNonObstructing(IBlockAccess worldIn, int x, int y, int z, int side, double otherMinX, double otherMinY, double otherMinZ, double otherMaxX, double otherMaxY, double otherMaxZ) {
|
||||
if(getRenderBlockPass() == 1) {
|
||||
return true;
|
||||
}
|
||||
if(side > 1) {
|
||||
return true;
|
||||
}
|
||||
return otherMinX < 0.0625F || otherMinZ < 0.0625F || otherMaxX > 0.9375F || otherMaxZ > 0.9375F;
|
||||
}
|
||||
|
||||
MixinBlockCactus(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.faceculling;
|
||||
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCarpet;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
@Mixin(value = BlockCarpet.class)
|
||||
public abstract class MixinBlockCarpet extends Block implements IFaceObstructionCheckHelper {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason More accurate face culling.
|
||||
*/
|
||||
@Overwrite()
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
//If this is the top
|
||||
if(side == 1) {
|
||||
return true;
|
||||
}
|
||||
//Check if other block is solid
|
||||
Block otherBlock = worldIn.getBlock(x, y, z);
|
||||
if(otherBlock.isOpaqueCube()) {
|
||||
return false;
|
||||
}
|
||||
//Check for IFaceObstructionCheckHelper
|
||||
if(otherBlock instanceof IFaceObstructionCheckHelper target) {
|
||||
return target.isFaceNonObstructing(worldIn, x, y, z, side, 0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
||||
}
|
||||
//Default
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFaceNonObstructing(IBlockAccess worldIn, int x, int y, int z, int side, double otherMinX, double otherMinY, double otherMinZ, double otherMaxX, double otherMaxY, double otherMaxZ) {
|
||||
if(getRenderBlockPass() == 1) {
|
||||
return true;
|
||||
}
|
||||
if(side <= 1) {
|
||||
return side == 0;
|
||||
}
|
||||
return otherMaxY > 0.0625F;
|
||||
}
|
||||
|
||||
MixinBlockCarpet(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.faceculling;
|
||||
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFarmland;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(value = BlockFarmland.class)
|
||||
public abstract class MixinBlockFarmland extends Block implements IFaceObstructionCheckHelper {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason More accurate face culling.
|
||||
*/
|
||||
public boolean shouldSideBeRendered(IBlockAccess worldIn, int x, int y, int z, int side) {
|
||||
//If this is the top
|
||||
if(side == 1) {
|
||||
return true;
|
||||
}
|
||||
//Check if other block is solid
|
||||
Block otherBlock = worldIn.getBlock(x, y, z);
|
||||
if(otherBlock.isOpaqueCube()) {
|
||||
return false;
|
||||
}
|
||||
//Check for IFaceObstructionCheckHelper
|
||||
if(otherBlock instanceof IFaceObstructionCheckHelper target) {
|
||||
return target.isFaceNonObstructing(worldIn, x, y, z, side, 0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
|
||||
}
|
||||
//Default
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFaceNonObstructing(IBlockAccess worldIn, int x, int y, int z, int side, double otherMinX, double otherMinY, double otherMinZ, double otherMaxX, double otherMaxY, double otherMaxZ) {
|
||||
if(getRenderBlockPass() == 1) {
|
||||
return true;
|
||||
}
|
||||
if(side <= 1) {
|
||||
return side == 0;
|
||||
}
|
||||
return otherMaxY > 0.9375F;
|
||||
}
|
||||
|
||||
MixinBlockFarmland(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
}
|
||||
+5
-2
@@ -20,7 +20,8 @@ public abstract class MixinBlockSlab extends Block implements IFaceObstructionCh
|
||||
int thisX = x + Facing.offsetsXForSide[Facing.oppositeSide[side]];
|
||||
int thisY = y + Facing.offsetsYForSide[Facing.oppositeSide[side]];
|
||||
int thisZ = z + Facing.offsetsZForSide[Facing.oppositeSide[side]];
|
||||
if((worldIn.getBlockMetadata(thisX, thisY, thisZ) & 8) != side) {
|
||||
boolean isTop = (worldIn.getBlockMetadata(thisX, thisY, thisZ) & 8) != 0;
|
||||
if(isTop && side == 0 || !isTop && side == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +62,9 @@ public abstract class MixinBlockSlab extends Block implements IFaceObstructionCh
|
||||
};
|
||||
}
|
||||
|
||||
MixinBlockSlab(Material material) { super(material); }
|
||||
MixinBlockSlab(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
@Shadow @Final protected boolean field_150004_a;
|
||||
}
|
||||
+5
-4
@@ -14,10 +14,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
@Mixin(value = BlockSnow.class)
|
||||
public abstract class MixinBlockSnow extends Block implements IFaceObstructionCheckHelper {
|
||||
|
||||
MixinBlockSnow(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason More accurate face culling.
|
||||
@@ -56,5 +52,10 @@ public abstract class MixinBlockSnow extends Block implements IFaceObstructionCh
|
||||
default -> otherMaxY > (float) (2 * (1 + meta)) * 0.0625f;
|
||||
};
|
||||
}
|
||||
|
||||
MixinBlockSnow(Material material) {
|
||||
super(material);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public abstract class MixinBlockStairs extends Block implements IFaceObstruction
|
||||
};
|
||||
}
|
||||
|
||||
private MixinBlockStairs(Material materialIn) {
|
||||
MixinBlockStairs(Material materialIn) {
|
||||
super(materialIn);
|
||||
}
|
||||
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.faceculling;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockWall;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(value = RenderBlocks.class)
|
||||
public abstract class MixinRenderBlocks {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason Culling a few more faces
|
||||
*/
|
||||
@Overwrite
|
||||
public boolean renderBlockFence(BlockFence fence, int x, int y, int z) {
|
||||
float min = 0.375F;
|
||||
float max = 0.625F;
|
||||
setRenderBounds(min, 0.0D, min, max, 1.0D, max);
|
||||
renderStandardBlock(fence, x, y, z);
|
||||
|
||||
boolean connectXNeg = fence.canConnectFenceTo(blockAccess, x - 1, y, z);
|
||||
boolean connectXPos = fence.canConnectFenceTo(blockAccess, x + 1, y, z);
|
||||
boolean connectZNeg = fence.canConnectFenceTo(blockAccess, x, y, z - 1);
|
||||
boolean connectZPos = fence.canConnectFenceTo(blockAccess, x, y, z + 1);
|
||||
boolean connectX = connectXNeg || connectXPos;
|
||||
boolean connectZ = connectZNeg || connectZPos;
|
||||
|
||||
min = 0.4375F;
|
||||
max = 0.5625F;
|
||||
float minY = 0.75F;
|
||||
float maxY = 0.9375F;
|
||||
float minX = connectXNeg ? 0.0F : min;
|
||||
float maxX = connectXPos ? 1.0F : max;
|
||||
float minZ = connectZNeg ? 0.0F : min;
|
||||
float maxZ = connectZPos ? 1.0F : max;
|
||||
field_152631_f = true;
|
||||
//Upper beam
|
||||
if(connectX) {
|
||||
setRenderBounds(minX, minY, min, maxX, maxY, max);
|
||||
renderStandardBlock(fence, x, y, z);
|
||||
}
|
||||
if(connectZ) {
|
||||
setRenderBounds(min, minY, minZ, max, maxY, maxZ);
|
||||
renderStandardBlock(fence, x, y, z);
|
||||
}
|
||||
|
||||
minY = 0.375F;
|
||||
maxY = 0.5625F;
|
||||
//Lower beam
|
||||
if(connectX) {
|
||||
setRenderBounds(minX, minY, min, maxX, maxY, max);
|
||||
renderStandardBlock(fence, x, y, z);
|
||||
}
|
||||
if(connectZ) {
|
||||
setRenderBounds(min, minY, minZ, max, maxY, maxZ);
|
||||
renderStandardBlock(fence, x, y, z);
|
||||
}
|
||||
|
||||
field_152631_f = false;
|
||||
fence.setBlockBoundsBasedOnState(blockAccess, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason Fix modded wall detection
|
||||
*/
|
||||
@Redirect(
|
||||
method = "renderBlockFenceGate(Lnet/minecraft/block/BlockFenceGate;III)Z",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"
|
||||
),
|
||||
expect = 4
|
||||
)
|
||||
Block detectModdedWalls(IBlockAccess world, int x, int y, int z) {
|
||||
return world.getBlock(x, y, z) instanceof BlockWall ? Blocks.cobblestone_wall : null;
|
||||
}
|
||||
|
||||
@Shadow public IBlockAccess blockAccess;
|
||||
@Shadow public boolean field_152631_f;
|
||||
@Shadow public abstract void setRenderBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ);
|
||||
@Shadow public abstract boolean renderStandardBlock(Block blockType, int blockX, int blockY, int blockZ);
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.optimization;
|
||||
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.tileentity.RenderItemFrame;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(value = RenderItemFrame.class)
|
||||
public abstract class MixinRenderItemFrame extends Render {
|
||||
|
||||
private EntityItem cachedEntityItem;
|
||||
|
||||
@Redirect(
|
||||
method = "func_82402_b(Lnet/minecraft/entity/item/EntityItemFrame;)V",
|
||||
at = @At(
|
||||
value = "NEW",
|
||||
target = "(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;)Lnet/minecraft/entity/item/EntityItem;",
|
||||
ordinal = 0
|
||||
)
|
||||
)
|
||||
public EntityItem cacheEntityItem(World world, double x, double y, double z, ItemStack itemstack) {
|
||||
if(cachedEntityItem == null) {
|
||||
cachedEntityItem = new EntityItem(world, 0.0D, 0.0D, 0.0D, itemstack);
|
||||
} else {
|
||||
cachedEntityItem.setEntityItemStack(itemstack);
|
||||
}
|
||||
return cachedEntityItem;
|
||||
}
|
||||
|
||||
}
|
||||
+27
-1
@@ -2,6 +2,10 @@ package com.gtnewhorizons.angelica.mixins.early.notfine.particles;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import jss.notfine.core.Settings;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
@@ -16,9 +20,31 @@ public abstract class MixinWorldClient {
|
||||
* @author jss2a98aj
|
||||
* @reason Xoshiro256** is faster than Random.
|
||||
*/
|
||||
@Redirect(method = "doVoidFogParticles(III)V", at = @At(value = "NEW", target = "java/util/Random", ordinal = 0))
|
||||
@Redirect(
|
||||
method = "doVoidFogParticles(III)V",
|
||||
at = @At(
|
||||
value = "NEW",
|
||||
target = "()Ljava/util/Random;",
|
||||
ordinal = 0
|
||||
)
|
||||
)
|
||||
private Random notFine$redirectDoVoidFogParticlesRandom() {
|
||||
return new RandomXoshiro256StarStar();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason Toggle void particles.
|
||||
*/
|
||||
@WrapOperation(
|
||||
method = "doVoidFogParticles(III)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/WorldProvider;getWorldHasVoidParticles()Z"
|
||||
)
|
||||
)
|
||||
private boolean notFine$toggleVoidParticles(WorldProvider provider, Operation<Boolean> original){
|
||||
return ((boolean) Settings.PARTICLES_VOID.option.getStore()) ? original.call(provider) : false;
|
||||
}
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.particles;
|
||||
|
||||
import jss.notfine.core.Settings;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.WorldType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
@Mixin(value = WorldProvider.class)
|
||||
public class MixinWorldProvider {
|
||||
|
||||
/**
|
||||
* @author jss2a98aj
|
||||
* @reason Toggle void particles.
|
||||
*/
|
||||
@Overwrite
|
||||
public boolean getWorldHasVoidParticles() {
|
||||
return (boolean)Settings.PARTICLES_VOID.option.getStore() && terrainType.hasVoidParticles(hasNoSky);
|
||||
}
|
||||
|
||||
@Shadow public WorldType terrainType;
|
||||
@Shadow public boolean hasNoSky;
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.toggle;
|
||||
|
||||
import jss.notfine.core.SettingsManager;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(EntityRenderer.class)
|
||||
public abstract class MixinEntityRenderer$RenderRainSnow {
|
||||
|
||||
@Redirect(
|
||||
method = "renderRainSnow(F)V",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z",
|
||||
opcode = Opcodes.GETFIELD
|
||||
)
|
||||
)
|
||||
private boolean notFine$bypassWeatherMode(GameSettings settings) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ModifyVariable(
|
||||
method = "renderRainSnow(F)V",
|
||||
at = @At("STORE"),
|
||||
ordinal = 0
|
||||
)
|
||||
private byte notFine$weatherDistance(byte distance) {
|
||||
return SettingsManager.downfallDistance;
|
||||
}
|
||||
}
|
||||
+29
-15
@@ -1,13 +1,17 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine.toggle;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import jss.notfine.core.Settings;
|
||||
import jss.notfine.core.SettingsManager;
|
||||
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
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.ModifyVariable;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(EntityRenderer.class)
|
||||
@@ -22,29 +26,39 @@ abstract public class MixinEntityRenderer {
|
||||
ordinal = 0
|
||||
)
|
||||
)
|
||||
private boolean notFine$toggleWaterDetail(GameSettings settings) {
|
||||
private boolean toggleWaterDetail(GameSettings settings) {
|
||||
return SettingsManager.waterDetail;
|
||||
}
|
||||
|
||||
@Redirect(
|
||||
method = "renderRainSnow(F)V",
|
||||
@WrapOperation(
|
||||
method = "setupFog",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z",
|
||||
opcode = Opcodes.GETFIELD
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/WorldProvider;getWorldHasVoidParticles()Z"
|
||||
)
|
||||
)
|
||||
private boolean notFine$bypassWeatherMode(GameSettings settings) {
|
||||
return false;
|
||||
private boolean angelica$wrapVoidFog(WorldProvider provider, Operation<Boolean> original){
|
||||
return ((boolean)Settings.VOID_FOG.option.getStore()) ? original.call(provider) : false;
|
||||
}
|
||||
|
||||
@ModifyVariable(
|
||||
method = "renderRainSnow(F)V",
|
||||
at = @At("STORE"),
|
||||
ordinal = 0
|
||||
@Redirect(
|
||||
method = "updateRenderer()V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/renderer/EntityRenderer;updateTorchFlicker()V"
|
||||
)
|
||||
)
|
||||
private byte notFine$weatherDistance(byte distance) {
|
||||
return SettingsManager.downfallDistance;
|
||||
private void toggleTorchFlicker(EntityRenderer instance) {
|
||||
if((boolean)Settings.MODE_LIGHT_FLICKER.option.getStore()) {
|
||||
updateTorchFlicker();
|
||||
} else {
|
||||
lightmapUpdateNeeded = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Shadow
|
||||
abstract void updateTorchFlicker();
|
||||
|
||||
@Shadow private boolean lightmapUpdateNeeded;
|
||||
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine_mcpf_compat;
|
||||
|
||||
import com.prupe.mcpatcher.cit.CITUtils;
|
||||
import jss.notfine.core.Settings;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(ItemRenderer.class)
|
||||
public class MixinItemRenderer {
|
||||
|
||||
@Redirect(
|
||||
method = "renderItem(Lnet/minecraft/entity/EntityLivingBase;Lnet/minecraft/item/ItemStack;ILnet/minecraftforge/client/IItemRenderer$ItemRenderType;)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/item/ItemStack;hasEffect(I)Z"
|
||||
),
|
||||
remap = false
|
||||
)
|
||||
private boolean notFine$toggleGlint(ItemStack stack, int pass) {
|
||||
return (boolean) Settings.MODE_GLINT_WORLD.option.getStore() && stack.hasEffect(pass) && !CITUtils.renderEnchantmentHeld(stack, pass);
|
||||
}
|
||||
}
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.notfine_mcpf_compat;
|
||||
|
||||
import com.prupe.mcpatcher.cit.CITUtils;
|
||||
import jss.notfine.core.Settings;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(RenderItem.class)
|
||||
public class MixinRenderItem {
|
||||
|
||||
@Redirect(
|
||||
method = "renderDroppedItem(Lnet/minecraft/entity/item/EntityItem;Lnet/minecraft/util/IIcon;IFFFFI)V",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/item/ItemStack;hasEffect(I)Z"
|
||||
),
|
||||
remap = false
|
||||
)
|
||||
private boolean notFine$toggleGlint(ItemStack stack, int pass) {
|
||||
return stack.hasEffect(pass) && !CITUtils.renderEnchantmentDropped(stack) && (boolean) Settings.MODE_GLINT_WORLD.option.getStore();
|
||||
}
|
||||
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
/**
|
||||
* Dynamic surroundings overwrites the method resulting in a clash
|
||||
*/
|
||||
@Mixin(EntityRenderer.class)
|
||||
public abstract class MixinEntityRenderer$WeatherQuality {
|
||||
|
||||
@Redirect(method = "renderRainSnow(F)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z", opcode = Opcodes.GETFIELD))
|
||||
protected boolean redirectGetFancyWeather(GameSettings settings) {
|
||||
return SodiumClientMod.options().quality.weatherQuality.isFancy();
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import net.minecraftforge.client.GuiIngameForge;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(GuiIngameForge.class)
|
||||
public class MixinGuiIngameForge {
|
||||
|
||||
@Redirect(method = "renderGameOverlay(FZII)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;isFancyGraphicsEnabled()Z"))
|
||||
private boolean checkVignette(float idk) {
|
||||
return SodiumClientMod.options().quality.enableVignette.isFancy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,11 +25,6 @@ public class MixinMinecraft {
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method="runGameLoop", at=@At(value="FIELD", target="Lnet/minecraft/client/renderer/WorldRenderer;chunksUpdated:I", ordinal=0))
|
||||
private int sodium$chunksUpdated() {
|
||||
return ((IRenderGlobalExt)this.renderGlobal).getChunksSubmitted();
|
||||
}
|
||||
|
||||
@Redirect(method = "runGameLoop", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z"))
|
||||
private boolean sodium$overrideFancyGrass(GameSettings gameSettings) {
|
||||
return SodiumClientMod.options().quality.grassQuality.isFancy();
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
import net.minecraft.server.management.PlayerManager;
|
||||
|
||||
@Mixin(PlayerManager.class)
|
||||
public class MixinPlayerManager {
|
||||
|
||||
@ModifyArgs(method = "func_152622_a(I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MathHelper;clamp_int(III)I"))
|
||||
public void clamp_int(Args args) {
|
||||
args.set(2, 32);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.sodium;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import org.spongepowered.asm.lib.Opcodes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(Render.class)
|
||||
public class MixinRender {
|
||||
|
||||
@Redirect(method = "doRenderShadowAndFire", at = @At(value = "FIELD", target = "Lnet/minecraft/client/settings/GameSettings;fancyGraphics:Z", opcode = Opcodes.GETFIELD, ordinal = 0))
|
||||
private boolean redirectGetFancyShadows(GameSettings settings) {
|
||||
return SodiumClientMod.options().quality.entityShadows.isFancy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,11 +60,6 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
this.renderer.scheduleTerrainUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChunksSubmitted() {
|
||||
return this.renderer.getChunksSubmitted();
|
||||
}
|
||||
|
||||
@Inject(method="<init>", at=@At("RETURN"))
|
||||
private void sodium$initRenderer(Minecraft mc, CallbackInfo ci) {
|
||||
this.renderer = SodiumWorldRenderer.create(mc);
|
||||
|
||||
@@ -2,6 +2,5 @@ package com.gtnewhorizons.angelica.mixins.interfaces;
|
||||
|
||||
public interface IRenderGlobalExt {
|
||||
void scheduleTerrainUpdate();
|
||||
int getChunksSubmitted();
|
||||
|
||||
}
|
||||
@@ -7,4 +7,5 @@ import java.util.Set;
|
||||
public interface ITexturesCache {
|
||||
|
||||
Set<IIcon> getRenderedTextures();
|
||||
void enableTextureTracking();
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package com.gtnewhorizons.angelica.mixins.late.client.extrautils;
|
||||
|
||||
import com.rwtema.extrautils.block.IconConnectedTexture;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
@Mixin(IconConnectedTexture.class)
|
||||
public class MixinIconConnectedTexture {
|
||||
|
||||
@Final
|
||||
@Shadow(remap = false)
|
||||
public IIcon[] icons;
|
||||
|
||||
@Unique
|
||||
private ThreadLocal<Integer> newN = ThreadLocal.withInitial(() -> 0);
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void setType(int i) {
|
||||
this.newN.set(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@Overwrite
|
||||
public float getMinU() {
|
||||
return this.icons[newN.get()].getMinU();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@Overwrite
|
||||
public float getMaxU() {
|
||||
return this.icons[newN.get()].getMaxU();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@Overwrite
|
||||
public float getMinV() {
|
||||
return this.icons[newN.get()].getMinV();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@Overwrite
|
||||
public float getMaxV() {
|
||||
return this.icons[newN.get()].getMaxV();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@Overwrite
|
||||
public String getIconName() {
|
||||
return this.icons[newN.get()].getIconName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Overwrite
|
||||
public int getIconWidth() {
|
||||
return this.icons[newN.get()].getIconWidth();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Supper thread-safety for connected textures
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Overwrite
|
||||
public int getIconHeight() {
|
||||
return this.icons[newN.get()].getIconHeight();
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.gtnewhorizons.angelica.mixins.late.client.extrautils;
|
||||
|
||||
import com.rwtema.extrautils.block.render.FakeRenderBlocks;
|
||||
import com.rwtema.extrautils.block.render.RenderBlockConnectedTextures;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
@Mixin(RenderBlockConnectedTextures.class)
|
||||
public class MixinRenderBlockConnectedTextures {
|
||||
|
||||
@Unique
|
||||
private FakeRenderBlocks newFakeRender = new FakeRenderBlocks();
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Thread safety compat (don't use static FakeRenderBlocks anymore)
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public FakeRenderBlocks getFakeRender() {
|
||||
return newFakeRender;
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.gtnewhorizons.angelica.mixins.late.client.extrautils;
|
||||
|
||||
import com.rwtema.extrautils.block.render.FakeRenderBlocks;
|
||||
import com.rwtema.extrautils.block.render.FakeRenderEtherealBlocks;
|
||||
import com.rwtema.extrautils.block.render.RenderBlockConnectedTextures;
|
||||
import com.rwtema.extrautils.block.render.RenderBlockConnectedTexturesEthereal;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
|
||||
@Mixin(RenderBlockConnectedTexturesEthereal.class)
|
||||
public abstract class MixinRenderBlockConnectedTexturesEthereal extends RenderBlockConnectedTextures{
|
||||
|
||||
@Unique
|
||||
private FakeRenderEtherealBlocks newFakeRenderEthereal = new FakeRenderEtherealBlocks();
|
||||
|
||||
/**
|
||||
* @author Cleptomania
|
||||
* @reason Thread safety fixes for ethereal connected textures. The way the subclassing
|
||||
* works for this system means overwriting this function to use our new non-static
|
||||
* FakeRenderEtherealBlocks field is about the only way to do it.
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
if (renderer.hasOverrideBlockTexture())
|
||||
return renderer.renderStandardBlock(block, x, y, z);
|
||||
getFakeRender().setWorld(renderer.blockAccess);
|
||||
getFakeRender().curBlock = world.getBlock(x, y, z);
|
||||
getFakeRender().curMeta = world.getBlockMetadata(x, y, z);
|
||||
block.setBlockBoundsBasedOnState(getFakeRender().blockAccess, x, y, z);
|
||||
getFakeRender().setRenderBoundsFromBlock(block);
|
||||
boolean render = getFakeRender().renderStandardBlock(block, x, y, z);
|
||||
newFakeRenderEthereal.setWorld(renderer.blockAccess);
|
||||
newFakeRenderEthereal.curBlock = fakeRender.curBlock;
|
||||
newFakeRenderEthereal.curMeta = fakeRender.curMeta;
|
||||
double h = 0.05D;
|
||||
newFakeRenderEthereal.setRenderBounds(h, h, h, 1.0D - h, 1.0D - h, 1.0D - h);
|
||||
render &= newFakeRenderEthereal.renderStandardBlock(block, x, y, z);
|
||||
return render;
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.gtnewhorizons.angelica.mixins.late.notfine.faceculling.thaumcraft;
|
||||
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import thaumcraft.common.blocks.BlockStoneDevice;
|
||||
|
||||
@Mixin(value = BlockStoneDevice.class)
|
||||
public abstract class MixinBlockStoneDevice implements IFaceObstructionCheckHelper {
|
||||
|
||||
@Override
|
||||
public boolean isFaceNonObstructing(IBlockAccess worldIn, int x, int y, int z, int side, double otherMinX, double otherMinY, double otherMinZ, double otherMaxX, double otherMaxY, double otherMaxZ) {
|
||||
return switch (worldIn.getBlockMetadata(x, y, z)) {
|
||||
case 0, 12 -> false;
|
||||
case 1, 5, 9, 10, 14 -> side != 1;
|
||||
case 11 -> side != 0;
|
||||
case 13 -> side > 1;
|
||||
default -> true;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.gtnewhorizons.angelica.mixins.late.notfine.faceculling.thaumcraft;
|
||||
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import thaumcraft.common.blocks.BlockTable;
|
||||
|
||||
@Mixin(value = BlockTable.class)
|
||||
public abstract class MixinBlockTable implements IFaceObstructionCheckHelper {
|
||||
|
||||
@Override
|
||||
public boolean isFaceNonObstructing(IBlockAccess worldIn, int x, int y, int z, int side, double otherMinX, double otherMinY, double otherMinZ, double otherMaxX, double otherMaxY, double otherMaxZ) {
|
||||
switch(side) {
|
||||
case 0: return false;
|
||||
case 1: {
|
||||
return worldIn.getBlockMetadata(x, y, z) < 14;
|
||||
}
|
||||
default: {
|
||||
float lowerBound = 0.25f;
|
||||
if(worldIn.getBlockMetadata(x, y, z) >= 14) {
|
||||
lowerBound = 0.5f;
|
||||
if(otherMaxY <= 0.25f) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return otherMinY < lowerBound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.gtnewhorizons.angelica.mixins.late.notfine.faceculling.thaumcraft;
|
||||
|
||||
import jss.notfine.util.IFaceObstructionCheckHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import thaumcraft.common.blocks.BlockWoodenDevice;
|
||||
|
||||
@Mixin(value = BlockWoodenDevice.class)
|
||||
public abstract class MixinBlockWoodenDevice implements IFaceObstructionCheckHelper {
|
||||
|
||||
@Override
|
||||
public boolean isFaceNonObstructing(IBlockAccess worldIn, int x, int y, int z, int side, double otherMinX, double otherMinY, double otherMinZ, double otherMaxX, double otherMaxY, double otherMaxZ) {
|
||||
return switch (worldIn.getBlockMetadata(x, y, z)) {
|
||||
case 1 -> side != 1;
|
||||
case 4 -> side > 1;
|
||||
case 6, 7 -> false;
|
||||
default -> true;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,13 +78,15 @@ public class ClientProxy extends CommonProxy {
|
||||
LOGGER.info("World loaded - Enabling GLSM Cache");
|
||||
}
|
||||
|
||||
// Register all blocks. Because blockids are unique to a world, this must be done each load
|
||||
GameData.getBlockRegistry().forEach(o -> {
|
||||
|
||||
final Block b = (Block) o;
|
||||
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, true, true);
|
||||
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, false, true);
|
||||
});
|
||||
if(AngelicaConfig.enableSodium) {
|
||||
// Register all blocks. Because blockids are unique to a world, this must be done each load
|
||||
GameData.getBlockRegistry().forEach(o -> {
|
||||
|
||||
final Block b = (Block) o;
|
||||
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, true, true);
|
||||
AngelicaBlockSafetyRegistry.canBlockRenderOffThread(b, false, true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,9 +212,9 @@ public class ClientProxy extends CommonProxy {
|
||||
event.left.set(i + 4, String.format("lc: %d b: %s bl: %d sl: %d rl: %d",
|
||||
chunk.getTopFilledSegment() + 15,
|
||||
chunk.getBiomeGenForWorldCoords(bX & 15, bZ & 15, mc.theWorld.getWorldChunkManager()).biomeName,
|
||||
chunk.getSavedLightValue(EnumSkyBlock.Block, bX & 15, bY, bZ & 15),
|
||||
chunk.getSavedLightValue(EnumSkyBlock.Sky, bX & 15, bY, bZ & 15),
|
||||
chunk.getBlockLightValue(bX & 15, bY, bZ & 15, 0)));
|
||||
chunk.getSavedLightValue(EnumSkyBlock.Block, bX & 15, MathHelper.clamp_int(bY, 0, 255), bZ & 15),
|
||||
chunk.getSavedLightValue(EnumSkyBlock.Sky, bX & 15, MathHelper.clamp_int(bY, 0, 255), bZ & 15),
|
||||
chunk.getBlockLightValue(bX & 15, MathHelper.clamp_int(bY, 0, 255), bZ & 15, 0)));
|
||||
}
|
||||
}
|
||||
event.setCanceled(true);
|
||||
@@ -276,7 +278,8 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
// This is a bit of a hack to prevent the FOV from being modified by other mods
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onFOVModifierUpdate(FOVUpdateEvent event) {
|
||||
if (!(boolean)Settings.DYNAMIC_FOV.option.getStore()){
|
||||
event.newfov = 1.0F;
|
||||
|
||||
@@ -28,6 +28,8 @@ import com.gtnewhorizons.angelica.compat.mojang.VertexFormat;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.glsm.TessellatorManager;
|
||||
import com.gtnewhorizons.angelica.glsm.VBOManager;
|
||||
import jss.notfine.core.Settings;
|
||||
import jss.notfine.gui.options.named.GraphicsQualityOff;
|
||||
import me.jellysquid.mods.sodium.client.SodiumClientMod;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
@@ -92,7 +94,8 @@ public class CloudRenderer implements IResourceManagerReloadListener {
|
||||
}
|
||||
|
||||
private void vertices(CapturingTessellator tessellator) {
|
||||
boolean fancy = SodiumClientMod.options().quality.cloudQuality.isFancy();
|
||||
GraphicsQualityOff cloudGraphicsQuality = (GraphicsQualityOff)Settings.MODE_CLOUDS.option.getStore();
|
||||
boolean fancy = cloudGraphicsQuality == GraphicsQualityOff.FANCY || cloudGraphicsQuality == GraphicsQualityOff.DEFAULT && mc.gameSettings.fancyGraphics;
|
||||
|
||||
float scale = getScale();
|
||||
float CULL_DIST = 2 * scale;
|
||||
@@ -235,7 +238,9 @@ public class CloudRenderer implements IResourceManagerReloadListener {
|
||||
}
|
||||
|
||||
public void checkSettings() {
|
||||
final int cloudQualitySetting = SodiumClientMod.options().quality.cloudQuality.isFancy() ? 2 : 1;
|
||||
GraphicsQualityOff cloudGraphicsQuality = (GraphicsQualityOff)Settings.MODE_CLOUDS.option.getStore();
|
||||
final int cloudQualitySetting = cloudGraphicsQuality == GraphicsQualityOff.FANCY
|
||||
|| cloudGraphicsQuality == GraphicsQualityOff.DEFAULT && mc.gameSettings.fancyGraphics ? 2 : 1;
|
||||
boolean newEnabled = mc.gameSettings.shouldRenderClouds()
|
||||
&& mc.theWorld != null
|
||||
&& mc.theWorld.provider.isSurfaceWorld();
|
||||
|
||||
@@ -37,7 +37,9 @@ public class AngelicaBlockSafetyRegistry {
|
||||
&& (isbrh.getClass().isAnnotationPresent(ThreadSafeISBRH.class)
|
||||
|| isbrh instanceof ThreadSafeISBRHFactory);
|
||||
} else {
|
||||
canBeOffThread = !(block.getClass().getName().startsWith("gregtech.")) && !(block.getClass().getName().startsWith("com.github.bartimaeusnek."));
|
||||
// Check blacklist here
|
||||
// !(block.getClass().getName().startsWith("com.github.bartimaeusnek."));
|
||||
canBeOffThread = true;
|
||||
}
|
||||
|
||||
final long stamp = LOCK.writeLock();
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.gtnewhorizons.angelica.transform.compat;
|
||||
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import cpw.mods.fml.relauncher.FMLLaunchHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum CompatASMTransformers {
|
||||
|
||||
EXTRA_UTILITIES_ISBRH("RenderBlockColor Transformer", () -> AngelicaConfig.fixExtraUtilsSodiumCompat, Side.CLIENT,
|
||||
"com.gtnewhorizons.angelica.transform.compat.ExtraUtilsTransformer"
|
||||
);
|
||||
|
||||
private final Supplier<Boolean> applyIf;
|
||||
private final Side side;
|
||||
private final String[] transformerClasses;
|
||||
|
||||
CompatASMTransformers(String description, Supplier<Boolean> applyIf, Side side, String... transformers) {
|
||||
this.applyIf = applyIf;
|
||||
this.side = side;
|
||||
this.transformerClasses = transformers;
|
||||
}
|
||||
|
||||
private boolean shouldBeLoaded() { return applyIf.get() && shouldLoadSide(); }
|
||||
|
||||
private boolean shouldLoadSide() {
|
||||
return side == Side.BOTH || (side == Side.SERVER && FMLLaunchHandler.side()
|
||||
.isServer())
|
||||
|| (side == Side.CLIENT && FMLLaunchHandler.side()
|
||||
.isClient());
|
||||
}
|
||||
|
||||
public static List<String> getTransformers() {
|
||||
final List<String> list = new ArrayList<>();
|
||||
for (CompatASMTransformers transformer : values()) {
|
||||
if (transformer.shouldBeLoaded()) {
|
||||
AngelicaTweaker.LOGGER.info("Loading transformer {}", (Object[]) transformer.transformerClasses);
|
||||
list.addAll(Arrays.asList(transformer.transformerClasses));
|
||||
} else {
|
||||
AngelicaTweaker.LOGGER.info("Not loading transformer {}", (Object[]) transformer.transformerClasses);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private enum Side {
|
||||
BOTH,
|
||||
CLIENT,
|
||||
SERVER
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.gtnewhorizons.angelica.transform.compat;
|
||||
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
|
||||
import com.gtnewhorizons.angelica.transform.ClassConstantPoolParser;
|
||||
import net.minecraft.launchwrapper.IClassTransformer;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.tree.AnnotationNode;
|
||||
import org.objectweb.asm.tree.ClassNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ExtraUtilsTransformer implements IClassTransformer {
|
||||
|
||||
private static final String RenderBlockColor = "com.rwtema.extrautils.block.render.RenderBlockColor";
|
||||
private static final String RenderBlockConnectedTextures = "com.rwtema.extrautils.block.render.RenderBlockConnectedTextures";
|
||||
private static final String RenderBlockConnectedTexturesEthereal = "com.rwtema.extrautils.block.render.RenderBlockConnectedTexturesEthereal";
|
||||
private static final String RenderBlockFullBright = "com.rwtema.extrautils.block.render.RenderBlockFullBright";
|
||||
private static final String RenderBlockSpike = "com.rwtema.extrautils.block.render.RenderBlockSpike";
|
||||
|
||||
private static final List<String> transformedClasses = Arrays.asList(RenderBlockColor, RenderBlockConnectedTextures, RenderBlockConnectedTexturesEthereal, RenderBlockFullBright, RenderBlockSpike);
|
||||
|
||||
private static final Map<String, Boolean> perThreadMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
perThreadMap.put(RenderBlockColor, false);
|
||||
perThreadMap.put(RenderBlockConnectedTextures, true);
|
||||
perThreadMap.put(RenderBlockConnectedTexturesEthereal, true);
|
||||
perThreadMap.put(RenderBlockFullBright, false);
|
||||
perThreadMap.put(RenderBlockSpike, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] transform(final String className, String transformedName, byte[] basicClass) {
|
||||
if (basicClass == null) return null;
|
||||
|
||||
if (!transformedClasses.contains(transformedName)) {
|
||||
return basicClass;
|
||||
}
|
||||
|
||||
AngelicaTweaker.LOGGER.info("Adding ThreadSafeISBRH for Extra Utilities to: {}", transformedName);
|
||||
|
||||
final ClassReader cr = new ClassReader(basicClass);
|
||||
final ClassNode cn = new ClassNode();
|
||||
cr.accept(cn, 0);
|
||||
|
||||
addThreadSafeISBRHAnnotation(transformedName, cn);
|
||||
|
||||
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
|
||||
cn.accept(cw);
|
||||
return cw.toByteArray();
|
||||
}
|
||||
|
||||
public void addThreadSafeISBRHAnnotation(String transformedName, ClassNode cn) {
|
||||
|
||||
AnnotationNode isbrhAnnotation = new AnnotationNode("Lcom/gtnewhorizons/angelica/api/ThreadSafeISBRH;");
|
||||
|
||||
Boolean perThread = perThreadMap.get(transformedName);
|
||||
if (perThread == null) {
|
||||
perThread = false;
|
||||
AngelicaTweaker.LOGGER.info("Tried to add ThreadSafeISBRH annotation to {} which is missing from perThreadMap. Using false for perThread.", transformedName);
|
||||
}
|
||||
isbrhAnnotation.values = Arrays.asList("perThread", perThread);
|
||||
|
||||
if (cn.visibleAnnotations == null) {
|
||||
cn.visibleAnnotations = new ArrayList<>();
|
||||
}
|
||||
cn.visibleAnnotations.add(isbrhAnnotation);
|
||||
}
|
||||
}
|
||||
@@ -21,10 +21,10 @@ public class AnimationsRenderUtils {
|
||||
if (textureAtlasSprite != null && textureAtlasSprite.hasAnimationMetadata()) {
|
||||
// null if called by anything but chunk render cache update (for example to get blocks rendered as items in
|
||||
// inventory)
|
||||
if (blockAccess instanceof ITexturesCache) {
|
||||
((ITexturesCache) blockAccess).getRenderedTextures().add(textureAtlasSprite);
|
||||
} else {
|
||||
((IPatchedTextureAtlasSprite) textureAtlasSprite).markNeedsAnimationUpdate();
|
||||
if (blockAccess instanceof ITexturesCache texturesCache) {
|
||||
texturesCache.getRenderedTextures().add(textureAtlasSprite);
|
||||
} else if(textureAtlasSprite instanceof IPatchedTextureAtlasSprite patchedSprite){
|
||||
patchedSprite.markNeedsAnimationUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class MCLogger {
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Properties;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -27,7 +28,7 @@ import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
import com.prupe.mcpatcher.mal.resource.ResourceList;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class ColorizeBlock {
|
||||
|
||||
@@ -136,8 +137,8 @@ public class ColorizeBlock {
|
||||
}
|
||||
|
||||
static void reset() {
|
||||
waterBlock = BlockAPI.getFixedBlock("minecraft:flowing_water");
|
||||
staticWaterBlock = BlockAPI.getFixedBlock("minecraft:water");
|
||||
waterBlock = Blocks.flowing_water;
|
||||
staticWaterBlock = Blocks.water;
|
||||
|
||||
blockColorMaps.clear();
|
||||
waterColorMap = null;
|
||||
@@ -193,10 +194,6 @@ public class ColorizeBlock {
|
||||
|
||||
private static void reloadWaterColors(PropertiesFile properties) {
|
||||
waterColorMap = registerColorMap(WATERCOLOR, "minecraft:flowing_water minecraft:water");
|
||||
if (waterColorMap == null) {
|
||||
waterColorMap = new ColorMap.Water();
|
||||
registerColorMap(waterColorMap, null, "minecraft:flowing_water minecraft:water");
|
||||
}
|
||||
}
|
||||
|
||||
private static void reloadSwampColors(PropertiesFile properties) {
|
||||
@@ -333,11 +330,11 @@ public class ColorizeBlock {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static IColorMap findColorMap(Block block, IBlockAccess blockAccess, int i, int j, int k) {
|
||||
private static IColorMap findColorMap(Block block, IBlockAccess blockAccess, int x, int y, int z) {
|
||||
List<BlockStateMatcher> maps = findColorMaps(block);
|
||||
if (maps != null) {
|
||||
for (BlockStateMatcher matcher : maps) {
|
||||
if (matcher.match(blockAccess, i, j, k)) {
|
||||
if (matcher.match(blockAccess, x, y, z)) {
|
||||
return getThreadLocal(matcher);
|
||||
}
|
||||
}
|
||||
@@ -361,17 +358,17 @@ public class ColorizeBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean colorizeBlock(Block block, IBlockAccess blockAccess, int i, int j, int k) {
|
||||
IColorMap colorMap = findColorMap(block, blockAccess, i, j, k);
|
||||
return colorizeBlock(block, blockAccess, colorMap, i, j, k);
|
||||
public static boolean colorizeBlock(Block block, IBlockAccess blockAccess, int x, int y, int z) {
|
||||
IColorMap colorMap = findColorMap(block, blockAccess, x, y, z);
|
||||
return colorizeBlock(block, blockAccess, colorMap, x, y, z);
|
||||
}
|
||||
|
||||
private static boolean colorizeBlock(Block block, IBlockAccess blockAccess, IColorMap colorMap, int i, int j,
|
||||
int k) {
|
||||
private static boolean colorizeBlock(Block block, IBlockAccess blockAccess, IColorMap colorMap, int x, int y,
|
||||
int z) {
|
||||
if (colorMap == null) {
|
||||
return false;
|
||||
} else {
|
||||
blockColor = colorMap.getColorMultiplier(blockAccess, i, j, k);
|
||||
blockColor = colorMap.getColorMultiplier(blockAccess, x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -382,11 +379,11 @@ public class ColorizeBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean computeWaterColor(boolean includeBaseColor, int i, int j, int k) {
|
||||
public static boolean computeWaterColor(boolean includeBaseColor, int x, int y, int z) {
|
||||
if (waterColorMap == null) {
|
||||
return false;
|
||||
} else {
|
||||
Colorizer.setColorF(waterColorMap.getColorMultiplierF(BiomeAPI.getWorld(), i, j, k));
|
||||
Colorizer.setColorF(waterColorMap.getColorMultiplierF(BiomeAPI.getWorld(), x, y, z));
|
||||
if (includeBaseColor) {
|
||||
Colorizer.setColor[0] *= ColorizeEntity.waterBaseColor[0];
|
||||
Colorizer.setColor[1] *= ColorizeEntity.waterBaseColor[1];
|
||||
@@ -418,46 +415,46 @@ public class ColorizeBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public static int colorizeRedstoneWire(IBlockAccess blockAccess, int i, int j, int k, int defaultColor) {
|
||||
public static int colorizeRedstoneWire(IBlockAccess blockAccess, int x, int y, int z, int defaultColor) {
|
||||
if (redstoneColor == null) {
|
||||
return defaultColor;
|
||||
} else {
|
||||
int metadata = Math.max(Math.min(BlockAPI.getMetadataAt(blockAccess, i, j, k), 15), 0);
|
||||
int metadata = Math.max(Math.min(blockAccess.getBlockMetadata(x, y, z), 15), 0);
|
||||
return ColorUtils.float3ToInt(redstoneColor[metadata]);
|
||||
}
|
||||
}
|
||||
|
||||
private static float[] getVertexColor(IBlockAccess blockAccess, IColorMap colorMap, int i, int j, int k,
|
||||
private static float[] getVertexColor(IBlockAccess blockAccess, IColorMap colorMap, int x, int y, int z,
|
||||
int[] offsets) {
|
||||
if (enableTestColorSmoothing) {
|
||||
int rgb = 0;
|
||||
if ((i + offsets[0]) % 2 == 0) {
|
||||
if ((x + offsets[0]) % 2 == 0) {
|
||||
rgb |= 0xff0000;
|
||||
}
|
||||
if ((j + offsets[1]) % 2 == 0) {
|
||||
if ((y + offsets[1]) % 2 == 0) {
|
||||
rgb |= 0x00ff00;
|
||||
}
|
||||
if ((k + offsets[2]) % 2 == 0) {
|
||||
if ((z + offsets[2]) % 2 == 0) {
|
||||
rgb |= 0x0000ff;
|
||||
}
|
||||
ColorUtils.intToFloat3(rgb, Colorizer.setColor);
|
||||
return Colorizer.setColor;
|
||||
} else {
|
||||
return colorMap.getColorMultiplierF(blockAccess, i + offsets[0], j + offsets[1], k + offsets[2]);
|
||||
return colorMap.getColorMultiplierF(blockAccess, x + offsets[0], y + offsets[1], z + offsets[2]);
|
||||
}
|
||||
}
|
||||
|
||||
// Called by asm
|
||||
@SuppressWarnings("unused")
|
||||
public static boolean setupBlockSmoothing(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess, int i,
|
||||
int j, int k, int face, float topLeft, float bottomLeft, float bottomRight, float topRight) {
|
||||
public static boolean setupBlockSmoothing(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess, int x,
|
||||
int y, int z, int face, float topLeft, float bottomLeft, float bottomRight, float topRight) {
|
||||
return RenderBlocksUtils.useColorMultiplier(face) && setupBiomeSmoothing(
|
||||
renderBlocks,
|
||||
block,
|
||||
blockAccess,
|
||||
i,
|
||||
j,
|
||||
k,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
face,
|
||||
true,
|
||||
topLeft,
|
||||
@@ -469,14 +466,14 @@ public class ColorizeBlock {
|
||||
// TODO: remove
|
||||
@Deprecated
|
||||
public static boolean setupBlockSmoothingGrassSide(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess,
|
||||
int i, int j, int k, int face, float topLeft, float bottomLeft, float bottomRight, float topRight) {
|
||||
int x, int y, int z, int face, float topLeft, float bottomLeft, float bottomRight, float topRight) {
|
||||
return checkBiomeSmoothing(block, face) && setupBiomeSmoothing(
|
||||
renderBlocks,
|
||||
block,
|
||||
blockAccess,
|
||||
i,
|
||||
j,
|
||||
k,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
face,
|
||||
true,
|
||||
topLeft,
|
||||
@@ -485,21 +482,21 @@ public class ColorizeBlock {
|
||||
topRight);
|
||||
}
|
||||
|
||||
public static boolean setupBlockSmoothing(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess, int i,
|
||||
int j, int k, int face) {
|
||||
public static boolean setupBlockSmoothing(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess, int x,
|
||||
int y, int z, int face) {
|
||||
return checkBiomeSmoothing(block, face)
|
||||
&& setupBiomeSmoothing(renderBlocks, block, blockAccess, i, j, k, face, true, 1.0f, 1.0f, 1.0f, 1.0f);
|
||||
&& setupBiomeSmoothing(renderBlocks, block, blockAccess, x, y, z, face, true, 1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
private static boolean checkBiomeSmoothing(Block block, int face) {
|
||||
return enableSmoothBiomes && face >= 0
|
||||
&& RenderBlocksUtils.isAmbientOcclusionEnabled()
|
||||
&& BlockAPI.getBlockLightValue(block) == 0;
|
||||
&& block.getLightValue() == 0;
|
||||
}
|
||||
|
||||
private static boolean setupBiomeSmoothing(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess, int i,
|
||||
int j, int k, int face, boolean useAO, float topLeft, float bottomLeft, float bottomRight, float topRight) {
|
||||
if (!setupBlockSmoothing(block, blockAccess, i, j, k, face)) {
|
||||
private static boolean setupBiomeSmoothing(RenderBlocks renderBlocks, Block block, IBlockAccess blockAccess, int x,
|
||||
int y, int z, int face, boolean useAO, float topLeft, float bottomLeft, float bottomRight, float topRight) {
|
||||
if (!setupBlockSmoothing(block, blockAccess, x, y, z, face)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -530,18 +527,18 @@ public class ColorizeBlock {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void setupBlockSmoothing(Block block, IBlockAccess blockAccess, int i, int j, int k, int face,
|
||||
public static void setupBlockSmoothing(Block block, IBlockAccess blockAccess, int x, int y, int z, int face,
|
||||
float r, float g, float b) {
|
||||
if (!setupBlockSmoothing(block, blockAccess, i, j, k, face)) {
|
||||
if (!setupBlockSmoothing(block, blockAccess, x, y, z, face)) {
|
||||
setVertexColors(r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean setupBlockSmoothing(Block block, IBlockAccess blockAccess, int i, int j, int k, int face) {
|
||||
private static boolean setupBlockSmoothing(Block block, IBlockAccess blockAccess, int x, int y, int z, int face) {
|
||||
if (!checkBiomeSmoothing(block, face)) {
|
||||
return false;
|
||||
}
|
||||
IColorMap colorMap = findColorMap(block, blockAccess, i, j, k);
|
||||
IColorMap colorMap = findColorMap(block, blockAccess, x, y, z);
|
||||
if (colorMap == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -549,22 +546,22 @@ public class ColorizeBlock {
|
||||
int[][] offsets = FACE_VERTICES[face];
|
||||
float[] color;
|
||||
|
||||
color = getVertexColor(blockAccess, colorMap, i, j, k, offsets[0]);
|
||||
color = getVertexColor(blockAccess, colorMap, x, y, z, offsets[0]);
|
||||
colorRedTopLeft = color[0];
|
||||
colorGreenTopLeft = color[1];
|
||||
colorBlueTopLeft = color[2];
|
||||
|
||||
color = getVertexColor(blockAccess, colorMap, i, j, k, offsets[1]);
|
||||
color = getVertexColor(blockAccess, colorMap, x, y, z, offsets[1]);
|
||||
colorRedBottomLeft = color[0];
|
||||
colorGreenBottomLeft = color[1];
|
||||
colorBlueBottomLeft = color[2];
|
||||
|
||||
color = getVertexColor(blockAccess, colorMap, i, j, k, offsets[2]);
|
||||
color = getVertexColor(blockAccess, colorMap, x, y, z, offsets[2]);
|
||||
colorRedBottomRight = color[0];
|
||||
colorGreenBottomRight = color[1];
|
||||
colorBlueBottomRight = color[2];
|
||||
|
||||
color = getVertexColor(blockAccess, colorMap, i, j, k, offsets[3]);
|
||||
color = getVertexColor(blockAccess, colorMap, x, y, z, offsets[3]);
|
||||
colorRedTopRight = color[0];
|
||||
colorGreenTopRight = color[1];
|
||||
colorBlueTopRight = color[2];
|
||||
|
||||
@@ -12,8 +12,8 @@ import net.minecraft.potion.PotionHelper;
|
||||
import com.prupe.mcpatcher.MCLogger;
|
||||
import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.MapColorExpansion;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.PotionExpansion;
|
||||
import jss.notfine.util.MapColorExpansion;
|
||||
import jss.notfine.util.PotionExpansion;
|
||||
|
||||
public class ColorizeItem {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.prupe.mcpatcher.mal.biome.IColorMap;
|
||||
import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class ColorizeWorld {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackChangeHandler;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class Colorizer {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.prupe.mcpatcher.MCLogger;
|
||||
import com.prupe.mcpatcher.mal.biome.ColorUtils;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public final class Lightmap {
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackChangeHandler;
|
||||
import com.prupe.mcpatcher.mal.tile.TileLoader;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.NBTTagListExpansion;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.util.NBTTagListExpansion;
|
||||
|
||||
public class CITUtils {
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.prupe.mcpatcher.mal.block.BlockAPI;
|
||||
import com.prupe.mcpatcher.mal.block.BlockStateMatcher;
|
||||
|
||||
final class BlockOrientation extends RenderBlockState {
|
||||
@@ -116,77 +115,57 @@ final class BlockOrientation extends RenderBlockState {
|
||||
haveOffsets = false;
|
||||
di = dj = dk = 0;
|
||||
switch (renderType) {
|
||||
case 1: // renderCrossedSquares
|
||||
while (j + dj > 0 && block == BlockAPI.getBlockAt(blockAccess, i, j + dj - 1, k)) {
|
||||
case 1 -> { // renderCrossedSquares
|
||||
while (j + dj > 0 && block == blockAccess.getBlock(i, j + dj - 1, k)) {
|
||||
dj--;
|
||||
haveOffsets = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 7: // renderBlockDoor
|
||||
case 40: // renderBlockDoublePlant
|
||||
if ((metadata & 0x8) != 0 && block == BlockAPI.getBlockAt(blockAccess, i, j - 1, k)) {
|
||||
} // renderBlockDoor
|
||||
case 7, 40 -> { // renderBlockDoublePlant
|
||||
if ((metadata & 0x8) != 0 && block == blockAccess.getBlock(i, j - 1, k)) {
|
||||
dj--;
|
||||
haveOffsets = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 14: // renderBlockBed
|
||||
metadata = BlockAPI.getMetadataAt(blockAccess, i, j, k);
|
||||
}
|
||||
case 14 -> { // renderBlockBed
|
||||
metadata = blockAccess.getBlockMetadata(i, j, k);
|
||||
switch (metadata) {
|
||||
case 0:
|
||||
case 4:
|
||||
dk = 1; // head is one block south
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 5:
|
||||
di = -1; // head is one block west
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 6:
|
||||
dk = -1; // head is one block north
|
||||
break;
|
||||
|
||||
case 3:
|
||||
case 7:
|
||||
di = 1; // head is one block east
|
||||
break;
|
||||
|
||||
default:
|
||||
case 0, 4 -> dk = 1; // head is one block south
|
||||
case 1, 5 -> di = -1; // head is one block west
|
||||
case 2, 6 -> dk = -1; // head is one block north
|
||||
case 3, 7 -> di = 1; // head is one block east
|
||||
default -> {
|
||||
return false; // head itself, no offset
|
||||
}
|
||||
}
|
||||
haveOffsets = block == BlockAPI.getBlockAt(blockAccess, i + di, j, k + dk);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
haveOffsets = block == blockAccess.getBlock(i + di, j, k + dk);
|
||||
}
|
||||
default -> {
|
||||
}
|
||||
}
|
||||
return haveOffsets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConnectByBlock(Block neighbor, int neighborI, int neighborJ, int neighborK) {
|
||||
public boolean shouldConnectByBlock(Block neighbor, int neighborX, int neighborY, int neighborZ) {
|
||||
return block == neighbor
|
||||
&& (metadataBits & (1 << BlockAPI.getMetadataAt(blockAccess, neighborI, neighborJ, neighborK))) != 0;
|
||||
&& (metadataBits & (1 << blockAccess.getBlockMetadata(neighborX, neighborY, neighborZ))) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldConnectByTile(Block neighbor, IIcon origIcon, int neighborI, int neighborJ, int neighborK) {
|
||||
return origIcon
|
||||
== BlockAPI.getBlockIcon(neighbor, blockAccess, neighborI, neighborJ, neighborK, getTextureFaceOrig());
|
||||
public boolean shouldConnectByTile(Block neighbor, IIcon origIcon, int neighborX, int neighborY, int neighborZ) {
|
||||
return origIcon == neighbor.getIcon(blockAccess, neighborX, neighborY, neighborZ, getTextureFaceOrig());
|
||||
}
|
||||
|
||||
void setBlock(Block block, IBlockAccess blockAccess, int i, int j, int k) {
|
||||
void setBlock(Block block, IBlockAccess blockAccess, int x, int y, int z) {
|
||||
this.block = block;
|
||||
this.blockAccess = blockAccess;
|
||||
inWorld = true;
|
||||
this.i = i;
|
||||
this.j = j;
|
||||
this.k = k;
|
||||
this.i = x;
|
||||
this.j = y;
|
||||
this.k = z;
|
||||
renderType = block.getRenderType();
|
||||
metadata = altMetadata = BlockAPI.getMetadataAt(blockAccess, i, j, k);
|
||||
metadata = altMetadata = blockAccess.getBlockMetadata(x, y, z);
|
||||
offsetsComputed = false;
|
||||
}
|
||||
|
||||
@@ -213,85 +192,66 @@ final class BlockOrientation extends RenderBlockState {
|
||||
|
||||
private int getBlockFaceByRenderType(int face) {
|
||||
switch (renderType) {
|
||||
case 1: // renderCrossedSquares
|
||||
case 1 -> { // renderCrossedSquares
|
||||
return NORTH_FACE;
|
||||
|
||||
case 8: // renderBlockLadder
|
||||
}
|
||||
case 8 -> { // renderBlockLadder
|
||||
switch (metadata) {
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 2, 3, 4, 5 -> {
|
||||
return metadata;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 20: // renderBlockVine
|
||||
}
|
||||
case 20 -> { // renderBlockVine
|
||||
switch (metadata) {
|
||||
case 1:
|
||||
case 1 -> {
|
||||
return NORTH_FACE;
|
||||
|
||||
case 2:
|
||||
}
|
||||
case 2 -> {
|
||||
return EAST_FACE;
|
||||
|
||||
case 4:
|
||||
}
|
||||
case 4 -> {
|
||||
return SOUTH_FACE;
|
||||
|
||||
case 8:
|
||||
}
|
||||
case 8 -> {
|
||||
return WEST_FACE;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return face;
|
||||
}
|
||||
|
||||
private int blockFaceToTextureFace(int face) {
|
||||
switch (renderType) {
|
||||
case 31: // renderBlockLog (also applies to hay)
|
||||
case 31 -> { // renderBlockLog (also applies to hay)
|
||||
switch (metadata & 0xc) {
|
||||
case 4: // west-east
|
||||
case 4 -> { // west-east
|
||||
altMetadata &= ~0xc;
|
||||
rotateUV = ROTATE_UV_MAP[0][face + 6];
|
||||
return ROTATE_UV_MAP[0][face];
|
||||
|
||||
case 8: // north-south
|
||||
}
|
||||
case 8 -> { // north-south
|
||||
altMetadata &= ~0xc;
|
||||
rotateUV = ROTATE_UV_MAP[1][face + 6];
|
||||
return ROTATE_UV_MAP[1][face];
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 39: // renderBlockQuartz
|
||||
}
|
||||
case 39 -> { // renderBlockQuartz
|
||||
switch (metadata) {
|
||||
case 3: // north-south
|
||||
case 3 -> { // north-south
|
||||
altMetadata = 2;
|
||||
rotateUV = ROTATE_UV_MAP[2][face + 6];
|
||||
return ROTATE_UV_MAP[2][face];
|
||||
|
||||
case 4: // west-east
|
||||
}
|
||||
case 4 -> { // west-east
|
||||
altMetadata = 2;
|
||||
rotateUV = ROTATE_UV_MAP[3][face + 6];
|
||||
return ROTATE_UV_MAP[3][face];
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return face;
|
||||
}
|
||||
@@ -300,10 +260,4 @@ final class BlockOrientation extends RenderBlockState {
|
||||
return (neighbor + rotateUV) & 7;
|
||||
}
|
||||
|
||||
boolean logIt() {
|
||||
// return i == -31 && j == 72 && (k == 412 || k == 413);
|
||||
// return j == 72 && (metadata == 7 || metadata == 11) && blockFace == 1 &&
|
||||
// BlockAPI.getBlockName(block).equals("minecraft:log");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackChangeHandler;
|
||||
import com.prupe.mcpatcher.mal.tile.TileLoader;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class CTMUtils {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CTMUtils {
|
||||
Class.forName(MCPatcherUtils.RENDER_PASS_CLASS)
|
||||
.getMethod("finish")
|
||||
.invoke(null);
|
||||
} catch (Throwable e) {}
|
||||
} catch (Throwable ignore) {}
|
||||
|
||||
TexturePackChangeHandler.register(new TexturePackChangeHandler(MCPatcherUtils.CONNECTED_TEXTURES, 3) {
|
||||
|
||||
|
||||
@@ -8,9 +8,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.prupe.mcpatcher.mal.block.BlockAPI;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class GlassPaneRenderer {
|
||||
|
||||
@@ -47,14 +45,14 @@ public class GlassPaneRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean setupIcons(RenderBlocks renderBlocks, Block blockPane, IIcon origIcon, int i, int j, int k) {
|
||||
private static boolean setupIcons(RenderBlocks renderBlocks, Block blockPane, IIcon origIcon, int x, int y, int z) {
|
||||
skipPaneRendering = skipBottomEdgeRendering = skipTopEdgeRendering = false;
|
||||
if (!enable) {
|
||||
return false;
|
||||
}
|
||||
for (int face = BlockOrientation.NORTH_FACE; face <= BlockOrientation.EAST_FACE; face++) {
|
||||
icons[face] = CTMUtils
|
||||
.getBlockIcon(origIcon, renderBlocks, blockPane, renderBlocks.blockAccess, i, j, k, face);
|
||||
.getBlockIcon(origIcon, renderBlocks, blockPane, renderBlocks.blockAccess, x, y, z, face);
|
||||
if (icons[face] == null) {
|
||||
skipPaneRendering = false;
|
||||
return false;
|
||||
@@ -65,24 +63,24 @@ public class GlassPaneRenderer {
|
||||
return skipPaneRendering;
|
||||
}
|
||||
|
||||
private static void setupPaneEdges(RenderBlocks renderBlocks, Block blockPane, int i, int j, int k) {
|
||||
private static void setupPaneEdges(RenderBlocks renderBlocks, Block blockPane, int x, int y, int z) {
|
||||
IBlockAccess blockAccess = renderBlocks.blockAccess;
|
||||
int metadata = BlockAPI.getMetadataAt(blockAccess, i, j, k);
|
||||
skipBottomEdgeRendering = BlockAPI.getBlockAt(blockAccess, i, j - 1, k) == blockPane
|
||||
&& BlockAPI.getMetadataAt(blockAccess, i, j - 1, k) == metadata;
|
||||
skipTopEdgeRendering = BlockAPI.getBlockAt(blockAccess, i, j + 1, k) == blockPane
|
||||
&& BlockAPI.getMetadataAt(blockAccess, i, j + 1, k) == metadata;
|
||||
int metadata = blockAccess.getBlockMetadata(x, y, z);
|
||||
skipBottomEdgeRendering = blockAccess.getBlock(x, y - 1, z) == blockPane
|
||||
&& blockAccess.getBlockMetadata(x, y - 1, z) == metadata;
|
||||
skipTopEdgeRendering = blockAccess.getBlock(x, y + 1, z) == blockPane
|
||||
&& blockAccess.getBlockMetadata(x, y + 1, z) == metadata;
|
||||
}
|
||||
|
||||
private static void render(int i, int j, int k, boolean connectNorth, boolean connectSouth, boolean connectWest,
|
||||
private static void render(int x, int y, int z, boolean connectNorth, boolean connectSouth, boolean connectWest,
|
||||
boolean connectEast, double thickness, double uOffset, double yOffset, boolean edges) {
|
||||
final double i0 = i;
|
||||
final double i0 = x;
|
||||
final double i1 = i0 + 0.5 - thickness;
|
||||
final double i2 = i0 + 0.5 + thickness;
|
||||
final double i3 = i0 + 1.0;
|
||||
final double j0 = j + yOffset;
|
||||
final double j1 = j + 1.0 - yOffset;
|
||||
final double k0 = k;
|
||||
final double j0 = y + yOffset;
|
||||
final double j1 = y + 1.0 - yOffset;
|
||||
final double k0 = z;
|
||||
final double k1 = k0 + 0.5 - thickness;
|
||||
final double k2 = k0 + 0.5 + thickness;
|
||||
final double k3 = k0 + 1.0;
|
||||
|
||||
@@ -376,7 +376,7 @@ abstract class TileOverride implements ITileOverride {
|
||||
i += offset[0];
|
||||
j += offset[1];
|
||||
k += offset[2];
|
||||
Block neighbor = BlockAPI.getBlockAt(blockAccess, i, j, k);
|
||||
Block neighbor = blockAccess.getBlock(i, j, k);
|
||||
if (neighbor == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -390,8 +390,7 @@ abstract class TileOverride implements ITileOverride {
|
||||
int blockFace = renderBlockState.getBlockFace();
|
||||
if (blockFace >= 0) {
|
||||
int[] normal = NORMALS[blockFace];
|
||||
if (!BlockAPI.shouldSideBeRendered(
|
||||
neighbor,
|
||||
if (!neighbor.shouldSideBeRendered(
|
||||
blockAccess,
|
||||
i + normal[0],
|
||||
j + normal[1],
|
||||
@@ -417,34 +416,34 @@ abstract class TileOverride implements ITileOverride {
|
||||
}
|
||||
IBlockAccess blockAccess = renderBlockState.getBlockAccess();
|
||||
Block block = renderBlockState.getBlock();
|
||||
int i = renderBlockState.getI();
|
||||
int j = renderBlockState.getJ();
|
||||
int k = renderBlockState.getK();
|
||||
int x = renderBlockState.getI();
|
||||
int y = renderBlockState.getJ();
|
||||
int z = renderBlockState.getK();
|
||||
if (renderBlockState.getBlockFace() < 0 && requiresFace()) {
|
||||
properties.warning(
|
||||
"method=%s is not supported for non-standard block %s:%d @ %d %d %d",
|
||||
getMethod(),
|
||||
BlockAPI.getBlockName(block),
|
||||
BlockAPI.getMetadataAt(blockAccess, i, j, k),
|
||||
i,
|
||||
j,
|
||||
k);
|
||||
blockAccess.getBlockMetadata(x, y, z),
|
||||
x,
|
||||
y,
|
||||
z);
|
||||
return null;
|
||||
}
|
||||
if (block == null || RenderPassAPI.instance.skipThisRenderPass(block, renderPass)) {
|
||||
return null;
|
||||
}
|
||||
BlockStateMatcher filter = renderBlockState.getFilter();
|
||||
if (filter != null && !filter.match(blockAccess, i, j, k)) {
|
||||
if (filter != null && !filter.match(blockAccess, x, y, z)) {
|
||||
return null;
|
||||
}
|
||||
if (faceMatcher != null && !faceMatcher.match(renderBlockState)) {
|
||||
return null;
|
||||
}
|
||||
if (height != null && !height.get(j)) {
|
||||
if (height != null && !height.get(y)) {
|
||||
return null;
|
||||
}
|
||||
if (biomes != null && !biomes.get(BiomeAPI.getBiomeIDAt(blockAccess, i, j, k))) {
|
||||
if (biomes != null && !biomes.get(BiomeAPI.getBiomeIDAt(blockAccess, x, y, z))) {
|
||||
return null;
|
||||
}
|
||||
return getTileWorld_Impl(renderBlockState, origIcon);
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.util.IIcon;
|
||||
|
||||
import com.prupe.mcpatcher.mal.block.BlockStateMatcher;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
abstract public class TileOverrideIterator implements Iterator<ITileOverride> {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.prupe.mcpatcher.mal.resource.ResourceList;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackChangeHandler;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class CustomAnimation implements Comparable<CustomAnimation> {
|
||||
|
||||
@@ -340,7 +340,7 @@ public class CustomAnimation implements Comparable<CustomAnimation> {
|
||||
if (value != null && value.matches("^\\d+$")) {
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
} catch (NumberFormatException e) {}
|
||||
} catch (NumberFormatException ignore) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.util.InputHandler;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class FancyDial {
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackChangeHandler;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.FontRendererExpansion;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.util.FontRendererExpansion;
|
||||
|
||||
public class FontUtils {
|
||||
|
||||
@@ -267,7 +267,7 @@ public class FontUtils {
|
||||
charWidthf[ch] = width;
|
||||
isOverride[ch] = true;
|
||||
}
|
||||
} catch (NumberFormatException e) {}
|
||||
} catch (NumberFormatException ignore) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.prupe.mcpatcher.mal.resource.GLAPI;
|
||||
import com.prupe.mcpatcher.mal.resource.PropertiesFile;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
public class MipmapHelper {
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.prupe.mcpatcher.mal.resource.ResourceList;
|
||||
import com.prupe.mcpatcher.mal.resource.TexturePackAPI;
|
||||
import com.prupe.mcpatcher.mal.util.WeightedIndex;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
abstract public class ColorMap implements IColorMap {
|
||||
|
||||
|
||||
@@ -50,19 +50,6 @@ public class BlockAPI {
|
||||
}
|
||||
}
|
||||
|
||||
public static Block getFixedBlock(String name) {
|
||||
Block block = parseBlockName(name);
|
||||
if (block == null) {
|
||||
new IllegalArgumentException("unknown block " + name).printStackTrace();
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
public static Block parseBlockName(String name) {
|
||||
return GameData.getBlockRegistry()
|
||||
.getObject(name);
|
||||
}
|
||||
|
||||
public static String getBlockName(Block block) {
|
||||
return block == null ? "(null)" : block.getUnlocalizedName();
|
||||
}
|
||||
@@ -78,26 +65,6 @@ public class BlockAPI {
|
||||
return blocks;
|
||||
}
|
||||
|
||||
public static Block getBlockAt(IBlockAccess blockAccess, int i, int j, int k) {
|
||||
return blockAccess.getBlock(i, j, k);
|
||||
}
|
||||
|
||||
public static int getMetadataAt(IBlockAccess blockAccess, int i, int j, int k) {
|
||||
return blockAccess.getBlockMetadata(i, j, k);
|
||||
}
|
||||
|
||||
public static IIcon getBlockIcon(Block block, IBlockAccess blockAccess, int i, int j, int k, int face) {
|
||||
return block.getIcon(blockAccess, i, j, k, face);
|
||||
}
|
||||
|
||||
public static boolean shouldSideBeRendered(Block block, IBlockAccess blockAccess, int i, int j, int k, int face) {
|
||||
return block.shouldSideBeRendered(blockAccess, i, j, k, face);
|
||||
}
|
||||
|
||||
public static int getBlockLightValue(Block block) {
|
||||
return block.getLightValue();
|
||||
}
|
||||
|
||||
public static BlockStateMatcher createMatcher(PropertiesFile source, String matchString) {
|
||||
Map<String, String> propertyMap = new HashMap<>();
|
||||
String namespace = null;
|
||||
@@ -133,14 +100,14 @@ public class BlockAPI {
|
||||
}
|
||||
|
||||
if (MCPatcherUtils.isNullOrEmpty(namespace)) {
|
||||
namespace = source.getResource()
|
||||
.getResourceDomain();
|
||||
namespace = source.getResource().getResourceDomain();
|
||||
}
|
||||
if (MCPatcherUtils.isNullOrEmpty(blockName)) {
|
||||
source.warning("cannot parse namespace/block name from %s", matchString);
|
||||
return null;
|
||||
}
|
||||
Block block = parseBlockName(namespace + ':' + blockName);
|
||||
Block block = GameData.getBlockRegistry()
|
||||
.getObject(namespace + ':' + blockName);
|
||||
if (block == null) {
|
||||
source.warning("unknown block %s:%s", namespace, blockName);
|
||||
return null;
|
||||
@@ -151,4 +118,5 @@ public class BlockAPI {
|
||||
metadata.toString()
|
||||
.trim());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,15 +65,15 @@ public class BlockStateMatcher {
|
||||
return fullString;
|
||||
}
|
||||
|
||||
public boolean match(IBlockAccess blockAccess, int i, int j, int k) {
|
||||
Block block = BlockAPI.getBlockAt(blockAccess, i, j, k);
|
||||
public boolean match(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
Block block = blockAccess.getBlock(x, y, z);
|
||||
if (block != this.block) {
|
||||
return false;
|
||||
}
|
||||
int metadata = BlockAPI.getMetadataAt(blockAccess, i, j, k);
|
||||
int metadata = blockAccess.getBlockMetadata(x, y, z);
|
||||
if (block == doublePlantBlock) {
|
||||
if ((metadata & 0x8) != 0 && BlockAPI.getBlockAt(blockAccess, i, j - 1, k) == block) {
|
||||
metadata = BlockAPI.getMetadataAt(blockAccess, i, j - 1, k);
|
||||
if ((metadata & 0x8) != 0 && blockAccess.getBlock(x, y - 1, z) == block) {
|
||||
metadata = blockAccess.getBlockMetadata(x, y - 1, z);
|
||||
}
|
||||
metadata &= 0x7;
|
||||
} else if (block == logBlock) {
|
||||
|
||||
@@ -2,20 +2,17 @@ package com.prupe.mcpatcher.mal.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import mist475.mcpatcherforge.config.MCPatcherForgeConfig;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
|
||||
// Shared by both CTM and Custom Colors.
|
||||
public class RenderBlocksUtils {
|
||||
|
||||
public static final boolean enableBetterGrass = MCPatcherForgeConfig.instance().betterGrass;
|
||||
|
||||
private static final Block grassBlock = BlockAPI.getFixedBlock("minecraft:grass");
|
||||
private static final Block snowBlock = BlockAPI.getFixedBlock("minecraft:snow_layer");
|
||||
private static final Block craftedSnowBlock = BlockAPI.getFixedBlock("minecraft:snow");
|
||||
|
||||
private static final int COLOR = 0;
|
||||
private static final int NONCOLOR = 1;
|
||||
private static final int COLOR_AND_NONCOLOR = 2;
|
||||
@@ -28,7 +25,7 @@ public class RenderBlocksUtils {
|
||||
public static int layerIndex;
|
||||
public static IIcon blankIcon;
|
||||
|
||||
public static void setupColorMultiplier(Block block, IBlockAccess blockAccess, int i, int j, int k,
|
||||
public static void setupColorMultiplier(Block block, IBlockAccess blockAccess, int x, int y, int z,
|
||||
boolean haveOverrideTexture, float r, float g, float b) {
|
||||
if (haveOverrideTexture || !RenderPassAPI.instance.useColorMultiplierThisPass(block)) {
|
||||
colorMultiplierType[0] = COLOR;
|
||||
@@ -36,24 +33,24 @@ public class RenderBlocksUtils {
|
||||
colorMultiplierType[3] = COLOR;
|
||||
colorMultiplierType[4] = COLOR;
|
||||
colorMultiplierType[5] = COLOR;
|
||||
} else if (block == grassBlock) {
|
||||
} else if (block == Blocks.grass) {
|
||||
colorMultiplierType[0] = NONCOLOR;
|
||||
if (enableBetterGrass) {
|
||||
if (isSnowCovered(blockAccess, i, j, k)) {
|
||||
if (isSnowCovered(blockAccess, x, y, z)) {
|
||||
colorMultiplierType[2] = NONCOLOR;
|
||||
colorMultiplierType[3] = NONCOLOR;
|
||||
colorMultiplierType[4] = NONCOLOR;
|
||||
colorMultiplierType[5] = NONCOLOR;
|
||||
} else {
|
||||
j--;
|
||||
colorMultiplierType[2] = block == BlockAPI.getBlockAt(blockAccess, i, j, k - 1)
|
||||
&& !isSnowCovered(blockAccess, i, j, k - 1) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
colorMultiplierType[3] = block == BlockAPI.getBlockAt(blockAccess, i, j, k + 1)
|
||||
&& !isSnowCovered(blockAccess, i, j, k + 1) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
colorMultiplierType[4] = block == BlockAPI.getBlockAt(blockAccess, i - 1, j, k)
|
||||
&& !isSnowCovered(blockAccess, i - 1, j, k) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
colorMultiplierType[5] = block == BlockAPI.getBlockAt(blockAccess, i + 1, j, k)
|
||||
&& !isSnowCovered(blockAccess, i + 1, j, k) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
y--;
|
||||
colorMultiplierType[2] = block == blockAccess.getBlock(x, y, z - 1)
|
||||
&& !isSnowCovered(blockAccess, x, y, z - 1) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
colorMultiplierType[3] = block == blockAccess.getBlock(x, y, z + 1)
|
||||
&& !isSnowCovered(blockAccess, x, y, z + 1) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
colorMultiplierType[4] = block == blockAccess.getBlock(x - 1, y, z)
|
||||
&& !isSnowCovered(blockAccess, x - 1, y, z) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
colorMultiplierType[5] = block == blockAccess.getBlock(x + 1, y, z)
|
||||
&& !isSnowCovered(blockAccess, x + 1, y, z) ? COLOR : COLOR_AND_NONCOLOR;
|
||||
}
|
||||
} else {
|
||||
colorMultiplierType[2] = COLOR_AND_NONCOLOR;
|
||||
@@ -68,7 +65,7 @@ public class RenderBlocksUtils {
|
||||
colorMultiplierType[4] = COLOR;
|
||||
colorMultiplierType[5] = COLOR;
|
||||
}
|
||||
if (!isAmbientOcclusionEnabled() || BlockAPI.getBlockLightValue(block) != 0) {
|
||||
if (!isAmbientOcclusionEnabled() || block.getLightValue() != 0) {
|
||||
setupColorMultiplier(0, r, g, b);
|
||||
setupColorMultiplier(1, r, g, b);
|
||||
setupColorMultiplier(2, r, g, b);
|
||||
@@ -79,7 +76,7 @@ public class RenderBlocksUtils {
|
||||
}
|
||||
|
||||
public static void setupColorMultiplier(Block block, boolean useColor) {
|
||||
if (block == grassBlock || !useColor) {
|
||||
if (block == Blocks.grass || !useColor) {
|
||||
colorMultiplierType[0] = NONCOLOR;
|
||||
colorMultiplierType[2] = NONCOLOR;
|
||||
colorMultiplierType[3] = NONCOLOR;
|
||||
@@ -136,49 +133,39 @@ public class RenderBlocksUtils {
|
||||
return face < 0 ? 1 : face % 6;
|
||||
}
|
||||
|
||||
public static IIcon getGrassTexture(Block block, IBlockAccess blockAccess, int i, int j, int k, int face,
|
||||
public static IIcon getGrassTexture(Block block, IBlockAccess blockAccess, int x, int y, int z, int face,
|
||||
IIcon topIcon) {
|
||||
if (!enableBetterGrass || face < 2) {
|
||||
return null;
|
||||
}
|
||||
boolean isSnow = isSnowCovered(blockAccess, i, j, k);
|
||||
j--;
|
||||
boolean isSnow = isSnowCovered(blockAccess, x, y, z);
|
||||
y--;
|
||||
switch (face) {
|
||||
case 2:
|
||||
k--;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
k++;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
i--;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
i++;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 2 -> z--;
|
||||
case 3 -> z++;
|
||||
case 4 -> x--;
|
||||
case 5 -> x++;
|
||||
default -> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (block != BlockAPI.getBlockAt(blockAccess, i, j, k)) {
|
||||
if (block != blockAccess.getBlock(x, y, z)) {
|
||||
return null;
|
||||
}
|
||||
boolean neighborIsSnow = isSnowCovered(blockAccess, i, j, k);
|
||||
boolean neighborIsSnow = isSnowCovered(blockAccess, x, y, z);
|
||||
if (isSnow != neighborIsSnow) {
|
||||
return null;
|
||||
}
|
||||
return isSnow ? BlockAPI.getBlockIcon(snowBlock, blockAccess, i, j, k, face) : topIcon;
|
||||
return isSnow ? Blocks.snow_layer.getIcon(blockAccess, x, y, z, face) : topIcon;
|
||||
}
|
||||
|
||||
private static boolean isSnowCovered(IBlockAccess blockAccess, int i, int j, int k) {
|
||||
Block topBlock = BlockAPI.getBlockAt(blockAccess, i, j + 1, k);
|
||||
return topBlock == snowBlock || topBlock == craftedSnowBlock;
|
||||
private static boolean isSnowCovered(IBlockAccess blockAccess, int x, int y, int z) {
|
||||
Block topBlock = blockAccess.getBlock(x, y + 1, z);
|
||||
return topBlock == Blocks.snow_layer || topBlock == Blocks.snow;
|
||||
}
|
||||
|
||||
public static boolean isAmbientOcclusionEnabled() {
|
||||
return Minecraft.isAmbientOcclusionEnabled();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,8 +14,8 @@ import net.minecraft.nbt.NBTTagLong;
|
||||
import net.minecraft.nbt.NBTTagShort;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.NBTTagCompoundExpansion;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.NBTTagListExpansion;
|
||||
import jss.notfine.util.NBTTagCompoundExpansion;
|
||||
import jss.notfine.util.NBTTagListExpansion;
|
||||
|
||||
abstract public class NBTRule {
|
||||
|
||||
|
||||
Loaded 100 of 151 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user