Added polearms

This commit is contained in:
Sollace 2022-09-18 21:39:42 +02:00
parent a5f847df22
commit 33d4233866
53 changed files with 657 additions and 13 deletions

View file

@ -105,6 +105,12 @@ public interface URenderers {
matrices.push(); matrices.push();
}); });
PolearmRenderer.register(UItems.WOODEN_POLEARM);
PolearmRenderer.register(UItems.STONE_POLEARM);
PolearmRenderer.register(UItems.IRON_POLEARM);
PolearmRenderer.register(UItems.GOLDEN_POLEARM);
PolearmRenderer.register(UItems.DIAMOND_POLEARM);
PolearmRenderer.register(UItems.NETHERITE_POLEARM);
ModelPredicateProviderRegistry.register(UItems.GEMSTONE, new Identifier("affinity"), (stack, world, entity, seed) -> { ModelPredicateProviderRegistry.register(UItems.GEMSTONE, new Identifier("affinity"), (stack, world, entity, seed) -> {
return GemstoneItem.isEnchanted(stack) ? 1 + GemstoneItem.getSpellKey(stack).getAffinity().ordinal() : 0; return GemstoneItem.isEnchanted(stack) ? 1 + GemstoneItem.getSpellKey(stack).getAffinity().ordinal() : 0;
}); });

View file

@ -0,0 +1,82 @@
package com.minelittlepony.unicopia.client.render;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry.DynamicItemRenderer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.item.UnclampedModelPredicateProvider;
import net.minecraft.client.model.*;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.model.TridentEntityModel;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.json.ModelTransformation.Mode;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.*;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
public class PolearmRenderer implements DynamicItemRenderer, UnclampedModelPredicateProvider {
private static final PolearmRenderer INSTANCE = new PolearmRenderer();
private static final Identifier THROWING = new Identifier("throwing");
private final TridentEntityModel model = new TridentEntityModel(getTexturedModelData().createModel());
public static void register(Item item) {
BuiltinItemRendererRegistry.INSTANCE.register(item, INSTANCE);
ModelPredicateProviderRegistry.register(item, THROWING, INSTANCE);
ModelLoadingRegistry.INSTANCE.registerModelProvider((renderer, out) -> out.accept(getModelId(item)));
}
static ModelIdentifier getModelId(ItemConvertible item) {
Identifier id = Registry.ITEM.getId(item.asItem());
return new ModelIdentifier(id.toString() + "_in_inventory#inventory");
}
public static TexturedModelData getTexturedModelData() {
ModelData data = new ModelData();
ModelPartData root = data.getRoot();
int y = -9;
ModelPartData pole = root.addChild("pole", ModelPartBuilder.create().uv(0, 6).cuboid(-0.5f, y, -0.5f, 1, 25, 1), ModelTransform.NONE);
pole.addChild("base", ModelPartBuilder.create().uv(4, 0).cuboid(-1.5f, y - 2, -0.5f, 3, 2, 1), ModelTransform.NONE);
pole.addChild("head", ModelPartBuilder.create().uv(0, 0).cuboid(-0.5f, y - 6, -0.5f, 1, 4, 1), ModelTransform.NONE);
return TexturedModelData.of(data, 32, 32);
}
@Override
public void render(ItemStack stack, Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
if (mode == Mode.GUI || mode == Mode.GROUND || mode == Mode.FIXED) {
// render as normal sprite
ItemRenderer renderer = MinecraftClient.getInstance().getItemRenderer();
BakedModel model = renderer.getModels().getModelManager().getModel(getModelId(stack.getItem()));
matrices.pop();
matrices.push();
renderer.renderItem(stack, mode, false, matrices, vertexConsumers, light, overlay, model);
matrices.pop();
matrices.push();
} else {
matrices.push();
matrices.scale(1, -1, -1);
Identifier id = Registry.ITEM.getId(stack.getItem());
Identifier texture = new Identifier(id.getNamespace(), "textures/entity/polearm/" + id.getPath() + ".png");
VertexConsumer vertexConsumer2 = ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, model.getLayer(texture), false, stack.hasGlint());
model.render(matrices, vertexConsumer2, light, overlay, 1, 1, 1, 1);
matrices.pop();
}
}
@Override
public float unclampedCall(ItemStack stack, ClientWorld world, LivingEntity entity, int seed) {
return entity != null && entity.isUsingItem() && entity.getActiveItem() == stack ? 1 : 0;
}
}

