From 71ae8f925b7d2fafad09879edd638ffde25193e9 Mon Sep 17 00:00:00 2001 From: strubium <113206902+strubium@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:34:47 -0600 Subject: [PATCH] Weapon + ItemMagazine --- .../com/paneedah/weaponlib/ItemMagazine.java | 25 ++++--------------- .../java/com/paneedah/weaponlib/Weapon.java | 18 +++---------- .../weaponlib/render/ModificationGUI.java | 2 +- 3 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/paneedah/weaponlib/ItemMagazine.java b/src/main/java/com/paneedah/weaponlib/ItemMagazine.java index 0f314d0a1..6e30dc90e 100644 --- a/src/main/java/com/paneedah/weaponlib/ItemMagazine.java +++ b/src/main/java/com/paneedah/weaponlib/ItemMagazine.java @@ -1,5 +1,6 @@ package com.paneedah.weaponlib; +import lombok.Getter; import net.minecraft.client.model.ModelBase; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -64,10 +65,10 @@ protected ItemAttachment createAttachment(ModContext modContext) { private ModContext modContext; - private final int capacity; - private List compatibleBullets; - private SoundEvent reloadSound; - private SoundEvent unloadSound; + @Getter private final int capacity; + @Getter private List compatibleBullets; + @Getter private SoundEvent reloadSound; + @Getter private SoundEvent unloadSound; ItemMagazine(ModelBase model, String textureName, int capacity) { this(model, textureName, capacity, null, null); @@ -103,22 +104,6 @@ public void onCreated(ItemStack stack, World world, EntityPlayer player) { initializeTag(stack, 0); } - public List getCompatibleBullets() { - return compatibleBullets; - } - - public int getCapacity() { - return capacity; - } - - public SoundEvent getReloadSound() { - return reloadSound; - } - - public SoundEvent getUnloadSound() { - return unloadSound; - } - @Override public Part getRenderablePart() { return this; diff --git a/src/main/java/com/paneedah/weaponlib/Weapon.java b/src/main/java/com/paneedah/weaponlib/Weapon.java index 271bd6688..2dec3671b 100644 --- a/src/main/java/com/paneedah/weaponlib/Weapon.java +++ b/src/main/java/com/paneedah/weaponlib/Weapon.java @@ -115,7 +115,7 @@ public static class Builder { private CreativeTabs creativeTab; private WeaponRenderer renderer; //float zoom = Weapon.DEFAULT_ZOOM; - List maxShots = new ArrayList<>(); + @Getter List maxShots = new ArrayList<>(); String crosshair; String crosshairRunning; String crosshairZoomed; @@ -150,7 +150,7 @@ public static class Builder { long pumpTimeoutMilliseconds; long burstTimeoutMilliseconds = Weapon.DEFAULT_BURST_TIMEOUT_MILLISECONDS; - private float inaccuracy = DEFAULT_INACCURACY; + @Getter private float inaccuracy = DEFAULT_INACCURACY; int pellets = 1; @@ -223,7 +223,7 @@ public static class Builder { private boolean newSys = false; - private int[][] guiPositions = new int[][]{{-43, 86}, {97, 96}, {92, 34}, {14, -55}, {164, -26}, {145, 67}, {60, 110}, {0, -50}, {-100, -50}, {-29, 44}, {50, 100}}; + @Getter private int[][] guiPositions = new int[][]{{-43, 86}, {97, 96}, {92, 34}, {14, -55}, {164, -26}, {145, 67}, {60, 110}, {0, -50}, {-100, -50}, {-29, 44}, {50, 100}}; public Builder() { @@ -257,22 +257,10 @@ public Builder hasGUIPositions(int[][] gp) { return this; } - public List getMaxShots() { - return this.maxShots; - } - - public int[][] getGUIPositions() { - return this.guiPositions; - } - public float getFirerate() { return this.fireRate; } - public float getInaccuracy() { - return this.inaccuracy; - } - public Builder hasFlashPedals() { this.hasFlashPedals = true; return this; diff --git a/src/main/java/com/paneedah/weaponlib/render/ModificationGUI.java b/src/main/java/com/paneedah/weaponlib/render/ModificationGUI.java index a3bbbec65..8600579f8 100644 --- a/src/main/java/com/paneedah/weaponlib/render/ModificationGUI.java +++ b/src/main/java/com/paneedah/weaponlib/render/ModificationGUI.java @@ -500,7 +500,7 @@ public void setupForWeapon(PlayerWeaponInstance pwi) { hasBeenSetup = true; - int[][] guiPositions = pwi.getWeapon().builder.getGUIPositions(); + int[][] guiPositions = pwi.getWeapon().builder.getGuiPositions(); for (ModificationTab tab : tabList) { // Update custom GUI positionings tab.setPos(guiPositions[tab.id][0], guiPositions[tab.id][1]);