Created
October 9, 2020 17:58
-
-
Save Haven-King/fa31c3c6b876588d92331717eeb3f6ae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @Mixin(BirdBath.class) | |
| public class BirdBathMixin extends CauldronBlock { | |
| public BirdBathMixin(Settings settings) { | |
| super(settings); | |
| } | |
| @Inject(method = "<init>", at = @At("TAIL")) | |
| private void setDefaultState(CallbackInfo ci) { | |
| this.setDefaultState(this.getDefaultState().with(Tweaks.INFINITE, false)); | |
| } | |
| @Inject(method = "appendProperties", at = @At("TAIL")) | |
| private void addInfiniteState(StateManager.Builder<Block, BlockState> builder, CallbackInfo ci) { | |
| builder.add(Tweaks.INFINITE); | |
| } | |
| } |
This file contains hidden or 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
| public class VolatileMixinPlugin implements IMixinConfigPlugin { | |
| @Override | |
| public void onLoad(String mixinPackage) { | |
| } | |
| @Override | |
| public String getRefMapperConfig() { | |
| return null; | |
| } | |
| @Override | |
| public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { | |
| if (mixinClassName.equals("dev.hephaestus.tweaks.mixin.compat.BirdBathMixin") | |
| && !FabricLoader.getInstance().isModLoaded("decorative")) { | |
| return false; | |
| } | |
| boolean isDevelopmentEnvironment = FabricLoader.getInstance().isDevelopmentEnvironment(); | |
| if (mixinClassName.contains("mixin.dev") && !isDevelopmentEnvironment) | |
| return false; | |
| else return !mixinClassName.contains("mixin.prod") || !isDevelopmentEnvironment; | |
| } | |
| @Override | |
| public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { | |
| } | |
| @Override | |
| public List<String> getMixins() { | |
| 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) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment