diff --git a/src/main/java/com/paneedah/weaponlib/CustomArmor.java b/src/main/java/com/paneedah/weaponlib/CustomArmor.java index bbeab1c27..dc4a4a51e 100644 --- a/src/main/java/com/paneedah/weaponlib/CustomArmor.java +++ b/src/main/java/com/paneedah/weaponlib/CustomArmor.java @@ -6,6 +6,7 @@ import com.paneedah.weaponlib.crafting.IModernCraftingRecipe; import com.paneedah.weaponlib.model.ModelBaseRendererWrapper; import com.paneedah.weaponlib.model.WrappableModel; +import lombok.Getter; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBiped; @@ -197,8 +198,8 @@ public Builder withModelSupplier(Function modelFactory) { public Builder withCompatibleAttachment(AttachmentCategory category, ModelBase attachmentModel, String textureName, Consumer positioner) { - ItemAttachment item = new ItemAttachment(category, attachmentModel, textureName, null); - compatibleAttachments.put(item, new CompatibleAttachment(item, positioner)); + ItemAttachment item = new ItemAttachment<>(category, attachmentModel, textureName, null); + compatibleAttachments.put(item, new CompatibleAttachment<>(item, positioner)); return this; } @@ -420,7 +421,7 @@ public CustomArmor buildBoots(boolean isClient) { //private EntityEquipmentSlot slot; private boolean hasNightVision; - private boolean vignetteEnabled; + @Getter private boolean vignetteEnabled; private float exposureReductionFactor; private SoundEvent breathingSound; @@ -429,12 +430,12 @@ public CustomArmor buildBoots(boolean isClient) { //private boolean shieldEnabled; private long shieldRegenerationTimeout = 1000; private double shieldRegenerationRate = 1.0; // restored shield capacity per sec - private double maxShieldCapacity; + @Getter private double maxShieldCapacity; private final String unlocalizedArmorSetName; - private double shieldIndicatorPositionX; - private double shieldIndicatorPositionY; - private double shieldIndicatorWidth; - private double shieldIndicatorHeight; + @Getter private double shieldIndicatorPositionX; + @Getter private double shieldIndicatorPositionY; + @Getter private double shieldIndicatorWidth; + @Getter private double shieldIndicatorHeight; private String shieldIndicatorMaskTextureName; private String shieldIndicatorProgressBarTextureName; @@ -645,10 +646,6 @@ public boolean hasNightVision() { return hasNightVision; } - public boolean isVignetteEnabled() { - return vignetteEnabled; - } - @Override public Function getAbsorbFunction(Spreadable spreadable) { return dose -> dose * (1f - exposureReductionFactor); @@ -784,26 +781,6 @@ public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource s } } - public double getMaxShieldCapacity() { - return maxShieldCapacity; - } - - public double getShieldIndicatorPositionX() { - return shieldIndicatorPositionX; - } - - public double getShieldIndicatorPositionY() { - return shieldIndicatorPositionY; - } - - public double getShieldIndicatorWidth() { - return shieldIndicatorWidth; - } - - public double getShieldIndicatorHeight() { - return shieldIndicatorHeight; - } - @Override public CraftingEntry[] getModernRecipe() { return this.modernRecipe; 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/Tuple.java b/src/main/java/com/paneedah/weaponlib/Tuple.java index 14ecf4232..22fcea833 100644 --- a/src/main/java/com/paneedah/weaponlib/Tuple.java +++ b/src/main/java/com/paneedah/weaponlib/Tuple.java @@ -1,5 +1,9 @@ package com.paneedah.weaponlib; +import lombok.Getter; +import lombok.Setter; + +@Setter @Getter public final class Tuple { private U u; @@ -11,20 +15,4 @@ public Tuple(U u, V v) { this.v = v; } - public U getU() { - return u; - } - - public void setU(U u) { - this.u = u; - } - - public V getV() { - return v; - } - - public void setV(V v) { - this.v = v; - } - } diff --git a/src/main/java/com/paneedah/weaponlib/Weapon.java b/src/main/java/com/paneedah/weaponlib/Weapon.java index 92011972d..2dec3671b 100644 --- a/src/main/java/com/paneedah/weaponlib/Weapon.java +++ b/src/main/java/com/paneedah/weaponlib/Weapon.java @@ -14,6 +14,7 @@ import com.paneedah.weaponlib.render.shells.ShellParticleSimulator.Shell.Type; import dev.redstudio.redcore.utils.DecimalUtils; import io.redstudioragnarok.redcore.vectors.Vector3F; +import lombok.Getter; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.model.ModelBase; @@ -114,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; @@ -149,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; @@ -222,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() { @@ -256,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; @@ -1022,24 +1011,24 @@ public Weapon build(ModContext modContext) { public Builder builder; - private final ModContext modContext; + @Getter private final ModContext modContext; - private Vec3d muzzlePosition; + @Getter private Vec3d muzzlePosition; private CraftingEntry[] modernRecipe; - private SoundEvent shootSound; - private SoundEvent endOfShootSound; - private SoundEvent silencedShootSound; - private SoundEvent reloadSound; - private SoundEvent reloadIterationSound; - private SoundEvent inspectSound; - private SoundEvent drawSound; - private SoundEvent allReloadIterationsCompletedSound; - private SoundEvent unloadSound; - private SoundEvent ejectSpentRoundSound; - private SoundEvent burstShootSound; - private SoundEvent silencedBurstShootSound; + @Getter private SoundEvent shootSound; + @Getter private SoundEvent endOfShootSound; + @Getter private SoundEvent silencedShootSound; + @Getter private SoundEvent reloadSound; + @Getter private SoundEvent reloadIterationSound; + @Getter private SoundEvent inspectSound; + @Getter private SoundEvent drawSound; + @Getter private SoundEvent allReloadIterationsCompletedSound; + @Getter private SoundEvent unloadSound; + @Getter private SoundEvent ejectSpentRoundSound; + @Getter private SoundEvent burstShootSound; + @Getter private SoundEvent silencedBurstShootSound; public enum State {READY, SHOOTING, RELOAD_REQUESTED, RELOAD_CONFIRMED, UNLOAD_STARTED, UNLOAD_REQUESTED_FROM_SERVER, UNLOAD_CONFIRMED, PAUSED, MODIFYING, EJECT_SPENT_ROUND} @@ -1071,59 +1060,6 @@ public CraftingEntry[] getModernRecipe() { } - public SoundEvent getShootSound() { - return shootSound; - } - - public SoundEvent getBurstShootSound() { - return burstShootSound; - } - - public SoundEvent getSilencedBurstShootSound() { - return silencedBurstShootSound; - } - - public SoundEvent getEndOfShootSound() { - return endOfShootSound; - } - - public SoundEvent getSilencedShootSound() { - return silencedShootSound; - } - - public SoundEvent getReloadSound() { - return reloadSound; - } - - - public SoundEvent getReloadIterationSound() { - return reloadIterationSound; - } - - public SoundEvent getInspectSound() { - return inspectSound; - } - - public SoundEvent getDrawSound() { - return drawSound; - } - - public SoundEvent getAllReloadIterationsCompletedSound() { - return allReloadIterationsCompletedSound; - } - - public SoundEvent getUnloadSound() { - return unloadSound; - } - - public SoundEvent getEjectSpentRoundSound() { - return ejectSpentRoundSound; - } - - public Vec3d getMuzzlePosition() { - return this.muzzlePosition; - } - @Override public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack itemStack) { return true; @@ -1601,10 +1537,6 @@ public float getRecoil() { return BalancePackManager.shouldChangeWeaponRecoil(this) ? (float) BalancePackManager.getNewWeaponRecoil(this) : builder.recoil; } - public ModContext getModContext() { - return modContext; - } - public float getShellCasingVerticalOffset() { return builder.shellCasingVerticalOffset; } diff --git a/src/main/java/com/paneedah/weaponlib/WeaponRenderer.java b/src/main/java/com/paneedah/weaponlib/WeaponRenderer.java index 432ea96ca..2398464c4 100644 --- a/src/main/java/com/paneedah/weaponlib/WeaponRenderer.java +++ b/src/main/java/com/paneedah/weaponlib/WeaponRenderer.java @@ -17,6 +17,8 @@ import com.paneedah.weaponlib.config.ModernConfigManager; import com.paneedah.weaponlib.render.*; import com.paneedah.weaponlib.shader.jim.Shader; +import lombok.Getter; +import lombok.Setter; import net.minecraft.block.state.IBlockState; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.gui.ScaledResolution; @@ -312,88 +314,15 @@ public static class Builder { private boolean compoundReloadUsesTactical; private boolean compoundReloadEmptyUsesTactical; - private boolean hasTacticalReload; - - public boolean isHasTacticalReload() { - return hasTacticalReload; - } - - public void setHasTacticalReload(boolean hasTacticalReload) { - this.hasTacticalReload = hasTacticalReload; - } - - public boolean isHasUnloadEmpty() { - return hasUnloadEmpty; - } - - public void setHasUnloadEmpty(boolean hasUnloadEmpty) { - this.hasUnloadEmpty = hasUnloadEmpty; - } - - public boolean isHasLoadEmpty() { - return hasLoadEmpty; - } - - public void setHasLoadEmpty(boolean hasLoadEmpty) { - this.hasLoadEmpty = hasLoadEmpty; - } - - public boolean isHasCompoundReloadEmpty() { - return hasCompoundReloadEmpty; - } - - public void setHasCompoundReloadEmpty(boolean hasCompoundReloadEmpty) { - this.hasCompoundReloadEmpty = hasCompoundReloadEmpty; - } - - public boolean isHasCompoundReload() { - return hasCompoundReload; - } - - public void setHasCompoundReload(boolean hasCompoundReload) { - this.hasCompoundReload = hasCompoundReload; - } - - public boolean isHasLoad() { - return hasLoad; - } - - public void setHasLoad(boolean hasLoad) { - this.hasLoad = hasLoad; - } - - public boolean isHasUnload() { - return hasUnload; - } - - public void setHasUnload(boolean hasUnload) { - this.hasUnload = hasUnload; - } - - public boolean isHasDraw() { - return hasDraw; - } - - public void setHasDraw(boolean hasDraw) { - this.hasDraw = hasDraw; - } - - public boolean isHasInspect() { - return hasInspect; - } - - public void setHasInspect(boolean hasInspect) { - this.hasInspect = hasInspect; - } - - private boolean hasUnloadEmpty; - private boolean hasLoadEmpty; - private boolean hasCompoundReloadEmpty; - private boolean hasCompoundReload; - private boolean hasLoad; - private boolean hasUnload; - private boolean hasDraw; - private boolean hasInspect; + @Setter @Getter private boolean hasTacticalReload; + @Setter @Getter private boolean hasUnloadEmpty; + @Setter @Getter private boolean hasLoadEmpty; + @Setter @Getter private boolean hasCompoundReloadEmpty; + @Setter @Getter private boolean hasCompoundReload; + @Setter @Getter private boolean hasLoad; + @Setter @Getter private boolean hasUnload; + @Setter @Getter private boolean hasDraw; + @Setter @Getter private boolean hasInspect; private boolean hasEjectSpentRound; private boolean hasEjectSpentRoundAimed; @@ -1243,7 +1172,7 @@ public Builder setupModernAnimations(String animationFile, ItemAttachment 1) { + if (compound.getBone(BBLoader.KEY_MAGIC_MAGAZINE).getBbTransition().size() > 1) { compoundReloadUsesTactical = true; } } @@ -1252,7 +1181,7 @@ public Builder setupModernAnimations(String animationFile, ItemAttachment 1) { + if (compoundEmpty.getBone(BBLoader.KEY_MAGIC_MAGAZINE).getBbTransition().size() > 1) { compoundReloadEmptyUsesTactical = true; } } @@ -2737,7 +2666,7 @@ private List>> getCompl .withPartPositionFunction(Part.RIGHT_HAND, createWeaponPartPositionFunction(r)); - t.sound = p.getSound(); + t.sound = p.getSoundEvent(); for (Entry>>> e : custom.entrySet()) { diff --git a/src/main/java/com/paneedah/weaponlib/WeaponResourcePack.java b/src/main/java/com/paneedah/weaponlib/WeaponResourcePack.java index 81a20ffa2..62a466346 100644 --- a/src/main/java/com/paneedah/weaponlib/WeaponResourcePack.java +++ b/src/main/java/com/paneedah/weaponlib/WeaponResourcePack.java @@ -39,9 +39,8 @@ private String modifyResourcePath(ResourceLocation resourceLocation) { @Override public boolean resourceExists(ResourceLocation resourceLocation) { String resourcePath = modifyResourcePath(resourceLocation); - boolean value = WEAPONLIB_RESOURCE_DOMAIN.equals(resourceLocation.getNamespace()) + return WEAPONLIB_RESOURCE_DOMAIN.equals(resourceLocation.getNamespace()) && getClass().getResource(resourcePath) != null; - return value; } diff --git a/src/main/java/com/paneedah/weaponlib/animation/AnimationModeProcessor.java b/src/main/java/com/paneedah/weaponlib/animation/AnimationModeProcessor.java index 8f74e04ac..e50e73ec8 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/AnimationModeProcessor.java +++ b/src/main/java/com/paneedah/weaponlib/animation/AnimationModeProcessor.java @@ -5,6 +5,8 @@ import com.paneedah.weaponlib.animation.gui.AnimationGUI; import com.paneedah.weaponlib.debug.DebugRenderer; import com.paneedah.weaponlib.render.Shaders; +import lombok.Getter; +import lombok.Setter; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.GlStateManager; @@ -37,12 +39,12 @@ public class AnimationModeProcessor { private final HashMap shouldRender = new HashMap<>(); - private AttachmentCategory activeCategory; + @Setter private AttachmentCategory activeCategory; private AttachmentCategory exclusionCategory; - private static final AnimationModeProcessor instance = new AnimationModeProcessor(); + @Getter private static final AnimationModeProcessor instance = new AnimationModeProcessor(); - public boolean legacyMode = false; + @Getter public boolean legacyMode = false; public Vec3d pan = Vec3d.ZERO; @@ -69,10 +71,6 @@ public AttachmentCategory getExcludedCategory() { return this.exclusionCategory; } - public void setActiveCategory(AttachmentCategory category) { - this.activeCategory = category; - } - public boolean shouldIsolateCategory() { return this.activeCategory != null; } @@ -106,14 +104,6 @@ public void setFPSMode(boolean state) { this.fpsMode = state; } - public static AnimationModeProcessor getInstance() { - return instance; - } - - public boolean isLegacyMode() { - return this.legacyMode; - } - public void captureDeferral() { deferredMatrix.rewind(); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, deferredMatrix); diff --git a/src/main/java/com/paneedah/weaponlib/animation/DebugPositioner.java b/src/main/java/com/paneedah/weaponlib/animation/DebugPositioner.java index d1ea74678..60f49c3f7 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/DebugPositioner.java +++ b/src/main/java/com/paneedah/weaponlib/animation/DebugPositioner.java @@ -2,6 +2,8 @@ import com.paneedah.weaponlib.KeyBindings; import com.paneedah.weaponlib.tracking.LivingEntityTracker; +import lombok.Getter; +import lombok.Setter; import net.minecraft.entity.Entity; import net.minecraft.util.text.TextComponentString; import org.lwjgl.opengl.GL11; @@ -25,24 +27,14 @@ public class DebugPositioner { private static final Set debugParts = new HashSet<>(); - private static Entity watchableEntity; + @Getter private static Entity watchableEntity; - private static boolean isAdjustRotationMode; - - public static void setAdjustRotPoint(boolean status) { - isAdjustRotationMode = status; - } + @Setter private static boolean isAdjustRotationMode; + @Setter @Getter public static final class TransitionConfiguration { private long pause; - public long getPause() { - return pause; - } - - public void setPause(long pause) { - this.pause = pause; - } } public static class Position { @@ -399,10 +391,6 @@ public static void watch() { System.out.println("Trackable entities: " + tracker.getTrackableEntitites()); } - public static Entity getWatchableEntity() { - return watchableEntity; - } - public static void showCurrentMatrix(String message) { showCurrentMatrix(null, message); } diff --git a/src/main/java/com/paneedah/weaponlib/animation/Interpolation.java b/src/main/java/com/paneedah/weaponlib/animation/Interpolation.java index 09e2067e1..ac550272b 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/Interpolation.java +++ b/src/main/java/com/paneedah/weaponlib/animation/Interpolation.java @@ -11,14 +11,13 @@ public enum Interpolation { public double interpolate(double input) { switch (this) { - case LINEAR: - return input; case ACCELERATION: return input * input; case DECELERATION: return 1 - ((1 - input) * (1 - input)); case SMOOTHSTEP: return input * input * (3 - (2 * input)); + case LINEAR: default: return input; } diff --git a/src/main/java/com/paneedah/weaponlib/animation/ModernAnimator.java b/src/main/java/com/paneedah/weaponlib/animation/ModernAnimator.java deleted file mode 100644 index efa8b941c..000000000 --- a/src/main/java/com/paneedah/weaponlib/animation/ModernAnimator.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.paneedah.weaponlib.animation; - -import com.paneedah.weaponlib.animation.jim.AnimationData; - -public class ModernAnimator { - - - public static ModernAnimator instance = new ModernAnimator(); - - public static ModernAnimator getInstance() { - return instance; - } - - public void position(AnimationData data) { - - } - -} diff --git a/src/main/java/com/paneedah/weaponlib/animation/MultipartTransition.java b/src/main/java/com/paneedah/weaponlib/animation/MultipartTransition.java index fcfa01400..c680b06b9 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/MultipartTransition.java +++ b/src/main/java/com/paneedah/weaponlib/animation/MultipartTransition.java @@ -1,5 +1,6 @@ package com.paneedah.weaponlib.animation; +import lombok.Getter; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.Vec3d; @@ -16,12 +17,12 @@ public static Consumer anchoredPosition() { return (Consumer) DEFAULT_POSITION; } - public Context cont; + @Getter public Context context; private final Map> multipartPositionFunctions = new HashMap<>(); private final Map attachedTo = new HashMap<>(); - private final long duration; - private final long pause; + @Getter private final long duration; + @Getter private final long pause; public SoundEvent sound; @@ -91,18 +92,6 @@ public Consumer getPositioning(Part part) { return multipartPositionFunctions.get(part); } - public Context getContext() { - return this.cont; - } - - public long getDuration() { - return duration; - } - - public long getPause() { - return pause; - } - public Part getAttachedTo(Part part) { return attachedTo.get(part); } diff --git a/src/main/java/com/paneedah/weaponlib/animation/OpenGLSelectionHelper.java b/src/main/java/com/paneedah/weaponlib/animation/OpenGLSelectionHelper.java index bbb357f83..951ffbdab 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/OpenGLSelectionHelper.java +++ b/src/main/java/com/paneedah/weaponlib/animation/OpenGLSelectionHelper.java @@ -32,19 +32,13 @@ public class OpenGLSelectionHelper { public static Framebuffer ballBuf; - public static boolean mouseClick = false; - /** * Allows you to select obj behind * - * @return + * @return true */ public static boolean shouldRender(int id) { - return true; - } - - public static void setupSelectionBuffer() { - + return true; //TODO This always returns true } public static void bindBallBuf() { diff --git a/src/main/java/com/paneedah/weaponlib/animation/Transition.java b/src/main/java/com/paneedah/weaponlib/animation/Transition.java index c6d22e52b..80743e2ce 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/Transition.java +++ b/src/main/java/com/paneedah/weaponlib/animation/Transition.java @@ -1,6 +1,8 @@ package com.paneedah.weaponlib.animation; import com.paneedah.weaponlib.Part; +import lombok.Getter; +import lombok.Setter; import net.minecraft.util.SoundEvent; import java.util.function.Consumer; @@ -14,13 +16,12 @@ public static Consumer anchoredPosition() { return (Consumer) ANCHORED_POSITION; } - private final Consumer itemPositioning; - private long duration; - private final long pause; - private final Part attachedTo; - private boolean animated; - - private SoundEvent evt; + @Getter private final Consumer itemPositioning; + @Getter @Setter private long duration; + @Getter private final long pause; + @Getter private final Part attachedTo; + @Getter private boolean animated; + @Getter @Setter private SoundEvent soundEvent; public Transition(Consumer itemPositioning, Part attachedTo, boolean animated) { this(itemPositioning, 0, 0); @@ -35,42 +36,10 @@ public Transition(Consumer itemPositioning, long duration, long pause) this(itemPositioning, duration, pause, null); } - public void setSound(SoundEvent event) { - this.evt = event; - } - public Transition(Consumer itemPositioning, long duration, long pause, Part attachedTo) { this.itemPositioning = itemPositioning; this.duration = duration; this.pause = pause; this.attachedTo = attachedTo; } - - public Consumer getItemPositioning() { - return itemPositioning; - } - - public void setDuration(long newDuration) { - this.duration = newDuration; - } - - public long getDuration() { - return duration; - } - - public SoundEvent getSound() { - return this.evt; - } - - public long getPause() { - return pause; - } - - public Part getAttachedTo() { - return attachedTo; - } - - public boolean isAnimated() { - return animated; - } } diff --git a/src/main/java/com/paneedah/weaponlib/animation/gui/AnimGUIRenderable.java b/src/main/java/com/paneedah/weaponlib/animation/gui/AnimGUIRenderable.java deleted file mode 100644 index 6af272d79..000000000 --- a/src/main/java/com/paneedah/weaponlib/animation/gui/AnimGUIRenderable.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.paneedah.weaponlib.animation.gui; - -public abstract class AnimGUIRenderable { - - public abstract void render(int mouseX, int mouseY); - -} diff --git a/src/main/java/com/paneedah/weaponlib/animation/gui/AnimationGUI.java b/src/main/java/com/paneedah/weaponlib/animation/gui/AnimationGUI.java index 4f842f336..6a689eb36 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/gui/AnimationGUI.java +++ b/src/main/java/com/paneedah/weaponlib/animation/gui/AnimationGUI.java @@ -8,6 +8,7 @@ import com.paneedah.weaponlib.animation.DebugPositioner.Position; import com.paneedah.weaponlib.animation.OpenGLSelectionHelper; import com.paneedah.weaponlib.compatibility.RecoilParam; +import lombok.Getter; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.gui.ScaledResolution; @@ -35,7 +36,7 @@ public class AnimationGUI { - private static final AnimationGUI instance = new AnimationGUI(); + @Getter private static final AnimationGUI instance = new AnimationGUI(); public ArrayList panels = new ArrayList<>(); @@ -76,11 +77,6 @@ public class AnimationGUI { public Slider debugFireRate = new Slider("Debug Fire Rate", false, 1, 25); - public static AnimationGUI getInstance() { - //instance = new AnimationGUI(); - return instance; - } - public boolean isPanelClosed(String name) { for (Panel panel : this.panels) { if (panel.getTitle().equals(name)) { @@ -107,7 +103,6 @@ public RecoilParam getRecoilParams() { } public AnimationGUI() { - Panel cameraPanel = new Panel(this, "Functionality", 10, 10, 20); // cam reset 0 @@ -191,8 +186,6 @@ public void render() { public Textbar rotation = new Textbar("Rotation", 10, 75, 90, 15); public void extraRender() { - - ScaledResolution sr = new ScaledResolution(MC); position.x = (int) (sr.getScaledWidth_double() - 100); rotation.x = (int) (sr.getScaledWidth_double() - 100); diff --git a/src/main/java/com/paneedah/weaponlib/animation/gui/Button.java b/src/main/java/com/paneedah/weaponlib/animation/gui/Button.java index d89df7370..04cb8b328 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/gui/Button.java +++ b/src/main/java/com/paneedah/weaponlib/animation/gui/Button.java @@ -1,9 +1,12 @@ package com.paneedah.weaponlib.animation.gui; +import lombok.Getter; +import lombok.Setter; import net.minecraft.client.renderer.GlStateManager; import java.awt.*; +@Getter @Setter public class Button { public double x, y; @@ -69,54 +72,6 @@ public boolean isMouseOver(int mouseX, int mouseY) { } - public double getX() { - return x; - } - - public void setX(int x) { - this.x = x; - } - - public double getY() { - return y; - } - - public void setY(int y) { - this.y = y; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getSize() { - return size; - } - - public void setSize(int size) { - this.size = size; - } - - public boolean isState() { - return state; - } - - public void setState(boolean state) { - this.state = state; - } - - public boolean isToggle() { - return isToggle; - } - - public void setToggle(boolean isToggle) { - this.isToggle = isToggle; - } - public void onMouseClick() { if (isToggle) { diff --git a/src/main/java/com/paneedah/weaponlib/animation/gui/Panel.java b/src/main/java/com/paneedah/weaponlib/animation/gui/Panel.java index 1256da38d..f7230dcb1 100644 --- a/src/main/java/com/paneedah/weaponlib/animation/gui/Panel.java +++ b/src/main/java/com/paneedah/weaponlib/animation/gui/Panel.java @@ -2,11 +2,14 @@ import com.paneedah.weaponlib.animation.AnimationModeProcessor; import io.redstudioragnarok.redcore.vectors.Vector2D; +import lombok.Getter; +import lombok.Setter; import net.minecraft.client.renderer.GlStateManager; import java.awt.*; import java.util.ArrayList; +@Getter @Setter public class Panel { @@ -40,14 +43,6 @@ public Panel(AnimationGUI gui, String title, double x, double y, double buttonSi this.buttonSize = buttonSize; } - public boolean isClosed() { - return this.closed; - } - - public void setClosed(boolean bool) { - this.closed = bool; - } - public void handleButtonClicks(int mouseX, int mouseY) { @@ -184,111 +179,12 @@ public void render(int mouseX, int mouseY) { } - public String getTitle() { - return this.title; - } - - public ArrayList