View file

@ -16,7 +16,6 @@ public interface UEntityAttributes {
EntityAttribute EXTRA_MINING_SPEED = register("earth.mining_speed", new ClampedEntityAttribute("player.miningSpeed", 1, 0, 5).setTracked(true)); EntityAttribute EXTRA_MINING_SPEED = register("earth.mining_speed", new ClampedEntityAttribute("player.miningSpeed", 1, 0, 5).setTracked(true));
EntityAttribute ENTITY_GRAVTY_MODIFIER = register("player.gravity", (new EntityAttribute("player.gravityModifier", 1) {}).setTracked(true)); EntityAttribute ENTITY_GRAVTY_MODIFIER = register("player.gravity", (new EntityAttribute("player.gravityModifier", 1) {}).setTracked(true));
private static EntityAttribute register(String name, EntityAttribute attribute) { private static EntityAttribute register(String name, EntityAttribute attribute) {
REGISTRY.add(attribute); REGISTRY.add(attribute);
return Registry.register(Registry.ATTRIBUTE, Unicopia.id(name), attribute); return Registry.register(Registry.ATTRIBUTE, Unicopia.id(name), attribute);

View file

@ -0,0 +1,36 @@
package com.minelittlepony.unicopia.item;
import java.util.UUID;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import com.minelittlepony.unicopia.entity.UEntityAttributes;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.attribute.*;
import net.minecraft.item.*;
public class PolearmItem extends SwordItem {
protected static final UUID ATTACK_RANGE_MODIFIER_ID = UUID.fromString("A7B3659C-AA74-469C-963A-09A391DCAA0F");
private final Multimap<EntityAttribute, EntityAttributeModifier> attributeModifiers;
private final int attackRange;
public PolearmItem(ToolMaterial material, int damage, float speed, int range, Settings settings) {
super(material, damage, speed, settings);
this.attackRange = range;
ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder = ImmutableMultimap.builder();
builder.putAll(super.getAttributeModifiers(EquipmentSlot.MAINHAND));
builder.put(UEntityAttributes.EXTENDED_REACH_DISTANCE, new EntityAttributeModifier(ATTACK_RANGE_MODIFIER_ID, "Weapon modifier", attackRange, EntityAttributeModifier.Operation.ADDITION));
attributeModifiers = builder.build();
}
@Override
public Multimap<EntityAttribute, EntityAttributeModifier> getAttributeModifiers(EquipmentSlot slot) {
if (slot == EquipmentSlot.MAINHAND) {
return attributeModifiers;
}
return super.getAttributeModifiers(slot);
}
}

View file

@ -9,15 +9,10 @@ import com.minelittlepony.unicopia.entity.UEntities;
import com.minelittlepony.unicopia.item.enchantment.UEnchantments; import com.minelittlepony.unicopia.item.enchantment.UEnchantments;
import com.minelittlepony.unicopia.item.toxin.UFoodComponents; import com.minelittlepony.unicopia.item.toxin.UFoodComponents;
import net.minecraft.item.Item; import net.minecraft.item.*;
import net.minecraft.item.Item.Settings; import net.minecraft.item.Item.Settings;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.Items;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.item.BlockItem; import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.minecraft.item.FoodComponents;
import net.minecraft.item.MusicDiscItem;
import net.minecraft.item.SpawnEggItem;
import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Rarity; import net.minecraft.util.Rarity;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
@ -83,6 +78,13 @@ public interface UItems {
Item DRAGON_BREATH_SCROLL = register("dragon_breath_scroll", new DragonBreathScrollItem(new Item.Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.TOOLS))); Item DRAGON_BREATH_SCROLL = register("dragon_breath_scroll", new DragonBreathScrollItem(new Item.Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.TOOLS)));
Item WOODEN_POLEARM = register("wooden_polearm", new PolearmItem(ToolMaterials.WOOD, 3, -2.4F, 2, new Item.Settings().group(ItemGroup.COMBAT)));
Item STONE_POLEARM = register("stone_polearm", new PolearmItem(ToolMaterials.STONE, 3, -2.4F, 2, new Item.Settings().group(ItemGroup.COMBAT)));
Item IRON_POLEARM = register("iron_polearm", new PolearmItem(ToolMaterials.IRON, 3, -2.4F, 3, new Item.Settings().group(ItemGroup.COMBAT)));
Item GOLDEN_POLEARM = register("golden_polearm", new PolearmItem(ToolMaterials.GOLD, 3, -2.4F, 4, new Item.Settings().group(ItemGroup.COMBAT)));
Item DIAMOND_POLEARM = register("diamond_polearm", new PolearmItem(ToolMaterials.DIAMOND, 3, -2.4F, 5, new Item.Settings().group(ItemGroup.COMBAT)));
Item NETHERITE_POLEARM = register("netherite_polearm", new PolearmItem(ToolMaterials.NETHERITE, 3, -2.4F, 5, new Item.Settings().group(ItemGroup.COMBAT).fireproof()));
Item BUTTERFLY_SPAWN_EGG = register("butterfly_spawn_egg", new SpawnEggItem(UEntities.BUTTERFLY, 0x222200, 0xaaeeff, new Item.Settings().group(ItemGroup.MISC))); Item BUTTERFLY_SPAWN_EGG = register("butterfly_spawn_egg", new SpawnEggItem(UEntities.BUTTERFLY, 0x222200, 0xaaeeff, new Item.Settings().group(ItemGroup.MISC)));
Item BUTTERFLY = register("butterfly", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.INSECTS))); Item BUTTERFLY = register("butterfly", new Item(new Item.Settings().group(ItemGroup.FOOD).food(UFoodComponents.INSECTS)));

