Update to 1.21.4

This commit is contained in:
Bruno Rybársky 2024-12-05 14:46:33 +01:00
parent b7fc022f90
commit 8afe0c0063
No known key found for this signature in database
GPG Key ID: 6C9206A821C70598
88 changed files with 294 additions and 394 deletions

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.7-SNAPSHOT' id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
@ -36,7 +36,6 @@ dependencies {
modImplementation include("eu.pb4:polymer-blocks:${project.polymer_version}") modImplementation include("eu.pb4:polymer-blocks:${project.polymer_version}")
modImplementation include("eu.pb4:polymer-resource-pack:${project.polymer_version}") modImplementation include("eu.pb4:polymer-resource-pack:${project.polymer_version}")
modImplementation include("eu.pb4:polymer-autohost:${project.polymer_version}") modImplementation include("eu.pb4:polymer-autohost:${project.polymer_version}")
modImplementation "eu.pb4.polyport:trinkets:${project.trinkets_version}"
modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_api_version}") modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_api_version}")
@ -48,14 +47,12 @@ processResources {
inputs.property "version", project.version inputs.property "version", project.version
inputs.property "minecraft_version", project.minecraft_version inputs.property "minecraft_version", project.minecraft_version
inputs.property "loader_version", project.loader_version inputs.property "loader_version", project.loader_version
inputs.property "trinkets_version", project.trinkets_version
filteringCharset "UTF-8" filteringCharset "UTF-8"
filesMatching("fabric.mod.json") { filesMatching("fabric.mod.json") {
expand "version": project.version, expand "version": project.version,
"minecraft_version": project.minecraft_version, "minecraft_version": project.minecraft_version,
"loader_version": project.loader_version, "loader_version": project.loader_version
"trinkets_version": project.trinkets_version
} }
} }

@ -2,17 +2,16 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://modmuss50.me/fabric.html # check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.3 minecraft_version=1.21.4
yarn_mappings=1.21.3+build.2 yarn_mappings=1.21.4+build.1
loader_version=0.16.8 loader_version=0.16.9
# Mod Properties # Mod Properties
mod_version=1.9.7 mod_version=1.9.8
maven_group=systems.brn maven_group=systems.brn
archives_base_name=plasticgun archives_base_name=plasticgun
# Dependencies # Dependencies
# check this on https://modmuss50.me/fabric.html # check this on https://modmuss50.me/fabric.html
fabric_version=0.107.0+1.21.3 fabric_version=0.110.5+1.21.4
polymer_version=0.10.1+1.21.3 polymer_version=0.11.0+1.21.4-rc1
server_translations_api_version=2.4.0+1.21.2-rc1 server_translations_api_version=2.4.0+1.21.2-rc1
trinkets_version=3.10.0+polymerport.2

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

@ -122,7 +122,7 @@ public class PlasticGun implements ModInitializer {
bullets.add(new BulletItem("force_container", 99, 0, 888, false, 0, 1)); bullets.add(new BulletItem("force_container", 99, 0, 888, false, 0, 1));
// Guns // Guns
guns.add(new Gun("forcegun", 0, 4, 5, 10, 10, 888, 5, 0, 4, 0f, 0f, 5f, 10f, 0, 0)); // 0 guns.add(new Gun("forcegun", 0, 4, 5, 10, 10, 888, 5, 0, 10, 0f, 0f, 5f, 10f, 0, 0)); // 0
guns.add(new Gun("p2022", 0.2, 12, 5, 10, 41, 9, 10, 0, 0, 1f, 4, 0.1f, 0.25f, -1, 1)); // 1.8 guns.add(new Gun("p2022", 0.2, 12, 5, 10, 41, 9, 10, 0, 0, 1f, 4, 0.1f, 0.25f, -1, 1)); // 1.8
guns.add(new Gun("colt_1903", 0.3, 10, 5, 8, 38, 32, 10, 0, 0, 1, 3, 0.1f, 0.3f, -1, 1)); // 3 guns.add(new Gun("colt_1903", 0.3, 10, 5, 8, 38, 32, 10, 0, 0, 1, 3, 0.1f, 0.3f, -1, 1)); // 3
guns.add(new Gun("ak_47", 0.2, 4, 5, 30, 45, 762, 0, 0, 0, 1f, 2, 0.2f, 0.4f, -1, 1)); // 9 guns.add(new Gun("ak_47", 0.2, 4, 5, 30, 45, 762, 0, 0, 0, 1f, 2, 0.2f, 0.4f, -1, 1)); // 9
@ -131,8 +131,8 @@ public class PlasticGun implements ModInitializer {
guns.add(new Gun("colt_peacemaker", 0.6, 8, 5, 6, 43, 45, 10, 0, 0, 0.9f, 2, 0.2f, 0.5f, -1, 1)); // 4.8 guns.add(new Gun("colt_peacemaker", 0.6, 8, 5, 6, 43, 45, 10, 0, 0, 0.9f, 2, 0.2f, 0.5f, -1, 1)); // 4.8
guns.add(new Gun("tokarev_tt_33", 0.7, 10, 5, 8, 45, 762, 10, 0, 0, 1.5f, 2.5f, 0.25f, 0.5f, -1, 1)); // 7 guns.add(new Gun("tokarev_tt_33", 0.7, 10, 5, 8, 45, 762, 10, 0, 0, 1.5f, 2.5f, 0.25f, 0.5f, -1, 1)); // 7
guns.add(new Gun("357_revolver", 1, 8, 5, 6, 45, 357, 20, 0, 0, 2, 4, 0.2f, 0.5f, -1, 1)); // 8 guns.add(new Gun("357_revolver", 1, 8, 5, 6, 45, 357, 20, 0, 0, 2, 4, 0.2f, 0.5f, -1, 1)); // 8
guns.add(new Gun("awp", 1, 4, 20, 1, 75, 762, 40, 0, 0, 2f, 8, 0.3f, 0.6f, -1, 1)); // 4 guns.add(new Gun("awp", 1, 4, 20, 1, 75, 762, 40, 0, 0, 4f, 16f, 0.3f, 0.6f, -2, 2)); // 4
guns.add(new Gun("rpg9", 2, 4, 20, 1, 10, 999, 20, 20, 0, 3f, 0.5f, 1, 2, -1, 1)); // 8 guns.add(new Gun("rpg9", 2, 4, 20, 1, 10, 999, 20, 10, 0, 3f, 0.5f, 1, 2, -1, 1)); // 8
grenades.add(new GrenadeItem("grenade_m18", 1, 0.1f, 0.2f, 50, false, false, 0, 0, 100, 15, 30)); // 0.02 grenades.add(new GrenadeItem("grenade_m18", 1, 0.1f, 0.2f, 50, false, false, 0, 0, 100, 15, 30)); // 0.02

@ -5,6 +5,8 @@ import net.minecraft.component.type.LoreComponent;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import systems.brn.plasticgun.lib.SimpleItem; import systems.brn.plasticgun.lib.SimpleItem;
@ -28,8 +30,8 @@ public class BulletItem extends SimpleItem {
Text.translatable("gun.description.explosion_coefficient", explosionPowerCoefficient), Text.translatable("gun.description.explosion_coefficient", explosionPowerCoefficient),
Text.translatable("gun.description.repulsion_efficient", repulsionPowerCoefficient), Text.translatable("gun.description.repulsion_efficient", repulsionPowerCoefficient),
Text.translatable(isIncendiary ? "gun.description.incendiary_yes" : "gun.description.incendiary_no") Text.translatable(isIncendiary ? "gun.description.incendiary_yes" : "gun.description.incendiary_no")
)) )))
) .registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
, ,
id(path), id(path),
Items.STICK); Items.STICK);

