From e81708e7941dd3fa03e064bbd4e84e9ac3a4cfbf Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Thu, 26 Mar 2020 23:21:12 -0400 Subject: [PATCH] 1.0.1 Fix Crash in Non-Development Environment Update Lang --- CHANGELOG.md | 4 ++++ gradle.properties | 2 +- .../gulliverreloaded/CustomPotion.java | 7 +++++++ .../gulliverreloaded/GulliverReloaded.java | 4 +--- .../mixin/StatusEffectAccessor.java | 15 --------------- .../assets/gulliverreloaded/lang/en_us.json | 2 ++ src/main/resources/gulliverreloaded.mixins.json | 3 +-- 7 files changed, 16 insertions(+), 21 deletions(-) delete mode 100644 src/main/java/com/thebrokenrail/gulliverreloaded/mixin/StatusEffectAccessor.java diff --git a/CHANGELOG.md b/CHANGELOG.md index 141f1e4..662f33e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Changelog +**1.0.1** +* Fix Crash in Non-Development Environment +* Update Lang + **1.0** * Initial Release diff --git a/gradle.properties b/gradle.properties index efedc67..22ed895 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G fabric_loader_version = 0.7.8+build.189 # Mod Properties - mod_version = 1.0.0 + mod_version = 1.0.1 maven_group = com.thebrokenrail archives_base_name = gulliverreloaded diff --git a/src/main/java/com/thebrokenrail/gulliverreloaded/CustomPotion.java b/src/main/java/com/thebrokenrail/gulliverreloaded/CustomPotion.java index bb0820a..7f41eeb 100644 --- a/src/main/java/com/thebrokenrail/gulliverreloaded/CustomPotion.java +++ b/src/main/java/com/thebrokenrail/gulliverreloaded/CustomPotion.java @@ -1,9 +1,16 @@ package com.thebrokenrail.gulliverreloaded; import net.minecraft.entity.effect.StatusEffect; +import net.minecraft.entity.effect.StatusEffectType; import net.minecraft.potion.Potion; public class CustomPotion { + public static class CustomStatusEffect extends StatusEffect { + public CustomStatusEffect(StatusEffectType type, int color) { + super(type, color); + } + } + private StatusEffect statusEffect; private Potion potion; private Potion longPotion; diff --git a/src/main/java/com/thebrokenrail/gulliverreloaded/GulliverReloaded.java b/src/main/java/com/thebrokenrail/gulliverreloaded/GulliverReloaded.java index 2416ec2..66d83d8 100644 --- a/src/main/java/com/thebrokenrail/gulliverreloaded/GulliverReloaded.java +++ b/src/main/java/com/thebrokenrail/gulliverreloaded/GulliverReloaded.java @@ -1,12 +1,10 @@ package com.thebrokenrail.gulliverreloaded; import com.thebrokenrail.gulliverreloaded.mixin.BrewingRecipeRegistryAccessor; -import com.thebrokenrail.gulliverreloaded.mixin.StatusEffectAccessor; import net.fabricmc.api.ModInitializer; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectType; -import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.Items; import net.minecraft.potion.Potion; import net.minecraft.potion.Potions; @@ -27,7 +25,7 @@ public class GulliverReloaded implements ModInitializer { } private CustomPotion registerEffect(String name, int color) { - StatusEffect effect = Registry.register(Registry.STATUS_EFFECT, new Identifier(NAMESPACE, name), StatusEffectAccessor.createStatusEffect(StatusEffectType.NEUTRAL, color)); + StatusEffect effect = Registry.register(Registry.STATUS_EFFECT, new Identifier(NAMESPACE, name), new CustomPotion.CustomStatusEffect(StatusEffectType.NEUTRAL, color)); Potion potion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, name), new Potion(new StatusEffectInstance(effect, 3600))); Potion longPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "long_" + name), new Potion(name, new StatusEffectInstance(effect, 9600))); Potion strongPotion = Registry.register(Registry.POTION, new Identifier(NAMESPACE, "strong_" + name), new Potion(name, new StatusEffectInstance(effect, 1800, 1))); diff --git a/src/main/java/com/thebrokenrail/gulliverreloaded/mixin/StatusEffectAccessor.java b/src/main/java/com/thebrokenrail/gulliverreloaded/mixin/StatusEffectAccessor.java deleted file mode 100644 index 89e6c8e..0000000 --- a/src/main/java/com/thebrokenrail/gulliverreloaded/mixin/StatusEffectAccessor.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.thebrokenrail.gulliverreloaded.mixin; - -import net.minecraft.entity.effect.StatusEffect; -import net.minecraft.entity.effect.StatusEffectType; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Invoker; - -@SuppressWarnings("unused") -@Mixin(StatusEffect.class) -public interface StatusEffectAccessor { - @Invoker - static StatusEffect createStatusEffect(StatusEffectType type, int color) { - throw new UnsupportedOperationException(); - } -} diff --git a/src/main/resources/assets/gulliverreloaded/lang/en_us.json b/src/main/resources/assets/gulliverreloaded/lang/en_us.json index d126556..c2b2df5 100644 --- a/src/main/resources/assets/gulliverreloaded/lang/en_us.json +++ b/src/main/resources/assets/gulliverreloaded/lang/en_us.json @@ -5,6 +5,8 @@ "item.minecraft.potion.effect.grow": "Potion of Growing", "item.minecraft.splash_potion.effect.shrink": "Splash Potion of Shrinking", "item.minecraft.splash_potion.effect.grow": "Splash Potion of Growing", + "item.minecraft.lingering_potion.effect.shrink": "Lingering Potion of Shrinking", + "item.minecraft.lingering_potion.effect.grow": "Lingering Potion of Growing", "item.minecraft.tipped_arrow.effect.shrink": "Arrow of Shrinking", "item.minecraft.tipped_arrow.effect.grow": "Arrow of Growing" } \ No newline at end of file diff --git a/src/main/resources/gulliverreloaded.mixins.json b/src/main/resources/gulliverreloaded.mixins.json index 2acb6c6..597a3b5 100644 --- a/src/main/resources/gulliverreloaded.mixins.json +++ b/src/main/resources/gulliverreloaded.mixins.json @@ -8,8 +8,7 @@ "mixins": [ "BrewingRecipeRegistryAccessor", "MixinLivingEntity", - "MixinPlayerEntity", - "StatusEffectAccessor" + "MixinPlayerEntity" ], "injectors": { "defaultRequire": 1