View file

@ -0,0 +1,49 @@
package com.minelittlepony.unicopia.mixin;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.injection.*;
import com.minelittlepony.unicopia.entity.player.Pony;
import net.minecraft.server.network.*;
@Mixin(value = {
ServerPlayerInteractionManager.class,
ServerPlayNetworkHandler.class
})
abstract class MixinReachDistanceFix {
@Accessor
public abstract ServerPlayerEntity getPlayer();
@Redirect(
method = {
"processBlockBreakingAction",
"onPlayerInteractBlock",
"onPlayerInteractEntity"
},
at = @At(
value = "FIELD",
target = "net/minecraft/server/network/ServerPlayNetworkHandler.MAX_BREAK_SQUARED_DISTANCE:D",
opcode = Opcodes.GETSTATIC
)
)
private double getMaxBreakSquaredDistance() {
double reach = 6 + Pony.of(getPlayer()).getExtendedReach();
return reach * reach;
}
/*
@ModifyConstant(
method = {
"processBlockBreakingAction",
"onPlayerInteractBlock",
"onPlayerInteractEntity"
},
constant = @Constant(doubleValue = 36D)
)
private double modifyMaxBreakSquaredDistance(double initial) {
double reach = 6 + Pony.of(getPlayer()).getExtendedReach();
return reach * reach;
}*/
}

View file

@ -2,8 +2,7 @@ package com.minelittlepony.unicopia.mixin;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.minelittlepony.unicopia.entity.duck.ServerPlayerEntityDuck; import com.minelittlepony.unicopia.entity.duck.ServerPlayerEntityDuck;

View file

@ -20,4 +20,11 @@ abstract class MixinClientPlayerInteractionManager {
info.setReturnValue(player.getExtendedReach() + info.getReturnValueF()); info.setReturnValue(player.getExtendedReach() + info.getReturnValueF());
} }
} }
@Inject(method = "hasExtendedReach", at = @At("HEAD"), cancellable = true)
private void onHasExtendedReach(CallbackInfoReturnable<Boolean> info) {
if (!info.getReturnValueZ() && Pony.of(MinecraftClient.getInstance().player).getExtendedReach() > 0) {
info.setReturnValue(true);
}
}
} }

View file