@ -1,11 +1,12 @@
package systems.brn.plasticgun.defence; package systems.brn.plasticgun.defence;
import dev.emi.trinkets.api.TrinketsApi;
import net.minecraft.component.DataComponentTypes; import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.LoreComponent; import net.minecraft.component.type.LoreComponent;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import systems.brn.plasticgun.lib.TrinketPolymerItem; import systems.brn.plasticgun.lib.TrinketPolymerItem;
import systems.brn.plasticgun.lib.WeaponDamageType; import systems.brn.plasticgun.lib.WeaponDamageType;
@ -25,11 +26,10 @@ public class WeaponArmor extends TrinketPolymerItem {
Text.translatable("gun.description.armor.grenade", (int) ((1 - grenadeDamageCoefficient) * 100)), Text.translatable("gun.description.armor.grenade", (int) ((1 - grenadeDamageCoefficient) * 100)),
Text.translatable("gun.description.armor.fragmentation_grenade", (int) ((1 - fragmentationDamageCoefficient) * 100)), Text.translatable("gun.description.armor.fragmentation_grenade", (int) ((1 - fragmentationDamageCoefficient) * 100)),
Text.translatable("gun.description.armor.shuriken", (int) ((1 - shurikenDamageCoefficient) * 100)) Text.translatable("gun.description.armor.shuriken", (int) ((1 - shurikenDamageCoefficient) * 100))
))) ))).registryKey(RegistryKey.of(RegistryKeys.ITEM, id(name)))
, name) , name)
; ;
Registry.register(Registries.ITEM, id(name), this); Registry.register(Registries.ITEM, id(name), this);
TrinketsApi.registerTrinket(this, this);
resistances.put(WeaponDamageType.BULLET, bulletDamageCoefficient); resistances.put(WeaponDamageType.BULLET, bulletDamageCoefficient);
resistances.put(WeaponDamageType.FRAGMENTATION_GRENADE, fragmentationDamageCoefficient); resistances.put(WeaponDamageType.FRAGMENTATION_GRENADE, fragmentationDamageCoefficient);
resistances.put(WeaponDamageType.GRENADE, grenadeDamageCoefficient); resistances.put(WeaponDamageType.GRENADE, grenadeDamageCoefficient);

@ -8,6 +8,8 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundCategory;
@ -57,6 +59,7 @@ public class GrenadeItem extends SimpleItem implements PolymerItem {
Text.translatable("gun.description.effect_radius", effectRadius), Text.translatable("gun.description.effect_radius", effectRadius),
Text.translatable("gun.description.particle_count", smokeCount) Text.translatable("gun.description.particle_count", smokeCount)
))) )))
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
.maxDamage(explosionTarget + 1) .maxDamage(explosionTarget + 1)
, id(path), Items.STICK , id(path), Items.STICK
); );

