1.0.1
All checks were successful
Gulliver Reloaded/pipeline/head This commit looks good

Fix Crash in Non-Development Environment
Update Lang
This commit is contained in:
TheBrokenRail 2020-03-26 23:21:12 -04:00
parent 2a3223a873
commit e81708e794
7 changed files with 16 additions and 21 deletions

View File

@ -1,4 +1,8 @@
# Changelog
**1.0.1**
* Fix Crash in Non-Development Environment
* Update Lang
**1.0**
* Initial Release

View File

@ -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

View File

@ -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;

View File

@ -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)));

View File

@ -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();
}
}

View File

@ -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"
}

View File

@ -8,8 +8,7 @@
"mixins": [
"BrewingRecipeRegistryAccessor",
"MixinLivingEntity",
"MixinPlayerEntity",
"StatusEffectAccessor"
"MixinPlayerEntity"
],
"injectors": {
"defaultRequire": 1