fix: elytra craftable
This commit is contained in:
5 files changed
+46
-25
No files matched your search
+1
-1
@@ -18,7 +18,7 @@ public abstract class MixinElytraItem extends Item implements Equipment {
|
||||
@Override
|
||||
public ItemStack getRecipeRemainder(ItemStack stack) {
|
||||
if (SLSCarpetSettings.elytraCraftable) {
|
||||
return stack;
|
||||
return stack.copyWithCount(1);
|
||||
}
|
||||
else return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.github.zly2006.carpetslsaddition.mixin.elytra;
|
||||
|
||||
import com.github.zly2006.carpetslsaddition.SLSCarpetSettings;
|
||||
import net.minecraft.item.*;
|
||||
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.CallbackInfoReturnable;
|
||||
|
||||
@SuppressWarnings("ConstantValue")
|
||||
@Mixin(Item.class)
|
||||
public abstract class MixinItem {
|
||||
@Inject(
|
||||
method = "hasRecipeRemainder",
|
||||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
public void hasRecipeRemainder(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (SLSCarpetSettings.elytraCraftable && (Object) this == Items.ELYTRA) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(
|
||||
method = "getRecipeRemainder",
|
||||
at = @At("HEAD"),
|
||||
cancellable = true
|
||||
)
|
||||
public void getRecipeRemainder(CallbackInfoReturnable<Item> cir) {
|
||||
if (SLSCarpetSettings.elytraCraftable && (Object) this == Items.ELYTRA) {
|
||||
cir.setReturnValue(Items.ELYTRA);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.github.zly2006.carpetslsaddition.mixin.elytra;
|
||||
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(Recipe.class)
|
||||
public interface MixinRecipe {
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.github.zly2006.carpetslsaddition.mixin.plugin;
|
||||
|
||||
import me.fallenbreath.conditionalmixin.api.mixin.RestrictiveMixinConfigPlugin;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class BasicMixinPlugin extends RestrictiveMixinConfigPlugin {
|
||||
@Override
|
||||
public String getRefMapperConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMixins() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user