@ -10,6 +10,8 @@ import net.minecraft.item.*;
import net.minecraft.network.packet.s2c.play.PositionFlag; import net.minecraft.network.packet.s2c.play.PositionFlag;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundCategory;
@ -28,6 +30,8 @@ import systems.brn.plasticgun.lib.SimpleItem;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import static systems.brn.plasticgun.PlasticGun.bullets; import static systems.brn.plasticgun.PlasticGun.bullets;
import static systems.brn.plasticgun.PlasticGun.itemBulletItemMap; import static systems.brn.plasticgun.PlasticGun.itemBulletItemMap;
import static systems.brn.plasticgun.lib.GunComponents.*; import static systems.brn.plasticgun.lib.GunComponents.*;
@ -73,6 +77,7 @@ public class Gun extends SimpleItem implements PolymerItem {
Text.translatable("gun.description.explosion_power", explosionPowerGun), Text.translatable("gun.description.explosion_power", explosionPowerGun),
Text.translatable("gun.description.repulsion_power", repulsionPowerGun) Text.translatable("gun.description.repulsion_power", repulsionPowerGun)
))) )))
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
.maxDamage(clipSize + 1) .maxDamage(clipSize + 1)
, id(path), Items.WOODEN_SWORD , id(path), Items.WOODEN_SWORD
); );
@ -242,7 +247,7 @@ public class Gun extends SimpleItem implements PolymerItem {
stack.set(DataComponentTypes.LORE, newLore); stack.set(DataComponentTypes.LORE, newLore);
} }
public void doRecoil(LivingEntity entity) { public int doRecoil(LivingEntity entity) {
if (entity.getEntityWorld() instanceof ServerWorld serverWorld) { if (entity.getEntityWorld() instanceof ServerWorld serverWorld) {
Random rng = entity.getWorld().getRandom(); Random rng = entity.getWorld().getRandom();
// Get the entity's current position and yaw // Get the entity's current position and yaw
@ -250,19 +255,22 @@ public class Gun extends SimpleItem implements PolymerItem {
float yaw = entity.getYaw(); float yaw = entity.getYaw();
float newPitch = entity.getPitch(); float newPitch = entity.getPitch();
Vec3d currentLook = entity.getRotationVector().multiply(-1); Vec3d currentLook = entity.getRotationVector().multiply(-1);
newPitch -= verticalRecoilMin + rng.nextFloat() * (verticalRecoilMax - verticalRecoilMin); float yawChange = verticalRecoilMin + rng.nextFloat() * (verticalRecoilMax - verticalRecoilMin);
yaw -= (float) (horizontalRecoilMin + rng.nextFloat() * (horizontalRecoilMax - horizontalRecoilMin)); float pitchChange = (float) (horizontalRecoilMin + rng.nextFloat() * (horizontalRecoilMax - horizontalRecoilMin));
newPitch -= yawChange;
yaw -= pitchChange;
entity.teleport(serverWorld, pos.x, pos.y, pos.z, PositionFlag.ROT, yaw, newPitch, true); entity.teleport(serverWorld, pos.x, pos.y, pos.z, PositionFlag.ROT, yaw, newPitch, true);
double velocityRecoil = rng.nextDouble() * (velocityRecoilMax - velocityRecoilMin); double velocityRecoil = rng.nextDouble() * (velocityRecoilMax - velocityRecoilMin);
if (velocityRecoil > 0) { if (velocityRecoil > 0) {
entity.setVelocity(currentLook.multiply(velocityRecoil)); entity.setVelocity(currentLook.multiply(velocityRecoil));
} }
return (int) ((abs(yawChange) + abs(pitchChange) + abs(velocityRecoil) + max(abs(yawChange), max(abs(pitchChange), abs(velocityRecoil)))) / 4f) * 40;
} }
return 0;
} }
public void shoot(ServerWorld world, LivingEntity user, Hand hand) { public int shoot(ServerWorld world, LivingEntity user, Hand hand) {
int stunLen = 0;
if (!world.isClient()) { if (!world.isClient()) {
ItemStack stack = user.getStackInHand(hand); ItemStack stack = user.getStackInHand(hand);
int currentReload = stack.getOrDefault(GUN_LOADING_COMPONENT, 1); int currentReload = stack.getOrDefault(GUN_LOADING_COMPONENT, 1);
@ -280,7 +288,7 @@ public class Gun extends SimpleItem implements PolymerItem {
world.playSound(null, user.getX(), user.getY(), user.getZ(), SoundEvents.ENTITY_GENERIC_EXPLODE.value(), SoundCategory.PLAYERS, 0.1f, 1.2f); world.playSound(null, user.getX(), user.getY(), user.getZ(), SoundEvents.ENTITY_GENERIC_EXPLODE.value(), SoundCategory.PLAYERS, 0.1f, 1.2f);
chamber.decrement(1); chamber.decrement(1);
stack.set(GUN_COOLDOWN_COMPONENT, cooldownTarget); stack.set(GUN_COOLDOWN_COMPONENT, cooldownTarget);
doRecoil(user); stunLen = doRecoil(user);
if (chamber.isEmpty()) { if (chamber.isEmpty()) {
stack.remove(GUN_AMMO_COMPONENT); stack.remove(GUN_AMMO_COMPONENT);
} else { } else {
@ -291,6 +299,7 @@ public class Gun extends SimpleItem implements PolymerItem {
} }
updateDamage(stack); updateDamage(stack);
} }
return stunLen;
} }
private @NotNull BulletEntity getBulletEntity(LivingEntity entity, Hand hand, BulletItem bullet, ItemStack chamber) { private @NotNull BulletEntity getBulletEntity(LivingEntity entity, Hand hand, BulletItem bullet, ItemStack chamber) {

@ -157,7 +157,7 @@ public class WeaponShootGoal<T extends HostileEntity & RangedAttackMob> extends
ItemStack chamber = gunStack.getOrDefault(GUN_AMMO_COMPONENT, ItemStack.EMPTY).copy(); ItemStack chamber = gunStack.getOrDefault(GUN_AMMO_COMPONENT, ItemStack.EMPTY).copy();
if (!chamber.isEmpty() && currentReload == 1 && currentCooldown == 0 && lockedTicks >= 10) { if (!chamber.isEmpty() && currentReload == 1 && currentCooldown == 0 && lockedTicks >= 10) {
if (this.actor.getEntityWorld() instanceof ServerWorld serverWorld) { if (this.actor.getEntityWorld() instanceof ServerWorld serverWorld) {
gun.shoot(serverWorld, this.actor, gunHand); this.targetSeeingTicker -= gun.shoot(serverWorld, this.actor, gunHand);
} }
} }
} }

@ -3,13 +3,15 @@ package systems.brn.plasticgun.lib;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import static systems.brn.plasticgun.lib.Util.id; import static systems.brn.plasticgun.lib.Util.id;
public class CraftingItem extends SimpleItem{ public class CraftingItem extends SimpleItem{
public CraftingItem(String name) { public CraftingItem(String name) {
super(new Settings(), id(name), Items.STICK); super(new Settings().registryKey(RegistryKey.of(RegistryKeys.ITEM, id(name))), id(name), Items.STICK);
Registry.register(Registries.ITEM, id(name), this); Registry.register(Registries.ITEM, id(name), this);
} }
} }

@ -21,6 +21,7 @@ import net.minecraft.world.World;
import systems.brn.plasticgun.grenades.GrenadeEntity; import systems.brn.plasticgun.grenades.GrenadeEntity;
import systems.brn.plasticgun.grenades.GrenadeItem; import systems.brn.plasticgun.grenades.GrenadeItem;
import systems.brn.plasticgun.packets.ModDetect; import systems.brn.plasticgun.packets.ModDetect;
import java.util.function.Predicate; import java.util.function.Predicate;
import static systems.brn.plasticgun.PlasticGun.*; import static systems.brn.plasticgun.PlasticGun.*;
@ -29,7 +30,7 @@ import static systems.brn.plasticgun.lib.GunComponents.*;
public class EventHandler { public class EventHandler {
public static ActionResult onItemUse(PlayerEntity playerEntity, World world, Hand hand) { public static ActionResult onItemUse(PlayerEntity playerEntity, World world, Hand hand) {
if (playerEntity instanceof ServerPlayerEntity serverPlayerEntity) { if (playerEntity instanceof ServerPlayerEntity serverPlayerEntity) {
if (!world.isClient && !clientsWithMod.contains(serverPlayerEntity)) { if (!world.isClient) {
rightClickWithItem(serverPlayerEntity, hand); rightClickWithItem(serverPlayerEntity, hand);
} }
} }
@ -108,11 +109,9 @@ public class EventHandler {
if (!world.isClient) { if (!world.isClient) {
for (ServerPlayerEntity player : world.getPlayers()) { for (ServerPlayerEntity player : world.getPlayers()) {
Hand hand = player.getActiveHand(); Hand hand = player.getActiveHand();
if (!clientsWithMod.contains(player)) {
if (player.handSwinging && player.handSwingTicks == -1) { if (player.handSwinging && player.handSwingTicks == -1) {
leftClickWithItem(player, hand); leftClickWithItem(player, hand);
} }
}
tickItemUpdate(player); tickItemUpdate(player);
} }
mobTickUpdate(world); mobTickUpdate(world);

@ -2,7 +2,6 @@ package systems.brn.plasticgun.lib;
import eu.pb4.polymer.core.api.item.PolymerItem; import eu.pb4.polymer.core.api.item.PolymerItem;
import eu.pb4.polymer.core.api.item.SimplePolymerItem; import eu.pb4.polymer.core.api.item.SimplePolymerItem;
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
import net.minecraft.item.*; import net.minecraft.item.*;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import xyz.nucleoid.packettweaker.PacketContext; import xyz.nucleoid.packettweaker.PacketContext;
@ -14,7 +13,7 @@ public abstract class SimpleItem extends SimplePolymerItem implements PolymerIte
public SimpleItem(Settings settings, Identifier identifier, Item replacement) { public SimpleItem(Settings settings, Identifier identifier, Item replacement) {
super(settings, replacement); super(settings, replacement);
this.identifier = identifier; this.identifier = identifier;
this.polymerModel = PolymerResourcePackUtils.getBridgedModelId(identifier.withPath("item/" + identifier.getPath())); this.polymerModel = identifier.withPath("item/" + identifier.getPath());
} }
@Override @Override

@ -1,29 +1,23 @@
package systems.brn.plasticgun.lib; package systems.brn.plasticgun.lib;
import dev.emi.trinkets.TrinketSlot;
import dev.emi.trinkets.api.*; import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.sound.SoundEvents;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.ActionResult; import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand; import net.minecraft.util.Hand;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.event.GameEvent;
import java.util.Map;
import java.util.Optional;
import static systems.brn.plasticgun.lib.Util.id; import static systems.brn.plasticgun.lib.Util.id;
public class TrinketPolymerItem extends SimpleItem implements Trinket { public class TrinketPolymerItem extends SimpleItem {
public TrinketPolymerItem(Item.Settings settings, String name) { public TrinketPolymerItem(Item.Settings settings, String name) {
super(settings, id(name), Items.STICK); super(settings.equippable(EquipmentSlot.CHEST), id(name), Items.STICK);
TrinketsApi.registerTrinket(this, this);
} }
@Override @Override
@ -40,31 +34,8 @@ public class TrinketPolymerItem extends SimpleItem implements Trinket {
} }
public static boolean equipItem(LivingEntity user, ItemStack stack) { public static boolean equipItem(LivingEntity user, ItemStack stack) {
Optional<TrinketComponent> optional = TrinketsApi.getTrinketComponent(user); user.equipStack(EquipmentSlot.CHEST, stack);
if (optional.isPresent()) { user.playSound(SoundEvents.ITEM_ARMOR_EQUIP_CHAIN.value());
TrinketComponent comp = optional.get();
for (Map<String, TrinketInventory> group : comp.getInventory().values()) {
for (TrinketInventory inv : group.values()) {
for (int i = 0; i < inv.size(); i++) {
if (inv.getStack(i).isEmpty()) {
SlotReference ref = new SlotReference(inv, i);
if (TrinketSlot.canInsert(stack, ref, user)) {
ItemStack newStack = stack.copy();
inv.setStack(i, newStack);
Trinket trinket = TrinketsApi.getTrinket(stack.getItem());
RegistryEntry<SoundEvent> soundEvent = trinket.getEquipSound(stack, ref, user);
if (!stack.isEmpty() && soundEvent != null) {
user.emitGameEvent(GameEvent.EQUIP);
user.playSound(soundEvent.value(), 1.0F, 1.0F);
}
stack.setCount(0);
return true;
}
}
}
}
}
}
return false; return false;
} }
} }

@ -1,14 +1,11 @@
package systems.brn.plasticgun.lib; package systems.brn.plasticgun.lib;
import dev.emi.trinkets.api.SlotReference;
import dev.emi.trinkets.api.TrinketComponent;
import dev.emi.trinkets.api.TrinketInventory;
import dev.emi.trinkets.api.TrinketsApi;
import eu.pb4.polymer.virtualentity.api.tracker.DisplayTrackedData; import eu.pb4.polymer.virtualentity.api.tracker.DisplayTrackedData;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents; import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.DataTracker;
import net.minecraft.entity.decoration.DisplayEntity; import net.minecraft.entity.decoration.DisplayEntity;
@ -27,7 +24,6 @@ import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundEvents; import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.Pair;
import net.minecraft.util.math.Box; import net.minecraft.util.math.Box;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@ -165,18 +161,12 @@ public class Util {
} }
public static double getFinalDamage(LivingEntity livingEntity, WeaponDamageType damageType, double damage) { public static double getFinalDamage(LivingEntity livingEntity, WeaponDamageType damageType, double damage) {
Optional<TrinketComponent> trinketComponentTemp = TrinketsApi.getTrinketComponent(livingEntity);
if (trinketComponentTemp.isPresent()) {
TrinketComponent trinketComponent = trinketComponentTemp.get();
for (WeaponArmor weaponArmor : weaponArmors) { for (WeaponArmor weaponArmor : weaponArmors) {
if (weaponArmor.resistances.containsKey(damageType)) { if (weaponArmor.resistances.containsKey(damageType)) {
List<Pair<SlotReference, ItemStack>> vestsComponents = trinketComponent.getEquipped(weaponArmor); ItemStack chestStack = livingEntity.getEquippedStack(EquipmentSlot.CHEST);
if (!vestsComponents.isEmpty()) { int currentDamage = chestStack.getDamage();
Pair<SlotReference, ItemStack> vestComponent = vestsComponents.getFirst(); int maxDamage = chestStack.getMaxDamage();
TrinketInventory trinketInventory = vestComponent.getLeft().inventory();
int currentDamage = vestComponent.getRight().getDamage();
int maxDamage = vestComponent.getRight().getMaxDamage();
double reducedDamage = 0; double reducedDamage = 0;
if (currentDamage < maxDamage) { if (currentDamage < maxDamage) {
double coefficient = weaponArmor.resistances.get(damageType); double coefficient = weaponArmor.resistances.get(damageType);
@ -185,16 +175,12 @@ public class Util {
} }
int nextDamage = currentDamage + (int) reducedDamage; int nextDamage = currentDamage + (int) reducedDamage;
int inventoryIndex = vestComponent.getLeft().index();
ItemStack vestStack = trinketInventory.getStack(inventoryIndex);
if (nextDamage >= maxDamage) { if (nextDamage >= maxDamage) {
vestStack.setCount(0); chestStack.setCount(0);
} else { } else {
vestStack.setDamage(nextDamage); chestStack.setDamage(nextDamage);
}
trinketInventory.setStack(inventoryIndex, vestStack);
}
} }
livingEntity.equipStack(EquipmentSlot.CHEST, chestStack);
} }
} }
return damage; return damage;
@ -304,6 +290,7 @@ public class Util {
} }
} }
} }
public static void addItemToLootTable(RegistryKey<LootTable> tableId, Item item, Integer weight) { public static void addItemToLootTable(RegistryKey<LootTable> tableId, Item item, Integer weight) {
LootTableEvents.MODIFY.register((key, tableBuilder, source, wrapperLookup) -> { LootTableEvents.MODIFY.register((key, tableBuilder, source, wrapperLookup) -> {
if (source.isBuiltin() && tableId.equals(key)) { if (source.isBuiltin() && tableId.equals(key)) {
@ -311,6 +298,7 @@ public class Util {
} }
}); });
} }
public static int getAfterWeight(float coeff, int weight) { public static int getAfterWeight(float coeff, int weight) {
return (int) Math.ceil(coeff * weight); return (int) Math.ceil(coeff * weight);
} }

@ -8,6 +8,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.registry.Registries; import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry; import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundCategory;
@ -35,6 +37,7 @@ public class ShurikenItem extends SimpleItem implements PolymerItem {
Text.translatable("gun.description.speed", speed), Text.translatable("gun.description.speed", speed),
Text.translatable("gun.description.damage_with_coefficient_max_speed", speed, speed * damage) Text.translatable("gun.description.damage_with_coefficient_max_speed", speed, speed * damage)
))) )))
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id(path)))
, id(path), Items.WOODEN_PICKAXE , id(path), Items.WOODEN_PICKAXE
); );
Registry.register(Registries.ITEM, id(path), this); Registry.register(Registries.ITEM, id(path), this);

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "minecraft:copper_ingot" } "minecraft:copper_ingot"
], ],
"result": { "result": {
"id": "plasticgun:32_acp", "id": "plasticgun:32_acp",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "plasticgun:enhanced_gunpowder" }, "plasticgun:enhanced_gunpowder",
{ "item": "minecraft:copper_ingot" }, "minecraft:copper_ingot",
{ "item": "plasticgun:kevlar_sheet" } "plasticgun:kevlar_sheet"
], ],
"result": { "result": {
"id": "plasticgun:32_acp_high_velocity", "id": "plasticgun:32_acp_high_velocity",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "plasticgun:enhanced_gunpowder" }, "plasticgun:enhanced_gunpowder",
{ "item": "minecraft:iron_nugget" }, "minecraft:iron_nugget",
{ "item": "plasticgun:kevlar_sheet" } "plasticgun:kevlar_sheet"
], ],
"result": { "result": {
"id": "plasticgun:357_magnum", "id": "plasticgun:357_magnum",

@ -6,10 +6,10 @@
" TI" " TI"
], ],
"key": { "key": {
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"T": { "item": "plasticgun:trigger_mechanism" }, "T": "plasticgun:trigger_mechanism",
"I": { "item": "plasticgun:iron_shuriken" } "I": "plasticgun:iron_shuriken"
}, },
"result": { "result": {
"id": "plasticgun:357_revolver", "id": "plasticgun:357_revolver",

@ -1,15 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "minecraft:gunpowder",
"item": "minecraft:gunpowder" "minecraft:iron_nugget",
}, "plasticgun:kevlar_sheet"
{
"item": "minecraft:iron_nugget"
},
{
"item": "plasticgun:kevlar_sheet"
}
], ],
"result": { "result": {
"id": "plasticgun:357_standard", "id": "plasticgun:357_standard",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "plasticgun:ceramic_plate" } "plasticgun:ceramic_plate"
], ],
"result": { "result": {
"id": "plasticgun:38_special", "id": "plasticgun:38_special",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "plasticgun:enhanced_gunpowder" }, "plasticgun:enhanced_gunpowder",
{ "item": "plasticgun:ceramic_plate" }, "plasticgun:ceramic_plate",
{ "item": "plasticgun:kevlar_sheet" } "plasticgun:kevlar_sheet"
], ],
"result": { "result": {
"id": "plasticgun:38_special_p", "id": "plasticgun:38_special_p",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "minecraft:iron_nugget" } "minecraft:iron_nugget"
], ],
"result": { "result": {
"id": "plasticgun:45_acp", "id": "plasticgun:45_acp",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "plasticgun:enhanced_gunpowder" }, "plasticgun:enhanced_gunpowder",
{ "item": "minecraft:iron_nugget" }, "minecraft:iron_nugget",
{ "item": "plasticgun:composite_resin" } "plasticgun:composite_resin"
], ],
"result": { "result": {
"id": "plasticgun:45_acp_hollow_point", "id": "plasticgun:45_acp_hollow_point",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "plasticgun:titanium_alloy" } "plasticgun:titanium_alloy"
], ],
"result": { "result": {
"id": "plasticgun:762_tokarev", "id": "plasticgun:762_tokarev",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "plasticgun:enhanced_gunpowder" }, "plasticgun:enhanced_gunpowder",
{ "item": "plasticgun:titanium_alloy" }, "plasticgun:titanium_alloy",
{ "item": "plasticgun:kevlar_sheet" } "plasticgun:kevlar_sheet"
], ],
"result": { "result": {
"id": "plasticgun:762_tokarev_ap", "id": "plasticgun:762_tokarev_ap",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "plasticgun:enhanced_gunpowder" }, "plasticgun:enhanced_gunpowder",
{ "item": "minecraft:gold_nugget" }, "minecraft:gold_nugget",
{ "item": "plasticgun:kevlar_sheet" } "plasticgun:kevlar_sheet"
], ],
"result": { "result": {
"id": "plasticgun:9mm_jhp", "id": "plasticgun:9mm_jhp",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "minecraft:gold_nugget" } "minecraft:gold_nugget"
], ],
"result": { "result": {
"id": "plasticgun:9mm_parabellum", "id": "plasticgun:9mm_parabellum",

@ -6,10 +6,10 @@
"RCR" "RCR"
], ],
"key": { "key": {
"R": { "item": "minecraft:redstone" }, "R": "minecraft:redstone",
"C": { "item": "minecraft:comparator" }, "C": "minecraft:comparator",
"I": { "item": "minecraft:iron_ingot" }, "I": "minecraft:iron_ingot",
"L": { "item": "minecraft:lapis_lazuli" } "L": "minecraft:lapis_lazuli"
}, },
"result": { "result": {
"id": "plasticgun:advanced_circuit", "id": "plasticgun:advanced_circuit",

@ -6,12 +6,12 @@
"I R" "I R"
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"P": { "item": "plasticgun:precision_gear" }, "P": "plasticgun:precision_gear",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"I": { "item": "plasticgun:iron_shuriken" }, "I": "plasticgun:iron_shuriken",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:ak_47", "id": "plasticgun:ak_47",

@ -6,8 +6,8 @@
" H " " H "
], ],
"key": { "key": {
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"T": { "item": "plasticgun:titanium_alloy" } "T": "plasticgun:titanium_alloy"
}, },
"result": { "result": {
"id": "plasticgun:alloy_wheel", "id": "plasticgun:alloy_wheel",

@ -6,12 +6,12 @@
"PGR" "PGR"
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"P": { "item": "plasticgun:precision_gear" }, "P": "plasticgun:precision_gear",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:awp", "id": "plasticgun:awp",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:clay_ball" }, "minecraft:clay_ball",
{ "item": "minecraft:bone_meal" } "minecraft:bone_meal"
], ],
"result": { "result": {
"id": "plasticgun:ceramic_mixture", "id": "plasticgun:ceramic_mixture",

@ -1,8 +1,6 @@
{ {
"type": "minecraft:smelting", "type": "minecraft:smelting",
"ingredient": { "ingredient": "plasticgun:ceramic_mixture",
"item": "plasticgun:ceramic_mixture"
},
"result": { "result": {
"id": "plasticgun:ceramic_plate" "id": "plasticgun:ceramic_plate"
}, },

@ -6,11 +6,11 @@
"PI " "PI "
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"P": { "item": "plasticgun:precision_gear" }, "P": "plasticgun:precision_gear",
"I": { "item": "plasticgun:iron_shuriken" } "I": "plasticgun:iron_shuriken"
}, },
"result": { "result": {
"id": "plasticgun:colt_1903", "id": "plasticgun:colt_1903",

@ -6,12 +6,12 @@
" RC" " RC"
], ],
"key": { "key": {
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"P": { "item": "plasticgun:precision_gear" }, "P": "plasticgun:precision_gear",
"T": { "item": "plasticgun:trigger_mechanism" }, "T": "plasticgun:trigger_mechanism",
"I": { "item": "plasticgun:iron_shuriken" }, "I": "plasticgun:iron_shuriken",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:colt_45", "id": "plasticgun:colt_45",

@ -6,10 +6,10 @@
" TR" " TR"
], ],
"key": { "key": {
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"T": { "item": "plasticgun:trigger_mechanism" }, "T": "plasticgun:trigger_mechanism",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:colt_peacemaker", "id": "plasticgun:colt_peacemaker",

@ -6,8 +6,8 @@
"CCC" "CCC"
], ],
"key": { "key": {
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"H": { "item": "plasticgun:hardened_steel" } "H": "plasticgun:hardened_steel"
}, },
"result": { "result": {
"id": "plasticgun:composite_frame", "id": "plasticgun:composite_frame",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:slime_ball" }, "minecraft:slime_ball",
{ "item": "minecraft:clay_ball" } "minecraft:clay_ball"
], ],
"result": { "result": {
"id": "plasticgun:composite_resin", "id": "plasticgun:composite_resin",

@ -6,7 +6,7 @@
" C" " C"
], ],
"key": { "key": {
"C": { "item": "minecraft:copper_ingot" } "C": "minecraft:copper_ingot"
}, },
"result": { "result": {
"id": "plasticgun:copper_wiring", "id": "plasticgun:copper_wiring",

@ -6,7 +6,7 @@
" D " " D "
], ],
"key": { "key": {
"D": { "item": "minecraft:diamond" } "D": "minecraft:diamond"
}, },
"result": { "result": {
"id": "plasticgun:diamond_shuriken" "id": "plasticgun:diamond_shuriken"

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "plasticgun:explosive_powder" } "plasticgun:explosive_powder"
], ],
"result": { "result": {
"id": "plasticgun:enhanced_gunpowder", "id": "plasticgun:enhanced_gunpowder",

@ -1,9 +1,9 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:gunpowder" }, "minecraft:gunpowder",
{ "item": "minecraft:blaze_powder" }, "minecraft:blaze_powder",
{ "item": "minecraft:coal" } "minecraft:coal"
], ],
"result": { "result": {
"id": "plasticgun:explosive_powder", "id": "plasticgun:explosive_powder",

@ -1,21 +1,11 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "plasticgun:hyperalloy",
"item": "plasticgun:hyperalloy" "minecraft:iron_chestplate",
}, "plasticgun:hyperalloy",
{ "plasticgun:hyperalloy",
"item": "minecraft:iron_chestplate" "plasticgun:hyperalloy"
},
{
"item": "plasticgun:hyperalloy"
},
{
"item": "plasticgun:hyperalloy"
},
{
"item": "plasticgun:hyperalloy"
}
], ],
"result": { "result": {
"id": "plasticgun:flak_vest", "id": "plasticgun:flak_vest",

@ -6,9 +6,9 @@
" C " " C "
], ],
"key": { "key": {
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"P": { "item": "plasticgun:plasma_core" } "P": "plasticgun:plasma_core"
}, },
"result": { "result": {
"id": "plasticgun:force_container", "id": "plasticgun:force_container",

@ -6,10 +6,10 @@
" H " " H "
], ],
"key": { "key": {
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"H": { "item": "plasticgun:hardened_steel" } "H": "plasticgun:hardened_steel"
}, },
"result": { "result": {
"id": "plasticgun:forcegun", "id": "plasticgun:forcegun",

@ -6,7 +6,7 @@
" G " " G "
], ],
"key": { "key": {
"G": { "item": "minecraft:gold_ingot" } "G": "minecraft:gold_ingot"
}, },
"result": { "result": {
"id": "plasticgun:golden_shuriken" "id": "plasticgun:golden_shuriken"

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:coal_block" }, "minecraft:coal_block",
{ "item": "minecraft:shears" } "minecraft:shears"
], ],
"result": { "result": {
"id": "plasticgun:graphene_sheet", "id": "plasticgun:graphene_sheet",

@ -6,10 +6,10 @@
" G " " G "
], ],
"key": { "key": {
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"C": { "item": "plasticgun:ceramic_plate" }, "C": "plasticgun:ceramic_plate",
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"G": { "item": "plasticgun:graphene_sheet" } "G": "plasticgun:graphene_sheet"
}, },
"result": { "result": {
"id": "plasticgun:grenade_an_m14", "id": "plasticgun:grenade_an_m14",

@ -6,10 +6,10 @@
" G " " G "
], ],
"key": { "key": {
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" } "G": "plasticgun:graphene_sheet"
}, },
"result": { "result": {
"id": "plasticgun:grenade_f1", "id": "plasticgun:grenade_f1",

@ -6,10 +6,10 @@
" P " " P "
], ],
"key": { "key": {
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"P": { "item": "plasticgun:plasma_core" } "P": "plasticgun:plasma_core"
}, },
"result": { "result": {
"id": "plasticgun:grenade_k417", "id": "plasticgun:grenade_k417",

@ -6,10 +6,10 @@
" R " " R "
], ],
"key": { "key": {
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:grenade_m18", "id": "plasticgun:grenade_m18",

@ -6,10 +6,10 @@
" P " " P "
], ],
"key": { "key": {
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"P": { "item": "plasticgun:plasma_core" } "P": "plasticgun:plasma_core"
}, },
"result": { "result": {
"id": "plasticgun:grenade_m34", "id": "plasticgun:grenade_m34",

@ -6,10 +6,10 @@
" G " " G "
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" } "G": "plasticgun:graphene_sheet"
}, },
"result": { "result": {
"id": "plasticgun:grenade_m7a3", "id": "plasticgun:grenade_m7a3",

@ -6,10 +6,10 @@
" P " " P "
], ],
"key": { "key": {
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"P": { "item": "plasticgun:plasma_core" } "P": "plasticgun:plasma_core"
}, },
"result": { "result": {
"id": "plasticgun:grenade_m84", "id": "plasticgun:grenade_m84",

@ -6,10 +6,10 @@
" T " " T "
], ],
"key": { "key": {
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"T": { "item": "plasticgun:titanium_alloy" } "T": "plasticgun:titanium_alloy"
}, },
"result": { "result": {
"id": "plasticgun:grenade_mk3a2", "id": "plasticgun:grenade_mk3a2",

@ -6,10 +6,10 @@
" G " " G "
], ],
"key": { "key": {
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"G": { "item": "plasticgun:graphene_sheet" } "G": "plasticgun:graphene_sheet"
}, },
"result": { "result": {
"id": "plasticgun:grenade_no_69", "id": "plasticgun:grenade_no_69",

@ -6,10 +6,10 @@
" P " " P "
], ],
"key": { "key": {
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"P": { "item": "plasticgun:plasma_core" } "P": "plasticgun:plasma_core"
}, },
"result": { "result": {
"id": "plasticgun:grenade_rgd_5", "id": "plasticgun:grenade_rgd_5",

@ -6,10 +6,10 @@
" T " " T "
], ],
"key": { "key": {
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"C": { "item": "plasticgun:composite_resin" }, "C": "plasticgun:composite_resin",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"T": { "item": "plasticgun:titanium_alloy" } "T": "plasticgun:titanium_alloy"
}, },
"result": { "result": {
"id": "plasticgun:grenade_rgo", "id": "plasticgun:grenade_rgo",

@ -6,10 +6,10 @@
" G " " G "
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" } "G": "plasticgun:graphene_sheet"
}, },
"result": { "result": {
"id": "plasticgun:grenade_thermite", "id": "plasticgun:grenade_thermite",

@ -1,8 +1,6 @@
{ {
"type": "minecraft:smelting", "type": "minecraft:smelting",
"ingredient": { "ingredient": "minecraft:iron_block",
"item": "minecraft:iron_block"
},
"result": { "result": {
"id": "plasticgun:hardened_steel" "id": "plasticgun:hardened_steel"
}, },

@ -6,9 +6,9 @@
"TTT" "TTT"
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:hyperalloy", "id": "plasticgun:hyperalloy",

@ -6,7 +6,7 @@
" I " " I "
], ],
"key": { "key": {
"I": { "item": "minecraft:iron_ingot" } "I": "minecraft:iron_ingot"
}, },
"result": { "result": {
"id": "plasticgun:iron_shuriken" "id": "plasticgun:iron_shuriken"

@ -6,8 +6,8 @@
" K " " K "
], ],
"key": { "key": {
"K": { "item": "plasticgun:reinforced_fiber" }, "K": "plasticgun:reinforced_fiber",
"F": { "item": "minecraft:feather" } "F": "minecraft:feather"
}, },
"result": { "result": {
"id": "plasticgun:kevlar_sheet", "id": "plasticgun:kevlar_sheet",

@ -6,9 +6,7 @@
"KKK" "KKK"
], ],
"key": { "key": {
"K": { "K": "plasticgun:kevlar_sheet"
"item": "plasticgun:kevlar_sheet"
}
}, },
"result": { "result": {
"id": "plasticgun:kevlar_vest" "id": "plasticgun:kevlar_vest"

@ -6,15 +6,9 @@
" C " " C "
], ],
"key": { "key": {
"C": { "C": "plasticgun:copper_wiring",
"item": "plasticgun:copper_wiring" "I": "minecraft:iron_ingot",
}, "R": "plasticgun:reinforced_fiber"
"I": {
"item": "minecraft:iron_ingot"
},
"R": {
"item": "plasticgun:reinforced_fiber"
}
}, },
"result": { "result": {
"id": "plasticgun:magnetic_coil", "id": "plasticgun:magnetic_coil",

@ -6,9 +6,9 @@
" S " " S "
], ],
"key": { "key": {
"S": { "item": "plasticgun:silicon_wafer" }, "S": "plasticgun:silicon_wafer",
"R": { "item": "minecraft:redstone" }, "R": "minecraft:redstone",
"I": { "item": "plasticgun:advanced_circuit" } "I": "plasticgun:advanced_circuit"
}, },
"result": { "result": {
"id": "plasticgun:microchip", "id": "plasticgun:microchip",

@ -6,7 +6,7 @@
" G " " G "
], ],
"key": { "key": {
"G": { "item": "plasticgun:graphene_sheet" } "G": "plasticgun:graphene_sheet"
}, },
"result": { "result": {
"id": "plasticgun:nano_tubes", "id": "plasticgun:nano_tubes",

@ -6,9 +6,7 @@
" N " " N "
], ],
"key": { "key": {
"N": { "N": "minecraft:netherite_ingot"
"item": "minecraft:netherite_ingot"
}
}, },
"result": { "result": {
"id": "plasticgun:netherite_shuriken" "id": "plasticgun:netherite_shuriken"

@ -6,11 +6,11 @@
"PI " "PI "
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"P": { "item": "plasticgun:precision_gear" }, "P": "plasticgun:precision_gear",
"I": { "item": "plasticgun:iron_shuriken" } "I": "plasticgun:iron_shuriken"
}, },
"result": { "result": {
"id": "plasticgun:p2022", "id": "plasticgun:p2022",

@ -6,9 +6,9 @@
"GEG" "GEG"
], ],
"key": { "key": {
"G": { "item": "minecraft:ghast_tear" }, "G": "minecraft:ghast_tear",
"E": { "item": "minecraft:ender_eye" }, "E": "minecraft:ender_eye",
"C": { "item": "plasticgun:composite_frame" } "C": "plasticgun:composite_frame"
}, },
"result": { "result": {
"id": "plasticgun:plasma_core", "id": "plasticgun:plasma_core",

@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "item": "minecraft:redstone_block" }, "minecraft:redstone_block",
{ "item": "plasticgun:advanced_circuit" } "plasticgun:advanced_circuit"
], ],
"result": { "result": {
"id": "plasticgun:power_cell", "id": "plasticgun:power_cell",

@ -6,9 +6,9 @@
" H " " H "
], ],
"key": { "key": {
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"I": { "item": "minecraft:iron_ingot" }, "I": "minecraft:iron_ingot",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:precision_gear", "id": "plasticgun:precision_gear",

@ -6,9 +6,9 @@
" S " " S "
], ],
"key": { "key": {
"S": { "item": "minecraft:string" }, "S": "minecraft:string",
"F": { "item": "minecraft:feather" }, "F": "minecraft:feather",
"I": { "item": "plasticgun:composite_resin" } "I": "plasticgun:composite_resin"
}, },
"result": { "result": {
"id": "plasticgun:reinforced_fiber", "id": "plasticgun:reinforced_fiber",

@ -6,10 +6,10 @@
" T " " T "
], ],
"key": { "key": {
"P": { "item": "plasticgun:plasma_core" }, "P": "plasticgun:plasma_core",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"T": { "item": "plasticgun:trigger_mechanism" } "T": "plasticgun:trigger_mechanism"
}, },
"result": { "result": {
"id": "plasticgun:rpg9", "id": "plasticgun:rpg9",

@ -6,9 +6,9 @@
" E " " E "
], ],
"key": { "key": {
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"H": { "item": "plasticgun:hardened_steel" } "H": "plasticgun:hardened_steel"
}, },
"result": { "result": {
"id": "plasticgun:rpg_shell", "id": "plasticgun:rpg_shell",

@ -6,9 +6,9 @@
" E " " E "
], ],
"key": { "key": {
"E": { "item": "plasticgun:explosive_powder" }, "E": "plasticgun:explosive_powder",
"G": { "item": "plasticgun:graphene_sheet" }, "G": "plasticgun:graphene_sheet",
"P": { "item": "plasticgun:plasma_core" } "P": "plasticgun:plasma_core"
}, },
"result": { "result": {
"id": "plasticgun:rpg_shell_incendiary", "id": "plasticgun:rpg_shell_incendiary",

@ -1,33 +1,15 @@
{ {
"type": "minecraft:crafting_shapeless", "type": "minecraft:crafting_shapeless",
"ingredients": [ "ingredients": [
{ "minecraft:sand",
"item": "minecraft:sand" "minecraft:quartz",
}, "minecraft:sand",
{ "minecraft:quartz",
"item": "minecraft:quartz" "minecraft:sand",
}, "minecraft:quartz",
{ "minecraft:sand",
"item": "minecraft:sand" "minecraft:quartz",
}, "minecraft:quartz"
{
"item": "minecraft:quartz"
},
{
"item": "minecraft:sand"
},
{
"item": "minecraft:quartz"
},
{
"item": "minecraft:sand"
},
{
"item": "minecraft:quartz"
},
{
"item": "minecraft:quartz"
}
], ],
"result": { "result": {
"id": "plasticgun:silicon_mixture", "id": "plasticgun:silicon_mixture",

@ -1,8 +1,6 @@
{ {
"type": "minecraft:smelting", "type": "minecraft:smelting",
"ingredient": { "ingredient": "plasticgun:silicon_mixture",
"item": "plasticgun:silicon_mixture"
},
"result": { "result": {
"id": "plasticgun:silicon_wafer" "id": "plasticgun:silicon_wafer"
}, },

@ -6,9 +6,9 @@
" T " " T "
], ],
"key": { "key": {
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"T": { "item": "plasticgun:trigger_mechanism" } "T": "plasticgun:trigger_mechanism"
}, },
"result": { "result": {
"id": "plasticgun:snub_nosed_revolver", "id": "plasticgun:snub_nosed_revolver",

@ -6,7 +6,7 @@
" S " " S "
], ],
"key": { "key": {
"S": { "item": "minecraft:cobblestone" } "S": "minecraft:cobblestone"
}, },
"result": { "result": {
"id": "plasticgun:stone_shuriken" "id": "plasticgun:stone_shuriken"

@ -6,8 +6,8 @@
"NNN" "NNN"
], ],
"key": { "key": {
"N": { "item": "plasticgun:nano_tubes" }, "N": "plasticgun:nano_tubes",
"I": { "item": "minecraft:iron_ingot" } "I": "minecraft:iron_ingot"
}, },
"result": { "result": {
"id": "plasticgun:titanium_alloy", "id": "plasticgun:titanium_alloy",

@ -6,11 +6,11 @@
"PI " "PI "
], ],
"key": { "key": {
"T": { "item": "plasticgun:titanium_alloy" }, "T": "plasticgun:titanium_alloy",
"C": { "item": "plasticgun:composite_frame" }, "C": "plasticgun:composite_frame",
"H": { "item": "plasticgun:hardened_steel" }, "H": "plasticgun:hardened_steel",
"P": { "item": "plasticgun:precision_gear" }, "P": "plasticgun:precision_gear",
"I": { "item": "plasticgun:iron_shuriken" } "I": "plasticgun:iron_shuriken"
}, },
"result": { "result": {
"id": "plasticgun:tokarev_tt_33", "id": "plasticgun:tokarev_tt_33",

@ -6,11 +6,11 @@
"IRI" "IRI"
], ],
"key": { "key": {
"I": { "item": "minecraft:iron_ingot" }, "I": "minecraft:iron_ingot",
"G": { "item": "plasticgun:precision_gear" }, "G": "plasticgun:precision_gear",
"C": { "item": "plasticgun:ceramic_plate" }, "C": "plasticgun:ceramic_plate",
"S": { "item": "minecraft:string" }, "S": "minecraft:string",
"R": { "item": "plasticgun:reinforced_fiber" } "R": "plasticgun:reinforced_fiber"
}, },
"result": { "result": {
"id": "plasticgun:trigger_mechanism", "id": "plasticgun:trigger_mechanism",

@ -1,8 +0,0 @@
{
"entities": [
"player"
],
"slots": [
"chest/vest"
]
}

@ -1,6 +0,0 @@
{
"replace": false,
"amount": 1,
"order": 0,
"icon": "plasticgun:gui/slots/vest_slot"
}

@ -1,7 +0,0 @@
{
"replace": false,
"values": [
"plasticgun:kevlar_vest",
"plasticgun:flak_vest"
]
}

@ -24,7 +24,6 @@
"depends": { "depends": {
"fabricloader": ">=${loader_version}", "fabricloader": ">=${loader_version}",
"fabric": "*", "fabric": "*",
"minecraft": ">=${minecraft_version}", "minecraft": ">=${minecraft_version}"
"trinkets": ">=${trinkets_version}"
} }
} }