This commit is contained in:
Bruno Rybársky 2024-12-23 08:49:36 +01:00
parent 8afe0c0063
commit 6fc5738e38
Signed by: BRNSystems
GPG Key ID: 6C9206A821C70598
147 changed files with 536 additions and 103 deletions

@ -35,6 +35,7 @@ dependencies {
modImplementation include("eu.pb4:polymer-virtual-entity:${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-extras:${project.polymer_version}")
modImplementation include("eu.pb4:polymer-autohost:${project.polymer_version}")
modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_api_version}")

@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.1
yarn_mappings=1.21.4+build.2
loader_version=0.16.9
# Mod Properties
mod_version=1.9.8
mod_version=2.0.0
maven_group=systems.brn
archives_base_name=plasticgun
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.110.5+1.21.4
fabric_version=0.111.0+1.21.4
polymer_version=0.11.0+1.21.4-rc1
polymer_version=0.11.1+1.21.4
server_translations_api_version=2.4.0+1.21.2-rc1

@ -122,17 +122,17 @@ public class PlasticGun implements ModInitializer {
bullets.add(new BulletItem("force_container", 99, 0, 888, false, 0, 1));
// Guns
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("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("colt_45", 0.4, 9, 5, 7, 48, 45, 10, 0, 0, 1.5f, 2, 0.15f, 0.4f, -1, 1)); // 3.6
guns.add(new Gun("snub_nosed_revolver", 0.4, 7, 3, 5, 36, 38, 20, 0, 0, 1f, 2, 0.2f, 0.45f, -1, 1)); // 2.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("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, 4f, 16f, 0.3f, 0.6f, -2, 2)); // 4
guns.add(new Gun("rpg9", 2, 4, 20, 1, 10, 999, 20, 10, 0, 3f, 0.5f, 1, 2, -1, 1)); // 8
guns.add(new Gun("forcegun", 0, 4, 5, 10, 10, 888, 5, 0, 10, 0f, 0f, 0f, 1f, 0, 0)); // 0
guns.add(new Gun("p2022", 0.2, 12, 5, 10, 41, 9, 10, 0, 0, 0f, 0.7f, 0.1f, 0.25f, -0.2, 0.2)); // 1.8
guns.add(new Gun("colt_1903", 0.3, 10, 5, 8, 38, 32, 10, 0, 0, 0, 0.5f, 0.1f, 0.3f, -0.2, 0.2)); // 3
guns.add(new Gun("ak_47", 0.2, 4, 5, 30, 45, 762, 0, 0, 0, 0.1f, 0.3f, 0.2f, 0.3f, -0.2, 0.2)); // 9
guns.add(new Gun("colt_45", 0.4, 9, 5, 7, 48, 45, 10, 0, 0, 0, 0.5f, 0.15f, 0.4f, -0.2, 0.2)); // 3.6
guns.add(new Gun("snub_nosed_revolver", 0.4, 7, 3, 5, 36, 38, 20, 0, 0, 0f, 0.4f, 0.2f, 0.45f, -0.2, 0.2)); // 2.8
guns.add(new Gun("colt_peacemaker", 0.6, 8, 5, 6, 43, 45, 10, 0, 0, 0, 1, 0.2f, 0.5f, -0.2, 0.2)); // 4.8
guns.add(new Gun("tokarev_tt_33", 0.7, 10, 5, 8, 45, 762, 10, 0, 0, 0, 2f, 0.25f, 0.5f, -0.2, 0.2)); // 7
guns.add(new Gun("357_revolver", 1, 8, 5, 6, 45, 357, 20, 0, 0, 2, 3, 0.2f, 0.5f, -0.2, 0.2)); // 8
guns.add(new Gun("awp", 1, 4, 20, 1, 75, 762, 40, 0, 0, 4f, 6f, 0.3f, 0.6f, -2, 2)); // 4
guns.add(new Gun("rpg9", 2, 4, 20, 1, 10, 999, 20, 10, 0, 2f, 4f, 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

@ -30,10 +30,8 @@ import systems.brn.plasticgun.lib.SimpleItem;
import java.util.ArrayList;
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.itemBulletItemMap;
import static java.lang.Math.*;
import static systems.brn.plasticgun.PlasticGun.*;
import static systems.brn.plasticgun.lib.GunComponents.*;
import static systems.brn.plasticgun.lib.Util.*;
@ -81,12 +79,21 @@ public class Gun extends SimpleItem implements PolymerItem {
.maxDamage(clipSize + 1)
, id(path), Items.WOODEN_SWORD
);
this.verticalRecoilMin = verticalRecoilMin;
this.verticalRecoilMax = verticalRecoilMax;
this.verticalRecoilMin = verticalRecoilMin / 10f;
this.verticalRecoilMax = verticalRecoilMax / 10f;
this.velocityRecoilMin = velocityRecoilMin;
this.velocityRecoilMax = velocityRecoilMax;
this.horizontalRecoilMin = horizontalRecoilMin;
this.horizontalRecoilMax = horizontalRecoilMax;
this.horizontalRecoilMin = horizontalRecoilMin / 10f;
this.horizontalRecoilMax = horizontalRecoilMax / 10f;
if (verticalRecoilMin > verticalRecoilMax) {
logger.error("verticalRecoilMin > verticalRecoilMax for {}", path);
}
if (horizontalRecoilMin > horizontalRecoilMax) {
logger.error("horizontalRecoilMin > horizontalRecoilMax for {}", path);
}
if (velocityRecoilMin > velocityRecoilMax) {
logger.error("velocityRecoilMin > velocityRecoilMax for {}", path);
}
Registry.register(Registries.ITEM, id(path), this);
this.damage = damage;
this.reloadCount = reloadCount;

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

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/32_acp"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/32_acp_high_velocity"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/357_magnum"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/357_revolver"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/357_standard"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/38_special"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/38_special_p"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/45_acp"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/45_acp_hollow_point"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/762_tokarev"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/762_tokarev_ap"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/9mm_jhp"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/9mm_parabellum"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/advanced_circuit"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/ak_47"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/alloy_wheel"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/awp"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/ceramic_mixture"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/ceramic_plate"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/colt_1903"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/colt_45"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/colt_peacemaker"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/composite_frame"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/composite_resin"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/copper_wiring"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/diamond_shuriken"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/enhanced_gunpowder"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/explosive_powder"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/flak_vest"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/force_container"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/forcegun"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/golden_shuriken"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/graphene_sheet"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_an_m14"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_f1"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_k417"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_m18"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_m34"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_m67"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_m7a3"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_m84"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_mk3a2"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_no_69"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_rgd_5"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_rgo"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/grenade_thermite"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/hardened_steel"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/hyperalloy"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/iron_shuriken"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/kevlar_sheet"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/kevlar_vest"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/magnetic_coil"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/microchip"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/nano_tubes"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/netherite_shuriken"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/p2022"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/plasma_core"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/power_cell"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/precision_gear"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/reinforced_fiber"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/rpg9"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/rpg_shell"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/rpg_shell_incendiary"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/silicon_mixture"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/silicon_wafer"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/snub_nosed_revolver"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/stone_shuriken"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/titanium_alloy"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/tokarev_tt_33"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/trigger_mechanism"
}
}

@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "plasticgun:item/wooden_shuriken"
}
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/32_acp"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/32_acp_high_velocity"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/357_magnum"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/357_revolver"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/357_standard"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/38_special"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/38_special_p"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/45_acp"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/45_acp_hollow_point"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/762_tokarev"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/762_tokarev_ap"
}

@ -1,6 +1,6 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/9mm_jhp"
}
}
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/9mm_parabellum"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/advanced_circuit"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/alloy_wheel"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/awp"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/ceramic_mixture"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/ceramic_plate"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/colt_1903"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/colt_45"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/colt_peacemaker"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/composite_frame"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/composite_resin"
}

@ -1,5 +1,5 @@
{
"parent": "minecraft:item/handheld",
"parent": "minecraft:item/generated",
"textures": {
"layer0": "plasticgun:item/copper_wiring"
}

Some files were not shown because too many files have changed in this diff Show More