diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2018-12-30 20:10:36 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2018-12-30 20:10:36 +0800 |
| commit | 3aac033fd430903a1989a48015fadc18e67a7c2f (patch) | |
| tree | cf337b4e12df85cd30d25721bab6c1ba1f4591f8 /src/main/java/me/shedaniel/mixins | |
| parent | 0fd1d706bdcb3857ff2b943aa82059dad8f4a8e9 (diff) | |
| download | RoughlyEnoughItems-3aac033fd430903a1989a48015fadc18e67a7c2f.tar.gz RoughlyEnoughItems-3aac033fd430903a1989a48015fadc18e67a7c2f.tar.bz2 RoughlyEnoughItems-3aac033fd430903a1989a48015fadc18e67a7c2f.zip | |
Better stuff
Diffstat (limited to 'src/main/java/me/shedaniel/mixins')
3 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java b/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java index 3ea59f768..57f24b048 100644 --- a/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java +++ b/src/main/java/me/shedaniel/mixins/MixinGuiContainerCreative.java @@ -78,6 +78,7 @@ public abstract class MixinGuiContainerCreative extends InventoryEffectRenderer return super.keyPressed(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_); } + @Overwrite public boolean mouseScrolled(double p_mouseScrolled_1_) { if (!this.needsScrollBars()) { return super.mouseScrolled(p_mouseScrolled_1_); diff --git a/src/main/java/me/shedaniel/mixins/MixinMinecraftResize.java b/src/main/java/me/shedaniel/mixins/MixinMinecraftResize.java index 73f93871d..4cacb122c 100755 --- a/src/main/java/me/shedaniel/mixins/MixinMinecraftResize.java +++ b/src/main/java/me/shedaniel/mixins/MixinMinecraftResize.java @@ -4,6 +4,7 @@ import me.shedaniel.listenerdefinitions.MinecraftResize; import net.minecraft.client.MainWindow; import org.dimdev.riftloader.RiftLoader; 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.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -12,11 +13,15 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; * Created by James on 7/28/2018. */ @Mixin(MainWindow.class) -public class MixinMinecraftResize { +public abstract class MixinMinecraftResize implements AutoCloseable { + @Shadow private int scaledHeight; + + @Shadow private int scaledWidth; + @Inject(method = "updateSize", at = @At("RETURN")) private void onResize(CallbackInfo ci) { for(MinecraftResize listener : RiftLoader.instance.getListeners(MinecraftResize.class)) { - listener.resize(); + listener.resize(this.scaledWidth, this.scaledHeight); } } diff --git a/src/main/java/me/shedaniel/mixins/MixinPotionBrewing.java b/src/main/java/me/shedaniel/mixins/MixinPotionBrewing.java new file mode 100644 index 000000000..37ab903ef --- /dev/null +++ b/src/main/java/me/shedaniel/mixins/MixinPotionBrewing.java @@ -0,0 +1,21 @@ +package me.shedaniel.mixins; + +import me.shedaniel.listenerdefinitions.PotionCraftingAdder; +import net.minecraft.item.Item; +import net.minecraft.potion.PotionBrewing; +import net.minecraft.potion.PotionType; +import org.dimdev.riftloader.RiftLoader; +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(PotionBrewing.class) +public class MixinPotionBrewing { + + @Inject(method = "addMix", at = @At("RETURN")) + private static void addMix(PotionType inputPotion, Item reagent, PotionType outputPotion, CallbackInfo info) { + RiftLoader.instance.getListeners(PotionCraftingAdder.class).forEach(potionCraftingAdder -> potionCraftingAdder.addPotionRecipe(inputPotion, reagent, outputPotion)); + } + +} |
