diff options
| author | Arslaan Pathan <[email protected]> | 2026-09-26 17:05:36 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-09-26 17:05:36 +1200 |
| commit | 14c68eb5ba16774f581d95a39e64a7b303954ffc (patch) | |
| tree | 2888ef11f47c6a639d440300ef580c247ad1bcb1 /src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens | |
| parent | 766ba1c1d977442332cadaaeca93d795baa559df (diff) | |
| download | arslaansmagichax-14c68eb5ba16774f581d95a39e64a7b303954ffc.tar.xz arslaansmagichax-14c68eb5ba16774f581d95a39e64a7b303954ffc.zip | |
migration to 26.2 - run migrateMappings with old loom then bring it back to new
Diffstat (limited to 'src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens')
8 files changed, 0 insertions, 622 deletions
diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ClickGUIScreen.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ClickGUIScreen.java deleted file mode 100644 index 7a017e2..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ClickGUIScreen.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui; - -import com.arslaancodes.arslaansmagichax.ArslaansMagicHaxClient; -import com.arslaancodes.arslaansmagichax.modules.Category; -import com.arslaancodes.arslaansmagichax.screens.clickgui.setting.Component; -import com.arslaancodes.arslaansmagichax.screens.clickgui.setting.KeybindingSelector; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.Screen; -import net.minecraft.text.Text; - -import java.util.ArrayList; -import java.util.List; - -public class ClickGUIScreen extends Screen { - public static final ClickGUIScreen INSTANCE = new ClickGUIScreen(); - - private List<Frame> frames; - - private ClickGUIScreen() { - super(Text.literal("ClickGUI")); - - frames = new ArrayList<>(); - - int offset = 20; - for (Category category : Category.values()) { - frames.add(new Frame(category, offset, 30, 100, 20)); - offset += 120; - } - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - for (Frame frame : frames) { - frame.render(context, mouseX, mouseY, deltaTicks); - frame.updatePosition(mouseX, mouseY); - } - super.render(context, mouseX, mouseY, deltaTicks); - } - - @Override - public boolean mouseClicked(double mouseX, double mouseY, int button) { - for (Frame frame : frames) { - frame.mouseClicked(mouseX, mouseY, button); - } - return super.mouseClicked(mouseX, mouseY, button); - } - - @Override - public boolean mouseReleased(double mouseX, double mouseY, int button) { - for (Frame frame : frames) { - frame.mouseReleased(mouseX, mouseY, button); - } - return super.mouseReleased(mouseX, mouseY, button); - } - - @Override - public boolean keyPressed(int keyCode, int scanCode, int modifiers) { - for (Frame frame : frames) { - if (frame.isOpen) { - for (ModuleButton button : frame.getButtons()) { - if (button.extended) { - for (Component comp : button.components) { - if (comp instanceof KeybindingSelector keybindingSelector) { - keybindingSelector.onKeyPressed(keyCode); - } - } - } - } - } - } - return super.keyPressed(keyCode, scanCode, modifiers); - } - - @Override - public boolean shouldPause() { - return false; - } - - @Override - public void close() { - super.close(); - ArslaansMagicHaxClient.clickGUI.setEnabled(false); - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/Frame.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/Frame.java deleted file mode 100644 index 8400038..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/Frame.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui; - -import com.arslaancodes.arslaansmagichax.modules.Category; -import com.arslaancodes.arslaansmagichax.modules.Module; -import com.arslaancodes.arslaansmagichax.modules.ModuleManager; -import com.arslaancodes.arslaansmagichax.screens.clickgui.setting.Component; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.text.Text; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -public class Frame { - public int x, y, width, height, dragX, dragY; - public Category category; - - public boolean dragging; - - public boolean isOpen = false; - - private List<ModuleButton> buttons; - - protected MinecraftClient mc = MinecraftClient.getInstance(); - - public Frame(Category category, int x, int y, int width, int height) { - this.category = category; - this.x = x; - this.y = y; - this.width = width; - this.height = height; - this.dragging = false; - - buttons = new ArrayList<>(); - - int offset = height; - for (Module module : ModuleManager.INSTANCE.getModulesWithCategory(category)) { - buttons.add(new ModuleButton(module, this, offset)); - offset += height; - } - } - - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - context.fill(x, y, x + width, y + height, new Color(252, 210, 77, 255).getRGB()); - - String text = category.name(); - int textY = y + (height - mc.textRenderer.fontHeight) / 2; - - context.drawText(mc.textRenderer, Text.literal(text), x + 5, textY, new Color(30, 30, 47, 255).getRGB(), false); - context.drawText(mc.textRenderer, isOpen ? "-" : "+", x + width - 5 - mc.textRenderer.getWidth("+"), textY, new Color(30, 30, 47, 255).getRGB(), false); - - if (isOpen) { - for (ModuleButton button : buttons) { - button.render(context, mouseX, mouseY, deltaTicks); - } - } - } - - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY)) { - if (button == 0) { - dragging = true; - dragX = (int) (mouseX - x); - dragY = (int) (mouseY - y); - } else { - isOpen = !isOpen; - } - } - - if (isOpen) { - for (ModuleButton moduleButton : buttons) { - moduleButton.mouseClicked(mouseX, mouseY, button); - } - } - } - - public void mouseReleased(double mouseX, double mouseY, int button) { - if (button == 0 && dragging) { - dragging = false; - } - - if (isOpen) { - for (ModuleButton moduleButton : buttons) { - moduleButton.mouseReleased(mouseX, mouseY, button); - } - } - } - - public boolean isHovered(double mouseX, double mouseY) { - return mouseX > x && mouseX < x + width && mouseY > y && mouseY < y + height; - } - - public void updatePosition(double mouseX, double mouseY) { - if (dragging) { - x = (int) (mouseX - dragX); - y = (int) (mouseY - dragY); - } - } - - public List<ModuleButton> getButtons() { - return buttons; - } - - public void updateButtons() { - int offset = height; - - for (ModuleButton button : buttons) { - button.offset = offset; - offset += height; - - if (button.extended) { - for (Component component : button.components) { - if (component.setting != null) { - if (component.setting.isVisible()) { - offset += height; - } - } else { - // this is 99.99% the keybinding thing, just add offset anyway and hope it works i guess - offset += height; - } - } - } - } - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java deleted file mode 100644 index 777c88c..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/ModuleButton.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui; - -import com.arslaancodes.arslaansmagichax.modules.Module; -import com.arslaancodes.arslaansmagichax.modules.settings.BooleanSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.ModeSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.NumberSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.Setting; -import com.arslaancodes.arslaansmagichax.screens.clickgui.setting.*; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.text.Text; - -import java.awt.Color; -import java.util.ArrayList; -import java.util.List; - -public class ModuleButton { - - public Module module; - public Frame parent; - public int offset; - public List<Component> components; - public boolean extended; - - public ModuleButton(Module module, Frame parent, int offset) { - this.module = module; - this.parent = parent; - this.offset = offset; - this.extended = false; - this.components = new ArrayList<>(); - - int setOffset = parent.height; - components.add(new KeybindingSelector(this, setOffset)); - setOffset += parent.height; - for (Setting setting : module.getSettings()) { - if (setting instanceof BooleanSetting) { - components.add(new CheckBox(setting, this, setOffset)); - } else if (setting instanceof ModeSetting) { - components.add(new ModeBox(setting, this, setOffset)); - } else if (setting instanceof NumberSetting) { - components.add(new Slider(setting, this, setOffset)); - } - setOffset += parent.height; - } - } - - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - int alpha = isHovered(mouseX, mouseY) ? 230 : 160; - - context.fill(parent.x, parent.y + offset, parent.x + parent.width, parent.y + offset + parent.height, new Color(30, 30, 47, alpha).getRGB()); - - if (isHovered(mouseX, mouseY)) { - context.drawTooltip(Text.literal(module.getDescription()), mouseX, mouseY); - } - - String text = module.getName(); - - int textX = parent.x + 5; - int textY = parent.y + offset + (parent.height - parent.mc.textRenderer.fontHeight) / 2; - - int textColor = module.isEnabled() ? new Color(252, 210, 77, 255).getRGB() : Color.white.getRGB(); - - context.drawTextWithShadow(parent.mc.textRenderer, Text.literal(text), textX, textY, textColor); - - if (extended) { - for (Component component : components) { - component.render(context, mouseX, mouseY, deltaTicks); - } - } - } - - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY)) { - if (button == 0) { - module.toggle(); - } - else if (button == 1) { - extended = !extended; - parent.updateButtons(); - } - } - - for (Component component : components) { - component.mouseClicked(mouseX, mouseY, button); - } - } - - public void mouseReleased(double mouseX, double mouseY, int button) { - // luigi wins by doing absolutely nothing - - // nevermind we did something - for (Component component : components) { - component.mouseReleased(mouseX, mouseY, button); - } - } - - public boolean isHovered(double mouseX, double mouseY) { - return mouseX > parent.x && mouseX < parent.x + parent.width && mouseY > parent.y + offset && mouseY < parent.y + offset + parent.height; - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/CheckBox.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/CheckBox.java deleted file mode 100644 index e1f8dd0..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/CheckBox.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui.setting; - -import com.arslaancodes.arslaansmagichax.modules.settings.BooleanSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.Setting; -import com.arslaancodes.arslaansmagichax.screens.clickgui.ModuleButton; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.text.Text; - -import java.awt.*; - -public class CheckBox extends Component { - - private BooleanSetting booleanSetting = (BooleanSetting) setting; - - public CheckBox(Setting setting, ModuleButton parent, int offset) { - super(setting, parent, offset); - this.booleanSetting = (BooleanSetting) setting; - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - String displayText = booleanSetting.getName() + ": " + booleanSetting.isEnabled(); - int textWidth = mc.textRenderer.getWidth(displayText); - int padding = 5; - int boxWidth = Math.max(parent.parent.width, textWidth + (padding * 2)); - - int alpha = isHovered(mouseX, mouseY) ? 230 : 160; - context.fill( - parent.parent.x, - parent.parent.y + parent.offset + offset, - parent.parent.x + boxWidth, - parent.parent.y + parent.offset + offset + parent.parent.height, - new Color(30, 30, 47, alpha).getRGB() - ); - - context.drawTextWithShadow( - mc.textRenderer, - Text.literal(displayText), - parent.parent.x + padding, - parent.parent.y + parent.offset + offset + (parent.parent.height - mc.textRenderer.fontHeight) / 2, - Color.white.getRGB() - ); - } - - @Override - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY) && button == 0) { - booleanSetting.toggle(); - } - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/Component.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/Component.java deleted file mode 100644 index 481adac..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/Component.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui.setting; - -import com.arslaancodes.arslaansmagichax.modules.settings.Setting; -import com.arslaancodes.arslaansmagichax.screens.clickgui.ModuleButton; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.DrawContext; - -public class Component { - - public Setting setting; - public ModuleButton parent; - public int offset; - - protected static MinecraftClient mc = MinecraftClient.getInstance(); - - public Component(Setting setting, ModuleButton parent, int offset) { - this.setting = setting; - this.parent = parent; - this.offset = offset; - } - - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - - } - - public void mouseClicked(double mouseX, double mouseY, int button) { - - } - - public void mouseReleased(double mouseX, double mouseY, int button) { - - } - - public boolean isHovered(double mouseX, double mouseY) { - return mouseX > parent.parent.x && mouseX < parent.parent.x + parent.parent.width && mouseY > parent.parent.y + parent.offset + offset && mouseY < parent.parent.y + parent.offset + offset + parent.parent.height; - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/KeybindingSelector.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/KeybindingSelector.java deleted file mode 100644 index 5322c14..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/KeybindingSelector.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui.setting; - -import com.arslaancodes.arslaansmagichax.screens.clickgui.ModuleButton; -import net.minecraft.client.gui.DrawContext; -import org.lwjgl.glfw.GLFW; - -import java.awt.*; - -public class KeybindingSelector extends Component { - - private boolean listening = false; - - public KeybindingSelector(ModuleButton parent, int offset) { - super(null, parent, offset); - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - int alpha = isHovered(mouseX, mouseY) ? 230 : 160; - context.fill(parent.parent.x, parent.parent.y + parent.offset + offset, parent.parent.x + parent.parent.width, parent.parent.y + parent.offset + offset + parent.parent.height, new Color(30, 30, 47, alpha).getRGB()); - - if (listening) { - context.fill(parent.parent.x, parent.parent.y + parent.offset + offset, parent.parent.x + parent.parent.width, parent.parent.y + parent.offset + offset + parent.parent.height, new Color(252, 210, 77, 255).getRGB()); - } - - String displayText = listening ? "Press a key..." : "Keybind: " + getKeyName(parent.module.getGlfwKeybinding()); - context.drawTextWithShadow(mc.textRenderer, displayText, parent.parent.x + 5, parent.parent.y + parent.offset + offset + (parent.parent.height - mc.textRenderer.fontHeight) / 2, Color.white.getRGB()); - } - - @Override - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY) && button == 0) { - listening = !listening; - } - } - - public void onKeyPressed(int keyCode) { - if (!listening) return; - - listening = false; - - if (keyCode == GLFW.GLFW_KEY_ESCAPE || keyCode == GLFW.GLFW_KEY_DELETE || keyCode == GLFW.GLFW_KEY_BACKSPACE) { - // remove bingdingd AHH I CANT SPELL - parent.module.setGlfwKeybinding(-1); - return; - } - - parent.module.setGlfwKeybinding(keyCode); - } - - private String getKeyName(int key) { - if (key == -1) return "NONE"; - String name = GLFW.glfwGetKeyName(key, 0); - - if (name != null) return name.toUpperCase(); - - return switch (key) { - case GLFW.GLFW_KEY_LEFT_SHIFT -> "LSHIFT"; - case GLFW.GLFW_KEY_RIGHT_SHIFT -> "RSHIFT"; - case GLFW.GLFW_KEY_LEFT_CONTROL -> "LCTRL"; - case GLFW.GLFW_KEY_RIGHT_CONTROL -> "RCTRL"; - case GLFW.GLFW_KEY_LEFT_ALT -> "LALT"; - case GLFW.GLFW_KEY_RIGHT_ALT -> "RALT"; - case GLFW.GLFW_KEY_SPACE -> "SPACE"; - case GLFW.GLFW_KEY_TAB -> "TAB"; - case GLFW.GLFW_KEY_ENTER -> "ENTER"; - case GLFW.GLFW_KEY_UP -> "UP"; - case GLFW.GLFW_KEY_DOWN -> "DOWN"; - case GLFW.GLFW_KEY_LEFT -> "LEFT"; - case GLFW.GLFW_KEY_RIGHT -> "RIGHT"; - default -> "KEY_" + key; - }; - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/ModeBox.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/ModeBox.java deleted file mode 100644 index 83de061..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/ModeBox.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui.setting; - -import com.arslaancodes.arslaansmagichax.modules.settings.ModeSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.Setting; -import com.arslaancodes.arslaansmagichax.screens.clickgui.ModuleButton; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.text.Text; - -import java.awt.*; - -public class ModeBox extends Component { - - private ModeSetting modeSetting = (ModeSetting) setting; - - public ModeBox(Setting setting, ModuleButton parent, int offset) { - super(setting, parent, offset); - this.modeSetting = (ModeSetting) setting; - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - String displayText = modeSetting.getName() + ": " + modeSetting.getMode(); - int textWidth = mc.textRenderer.getWidth(displayText); - - int padding = 5; - int boxWidth = Math.max(parent.parent.width, textWidth + padding * 2); - - int alpha = isHovered(mouseX, mouseY) ? 230 : 160; - context.fill( - parent.parent.x, - parent.parent.y + parent.offset + offset, - parent.parent.x + boxWidth, - parent.parent.y + parent.offset + offset + parent.parent.height, - new Color(30, 30, 47, alpha).getRGB() - ); - - context.drawTextWithShadow( - mc.textRenderer, - Text.literal(displayText), - parent.parent.x + padding, // left padding - parent.parent.y + parent.offset + offset + (parent.parent.height - mc.textRenderer.fontHeight) / 2, - Color.white.getRGB() - ); - } - - @Override - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY) && button == 0) { - modeSetting.cycle(); - } - } - - @Override - public void mouseReleased(double mouseX, double mouseY, int button) { - super.mouseReleased(mouseX, mouseY, button); - } -} diff --git a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/Slider.java b/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/Slider.java deleted file mode 100644 index 0fc906b..0000000 --- a/src/main/java/net/justlearning/arslaan3102/arslaansmagichax/screens/clickgui/setting/Slider.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.arslaancodes.arslaansmagichax.screens.clickgui.setting; - -import com.arslaancodes.arslaansmagichax.modules.settings.NumberSetting; -import com.arslaancodes.arslaansmagichax.modules.settings.Setting; -import com.arslaancodes.arslaansmagichax.screens.clickgui.ModuleButton; -import net.minecraft.client.gui.DrawContext; -import net.minecraft.text.Text; - -import java.awt.*; -import java.math.BigDecimal; -import java.math.RoundingMode; - -public class Slider extends Component { - - public NumberSetting numberSetting = (NumberSetting) setting; - - private boolean sliding = false; - - public Slider(Setting setting, ModuleButton parent, int offset) { - super(setting, parent, offset); - this.numberSetting = (NumberSetting) setting; - } - - @Override - public void render(DrawContext context, int mouseX, int mouseY, float deltaTicks) { - String displayText = numberSetting.getName() + ": " + numberSetting.getValue(); - int defaultPadding = 5; - int boxWidth = parent.parent.width; - - int alpha = isHovered(mouseX, mouseY) ? 230 : 160; - - context.fill( - parent.parent.x, - parent.parent.y + parent.offset + offset, - parent.parent.x + boxWidth, - parent.parent.y + parent.offset + offset + parent.parent.height, - new Color(30, 30, 47, alpha).getRGB() - ); - - double diff = Math.min(boxWidth, Math.max(0, mouseX - parent.parent.x)); - int renderWidth = (int) (boxWidth * (numberSetting.getValue() - numberSetting.getMin()) / (numberSetting.getMax() - numberSetting.getMin())); - - context.fill( - parent.parent.x, - parent.parent.y + parent.offset + offset, - parent.parent.x + renderWidth, - parent.parent.y + parent.offset + offset + parent.parent.height, - new Color(252, 210, 77, 255).getRGB() - ); - - if (sliding) { - if (diff == 0) { - numberSetting.setValue(numberSetting.getMin()); - } else { - numberSetting.setValue(roundToPlace((diff / boxWidth) * (numberSetting.getMax() - numberSetting.getMin()) + numberSetting.getMin(), 1)); - } - } - - int textWidth = mc.textRenderer.getWidth(displayText); - int leftPadding = defaultPadding; - if (textWidth + 2 * defaultPadding > boxWidth) { - leftPadding = Math.max(2, boxWidth - textWidth - 2); - } - - context.drawTextWithShadow( - mc.textRenderer, - Text.literal(displayText), - parent.parent.x + leftPadding, - parent.parent.y + parent.offset + offset + (parent.parent.height - mc.textRenderer.fontHeight) / 2, - Color.white.getRGB() - ); - } - - @Override - public void mouseClicked(double mouseX, double mouseY, int button) { - if (isHovered(mouseX, mouseY)) sliding = true; - } - - @Override - public void mouseReleased(double mouseX, double mouseY, int button) { - sliding = false; - } - - private double roundToPlace(double value, int place) { - if (place < 0) { - return value; - } - - BigDecimal bd = new BigDecimal(value); - bd = bd.setScale(place, RoundingMode.HALF_UP); - return bd.doubleValue(); - } -} |
