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
|
@Override
|
||||||
public ItemStack getRecipeRemainder(ItemStack stack) {
|
public ItemStack getRecipeRemainder(ItemStack stack) {
|
||||||
if (SLSCarpetSettings.elytraCraftable) {
|
if (SLSCarpetSettings.elytraCraftable) {
|
||||||
return stack;
|
return stack.copyWithCount(1);
|
||||||
}
|
}
|
||||||
else return ItemStack.EMPTY;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
"minVersion": "0.8",
|
"minVersion": "0.8",
|
||||||
"package": "com.github.zly2006.carpetslsaddition.mixin",
|
"package": "com.github.zly2006.carpetslsaddition.mixin",
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"plugin": "com.github.zly2006.carpetslsaddition.mixin.plugin.BasicMixinPlugin",
|
|
||||||
"server": [
|
"server": [
|
||||||
"server.MixinMinecraftDedicatedServer"
|
"server.MixinMinecraftDedicatedServer"
|
||||||
],
|
],
|
||||||
@@ -15,6 +14,8 @@
|
|||||||
"carpet.MixinSettingsManager",
|
"carpet.MixinSettingsManager",
|
||||||
"datapack.MixinVanillaResourcePackProvider",
|
"datapack.MixinVanillaResourcePackProvider",
|
||||||
"elytra.MixinElytraItem",
|
"elytra.MixinElytraItem",
|
||||||
|
"elytra.MixinItem",
|
||||||
|
"elytra.MixinRecipe",
|
||||||
"entity.MixinArmorStandEntity",
|
"entity.MixinArmorStandEntity",
|
||||||
"entity.MixinEnderDragonFight",
|
"entity.MixinEnderDragonFight",
|
||||||
"entity.MixinEndermanGoal",
|
"entity.MixinEndermanGoal",
|
||||||
|
|||||||
Reference in new issue
Block a user