-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compatible with forge 1.15.2-31.1.95.
- Loading branch information
1 parent
8cc058c
commit 4e560c5
Showing
22 changed files
with
381 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
src/main/java/io/github/zekerzhayard/optiforge/asm/MixinConnector.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...java/io/github/zekerzhayard/optiforge/asm/mixins/net/minecraft/entity/MixinMobEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...rd/optiforge/asm/transformers/net/minecraft/client/renderer/WorldRendererTransformer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.github.zekerzhayard.optiforge.asm.transformers.net.minecraft.client.renderer; | ||
|
||
import java.util.Objects; | ||
|
||
import io.github.zekerzhayard.optiforge.asm.transformers.ITransformer; | ||
import io.github.zekerzhayard.optiforge.asm.utils.ASMUtils; | ||
import net.minecraftforge.coremod.api.ASMAPI; | ||
import org.objectweb.asm.tree.AbstractInsnNode; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.objectweb.asm.tree.LabelNode; | ||
import org.objectweb.asm.tree.LocalVariableNode; | ||
import org.objectweb.asm.tree.MethodNode; | ||
import org.spongepowered.asm.util.Bytecode; | ||
|
||
public class WorldRendererTransformer implements ITransformer { | ||
@Override | ||
public boolean isTargetClass(String className) { | ||
return className.equals("net.minecraft.client.renderer.WorldRenderer"); | ||
} | ||
|
||
@Override | ||
public ClassNode postTransform(ClassNode cn, String mixinClassName) { | ||
MethodNode mn = Objects.requireNonNull(Bytecode.findMethod(cn, ASMAPI.mapMethod("func_184377_a"), "(Lnet/minecraft/util/SoundEvent;Lnet/minecraft/util/math/BlockPos;)V")); | ||
LabelNode start = null, end = null; | ||
for (AbstractInsnNode ain : mn.instructions.toArray()) { | ||
if (ain instanceof LabelNode) { | ||
LabelNode ln = (LabelNode) ain; | ||
if (start == null) { | ||
start = ln; | ||
} else { | ||
end = ln; | ||
} | ||
} | ||
} | ||
ASMUtils.insertLocalVariable(mn, new LocalVariableNode("musicDiscItem", "Lnet/minecraft/item/MusicDiscItem;", null, Objects.requireNonNull(start), Objects.requireNonNull(end), Bytecode.getFirstNonArgLocalIndex(mn))); | ||
mn.name = "playRecord"; | ||
mn.desc = "(Lnet/minecraft/util/SoundEvent;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/MusicDiscItem;)V"; | ||
return cn; | ||
} | ||
} |
Oops, something went wrong.