Skip to content

Commit

Permalink
Correct cheat item stacks of StatusEffectEmiStack
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamarine committed Nov 14, 2022
1 parent 0601ab4 commit 8e18345
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 23 deletions.
3 changes: 0 additions & 3 deletions src/main/java/io/github/pkstdev/emiffect/EMIffectPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Entrypoint("emi") // For automatically registering the entrypoint
public class EMIffectPlugin implements EmiPlugin {
public static final String MOD_ID = "emiffect";
public static final Logger LOGGER = LoggerFactory.getLogger("Emiffect");
public static final Identifier CATEGORY_ICON = new Identifier(MOD_ID, "textures/gui/emi/icon.png");
public static final EmiRecipeCategory CATEGORY
= new EmiRecipeCategory(new Identifier(MOD_ID, "status_effect_info"), new EmiTexture(CATEGORY_ICON, 0, 0, 16, 16, 16, 16, 16, 16));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/**
* Utilities used in EMIffect.
*/
package io.github.pkstdev.emiffect.util;
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
import net.minecraft.client.texture.StatusEffectSpriteManager;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.potion.PotionUtil;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class StatusEffectEmiStack extends EmiStack {
Expand Down Expand Up @@ -124,4 +129,14 @@ public Class<? extends StatusEffect> getType() {
return getValue().getClass();
}
}

@Override
public ItemStack getItemStack() {
ItemStack stack = super.getItemStack();
if (effect != null) {
stack = PotionUtil.setCustomPotionEffects(Items.POTION.getDefaultStack(),
Collections.singletonList(new StatusEffectInstance(effect, 600)));
}
return stack;
}
}
13 changes: 0 additions & 13 deletions src/main/resources/emiffect.mixins.json

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
"emi": [
]
},
"mixins": [
"emiffect.mixins.json"
],

"depends": {
"fabricloader": ">=0.14.9",
Expand Down

0 comments on commit 8e18345

Please sign in to comment.