-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 现在打开女仆 GUI,背景女仆不会抖动了 - toro 血量模组禁用了女仆渲染
- Loading branch information
1 parent
5b43e4b
commit 5936cf1
Showing
9 changed files
with
140 additions
and
4 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/github/tartaricacid/touhoulittlemaid/compat/torocraft/TorocraftCompat.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,16 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.compat.torocraft; | ||
|
||
import net.minecraftforge.fml.loading.LoadingModList; | ||
|
||
public class TorocraftCompat { | ||
private static final String MOD_ID = "torohealth"; | ||
private static boolean INSTALLED; | ||
|
||
public static void init() { | ||
INSTALLED = LoadingModList.get().getModFileById(MOD_ID) != null; | ||
} | ||
|
||
public static boolean isInstalled() { | ||
return INSTALLED; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/github/tartaricacid/touhoulittlemaid/geckolib3/util/RenderUtils.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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/github/tartaricacid/touhoulittlemaid/mixin/client/RenderSystemMixin.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,21 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.mixin.client; | ||
|
||
import com.github.tartaricacid.touhoulittlemaid.geckolib3.util.RenderUtils; | ||
import com.mojang.blaze3d.systems.RenderSystem; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RenderSystem.class) | ||
public class RenderSystemMixin { | ||
@Inject(at = @At("HEAD"), method = "runAsFancy(Ljava/lang/Runnable;)V") | ||
private static void beforeRunAsFancy(Runnable fancyRunnable, CallbackInfo ci) { | ||
RenderUtils.setRenderingEntitiesInInventory(true); | ||
} | ||
|
||
@Inject(at = @At("TAIL"), method = "runAsFancy(Ljava/lang/Runnable;)V") | ||
private static void afterRunAsFancy(Runnable fancyRunnable, CallbackInfo ci) { | ||
RenderUtils.setRenderingEntitiesInInventory(false); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
src/main/java/com/github/tartaricacid/touhoulittlemaid/mixin/plugin/MixinTweaker.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,53 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.mixin.plugin; | ||
|
||
import com.github.tartaricacid.touhoulittlemaid.compat.torocraft.TorocraftCompat; | ||
import com.google.common.collect.Lists; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.fml.loading.FMLEnvironment; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; | ||
import org.spongepowered.asm.mixin.extensibility.IMixinInfo; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
public class MixinTweaker implements IMixinConfigPlugin { | ||
public MixinTweaker() { | ||
TorocraftCompat.init(); | ||
} | ||
|
||
@Override | ||
public void onLoad(String mixinPackage) { | ||
} | ||
|
||
@Override | ||
public String getRefMapperConfig() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | ||
} | ||
|
||
@Override | ||
public List<String> getMixins() { | ||
if (TorocraftCompat.isInstalled() && FMLEnvironment.dist == Dist.CLIENT) { | ||
return Lists.newArrayList("plugin.TorocraftEntityDisplayMixin"); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
@Override | ||
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
} | ||
|
||
@Override | ||
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...va/com/github/tartaricacid/touhoulittlemaid/mixin/plugin/TorocraftEntityDisplayMixin.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,20 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.mixin.plugin; | ||
|
||
import com.github.tartaricacid.touhoulittlemaid.entity.passive.EntityMaid; | ||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.torocraft.torohealth.display.EntityDisplay; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(EntityDisplay.class) | ||
public class TorocraftEntityDisplayMixin { | ||
@Inject(at = @At("HEAD"), method = "drawEntity(Lcom/mojang/blaze3d/vertex/PoseStack;IIIFFLnet/minecraft/world/entity/LivingEntity;F)V", remap = false, cancellable = true) | ||
private static void getEntityInCrosshair(PoseStack matrixStack2, int x, int y, int size, float mouseX, float mouseY, LivingEntity entity, float scale, CallbackInfo ci) { | ||
if (entity instanceof EntityMaid) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
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