Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RPLE compatibility #121

Merged
merged 2 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ repositories {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
name "mvnmrtjp"
url "http://files.projectredwiki.com/maven"
metadataSources {
mavenPom()
artifact()

//Not having this causes jitpack to stall builds for minutes on systems without mrtjpcore already cached
exclusiveContent {
forRepository {
maven {
name "mvnmrtjp"
url "https://files.projectredwiki.com/maven"
metadataSources {
mavenPom()
artifact()
}
}
}
filter {
includeGroup("mrtjp")
}
allowInsecureProtocol
}
}
1 change: 1 addition & 0 deletions src/main/java/org/embeddedt/archaicfix/asm/Mixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public enum Mixin {
common_core_MixinShapedOreRecipe(Side.COMMON, Phase.EARLY, always(), "core.MixinShapedOreRecipe"),
common_core_MixinLongHashMap(Side.COMMON, Phase.EARLY, always(), "core.MixinLongHashMap"),
common_core_MixinBlock(Side.COMMON, Phase.EARLY, always(), "core.MixinBlock"),
common_core_MixinBlock_Late(Side.COMMON, Phase.EARLY, always(), "core.MixinBlock_Late"),
common_core_MixinEnchantmentHelper(Side.COMMON, Phase.EARLY, always(), "core.MixinEnchantmentHelper"),
common_core_MixinWorldChunkManager(Side.COMMON, Phase.EARLY, always(), "core.MixinWorldChunkManager"),
common_core_MixinShapedRecipes(Side.COMMON, Phase.EARLY, always(), "core.MixinShapedRecipes"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import cpw.mods.fml.relauncher.Side;
import net.minecraft.block.Block;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.IBlockAccess;
import org.embeddedt.archaicfix.block.ThreadedBlockData;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -57,13 +56,4 @@ private void onConstruct(Block block, Block.SoundType sound) {
}
return calculated;
}

/**
* @author embeddedt
* @reason Avoid calling getBlock
*/
@Redirect(method = "getLightValue(Lnet/minecraft/world/IBlockAccess;III)I", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"), require = 0)
public Block getLightValue(IBlockAccess world, int x, int y, int z) {
return (Block)(Object)this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.embeddedt.archaicfix.mixins.common.core;

import net.minecraft.block.Block;
import net.minecraft.world.IBlockAccess;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

//RPLE replaces getLightValue with an overwrite at priority 1000, so this redirect needs to be delayed for mixin to not crash
@Mixin(value = Block.class, priority = 2000)
public abstract class MixinBlock_Late {
/**
* @author embeddedt
* @reason Avoid calling getBlock
*/
@Redirect(method = "getLightValue(Lnet/minecraft/world/IBlockAccess;III)I", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/IBlockAccess;getBlock(III)Lnet/minecraft/block/Block;"), expect = 0, require = 0)
public Block getLightValue(IBlockAccess world, int x, int y, int z) {
return (Block)(Object)this;
}
}
Loading