@ -1,14 +1,15 @@
package com.minelittlepony.unicopia.mixin.client; package com.minelittlepony.unicopia.mixin.client;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import com.minelittlepony.unicopia.EquinePredicates; import com.minelittlepony.unicopia.EquinePredicates;
import com.minelittlepony.unicopia.client.BatEyesApplicator; import com.minelittlepony.unicopia.client.BatEyesApplicator;
import com.minelittlepony.unicopia.client.UnicopiaClient; import com.minelittlepony.unicopia.client.UnicopiaClient;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.Camera; import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack; import net.minecraft.client.util.math.MatrixStack;
@ -19,6 +20,18 @@ import net.minecraft.resource.SynchronousResourceReloader;
@Mixin(GameRenderer.class) @Mixin(GameRenderer.class)
abstract class MixinGameRenderer implements AutoCloseable, SynchronousResourceReloader { abstract class MixinGameRenderer implements AutoCloseable, SynchronousResourceReloader {
@Shadow
private @Final MinecraftClient client;
@ModifyConstant(
method = "updateTargetedEntity",
constant = @Constant(doubleValue = 6)
)
private double onUpdateTargetedEntity(double initial) {
return Math.max(initial, client.interactionManager.getReachDistance());
}
@Inject(method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D", @Inject(method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D",
at = @At("RETURN"), at = @At("RETURN"),
cancellable = true) cancellable = true)

View file

@ -70,6 +70,13 @@
"item.unicopia.alicorn_amulet": "Alicorn Amulet", "item.unicopia.alicorn_amulet": "Alicorn Amulet",
"item.unicopia.alicorn_amulet.lore": "Time worn: %d", "item.unicopia.alicorn_amulet.lore": "Time worn: %d",
"item.unicopia.wooden_polearm": "Wooden Polearm",
"item.unicopia.stone_polearm": "Stone Polearm",
"item.unicopia.iron_polearm": "Iron Polearm",
"item.unicopia.golden_polearm": "Golden Polearm",
"item.unicopia.diamond_polearm": "Diamond Polearm",
"item.unicopia.netherite_polearm": "Netherite Polearm",
"item.unicopia.music_disc_pet": "Music Disc", "item.unicopia.music_disc_pet": "Music Disc",
"item.unicopia.music_disc_pet.desc": "Danial Ingram - pet", "item.unicopia.music_disc_pet.desc": "Danial Ingram - pet",
"item.unicopia.music_disc_popular": "Music Disc", "item.unicopia.music_disc_popular": "Music Disc",

View file

@ -0,0 +1,14 @@
{
"parent": "item/trident_in_hand",
"textures": {
"particle": "unicopia:item/diamond_polearm"
},
"overrides": [
{
"predicate": {
"throwing": 1
},
"model": "unicopia:item/diamond_polearm_throwing"
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/diamond_polearm"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/trident_throwing",
"textures": {
"particle": "unicopia:item/diamond_polearm"
}
}

View file

@ -0,0 +1,14 @@
{
"parent": "item/trident_in_hand",
"textures": {
"particle": "unicopia:item/golden_polearm"
},
"overrides": [
{
"predicate": {
"throwing": 1
},
"model": "unicopia:item/golden_polearm_throwing"
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/golden_polearm"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/trident_throwing",
"textures": {
"particle": "unicopia:item/golden_polearm"
}
}

View file

@ -0,0 +1,14 @@
{
"parent": "item/trident_in_hand",
"textures": {
"particle": "unicopia:item/iron_polearm"
},
"overrides": [
{
"predicate": {
"throwing": 1
},
"model": "unicopia:item/iron_polearm_throwing"
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/iron_polearm"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/trident_throwing",
"textures": {
"particle": "unicopia:item/iron_polearm"
}
}

View file

@ -0,0 +1,14 @@
{
"parent": "item/trident_in_hand",
"textures": {
"particle": "unicopia:item/netherite_polearm"
},
"overrides": [
{
"predicate": {
"throwing": 1
},
"model": "unicopia:item/netherite_polearm_throwing"
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/netherite_polearm"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/trident_throwing",
"textures": {
"particle": "unicopia:item/netherite_polearm"
}
}

View file

@ -0,0 +1,14 @@
{
"parent": "item/trident_in_hand",
"textures": {
"particle": "unicopia:item/stone_polearm"
},
"overrides": [
{
"predicate": {
"throwing": 1
},
"model": "unicopia:item/stone_polearm_throwing"
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/stone_polearm"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/trident_throwing",
"textures": {
"particle": "unicopia:item/stone_polearm"
}
}

View file

@ -0,0 +1,14 @@
{
"parent": "item/trident_in_hand",
"textures": {
"particle": "unicopia:item/wooden_polearm"
},
"overrides": [
{
"predicate": {
"throwing": 1
},
"model": "unicopia:item/wooden_polearm_throwing"
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "unicopia:item/wooden_polearm"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/trident_throwing",
"textures": {
"particle": "unicopia:item/wooden_polearm"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -0,0 +1,30 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"unicopia:diamond_polearm"
]
},
"criteria": {
"has_ingredients": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{ "items": [ "minecraft:diamond" ] }
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "unicopia:diamond_polearm"
}
}
},
"requirements": [
[
"has_ingredients",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,30 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"unicopia:golden_polearm"
]
},
"criteria": {
"has_ingredients": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{ "items": [ "minecraft:gold_ingot" ] }
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "unicopia:golden_polearm"
}
}
},
"requirements": [
[
"has_ingredients",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,30 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"unicopia:iron_polearm"
]
},
"criteria": {
"has_ingredients": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{ "items": [ "minecraft:iron_ingot" ] }
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "unicopia:iron_polearm"
}
}
},
"requirements": [
[
"has_ingredients",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,30 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"unicopia:netherite_polearm_smithing"
]
},
"criteria": {
"has_ingredients": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{ "items": [ "minecraft:netherite_ingot" ] }
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "unicopia:netherite_polearm_smithing"
}
}
},
"requirements": [
[
"has_ingredients",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,30 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"unicopia:stone_polearm"
]
},
"criteria": {
"has_ingredients": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{ "tag": "minecraft:stone_tool_materials" }
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "unicopia:stone_polearm"
}
}
},
"requirements": [
[
"has_ingredients",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,30 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"unicopia:wooden_polearm"
]
},
"criteria": {
"has_ingredients": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{ "items": [ "minecraft:stick" ] }
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "unicopia:wooden_polearm"
}
}
},
"requirements": [
[
"has_ingredients",
"has_the_recipe"
]
]
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" X",
" # ",
"# "
],
"key": {
"#": {
"item": "minecraft:stick"
},
"X": {
"item": "minecraft:diamond"
}
},
"result": {
"item": "unicopia:diamond_polearm"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" X",
" # ",
"# "
],
"key": {
"#": {
"item": "minecraft:stick"
},
"X": {
"item": "minecraft:gold_ingot"
}
},
"result": {
"item": "unicopia:golden_polearm"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" X",
" # ",
"# "
],
"key": {
"#": {
"item": "minecraft:stick"
},
"X": {
"item": "minecraft:iron_ingot"
}
},
"result": {
"item": "unicopia:iron_polearm"
}
}

View file

@ -0,0 +1,12 @@
{
"type": "minecraft:smithing",
"addition": {
"item": "minecraft:netherite_ingot"
},
"base": {
"item": "unicopia:diamond_polearm"
},
"result": {
"item": "unicopia:netherite_polearm"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" X",
" # ",
"# "
],
"key": {
"#": {
"item": "minecraft:stick"
},
"X": {
"tag": "minecraft:stone_tool_materials"
}
},
"result": {
"item": "unicopia:stone_polearm"
}
}

View file

@ -0,0 +1,19 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" X",
" # ",
"# "
],
"key": {
"#": {
"item": "minecraft:stick"
},
"X": {
"tag": "minecraft:planks"
}
},
"result": {
"item": "unicopia:wooden_polearm"
}
}

View file

@ -23,6 +23,7 @@
"MixinPersistentProjectileEntity", "MixinPersistentProjectileEntity",
"MixinPlayerEntity", "MixinPlayerEntity",
"MixinProjectileEntity", "MixinProjectileEntity",
"MixinReachDistanceFix",
"MixinServerPlayerEntity", "MixinServerPlayerEntity",
"MixinServerPlayNetworkHandler", "MixinServerPlayNetworkHandler",
"MixinServerWorld", "MixinServerWorld",