From e2c36ad40d4db94b43a0924071cee7f8630f783d Mon Sep 17 00:00:00 2001 From: Connor Colenso Date: Sat, 24 Jan 2026 16:48:04 +0000 Subject: [PATCH] Compiles --- dependencies.gradle | 3 +- .../draconicevolution/DraconicEvolution.java | 3 +- .../api/GeneratorOverride.java | 2 +- .../brandonscore/client/ClientProxy.java | 49 ++ .../gui/guicomponents/ComponentBase.java | 224 ++++++ .../gui/guicomponents/ComponentButton.java | 122 +++ .../guicomponents/ComponentCollection.java | 170 ++++ .../guicomponents/ComponentItemRenderer.java | 50 ++ .../guicomponents/ComponentScrollingBase.java | 21 + .../ComponentSlotBackground.java | 48 ++ .../gui/guicomponents/ComponentTextField.java | 71 ++ .../guicomponents/ComponentTextureButton.java | 91 +++ .../guicomponents/ComponentTexturedRect.java | 68 ++ .../client/gui/guicomponents/GUIBase.java | 142 ++++ .../gui/guicomponents/GUIScrollingBase.java | 76 ++ .../client/utills/ClientUtills.java | 24 + .../brandonscore/client/utills/GuiHelper.java | 140 ++++ .../common/handlers/FileHandler.java | 19 + .../common/handlers/IProcess.java | 11 + .../common/handlers/ProcessHandler.java | 61 ++ .../brandonscore/common/lib/References.java | 19 + .../common/utills/DataUtills.java | 269 +++++++ .../common/utills/InfoHelper.java | 143 ++++ .../common/utills/InventoryUtils.java | 744 ++++++++++++++++++ .../common/utills/ItemNBTHelper.java | 109 +++ .../common/utills/PlayerUtils.java | 19 + .../common/utills/SimplexNoise.java | 479 +++++++++++ .../common/utills/Teleporter.java | 320 ++++++++ .../brandonscore/common/utills/Utills.java | 158 ++++ .../draconicevolution/client/ClientProxy.java | 5 - .../client/creativetab/DETab.java | 2 +- .../client/gui/GUIDraconiumChest.java | 2 +- .../client/gui/GUIEnergyInfuser.java | 2 +- .../client/gui/GUIFlowGate.java | 8 +- .../client/gui/GUIGenerator.java | 2 +- .../client/gui/GUIGrinder.java | 2 +- .../client/gui/GUITeleporter.java | 24 +- .../client/gui/GUIUpgradeModifier.java | 2 +- .../client/gui/GuiHudConfig.java | 4 +- .../client/gui/componentguis/GUIManual.java | 16 +- .../client/gui/componentguis/GUIReactor.java | 26 +- .../gui/componentguis/GUIToolConfig.java | 22 +- .../gui/componentguis/GUIToolInventory.java | 12 +- .../ComponentConfigItemButton.java | 5 +- .../ComponentContributorsPage.java | 8 +- .../guicomponents/ComponentFieldAdjuster.java | 6 +- .../guicomponents/ComponentFieldButton.java | 4 +- .../guicomponents/ComponentIndexButton.java | 6 +- .../guicomponents/ComponentManualPage.java | 10 +- .../client/handler/ClientEventHandler.java | 10 +- .../client/handler/HudHandler.java | 7 +- .../client/keybinding/KeyInputHandler.java | 2 +- .../client/render/item/RenderMobSoul.java | 2 +- .../render/particle/ParticleEnergyBeam.java | 3 +- .../client/render/particle/Particles.java | 2 +- .../tile/RenderTileTeleporterStand.java | 4 +- .../draconicevolution/common/CommonProxy.java | 69 +- .../common/achievements/Achievements.java | 2 +- .../common/blocks/BlockCustomDrop.java | 2 +- .../common/blocks/CKeyStone.java | 2 +- .../common/blocks/CustomSpawner.java | 4 +- .../common/blocks/TeleporterStand.java | 2 +- .../common/blocks/machine/EnergyCrystal.java | 2 +- .../common/blocks/machine/FlowGate.java | 2 +- .../multiblock/ReactorEnergyInjector.java | 2 +- .../blocks/multiblock/ReactorStabilizer.java | 2 +- .../container/ContainerDissEnchanter.java | 2 +- .../common/entity/ChaosImplosion.java | 6 +- .../common/entity/ChaosImplosionTrace.java | 2 +- .../common/entity/EntityChaosDrill.java | 2 +- .../common/entity/EntityChaosGuardian.java | 2 +- .../common/entity/EntityChaosVortex.java | 2 +- .../common/entity/EntityDragonHeart.java | 2 +- .../common/entity/EntityDragonProjectile.java | 4 +- .../common/entity/EntityEnderArrow.java | 2 +- .../common/handler/ContributorHandler.java | 2 +- .../common/handler/CraftingHandler.java | 2 +- .../handler/MinecraftForgeEventHandler.java | 8 +- .../common/inventory/InventoryTool.java | 2 +- .../common/items/DraconicCore.java | 2 +- .../draconicevolution/common/items/Key.java | 2 +- .../common/items/MobSoul.java | 10 +- .../items/armor/CustomArmorHandler.java | 7 +- .../common/items/armor/DraconicArmor.java | 23 +- .../common/items/armor/WyvernArmor.java | 16 +- .../common/items/tools/AdminSpawnEgg.java | 2 +- .../items/tools/DraconicDistructionStaff.java | 6 +- .../common/items/tools/DraconicHoe.java | 17 +- .../items/tools/DraconiumFluxCapacitor.java | 13 +- .../common/items/tools/Magnet.java | 4 +- .../common/items/tools/SafetyMatch.java | 2 +- .../common/items/tools/TeleporterMKI.java | 11 +- .../common/items/tools/TeleporterMKII.java | 12 +- .../common/items/tools/Wrench.java | 2 +- .../items/tools/baseclasses/MiningTool.java | 21 +- .../items/tools/baseclasses/RFItemBase.java | 11 +- .../items/tools/baseclasses/ToolBase.java | 11 +- .../common/items/weapons/DraconicBow.java | 33 +- .../common/items/weapons/DraconicSword.java | 18 +- .../common/items/weapons/WyvernBow.java | 32 +- .../common/items/weapons/WyvernSword.java | 20 +- .../common/network/ButtonPacket.java | 2 +- .../common/network/ContributorPacket.java | 3 +- .../common/network/GenericParticlePacket.java | 26 +- .../common/network/ItemConfigPacket.java | 6 +- .../common/network/ShieldHitPacket.java | 4 +- .../common/network/SpeedRequestPacket.java | 4 +- .../common/network/TeleporterPacket.java | 22 +- .../common/network/TileObjectPacket.java | 2 +- .../common/tileentities/TileCKeyStone.java | 2 +- .../tileentities/TileDissEnchanter.java | 2 +- .../tileentities/TileDraconiumChest.java | 2 +- .../common/tileentities/TileTestBlock.java | 60 +- .../energynet/TileRemoteEnergyBase.java | 6 +- .../TileWirelessEnergyTransceiver.java | 2 +- .../tileentities/gates/TileFluidGate.java | 6 +- .../tileentities/gates/TileFluxGate.java | 5 +- .../common/tileentities/gates/TileGate.java | 2 +- .../TileDislocatorReceptacle.java | 2 +- .../TileEnergyStorageCore.java | 11 +- .../multiblocktiles/TilePortalBlock.java | 2 +- .../reactor/ReactorExplosion.java | 6 +- .../reactor/ReactorExplosionTrace.java | 2 +- .../reactor/TileReactorCore.java | 8 +- .../common/utills/IConfigurableItem.java | 3 +- .../common/utills/IUpgradableItem.java | 2 +- .../common/utills/ItemConfigField.java | 4 +- .../common/utills/ShapedOreEnergyRecipe.java | 3 +- .../common/world/ChaosWorldGenHandler.java | 8 +- 129 files changed, 4038 insertions(+), 424 deletions(-) create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/ClientProxy.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentBase.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentButton.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentCollection.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentItemRenderer.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentScrollingBase.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentSlotBackground.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextField.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextureButton.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTexturedRect.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIBase.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIScrollingBase.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/ClientUtills.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/GuiHelper.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/FileHandler.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/IProcess.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/ProcessHandler.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/lib/References.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/DataUtills.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InfoHelper.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InventoryUtils.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/ItemNBTHelper.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/PlayerUtils.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/SimplexNoise.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Teleporter.java create mode 100644 src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Utills.java diff --git a/dependencies.gradle b/dependencies.gradle index fda18059..70d414b5 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,8 +1,8 @@ // Add your dependencies here dependencies { - api("com.github.GTNewHorizons:BrandonsCore:1.2.1-GTNH:dev") api("curse.maven:cofh-lib-220333:2388748") + api("com.github.GTNewHorizons:GTNHLib:0.9.6:dev") compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.4:api") {transitive = false} compileOnly("com.github.GTNewHorizons:OpenComputers:1.12.12-GTNH:api") {transitive = false} @@ -11,7 +11,6 @@ dependencies { compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:dev") {transitive = false} compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev') {transitive = false} compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.225:dev") {transitive = false} - compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.6:dev") {transitive = false} compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false} compileOnly("curse.maven:computercraft-67504:2269339") {transitive = false} diff --git a/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java b/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java index 91d99180..573897ce 100644 --- a/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java +++ b/src/main/java/com/brandon3055/draconicevolution/DraconicEvolution.java @@ -24,8 +24,7 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; canBeDeactivated = false, guiFactory = References.GUIFACTORY, dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;" - + "after:ThermalFoundation;" - + "required-after:BrandonsCore@[1.0.0.11,);") + + "after:ThermalFoundation;") public class DraconicEvolution { @Mod.Instance(References.MODID) diff --git a/src/main/java/com/brandon3055/draconicevolution/api/GeneratorOverride.java b/src/main/java/com/brandon3055/draconicevolution/api/GeneratorOverride.java index 23ab183b..4b713de3 100644 --- a/src/main/java/com/brandon3055/draconicevolution/api/GeneratorOverride.java +++ b/src/main/java/com/brandon3055/draconicevolution/api/GeneratorOverride.java @@ -4,7 +4,7 @@ import java.util.Random; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler; import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator; import com.brandon3055.draconicevolution.common.world.WorldGenEnderComet; diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/ClientProxy.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/ClientProxy.java new file mode 100644 index 00000000..83daf3a1 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/ClientProxy.java @@ -0,0 +1,49 @@ +package com.brandon3055.draconicevolution.brandonscore.client; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; + +import com.brandon3055.draconicevolution.common.CommonProxy; + +/** + * Created by Brandon on 14/5/2015. + */ +public class ClientProxy extends CommonProxy { + + @Override + public boolean isDedicatedServer() { + return false; + } + + @Override + public MinecraftServer getMCServer() { + return super.getMCServer(); + } + + @Override + public World getClientWorld() { + return Minecraft.getMinecraft().theWorld; + } + + @Override + public boolean isSpaceDown() { + return Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed(); + } + + @Override + public boolean isShiftDown() { + return Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed(); + } + + @Override + public boolean isCtrlDown() { + return Minecraft.getMinecraft().gameSettings.keyBindSprint.getIsKeyPressed(); + } + + @Override + public EntityPlayer getClientPlayer() { + return Minecraft.getMinecraft().thePlayer; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentBase.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentBase.java new file mode 100644 index 00000000..f07d3b6d --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentBase.java @@ -0,0 +1,224 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +/** + * Created by Brandon on 25/12/2014. This gui system is based on open blocks gui system + */ + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public abstract class ComponentBase extends Gui { + + protected static RenderItem itemRender = new RenderItem(); + protected int x; + protected int y; + protected boolean enabled = true; + public static Minecraft mc; + public FontRenderer fontRendererObj; + private String group = ""; + /** The width of the screen object. */ + public int width; + /** The height of the screen object. */ + public int height; + + public String name; + + public ComponentBase(int x, int y) { + this.x = x; + this.y = y; + mc = Minecraft.getMinecraft(); + fontRendererObj = mc.fontRenderer; + } + + public String getGroup() { + return group; + } + + public ComponentBase setGroup(String group) { + this.group = group; + return this; + } + + public ComponentBase setName(String name) { + this.name = name; + return this; + } + + public void setX(int x) { + this.x = x; + } + + public void setY(int y) { + this.y = y; + } + + public int getX() { + return x; + } + + public int getY() { + return y; + } + + public abstract int getWidth(); + + public abstract int getHeight(); + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + public boolean isEnabled() { + return enabled; + } + + public boolean isMouseOver(int mouseX, int mouseY) { + return mouseX >= x && mouseX < x + getWidth() && mouseY >= y && mouseY < y + getHeight(); + } + + public abstract void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY); + + public abstract void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY); + + public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {} + + protected void drawHoveringText(List list, int x, int y, FontRenderer font) { + if (!list.isEmpty()) { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + // RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int k = 0; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { + String s = (String) iterator.next(); + int l = font.getStringWidth(s); + + if (l > k) { + k = l; + } + } + + int adjX = x + 12; + int adjY = y - 12; + int i1 = 8; + + if (list.size() > 1) { + i1 += 2 + (list.size() - 1) * 10; + } + + if (adjX + k > width) { + adjX -= 28 + k; + } + + if (adjY + i1 + 6 > height) { + adjY = height - i1 - 6; + } + + this.zLevel = 300.0F; + itemRender.zLevel = 300.0F; + int j1 = -267386864; + this.drawGradientRect(adjX - 3, adjY - 4, adjX + k + 3, adjY - 3, j1, j1); + this.drawGradientRect(adjX - 3, adjY + i1 + 3, adjX + k + 3, adjY + i1 + 4, j1, j1); + this.drawGradientRect(adjX - 3, adjY - 3, adjX + k + 3, adjY + i1 + 3, j1, j1); + this.drawGradientRect(adjX - 4, adjY - 3, adjX - 3, adjY + i1 + 3, j1, j1); + this.drawGradientRect(adjX + k + 3, adjY - 3, adjX + k + 4, adjY + i1 + 3, j1, j1); + int k1 = 1347420415; + int l1 = (k1 & 16711422) >> 1 | k1 & -16777216; + this.drawGradientRect(adjX - 3, adjY - 3 + 1, adjX - 3 + 1, adjY + i1 + 3 - 1, k1, l1); + this.drawGradientRect(adjX + k + 2, adjY - 3 + 1, adjX + k + 3, adjY + i1 + 3 - 1, k1, l1); + this.drawGradientRect(adjX - 3, adjY - 3, adjX + k + 3, adjY - 3 + 1, k1, k1); + this.drawGradientRect(adjX - 3, adjY + i1 + 2, adjX + k + 3, adjY + i1 + 3, l1, l1); + + for (int i2 = 0; i2 < list.size(); ++i2) { + String s1 = (String) list.get(i2); + font.drawStringWithShadow(s1, adjX, adjY, -1); + + if (i2 == 0) { + adjY += 2; + } + + adjY += 10; + } + + this.zLevel = 0.0F; + itemRender.zLevel = 0.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + // RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } + } + + public void drawItemStack(ItemStack stack, int x, int y, String count) { + if (stack == null) return; + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + this.zLevel = 200.0F; + itemRender.zLevel = 200.0F; + FontRenderer font; + font = stack.getItem().getFontRenderer(stack); + if (font == null) font = fontRendererObj; + itemRender.renderItemAndEffectIntoGUI(font, mc.getTextureManager(), stack, x, y); + // itemRender.renderEffect(mc.getTextureManager(), x, y); + if (!count.equals("null")) + itemRender.renderItemOverlayIntoGUI(font, mc.getTextureManager(), stack, x, y, count); + this.zLevel = 0.0F; + itemRender.zLevel = 0.0F; + + // GL11.glEnable(GL11.GL_LIGHTING); + // GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glPopAttrib(); + GL11.glPopMatrix(); + } + + protected void renderToolTip(ItemStack stack, int x, int y) { + List list = stack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); + + for (int k = 0; k < list.size(); ++k) { + if (k == 0) { + list.set(k, stack.getRarity().rarityColor + (String) list.get(k)); + } else { + list.set(k, EnumChatFormatting.GRAY + (String) list.get(k)); + } + } + + FontRenderer font = stack.getItem().getFontRenderer(stack); + drawHoveringText(list, x, y, (font == null ? fontRendererObj : font)); + } + + public void mouseClicked(int x, int y, int button) {} + + public void setWorldAndResolution(Minecraft mc, int width, int height) { + + this.mc = mc; + this.fontRendererObj = mc.fontRenderer; + this.width = width; + this.height = height; + } + + /** Translate To Local */ + public String ttl(String unlocalizedName) { + return StatCollector.translateToLocal(unlocalizedName); + } + + public void updateScreen() {} + + protected void keyTyped(char par1, int par2) {} +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentButton.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentButton.java new file mode 100644 index 00000000..658e1892 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentButton.java @@ -0,0 +1,122 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StringUtils; + +import org.lwjgl.opengl.GL11; + +/** + * Created by Brandon on 1/01/2015. + */ +public class ComponentButton extends ComponentBase { + + protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); + + public int buttonId; + public GUIBase gui; + public int xSize; + public int ySize; + public int packedFGColour; + public String displayString; + public String hoverText; + + public ComponentButton(int x, int y, int xSize, int ySize, int id, GUIBase gui, String displayString) { + super(x, y); + this.xSize = xSize; + this.ySize = ySize; + this.buttonId = id; + this.gui = gui; + this.displayString = displayString; + } + + public ComponentButton(int x, int y, int xSize, int ySize, int id, GUIBase gui, String displayString, + String hoverText) { + this(x, y, xSize, ySize, id, gui, displayString); + this.hoverText = hoverText; + } + + @Override + public int getWidth() { + return xSize; + } + + @Override + public int getHeight() { + return ySize; + } + + @Override + public void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {} + + @Override + public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); + // FontRenderer fontrenderer = minecraft.fontRenderer; + minecraft.getTextureManager().bindTexture(buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + int k = isMouseOver(mouseX, mouseY) ? 2 : 1; + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.drawTexturedModalRect(this.x, this.y, 0, 46 + k * 20, this.xSize / 2, this.ySize); + this.drawTexturedModalRect( + this.x + this.xSize / 2, + this.y, + 200 - this.xSize / 2, + 46 + k * 20, + this.xSize / 2, + this.ySize); + if (this.ySize < 20) { + + this.drawTexturedModalRect(x, y + 3, 0, (46 + k * 20) + 20 - ySize + 3, xSize / 2, ySize - 3); + this.drawTexturedModalRect( + x + xSize / 2, + y + 3, + 200 - xSize / 2, + (46 + k * 20) + 20 - ySize + 3, + xSize / 2, + ySize - 3); + } + // this.mouseDragged(minecraft, mouseX, mouseY); + int l = 14737632; + + if (packedFGColour != 0) { + l = packedFGColour; + } else if (!this.enabled) { + l = 10526880; + } else if (isMouseOver(mouseX, mouseY)) { + l = 16777120; + } + this.drawCenteredString( + fontRendererObj, + this.displayString, + this.x + this.xSize / 2, + this.y + (this.ySize - 8) / 2, + l); + GL11.glPopAttrib(); + GL11.glPopMatrix(); + } + + @Override + public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + if (isMouseOver(mouseX, mouseY) && !StringUtils.isNullOrEmpty(hoverText)) { + List list = new ArrayList(); + list.add(hoverText); + drawHoveringText(list, mouseX + offsetX, mouseY + offsetY + 10, fontRendererObj); + } + } + + @Override + public void mouseClicked(int x, int y, int button) { + Minecraft.getMinecraft().getSoundHandler() + .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + gui.buttonClicked(buttonId, button); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentCollection.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentCollection.java new file mode 100644 index 00000000..8dfeb6c2 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentCollection.java @@ -0,0 +1,170 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.Minecraft; + +/** + * Created by Brandon on 28/12/2014. + */ +public class ComponentCollection extends ComponentBase { + + protected List components = new ArrayList(); + protected int xSize; + protected int ySize; + protected List deadGroups = new ArrayList(); + protected GUIBase gui; + private boolean openBoarders = false; + + public ComponentCollection(int x, int y, int xSize, int ySize, GUIBase gui) { + super(x, y); + this.xSize = xSize; + this.ySize = ySize; + this.gui = gui; + } + + @Override + public int getWidth() { + return xSize; + } + + @Override + public int getHeight() { + return ySize; + } + + public ComponentBase addComponent(ComponentBase component) { + components.add(component); + component.setWorldAndResolution(Minecraft.getMinecraft(), width, height); + return component; + } + + private boolean isComponentEnabled(ComponentBase component) { + return component != null && component.isEnabled(); + } + + private boolean isComponentCapturingMouse(ComponentBase component, int mouseX, int mouseY) { + return isComponentEnabled(component) && component.isMouseOver(mouseX, mouseY); + } + + @Override + public final void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + for (ComponentBase component : components) if (isComponentEnabled(component)) { + component.renderBackground(minecraft, offsetX + this.x, offsetY + this.y, mouseX - this.x, mouseY - this.y); + } + } + + @Override + public final void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + for (ComponentBase component : components) if (isComponentEnabled(component)) { + component.renderForground(minecraft, offsetX + this.x, offsetY + this.y, mouseX - this.x, mouseY - this.y); + } + } + + @Override + public final void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + for (ComponentBase component : components) if (isComponentEnabled(component)) { + component.renderFinal(minecraft, offsetX + this.x, offsetY + this.y, mouseX - this.x, mouseY - this.y); + } + } + + @Override + public void mouseClicked(int x, int y, int button) { + for (ComponentBase component : components) { + if (!gui.buttonPressed && component.isEnabled() && component.isMouseOver(x, y)) { + component.mouseClicked(x, y, button); + } + } + // removeScheduled(); + } + + @Override + public void keyTyped(char par1, int par2) { + for (ComponentBase component : components) { + if (component.isEnabled()) { + component.keyTyped(par1, par2); + } + } + } + + public List getComponents() { + return components; + } + + public ComponentBase getComponent(String name) { + for (ComponentBase component : components) { + if (component.name != null && component.name.equals(name)) return component; + } + return null; + } + + public void setGroupEnabled(String group, boolean enabled) { + for (ComponentBase component : components) { + if (component.getGroup().equals(group)) { + component.setEnabled(enabled); + } + } + } + + public void setOnlyGroupEnabled(String group) { + for (ComponentBase component : components) { + if (component.getGroup().equals(group)) { + component.setEnabled(enabled); + } else { + component.setEnabled(false); + } + } + } + + public void setComponentEnabled(String name, boolean enabled) { + for (ComponentBase component : components) { + if (component.name != null && component.name.equals(name)) { + component.setEnabled(enabled); + } + } + } + + public void removeGroup(String group) { + List list = new ArrayList(); + for (ComponentBase component : components) { + if (component.getGroup().equals(group)) list.add(component); + } + components.removeAll(list); + } + + @Override + public void setWorldAndResolution(Minecraft mc, int width, int height) { + super.setWorldAndResolution(mc, width, height); + for (ComponentBase component : components) { + component.setWorldAndResolution(mc, width, height); + } + } + + public void removeScheduled() { + if (!deadGroups.isEmpty()) { + for (String s : deadGroups) removeGroup(s); + deadGroups.clear(); + } + } + + public void schedulRemoval(String group) { + deadGroups.add(group); + } + + @Override + public void updateScreen() { + for (ComponentBase component : components) { + component.updateScreen(); + } + } + + public ComponentCollection setOpenBoarders() { + openBoarders = true; + return this; + } + + public boolean openBoarders() { + return openBoarders; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentItemRenderer.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentItemRenderer.java new file mode 100644 index 00000000..e132935d --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentItemRenderer.java @@ -0,0 +1,50 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +/** + * Created by Brandon on 31/12/2014. + */ +public class ComponentItemRenderer extends ComponentBase { + + private static final ResourceLocation texture = new ResourceLocation("brandonscore:textures/gui/Widgets.png"); + + ItemStack stack; + + public ComponentItemRenderer(int x, int y, ItemStack stack) { + super(x, y); + this.stack = stack; + } + + @Override + public int getWidth() { + return 20; + } + + @Override + public int getHeight() { + return 20; + } + + @Override + public void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {} + + @Override + public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + GL11.glColor4f(1f, 1f, 1f, 1f); + Minecraft.getMinecraft().renderEngine.bindTexture(texture); + drawTexturedModalRect(x, y, 118, 0, getWidth(), getHeight()); + drawItemStack(stack, x + 2, y + 2, "null"); + } + + @Override + public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + if (isMouseOver(mouseX, mouseY)) { + renderToolTip(stack, mouseX + offsetX, mouseY + offsetY); + } + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentScrollingBase.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentScrollingBase.java new file mode 100644 index 00000000..1cb70e58 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentScrollingBase.java @@ -0,0 +1,21 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +/** + * Created by Brandon on 6/03/2015. + */ +public abstract class ComponentScrollingBase extends ComponentBase { + + protected GUIScrollingBase gui; + + public ComponentScrollingBase(int x, int y, GUIScrollingBase gui) { + super(x, y); + this.gui = gui; + } + + public abstract void handleScrollInput(int direction); + + @Override + public boolean isMouseOver(int mouseX, int mouseY) { + return super.isMouseOver(mouseX, mouseY + gui.scrollOffset); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentSlotBackground.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentSlotBackground.java new file mode 100644 index 00000000..2e1c933d --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentSlotBackground.java @@ -0,0 +1,48 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; + +/** + * Created by Brandon on 13/01/2015. + */ +public class ComponentSlotBackground extends ComponentBase { + + private static final ResourceLocation widgets = new ResourceLocation("brandonscore:textures/gui/Widgets.png"); + + public ComponentSlotBackground(int x, int y) { + super(x, y); + } + + @Override + public int getWidth() { + return 18; + } + + @Override + public int getHeight() { + return 18; + } + + @Override + public void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + minecraft.renderEngine.bindTexture(widgets); + drawTexturedModalRect(x, y, 119, 1, getWidth(), getHeight()); + } + + @Override + public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {} + + public static ComponentCollection addInventorySlots(ComponentCollection c, int xOffset, int yOffset, + int lockedSlot) { + for (int x = 0; x < 9; x++) if (x != lockedSlot) + c.addComponent(new ComponentSlotBackground(xOffset + x * 18, yOffset + 58)).setGroup("INVENTORY"); + + for (int y = 0; y < 3; y++) { + for (int x = 0; x < 9; x++) if (x + y * 9 + 9 != lockedSlot) + c.addComponent(new ComponentSlotBackground(xOffset + x * 18, yOffset + y * 18)).setGroup("INVENTORY"); + } + + return c; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextField.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextField.java new file mode 100644 index 00000000..b259fc44 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextField.java @@ -0,0 +1,71 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiTextField; + +/** + * Created by brandon3055 on 16/2/2016. + */ +public class ComponentTextField extends ComponentBase { + + public GuiTextField textField; + private int xSize; + private int ySize; + private GUIBase parent; + private String label = ""; + private int labelColour = 0; + + public ComponentTextField(GUIBase parent, int x, int y, int xSize, int ySize) { + super(x, y); + this.xSize = xSize; + this.ySize = ySize; + this.parent = parent; + textField = new GuiTextField(fontRendererObj, x, y, xSize, ySize); + } + + @Override + public int getWidth() { + return xSize; + } + + @Override + public int getHeight() { + return ySize; + } + + @Override + public void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {} + + @Override + public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + drawRect(x - 1, y - 1, x + xSize - textField.width + 1, y + ySize + 1, -6250336); + textField.drawTextBox(); + drawRect(x, y, x + xSize - textField.width, y + ySize, -16777216); + fontRendererObj.drawString(label, x + 1, y + 2, labelColour); + } + + @Override + public void mouseClicked(int x, int y, int button) { + textField.mouseClicked(x, y, button); + } + + @Override + protected void keyTyped(char par1, int par2) { + textField.textboxKeyTyped(par1, par2); + if (textField.isFocused()) parent.componentCallBack(this); + } + + public boolean isFocused() { + return textField.isFocused(); + } + + public ComponentTextField setLabel(String label, int labelColour) { + this.label = label; + this.labelColour = labelColour; + int labelLength = fontRendererObj.getStringWidth(label); + textField.xPosition = x + labelLength; + textField.width = xSize - labelLength; + textField.setTextColor(labelColour); + return this; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextureButton.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextureButton.java new file mode 100644 index 00000000..18ef433c --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTextureButton.java @@ -0,0 +1,91 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +/** + * Created by brandon3055 on 31/7/2015. + */ +public class ComponentTextureButton extends ComponentButton { + + public int textureXPos; + public int textureYPos; + private ResourceLocation texture; + private boolean forceFullRender = false; + + // public ComponentTextureButton(int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise, + // String text) { + public ComponentTextureButton(int x, int y, int textureXPos, int textureYPos, int xSize, int ySize, int id, + GUIBase gui, String displayString, String hoverText, ResourceLocation texture) { + super(x, y, xSize, ySize, id, gui, displayString, hoverText); + this.textureXPos = textureXPos; + this.textureYPos = textureYPos; + this.texture = texture; + } + + public ComponentTextureButton forceFullRender() { + forceFullRender = true; + return this; + } + + @Override + public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + + GL11.glPushMatrix(); + minecraft.getTextureManager().bindTexture(texture); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (!forceFullRender) { + int k = isMouseOver(mouseX, mouseY) ? 2 : 1; + GL11.glEnable(GL11.GL_BLEND); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.drawTexturedModalRect(this.x, this.y, textureXPos, textureYPos + k * ySize, this.xSize, this.ySize); + int l = 14737632; + + if (packedFGColour != 0) { + l = packedFGColour; + } else if (!this.enabled) { + l = 10526880; + } else if (isMouseOver(mouseX, mouseY)) { + l = 16777120; + } + this.drawCenteredString( + fontRendererObj, + this.displayString, + this.x + this.xSize / 2, + this.y + (this.ySize - 8) / 2, + l); + } else { + int xPos = this.x; + int yPos = this.y; + int xSize = this.xSize; + int ySize = this.ySize; + Tessellator tessellator = Tessellator.instance; + + if (isMouseOver(mouseX, mouseY)) { + GL11.glDisable(GL11.GL_ALPHA_TEST); + tessellator.setColorRGBA_I(0x000000, 255); + tessellator.startDrawingQuads(); + tessellator.addVertex((double) xPos, (double) (yPos + ySize), (double) this.zLevel); + tessellator.addVertex((double) (xPos + xSize), (double) (yPos + ySize), (double) this.zLevel); + tessellator.addVertex((double) (xPos + xSize), (double) yPos, (double) this.zLevel); + tessellator.addVertex((double) xPos, (double) yPos, (double) this.zLevel); + tessellator.draw(); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((double) xPos, (double) (yPos + ySize), (double) this.zLevel, 0, 1); + tessellator.addVertexWithUV((double) (xPos + xSize), (double) (yPos + ySize), (double) this.zLevel, 1, 1); + tessellator.addVertexWithUV((double) (xPos + xSize), (double) yPos, (double) this.zLevel, 1, 0); + tessellator.addVertexWithUV((double) xPos, (double) yPos, (double) this.zLevel, 0, 0); + tessellator.draw(); + } + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTexturedRect.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTexturedRect.java new file mode 100644 index 00000000..875c867a --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/ComponentTexturedRect.java @@ -0,0 +1,68 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +/** + * Created by Brandon on 29/12/2014. + */ +public class ComponentTexturedRect extends ComponentBase { + + private int width; + private int height; + private int texX = 0; + private int texY = 0; + private final ResourceLocation texture; + private boolean transparent = false; + + public ComponentTexturedRect(int x, int y, int width, int height, ResourceLocation texture) { + super(x, y); + this.width = width; + this.height = height; + this.texture = texture; + } + + public ComponentTexturedRect(int x, int y, int texX, int texY, int width, int height, ResourceLocation texture, + boolean transparent) { + super(x, y); + this.width = width; + this.height = height; + this.texture = texture; + this.texX = texX; + this.texY = texY; + this.transparent = transparent; + } + + @Override + public int getWidth() { + return width; + } + + @Override + public int getHeight() { + return height; + } + + @Override + public void renderBackground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { + Minecraft.getMinecraft().renderEngine.bindTexture(texture); + if (transparent) { + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + // GL11.glScalef(1f, 0.33f, 1f); + // GL11.glScalef(0.5f, 0.5f, 0.5f); + } + GL11.glColor4f(1f, 1f, 1f, 1f); + drawTexturedModalRect(x, y, texX, texY, width, height); + if (transparent) { + // GL11.glScalef(2f, 2f, 2f); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + + @Override + public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {} +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIBase.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIBase.java new file mode 100644 index 00000000..15f915af --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIBase.java @@ -0,0 +1,142 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +/** + * Created by Brandon on 25/12/2014. This class is copied from open blocks + */ + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.inventory.Container; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public abstract class GUIBase extends GuiContainer { + + protected ComponentCollection collection; + /** used to prevent multiple buttons being pressed wen overlapping components are changed */ + protected boolean buttonPressed = false; + + public GUIBase(Container container, int xSize, int ySize) { + super(container); + this.xSize = xSize; + this.ySize = ySize; + mc = Minecraft.getMinecraft(); + collection = assembleComponents(); + } + + protected abstract ComponentCollection assembleComponents(); + + protected void addDependentComponents() {} + + @Override + protected void mouseClicked(int x, int y, int button) { + super.mouseClicked(x, y, button); + if (collection.isMouseOver(x - this.guiLeft, y - this.guiTop) || collection.openBoarders()) { + collection.mouseClicked(x - this.guiLeft, y - this.guiTop, button); + } + } + + @Override + protected void mouseMovedOrUp(int x, int y, int button) { + super.mouseMovedOrUp(x, y, button); + if (collection.isMouseOver(x - this.guiLeft, y - this.guiTop) || collection.openBoarders()) { + // if (button >= 0) collection.mouseUp(x - this.guiLeft, y - this.guiTop, button); + } + } + + @Override + protected void mouseClickMove(int x, int y, int button, long time) { + super.mouseClickMove(x, y, button, time); + // if (collection.isMouseOver(x - this.guiLeft, y - this.guiTop)) collection.mouseDrag(x - this.guiLeft, y - + // this.guiTop, button, time); + } + + @Override + protected void keyTyped(char par1, int par2) { + super.keyTyped(par1, par2); + collection.keyTyped(par1, par2); + } + + public void preRender(float mouseX, float mouseY) {} + + public void postRender(int mouseX, int mouseY) {} + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { + prepareRenderState(); + preRender(mouseX, mouseY); + GL11.glPushMatrix(); + GL11.glTranslated(this.guiLeft, this.guiTop, 0); + collection.renderBackground(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop); + GL11.glPopMatrix(); + postRender(mouseX, mouseY); + restoreRenderState(); + } + + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + // prepareRenderState(); + GL11.glPushMatrix(); + collection.renderForground(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop); + GL11.glPopMatrix(); + // restoreRenderState(); + } + + @Override + public void drawScreen(int mouseX, int mouseY, float par3) { + super.drawScreen(mouseX, mouseY, par3); + prepareRenderState(); + GL11.glPushMatrix(); + collection.renderFinal(this.mc, this.guiLeft, this.guiTop, mouseX - this.guiLeft, mouseY - this.guiTop); + GL11.glPopMatrix(); + restoreRenderState(); + } + + protected void prepareRenderState() { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + + protected void restoreRenderState() { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } + + @Override + public void setWorldAndResolution(Minecraft mc, int width, int height) { + super.setWorldAndResolution(mc, width, height); + collection.setWorldAndResolution(mc, width, height); + } + + @Override + public void updateScreen() { + super.updateScreen(); + collection.removeScheduled(); + collection.updateScreen(); + buttonPressed = false; + } + + public void buttonClicked(int id, int button) { + buttonPressed = true; + } + + public int getXSize() { + return xSize; + } + + public int getYSize() { + return ySize; + } + + /** + * This can be used by components to contact the GUI and the gui can then do some custom operation for that + * component Added so ComponentTextField can let the gui know when it has been changed + */ + public void componentCallBack(ComponentBase component) {} +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIScrollingBase.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIScrollingBase.java new file mode 100644 index 00000000..affe9915 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/gui/guicomponents/GUIScrollingBase.java @@ -0,0 +1,76 @@ +package com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents; + +import net.minecraft.inventory.Container; + +/** + * Created by Brandon on 6/03/2015. + */ +public abstract class GUIScrollingBase extends GUIBase { + + public int scrollOffset; + public int pageLength; + public int scrollLimit; + public int barPosition; + public boolean disableScrollBar = true; + + public GUIScrollingBase(Container container, int xSize, int ySize) { + super(container, xSize, ySize); + } + + @Override + public void handleMouseInput() { + super.handleMouseInput(); + int i = org.lwjgl.input.Mouse.getEventDWheel(); + if (i != 0) { + handleScrollInput(i > 0 ? -1 : 1); + + for (ComponentBase c : collection.getComponents()) { + if (c instanceof ComponentScrollingBase && c.isEnabled()) + ((ComponentScrollingBase) c).handleScrollInput(i > 0 ? -1 : 1); + } + } + } + + public abstract void handleScrollInput(int direction); + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { + super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY); + } + + protected int clickedY = 0; + protected boolean scrollPressed = false; + + @Override + protected void mouseClicked(int x, int y, int button) { + super.mouseClicked(x, y, button); + if (disableScrollBar) return; + clickedY = y; + if ((x - guiLeft + 17) > 0 && (x - guiLeft + 17) < 17 + && clickedY - guiTop - 20 > barPosition + && clickedY - guiTop - 20 < barPosition + 38) + scrollPressed = true; + } + + @Override + protected void mouseMovedOrUp(int x, int y, int button) { + super.mouseMovedOrUp(x, y, button); + scrollPressed = false; + } + + @Override + protected void mouseClickMove(int x, int y, int button, long time) { + super.mouseClickMove(x, y, button, time); + if (!scrollPressed || disableScrollBar) return; + barPosition += y - clickedY; + if (barPosition < 0) barPosition = 0; + else if (barPosition > 247) barPosition = 247; + if (barPosition != 0 && barPosition != 247) clickedY = y; + barMoved((double) barPosition / 247D * 1D); + } + + /** + * @param position New bar position between 0 (top) and 1 (bottom) + */ + public abstract void barMoved(double position); +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/ClientUtills.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/ClientUtills.java new file mode 100644 index 00000000..ebb19334 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/ClientUtills.java @@ -0,0 +1,24 @@ +package com.brandon3055.draconicevolution.brandonscore.client.utills; + +import com.brandon3055.draconicevolution.common.utills.LogHelper; + +import java.net.URI; + +/** + * Created by brandon3055 on 11/11/2015. + */ +@SuppressWarnings("unused") +public class ClientUtills { + + public static void openLink(String url) { + try { + URI uri = new URI(url); + Class oclass = Class.forName("java.awt.Desktop"); + Object object = oclass.getMethod("getDesktop", new Class[0]).invoke(null, new Object[0]); + oclass.getMethod("browse", new Class[] { URI.class }).invoke(object, new Object[] { uri }); + } catch (Throwable throwable) { + LogHelper.error("Couldn\'t open link"); + throwable.printStackTrace(); + } + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/GuiHelper.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/GuiHelper.java new file mode 100644 index 00000000..d52f5d61 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/client/utills/GuiHelper.java @@ -0,0 +1,140 @@ +package com.brandon3055.draconicevolution.brandonscore.client.utills; + +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +/** + * Created by Brandon on 28/06/2014. + */ +@SuppressWarnings("unused") +public class GuiHelper { + + public static final double PXL128 = 0.0078125; + public static final double PXL256 = 0.00390625; + + public static boolean isInRect(int x, int y, int xSize, int ySize, int mouseX, int mouseY) { + return ((mouseX >= x && mouseX <= x + xSize) && (mouseY >= y && mouseY <= y + ySize)); + } + + public static void drawTexturedRect(int x, int y, int u, int v, int width, int height) { + drawTexturedRect(x, y, width, height, u, v, width, height, 0, PXL256); + } + + public static void drawTexturedRect(double x, double y, double width, double height, int u, int v, int uSize, + int vSize, double zLevel, double pxl) { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(x, y + height, zLevel, u * pxl, (v + vSize) * pxl); + tessellator.addVertexWithUV(x + width, y + height, zLevel, (u + uSize) * pxl, (v + vSize) * pxl); + tessellator.addVertexWithUV(x + width, y, zLevel, (u + uSize) * pxl, v * pxl); + tessellator.addVertexWithUV(x, y, zLevel, u * pxl, v * pxl); + tessellator.draw(); + } + + public static void drawHoveringText(List list, int x, int y, FontRenderer font, float fade, double scale, + int guiWidth, int guiHeight) { + if (!list.isEmpty()) { + GL11.glPushMatrix(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glScaled(scale, scale, 1); + x = (int) (x / scale); + y = (int) (y / scale); + + int k = 0; + Iterator iterator = list.iterator(); + + while (iterator.hasNext()) { + String s = (String) iterator.next(); + int l = font.getStringWidth(s); + + if (l > k) { + k = l; + } + } + + int adjX = x + 12; + int adjY = y - 12; + int i1 = 8; + + if (list.size() > 1) { + i1 += 2 + (list.size() - 1) * 10; + } + + if (adjX + k > (int) (guiWidth / scale)) { + adjX -= 28 + k; + } + + if (adjY + i1 + 6 > (int) (guiHeight / scale)) { + adjY = (int) (guiHeight / scale) - i1 - 6; + } + + int j1 = -267386864; + drawGradientRect(adjX - 3, adjY - 4, adjX + k + 3, adjY - 3, j1, j1, fade, scale); + drawGradientRect(adjX - 3, adjY + i1 + 3, adjX + k + 3, adjY + i1 + 4, j1, j1, fade, scale); + drawGradientRect(adjX - 3, adjY - 3, adjX + k + 3, adjY + i1 + 3, j1, j1, fade, scale); + drawGradientRect(adjX - 4, adjY - 3, adjX - 3, adjY + i1 + 3, j1, j1, fade, scale); + drawGradientRect(adjX + k + 3, adjY - 3, adjX + k + 4, adjY + i1 + 3, j1, j1, fade, scale); + int k1 = 1347420415; + int l1 = (k1 & 16711422) >> 1 | k1 & -16777216; + drawGradientRect(adjX - 3, adjY - 3 + 1, adjX - 3 + 1, adjY + i1 + 3 - 1, k1, l1, fade, scale); + drawGradientRect(adjX + k + 2, adjY - 3 + 1, adjX + k + 3, adjY + i1 + 3 - 1, k1, l1, fade, scale); + drawGradientRect(adjX - 3, adjY - 3, adjX + k + 3, adjY - 3 + 1, k1, k1, fade, scale); + drawGradientRect(adjX - 3, adjY + i1 + 2, adjX + k + 3, adjY + i1 + 3, l1, l1, fade, scale); + + for (int i2 = 0; i2 < list.size(); ++i2) { + String s1 = (String) list.get(i2); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + font.drawStringWithShadow(s1, adjX, adjY, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF); + + adjY += 10; + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + + public static void drawGradientRect(int x1, int y1, int x2, int y2, int colour1, int colour2, float fade, + double scale) { + float f = ((colour1 >> 24 & 255) / 255.0F) * fade; + float f1 = (float) (colour1 >> 16 & 255) / 255.0F; + float f2 = (float) (colour1 >> 8 & 255) / 255.0F; + float f3 = (float) (colour1 & 255) / 255.0F; + float f4 = ((colour2 >> 24 & 255) / 255.0F) * fade; + float f5 = (float) (colour2 >> 16 & 255) / 255.0F; + float f6 = (float) (colour2 >> 8 & 255) / 255.0F; + float f7 = (float) (colour2 & 255) / 255.0F; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glShadeModel(GL11.GL_SMOOTH); + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.setColorRGBA_F(f1, f2, f3, f); + tessellator.addVertex((double) x2, (double) y1, 300D); + tessellator.addVertex((double) x1, (double) y1, 300D); + tessellator.setColorRGBA_F(f5, f6, f7, f4); + tessellator.addVertex((double) x1, (double) y2, 300D); + tessellator.addVertex((double) x2, (double) y2, 300D); + tessellator.draw(); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/FileHandler.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/FileHandler.java new file mode 100644 index 00000000..3e37eb39 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/FileHandler.java @@ -0,0 +1,19 @@ +package com.brandon3055.draconicevolution.brandonscore.common.handlers; + +import java.io.File; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +/** + * Created by Brandon on 7/6/2015. + */ +public class FileHandler { + + public static File configFolder; + public static File mcDirectory; + + public static void init(FMLPreInitializationEvent event) { + configFolder = event.getModConfigurationDirectory(); + mcDirectory = configFolder.getParentFile(); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/IProcess.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/IProcess.java new file mode 100644 index 00000000..5fe15f9f --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/IProcess.java @@ -0,0 +1,11 @@ +package com.brandon3055.draconicevolution.brandonscore.common.handlers; + +/** + * Created by brandon3055 on 12/8/2015. + */ +public interface IProcess { + + void updateProcess(); + + boolean isDead(); +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/ProcessHandler.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/ProcessHandler.java new file mode 100644 index 00000000..5361f737 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/handlers/ProcessHandler.java @@ -0,0 +1,61 @@ +package com.brandon3055.draconicevolution.brandonscore.common.handlers; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.world.WorldEvent; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; + +/** + * This is a class used to run processes that implement IProcess. Processes are similar to tile entities except that + * they are not bound to anything and they are not currently persistent (they will be deleted when the world closes) + * + * Created by brandon3055 on 12/8/2015. + */ +public class ProcessHandler { + + private static List processes = new ArrayList(); + private static List newProcesses = new ArrayList(); + + public static void init() { + FMLCommonHandler.instance().bus().register(new ProcessHandler()); + MinecraftForge.EVENT_BUS.register(new ProcessHandler()); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public void onServerTick(TickEvent.ServerTickEvent event) { + if (event.phase == TickEvent.Phase.START) { + + Iterator i = processes.iterator(); + + while (i.hasNext()) { + IProcess process = i.next(); + if (process.isDead()) i.remove(); + else process.updateProcess(); + } + + if (!newProcesses.isEmpty()) { + processes.addAll(newProcesses); + newProcesses.clear(); + } + } + } + + @SubscribeEvent + @SuppressWarnings("unused") + public void onWorldClose(WorldEvent.Unload event) { + processes.clear(); + newProcesses.clear(); + } + + @SuppressWarnings("unused") + public static void addProcess(IProcess process) { + newProcesses.add(process); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/lib/References.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/lib/References.java new file mode 100644 index 00000000..f8a6bc7b --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/lib/References.java @@ -0,0 +1,19 @@ +package com.brandon3055.draconicevolution.brandonscore.common.lib; + +/** + * Created by Brandon on 14/5/2015. + */ +public class References { + + // ======================Data Types========================// + public static final byte BYTE_ID = 0; + public static final byte SHORT_ID = 1; + public static final byte INT_ID = 2; + public static final byte LONG_ID = 3; + public static final byte FLOAT_ID = 4; + public static final byte DOUBLE_ID = 5; + public static final byte BOOLEAN_ID = 6; + public static final byte CHAR_ID = 7; + public static final byte STRING_ID = 8; + public static final byte INT_PAIR_ID = 9; +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/DataUtills.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/DataUtills.java new file mode 100644 index 00000000..6edef639 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/DataUtills.java @@ -0,0 +1,269 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +import java.text.DecimalFormat; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import com.brandon3055.draconicevolution.brandonscore.common.lib.References; + +import cpw.mods.fml.common.network.ByteBufUtils; +import io.netty.buffer.ByteBuf; + +/** + * Created by Brandon on 31/12/2014. + */ +@SuppressWarnings("unused") +public class DataUtills { + + public static DataUtills instance = new DataUtills(); + + public void writeObjectToBytes(ByteBuf bytes, int dataType, Object object) { + switch (dataType) { + case References.BYTE_ID: + bytes.writeByte((Byte) object); + break; + case References.SHORT_ID: + bytes.writeShort((Short) object); + break; + case References.INT_ID: + bytes.writeInt((Integer) object); + break; + case References.LONG_ID: + bytes.writeLong((Long) object); + break; + case References.FLOAT_ID: + bytes.writeFloat((Float) object); + break; + case References.DOUBLE_ID: + bytes.writeDouble((Double) object); + break; + case References.CHAR_ID: + bytes.writeChar((Character) object); + break; + case References.STRING_ID: + ByteBufUtils.writeUTF8String(bytes, (String) object); + break; + case References.BOOLEAN_ID: + bytes.writeBoolean((Boolean) object); + break; + case References.INT_PAIR_ID: + bytes.writeInt(((IntPair) object).i1); + bytes.writeInt(((IntPair) object).i2); + break; + } + } + + public Object readObjectFromBytes(ByteBuf bytes, int dataType) { + switch (dataType) { + case References.BYTE_ID: + return bytes.readByte(); + case References.SHORT_ID: + return bytes.readShort(); + case References.INT_ID: + return bytes.readInt(); + case References.LONG_ID: + return bytes.readLong(); + case References.FLOAT_ID: + return bytes.readFloat(); + case References.DOUBLE_ID: + return bytes.readDouble(); + case References.CHAR_ID: + return bytes.readChar(); + case References.STRING_ID: + return ByteBufUtils.readUTF8String(bytes); + case References.BOOLEAN_ID: + return bytes.readBoolean(); + case References.INT_PAIR_ID: + IntPair tx = new IntPair(0, 0); + tx.i1 = bytes.readInt(); + tx.i2 = bytes.readInt(); + return tx; + } + return null; + } + + public static void writeObjectToItem(ItemStack stack, Object value, int datatype, String name) { + switch (datatype) { + case References.BYTE_ID: + ItemNBTHelper.setByte(stack, name, (Byte) value); + break; + case References.SHORT_ID: + ItemNBTHelper.setShort(stack, name, (Short) value); + break; + case References.INT_ID: + ItemNBTHelper.setInteger(stack, name, (Integer) value); + break; + case References.LONG_ID: + ItemNBTHelper.setLong(stack, name, (Long) value); + break; + case References.FLOAT_ID: + ItemNBTHelper.setFloat(stack, name, (Float) value); + break; + case References.DOUBLE_ID: + ItemNBTHelper.setDouble(stack, name, (Double) value); + break; + // case References.CHAR_ID: + // ItemNBTHelper.setChar(stack, value.name, (Byte)value.value); + // break; + case References.STRING_ID: + ItemNBTHelper.setString(stack, name, (String) value); + break; + case References.BOOLEAN_ID: + ItemNBTHelper.setBoolean(stack, name, (Boolean) value); + break; + } + } + + public static void writeObjectToCompound(NBTTagCompound compound, Object value, int datatype, String name) { + switch (datatype) { + case References.BYTE_ID: + compound.setByte(name, (Byte) value); + break; + case References.SHORT_ID: + compound.setShort(name, (Short) value); + break; + case References.INT_ID: + compound.setInteger(name, (Integer) value); + break; + case References.LONG_ID: + compound.setLong(name, (Long) value); + break; + case References.FLOAT_ID: + compound.setFloat(name, (Float) value); + break; + case References.DOUBLE_ID: + compound.setDouble(name, (Double) value); + break; + // case References.CHAR_ID: + // ItemNBTHelper.setChar(stack, value.name, (Byte)value.value); + // break; + case References.STRING_ID: + compound.setString(name, (String) value); + break; + case References.BOOLEAN_ID: + compound.setBoolean(name, (Boolean) value); + break; + } + } + + public static Object readObjectFromItem(ItemStack stack, int dataType, String name, Object defaultExpected) { + switch (dataType) { + case References.BYTE_ID: + return ItemNBTHelper.getByte(stack, name, (Byte) defaultExpected); + case References.SHORT_ID: + return ItemNBTHelper.getShort(stack, name, (Short) defaultExpected); + case References.INT_ID: + return ItemNBTHelper.getInteger(stack, name, (Integer) defaultExpected); + case References.LONG_ID: + return ItemNBTHelper.getLong(stack, name, (Long) defaultExpected); + case References.FLOAT_ID: + return ItemNBTHelper.getFloat(stack, name, (Float) defaultExpected); + case References.DOUBLE_ID: + return ItemNBTHelper.getDouble(stack, name, (Double) defaultExpected); + // case References.CHAR_ID: + case References.STRING_ID: + return ItemNBTHelper.getString(stack, name, (String) defaultExpected); + case References.BOOLEAN_ID: + return ItemNBTHelper.getBoolean(stack, name, (Boolean) defaultExpected); + } + return null; + } + + public static Object readObjectFromItem(ItemStack stack, int dataType, String name) { + switch (dataType) { + case References.BYTE_ID: + return ItemNBTHelper.getByte(stack, name, (byte) 0); + case References.SHORT_ID: + return ItemNBTHelper.getShort(stack, name, (short) 0); + case References.INT_ID: + return ItemNBTHelper.getInteger(stack, name, 0); + case References.LONG_ID: + return ItemNBTHelper.getLong(stack, name, 0L); + case References.FLOAT_ID: + return ItemNBTHelper.getFloat(stack, name, 0F); + case References.DOUBLE_ID: + return ItemNBTHelper.getDouble(stack, name, 0D); + // case References.CHAR_ID: + case References.STRING_ID: + return ItemNBTHelper.getString(stack, name, ""); + case References.BOOLEAN_ID: + return ItemNBTHelper.getBoolean(stack, name, false); + } + return null; + } + + public static Object readObjectFromCompound(NBTTagCompound compound, int dataType, String name, + Object defaultExpected) { + switch (dataType) { + case References.BYTE_ID: + return compound.hasKey(name) ? compound.getByte(name) : (Byte) defaultExpected; + case References.SHORT_ID: + return compound.hasKey(name) ? compound.getShort(name) : (Short) defaultExpected; + case References.INT_ID: + return compound.hasKey(name) ? compound.getInteger(name) : (Integer) defaultExpected; + case References.LONG_ID: + return compound.hasKey(name) ? compound.getLong(name) : (Long) defaultExpected; + case References.FLOAT_ID: + return compound.hasKey(name) ? compound.getFloat(name) : (Float) defaultExpected; + case References.DOUBLE_ID: + return compound.hasKey(name) ? compound.getDouble(name) : (Double) defaultExpected; + // case References.CHAR_ID: + case References.STRING_ID: + return compound.hasKey(name) ? compound.getString(name) : (String) defaultExpected; + case References.BOOLEAN_ID: + return compound.hasKey(name) ? compound.getBoolean(name) : (Boolean) defaultExpected; + } + return null; + } + + public static class IntPair { + + public int i1; + public int i2; + + public IntPair(int i1, int i2) { + this.i1 = i1; + this.i2 = i2; + } + } + + public static class XZPair { + + public X x; + public Z z; + + public XZPair(X x, Z z) { + this.x = x; + this.z = z; + } + + public X getKey() { + return x; + } + + public Z getValue() { + return z; + } + } + + public static class XYZTri { + + public X x; + public Y y; + public Z z; + + public XYZTri(X x, Y y, Z z) { + this.x = x; + this.y = y; + this.z = z; + } + } + + public static String formatFileSize(long size) { + if (size <= 0) return "0"; + final String[] units = new String[] { "B", "kB", "MB", "GB", "TB" }; + int digitGroups = (int) (Math.log10(size) / Math.log10(1024)); + return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups]; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InfoHelper.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InfoHelper.java new file mode 100644 index 00000000..2edb47ea --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InfoHelper.java @@ -0,0 +1,143 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumberCompact; + +import java.util.List; + +import com.brandon3055.draconicevolution.common.utills.LogHelper; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + +import org.lwjgl.input.Keyboard; + +import cofh.api.energy.IEnergyContainerItem; + +/** + * Created by Brandon on 1/07/2014. + */ +@SuppressWarnings("unused") +public class InfoHelper { + + @SuppressWarnings("unchecked") + public static void addEnergyInfo(ItemStack stack, List list) { + IEnergyContainerItem item = (IEnergyContainerItem) stack.getItem(); + int energy = item.getEnergyStored(stack); + int maxEnergy = item.getMaxEnergyStored(stack); + + list.add( + StatCollector.translateToLocal("info.de.charge.txt") + ": " + + formatNumberCompact(energy) + + " / " + + formatNumberCompact(maxEnergy) + + " RF"); + } + + @SuppressWarnings("unchecked") + public static void addLore(ItemStack stack, List list, boolean addLeadingLine) { + String[] lore = getLore(stack); + if (addLeadingLine) list.add(""); + if (lore == null) { + list.add( + "" + EnumChatFormatting.ITALIC + + "" + + EnumChatFormatting.DARK_PURPLE + + "Invalid lore localization! (something is broken)"); + return; + } + for (String s : lore) list.add("" + EnumChatFormatting.ITALIC + "" + EnumChatFormatting.DARK_PURPLE + s); + } + + /** Add lore with a blank line above it */ + public static void addLore(ItemStack stack, List list) { + addLore(stack, list, true); + } + + /** Add the standard energy and lore information */ + @SuppressWarnings("unchecked") + public static void addEnergyAndLore(ItemStack stack, List list) { + if (!isShiftKeyDown()) list.add( + StatCollector.translateToLocal("info.de.hold.txt") + " " + + EnumChatFormatting.AQUA + + "" + + EnumChatFormatting.ITALIC + + StatCollector.translateToLocal("info.de.shift.txt") + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.GRAY + + StatCollector.translateToLocal("info.de.forDetails.txt")); + else { + addEnergyInfo(stack, list); + addLore(stack, list); + } + } + + /** returns lore text or an empty string if the lore is not set */ + public static String[] getLore(ItemStack stack) { + String unlocalizeLore = stack.getItem().getUnlocalizedName() + ".lore"; + String rawLore = StatCollector.translateToLocal(unlocalizeLore); + + if (rawLore.contains(unlocalizeLore)) { + // LogHelper.error("Invalid or missing Lore localization \""+unlocalizeLore+"\""); + return null; + } + + String lineCountS = rawLore.substring(0, 1); + rawLore = rawLore.substring(1); + int lineCount = 0; + + try { + lineCount = Integer.parseInt(lineCountS); + } catch (NumberFormatException e) { + LogHelper.error( + "Invalid Lore Format! Lore myst start with the number of lines \"3Line 1\\nLine 2\\nLine 3\""); + } + + String[] loreLines = new String[lineCount]; + + for (int i = 0; i < lineCount; i++) { + if (rawLore.contains("\\n")) loreLines[i] = rawLore.substring(0, rawLore.indexOf("\\n")); + else loreLines[i] = rawLore; + if (rawLore.contains("\\n")) rawLore = rawLore.substring(rawLore.indexOf("\\n") + 2); + } + + return loreLines; + } + + public static boolean isShiftKeyDown() { + return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); + } + + public static boolean isCtrlKeyDown() { + return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); + } + + @SuppressWarnings("unchecked") + public static boolean holdShiftForDetails(List list, boolean inverted) { + if (isShiftKeyDown() == inverted) list.add( + StatCollector.translateToLocal("info.de.hold.txt") + " " + + EnumChatFormatting.AQUA + + "" + + EnumChatFormatting.ITALIC + + StatCollector.translateToLocal("info.de.shift.txt") + + EnumChatFormatting.RESET + + " " + + EnumChatFormatting.GRAY + + StatCollector.translateToLocal("info.de.forDetails.txt")); + return isShiftKeyDown(); + } + + public static boolean holdShiftForDetails(List list) { + return holdShiftForDetails(list, false); + } + + /** "Information Text Colour" The colour used for custom tool tip info */ + public static String ITC() { + return "" + EnumChatFormatting.RESET + "" + EnumChatFormatting.DARK_AQUA; + } + + /** "Highlighted Information Text Colour" The colour used for parts that need to stand out */ + public static String HITC() { + return "" + EnumChatFormatting.RESET + "" + EnumChatFormatting.ITALIC + "" + EnumChatFormatting.GOLD; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InventoryUtils.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InventoryUtils.java new file mode 100644 index 00000000..333f6c5f --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/InventoryUtils.java @@ -0,0 +1,744 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +/** + * Everything in this class is copied from openblocks + */ + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.InventoryLargeChest; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; + +public class InventoryUtils { + + /*** + * Try to merge the supplied stack into the supplied slot in the target inventory + * + * @param targetInventory Although it doesn't return anything, it'll REDUCE the stack size of the stack that you + * pass in + * + * @param slot + * @param stack + */ + public static void tryInsertStack(IInventory targetInventory, int slot, ItemStack stack, boolean canMerge) { + if (targetInventory.isItemValidForSlot(slot, stack)) { + ItemStack targetStack = targetInventory.getStackInSlot(slot); + if (targetStack == null) { + targetInventory.setInventorySlotContents(slot, stack.copy()); + stack.stackSize = 0; + } else if (canMerge) { + if (targetInventory.isItemValidForSlot(slot, stack) && areMergeCandidates(stack, targetStack)) { + int space = targetStack.getMaxStackSize() - targetStack.stackSize; + int mergeAmount = Math.min(space, stack.stackSize); + ItemStack copy = targetStack.copy(); + copy.stackSize += mergeAmount; + targetInventory.setInventorySlotContents(slot, copy); + stack.stackSize -= mergeAmount; + } + } + } + } + + public static boolean areItemAndTagEqual(final ItemStack stackA, ItemStack stackB) { + return stackA.isItemEqual(stackB) && ItemStack.areItemStackTagsEqual(stackA, stackB); + } + + public static boolean areMergeCandidates(ItemStack source, ItemStack target) { + return areItemAndTagEqual(source, target) && target.stackSize < target.getMaxStackSize(); + } + + public static void insertItemIntoInventory(IInventory inventory, ItemStack stack) { + insertItemIntoInventory(inventory, stack, ForgeDirection.UNKNOWN, -1); + } + + public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, + int intoSlot) { + insertItemIntoInventory(inventory, stack, side, intoSlot, true); + } + + public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, int intoSlot, + boolean doMove) { + insertItemIntoInventory(inventory, stack, side, intoSlot, doMove, true); + } + + public static void insertItemIntoInventory(IInventory inventory, ItemStack stack, ForgeDirection side, int intoSlot, + boolean doMove, boolean canStack) { + if (stack == null) return; + + final int sideId = side.ordinal(); + IInventory targetInventory = inventory; + + // if we're not meant to move, make a clone of the inventory + if (!doMove) { + GenericInventory copy = new GenericInventory( + "temporary.inventory", + false, + targetInventory.getSizeInventory()); + copy.copyFrom(inventory); + targetInventory = copy; + } + + final Set attemptSlots = Sets.newTreeSet(); + + // if it's a sided inventory, get all the accessible slots + final boolean isSidedInventory = inventory instanceof ISidedInventory && side != ForgeDirection.UNKNOWN; + + if (isSidedInventory) { + int[] accessibleSlots = ((ISidedInventory) inventory).getAccessibleSlotsFromSide(sideId); + for (int slot : accessibleSlots) attemptSlots.add(slot); + } else { + // if it's just a standard inventory, get all slots + for (int a = 0; a < inventory.getSizeInventory(); a++) { + attemptSlots.add(a); + } + } + + // if we've defining a specific slot, we'll just use that + if (intoSlot > -1) attemptSlots.retainAll(ImmutableSet.of(intoSlot)); + + if (attemptSlots.isEmpty()) return; + + for (Integer slot : attemptSlots) { + if (stack.stackSize <= 0) break; + if (isSidedInventory && !((ISidedInventory) inventory).canInsertItem(slot, stack, sideId)) continue; + tryInsertStack(targetInventory, slot, stack, canStack); + } + } + + public static int moveItemInto(IInventory fromInventory, int fromSlot, Object target, int intoSlot, int maxAmount, + ForgeDirection direction, boolean doMove) { + return moveItemInto(fromInventory, fromSlot, target, intoSlot, maxAmount, direction, doMove, true); + } + + /*** + * Move an item from the fromInventory, into the target. The target can be an inventory or pipe. Double checks are + * automagically wrapped. If you're not bothered what slot you insert into, pass -1 for intoSlot. If you're passing + * false for doMove, it'll create a dummy inventory and its calculations on that instead + * + * @param fromInventory the inventory the item is coming from + * @param fromSlot the slot the item is coming from + * @param target the inventory you want the item to be put into. can be BC pipe or IInventory + * @param intoSlot the target slot. Pass -1 for any slot + * @param maxAmount The maximum amount you wish to pass + * @param direction The direction of the move. Pass UNKNOWN if not applicable + * @param doMove + * @param canStack + * @return The amount of items moved + */ + public static int moveItemInto(IInventory fromInventory, int fromSlot, Object target, int intoSlot, int maxAmount, + ForgeDirection direction, boolean doMove, boolean canStack) { + + fromInventory = InventoryUtils.getInventory(fromInventory); + + // if we dont have a stack in the source location, return 0 + ItemStack sourceStack = fromInventory.getStackInSlot(fromSlot); + if (sourceStack == null) { + return 0; + } + + if (fromInventory instanceof ISidedInventory + && !((ISidedInventory) fromInventory).canExtractItem(fromSlot, sourceStack, direction.ordinal())) + return 0; + + // create a clone of our source stack and set the size to either + // maxAmount or the stackSize + ItemStack clonedSourceStack = sourceStack.copy(); + clonedSourceStack.stackSize = Math.min(clonedSourceStack.stackSize, maxAmount); + int amountToMove = clonedSourceStack.stackSize; + int inserted = 0; + + if (target instanceof IInventory) { + IInventory targetInventory = getInventory((IInventory) target); + ForgeDirection side = direction.getOpposite(); + // try insert the item into the target inventory. this'll reduce the + // stackSize of our stack + InventoryUtils + .insertItemIntoInventory(targetInventory, clonedSourceStack, side, intoSlot, doMove, canStack); + inserted = amountToMove - clonedSourceStack.stackSize; + } + + // if we've done the move, reduce/remove the stack from our source + // inventory + if (doMove) { + ItemStack newSourcestack = sourceStack.copy(); + newSourcestack.stackSize -= inserted; + if (newSourcestack.stackSize == 0) { + fromInventory.setInventorySlotContents(fromSlot, null); + } else { + fromInventory.setInventorySlotContents(fromSlot, newSourcestack); + } + } + + return inserted; + } + + private static IInventory doubleChestFix(TileEntity te) { + final World world = te.getWorldObj(); + final int x = te.xCoord; + final int y = te.yCoord; + final int z = te.zCoord; + if (world.getBlock(x - 1, y, z) == Blocks.chest) return new InventoryLargeChest( + "Large chest", + (IInventory) world.getTileEntity(x - 1, y, z), + (IInventory) te); + if (world.getBlock(x + 1, y, z) == Blocks.chest) return new InventoryLargeChest( + "Large chest", + (IInventory) te, + (IInventory) world.getTileEntity(x + 1, y, z)); + if (world.getBlock(x, y, z - 1) == Blocks.chest) return new InventoryLargeChest( + "Large chest", + (IInventory) world.getTileEntity(x, y, z - 1), + (IInventory) te); + if (world.getBlock(x, y, z + 1) == Blocks.chest) return new InventoryLargeChest( + "Large chest", + (IInventory) te, + (IInventory) world.getTileEntity(x, y, z + 1)); + return (te instanceof IInventory) ? (IInventory) te : null; + } + + public static IInventory getInventory(World world, int x, int y, int z) { + TileEntity tileEntity = world.getTileEntity(x, y, z); + if (tileEntity instanceof TileEntityChest) return doubleChestFix(tileEntity); + if (tileEntity instanceof IInventory) return (IInventory) tileEntity; + return null; + } + + public static IInventory getInventory(World world, int x, int y, int z, ForgeDirection direction) { + if (direction != null) { + x += direction.offsetX; + y += direction.offsetY; + z += direction.offsetZ; + } + return getInventory(world, x, y, z); + } + + public static IInventory getInventory(IInventory inventory) { + if (inventory instanceof TileEntityChest) return doubleChestFix((TileEntity) inventory); + return inventory; + } + + public static List getInventoryContents(IInventory inventory) { + List result = Lists.newArrayList(); + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack slot = inventory.getStackInSlot(i); + if (slot != null) result.add(slot); + } + return result; + } + + /*** + * Get the indexes of all slots containing a stack of the supplied item type. + * + * @param inventory + * @param stack + * @return Returns a set of the slot indexes + */ + public static Set getSlotsWithStack(IInventory inventory, ItemStack stack) { + inventory = getInventory(inventory); + Set slots = Sets.newHashSet(); + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack stackInSlot = inventory.getStackInSlot(i); + if (stackInSlot != null && stackInSlot.isItemEqual(stack)) slots.add(i); + } + return slots; + } + + /*** + * Get the first slot containing an item type matching the supplied type. + * + * @param inventory + * @param stack + * @return Returns -1 if none found + */ + public static int getFirstSlotWithStack(IInventory inventory, ItemStack stack) { + inventory = getInventory(inventory); + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack stackInSlot = inventory.getStackInSlot(i); + if (stackInSlot != null && stackInSlot.isItemEqual(stack)) { + return i; + } + } + return -1; + } + + /*** + * Consume ONE of the supplied item types + * + * @param inventory + * @param stack + * @return Returns whether or not it was able to + */ + public static boolean consumeInventoryItem(IInventory inventory, ItemStack stack) { + int slotWithStack = getFirstSlotWithStack(inventory, stack); + if (slotWithStack > -1) { + ItemStack stackInSlot = inventory.getStackInSlot(slotWithStack); + stackInSlot.stackSize--; + if (stackInSlot.stackSize == 0) { + inventory.setInventorySlotContents(slotWithStack, null); + } + return true; + } + return false; + } + + /** + * Get the first slot index in an inventory with an item + * + * @param invent + * @return The slot index, or -1 if the inventory is empty + */ + public static int getSlotIndexOfNextStack(IInventory invent) { + for (int i = 0; i < invent.getSizeInventory(); i++) { + ItemStack stack = invent.getStackInSlot(i); + if (stack != null) { + return i; + } + } + return -1; + } + + /*** + * Removes an item stack from the inventory and returns a copy of it + * + * @param invent + * @return A copy of the stack it removed + */ + public static ItemStack removeNextItemStack(IInventory invent) { + int nextFilledSlot = getSlotIndexOfNextStack(invent); + if (nextFilledSlot > -1) { + ItemStack copy = invent.getStackInSlot(nextFilledSlot).copy(); + invent.setInventorySlotContents(nextFilledSlot, null); + return copy; + } + return null; + } + + public static int moveItemsFromOneOfSides(TileEntity te, IInventory inv, int maxAmount, int intoSlot, + Set sides) { + return moveItemsFromOneOfSides(te, inv, null, maxAmount, intoSlot, sides); + } + + public static int moveItemsFromOneOfSides(TileEntity te, IInventory inv, ItemStack filterStack, int maxAmount, + int intoSlot, Set sides) { + List shuffledSides = Lists.newArrayList(sides); + Collections.shuffle(shuffledSides); + + IInventory ourInventory = getInventory(inv); + + // loop through the shuffled sides + for (ForgeDirection dir : sides) { + TileEntity tileOnSurface = getTileInDirection(te, dir); + // if it's an inventory + if (tileOnSurface instanceof IInventory) { + final IInventory neighbor = (IInventory) tileOnSurface; + + Set slots; + + if (filterStack == null) slots = getAllSlots(neighbor); + else slots = getSlotsWithStack(neighbor, filterStack); + + for (Integer slot : slots) { + int moved = InventoryUtils + .moveItemInto(neighbor, slot, ourInventory, intoSlot, maxAmount, dir.getOpposite(), true); + if (moved > 0) return moved; + } + } + } + return 0; + } + + /** + * Tests to see if an item stack can be inserted in to an inventory Does not perform the insertion, only tests the + * possibility + * + * @param inventory The inventory to insert the stack into + * @param item the stack to insert + * @return the amount of items that could be put in to the stack + */ + public static int testInventoryInsertion(IInventory inventory, ItemStack item) { + if (item == null || item.stackSize == 0) return 0; + if (inventory == null) return 0; + int slotCount = inventory.getSizeInventory(); + /* + * Allows counting down the item size, without cloning or changing the object + */ + int itemSizeCounter = item.stackSize; + for (int i = 0; i < slotCount && itemSizeCounter > 0; i++) { + + if (!inventory.isItemValidForSlot(i, item)) continue; + ItemStack inventorySlot = inventory.getStackInSlot(i); + /* + * If the slot is empty, dump the biggest stack we can, taking in to consideration, the remaining amount of + * stack + */ + if (inventorySlot == null) { + itemSizeCounter -= Math + .min(Math.min(itemSizeCounter, inventory.getInventoryStackLimit()), item.getMaxStackSize()); + } + /* If the slot is not empty, check that these items stack */ + else if (areMergeCandidates(item, inventorySlot)) { + /* If they stack, decrement by the amount of space that remains */ + + int space = inventorySlot.getMaxStackSize() - inventorySlot.stackSize; + itemSizeCounter -= Math.min(itemSizeCounter, space); + } + } + // itemSizeCounter might be less than zero here. It shouldn't be, but I + // don't trust me. -NC + if (itemSizeCounter != item.stackSize) { + itemSizeCounter = Math.max(itemSizeCounter, 0); + return item.stackSize - itemSizeCounter; + } + return 0; + } + + public static Set getAllSlots(IInventory inventory) { + inventory = getInventory(inventory); + Set slots = new HashSet(); + for (int i = 0; i < inventory.getSizeInventory(); i++) { + slots.add(i); + } + return slots; + } + + public static Map getAllItems(IInventory inventory) { + Map result = Maps.newHashMap(); + for (int i = 0; i < inventory.getSizeInventory(); i++) { + ItemStack stack = inventory.getStackInSlot(i); + if (stack != null) result.put(i, stack); + } + + return result; + } + + public static int moveItemsToOneOfSides(TileEntity te, IInventory inv, int fromSlot, int maxAmount, + Set sides) { + // wrap it. Sure, we dont need to really as this'll never be a double + // chest but, whatevs. (M?) + final IInventory inventory = getInventory(inv); + + // if we've not got a stack in that slot, we dont care. + if (inventory.getStackInSlot(fromSlot) == null) return 0; + + // shuffle the sides that have been passed in + List shuffledSides = Lists.newArrayList(sides); + Collections.shuffle(shuffledSides); + + for (ForgeDirection dir : shuffledSides) { + // grab the tile in the current direction + TileEntity tileOnSurface = getTileInDirection(te, dir); + if (tileOnSurface == null) { + return 0; + } + + int moved = InventoryUtils.moveItemInto(inventory, fromSlot, tileOnSurface, -1, maxAmount, dir, true); + // move the object from our inventory, in the specified slot, to a + // pipe or any slot in an inventory in a particular direction + if (moved > 0) return moved; + } + return 0; + } + + public static boolean inventoryIsEmpty(IInventory inventory) { + for (int i = 0, l = inventory.getSizeInventory(); i < l; i++) + if (inventory.getStackInSlot(i) != null) return false; + return true; + } + + public static boolean tryMergeStacks(ItemStack stackToMerge, ItemStack stackInSlot) { + if (stackInSlot == null || !stackInSlot.isItemEqual(stackToMerge) + || !ItemStack.areItemStackTagsEqual(stackToMerge, stackInSlot)) + return false; + + int newStackSize = stackInSlot.stackSize + stackToMerge.stackSize; + + final int maxStackSize = stackToMerge.getMaxStackSize(); + if (newStackSize <= maxStackSize) { + stackToMerge.stackSize = 0; + stackInSlot.stackSize = newStackSize; + return true; + } else if (stackInSlot.stackSize < maxStackSize) { + stackToMerge.stackSize -= maxStackSize - stackInSlot.stackSize; + stackInSlot.stackSize = maxStackSize; + return true; + } + + return false; + } + + public static ItemStack returnItem(ItemStack stack) { + return (stack == null || stack.stackSize <= 0) ? null : stack.copy(); + } + + public static void swapStacks(IInventory inventory, int slot1, int slot2) { + swapStacks(inventory, slot1, slot2, true, true); + } + + public static void swapStacks(IInventory inventory, int slot1, int slot2, boolean copy, boolean validate) { + Preconditions.checkElementIndex(slot1, inventory.getSizeInventory(), "input slot id"); + Preconditions.checkElementIndex(slot2, inventory.getSizeInventory(), "output slot id"); + + ItemStack stack1 = inventory.getStackInSlot(slot1); + ItemStack stack2 = inventory.getStackInSlot(slot2); + + if (validate) { + isItemValid(inventory, slot2, stack1); + isItemValid(inventory, slot1, stack2); + } + + if (copy) { + if (stack1 != null) stack1 = stack1.copy(); + if (stack2 != null) stack2 = stack2.copy(); + } + + inventory.setInventorySlotContents(slot1, stack2); + inventory.setInventorySlotContents(slot2, stack1); + inventory.markDirty(); + } + + public static void swapStacks(ISidedInventory inventory, int slot1, ForgeDirection side1, int slot2, + ForgeDirection side2) { + swapStacks(inventory, slot1, side1, slot2, side2, true, true); + } + + public static void swapStacks(ISidedInventory inventory, int slot1, ForgeDirection side1, int slot2, + ForgeDirection side2, boolean copy, boolean validate) { + Preconditions.checkElementIndex(slot1, inventory.getSizeInventory(), "input slot id"); + Preconditions.checkElementIndex(slot2, inventory.getSizeInventory(), "output slot id"); + + ItemStack stack1 = inventory.getStackInSlot(slot1); + ItemStack stack2 = inventory.getStackInSlot(slot2); + + if (validate) { + isItemValid(inventory, slot2, stack1); + isItemValid(inventory, slot1, stack2); + + canExtract(inventory, slot1, side1, stack1); + canInsert(inventory, slot2, side2, stack1); + + canExtract(inventory, slot2, side2, stack2); + canInsert(inventory, slot1, side1, stack2); + } + + if (copy) { + if (stack1 != null) stack1 = stack1.copy(); + if (stack2 != null) stack2 = stack2.copy(); + } + + inventory.setInventorySlotContents(slot1, stack2); + inventory.setInventorySlotContents(slot2, stack1); + inventory.markDirty(); + } + + protected static void isItemValid(IInventory inventory, int slot, ItemStack stack) { + Preconditions.checkArgument(inventory.isItemValidForSlot(slot, stack), "Slot %s cannot accept item", slot); + } + + protected static void canInsert(ISidedInventory inventory, int slot, ForgeDirection side, ItemStack stack) { + Preconditions.checkArgument( + inventory.canInsertItem(slot, stack, side.ordinal()), + "Item cannot be inserted into slot %s on side %s", + slot, + side); + } + + protected static void canExtract(ISidedInventory inventory, int slot, ForgeDirection side, ItemStack stack) { + Preconditions.checkArgument( + inventory.canExtractItem(slot, stack, side.ordinal()), + "Item cannot be extracted from slot %s on side %s", + slot, + side); + } + + public static TileEntity getTileInDirection(TileEntity tile, ForgeDirection direction) { + int targetX = tile.xCoord + direction.offsetX; + int targetY = tile.yCoord + direction.offsetY; + int targetZ = tile.zCoord + direction.offsetZ; + return tile.getWorldObj().getTileEntity(targetX, targetY, targetZ); + } + + public static class GenericInventory implements IInventory { + + protected String inventoryTitle; + protected int slotsCount; + protected ItemStack[] inventoryContents; + protected boolean isInvNameLocalized; + + public GenericInventory(String name, boolean isInvNameLocalized, int size) { + this.isInvNameLocalized = isInvNameLocalized; + this.slotsCount = size; + this.inventoryTitle = name; + this.inventoryContents = new ItemStack[size]; + } + + @Override + public ItemStack decrStackSize(int par1, int par2) { + if (this.inventoryContents[par1] != null) { + ItemStack itemstack; + + if (this.inventoryContents[par1].stackSize <= par2) { + itemstack = this.inventoryContents[par1]; + this.inventoryContents[par1] = null; + return itemstack; + } + itemstack = this.inventoryContents[par1].splitStack(par2); + if (this.inventoryContents[par1].stackSize == 0) { + this.inventoryContents[par1] = null; + } + + return itemstack; + } + return null; + } + + @Override + public int getInventoryStackLimit() { + return 64; + } + + @Override + public int getSizeInventory() { + return slotsCount; + } + + @Override + public ItemStack getStackInSlot(int i) { + return this.inventoryContents[i]; + } + + public ItemStack getStackInSlot(Enum i) { + return getStackInSlot(i.ordinal()); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + if (i >= this.inventoryContents.length) { + return null; + } + if (this.inventoryContents[i] != null) { + ItemStack itemstack = this.inventoryContents[i]; + this.inventoryContents[i] = null; + return itemstack; + } + return null; + } + + public boolean isItem(int slot, Item item) { + return inventoryContents[slot] != null && inventoryContents[slot].getItem() == item; + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + return true; + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return true; + } + + public void clearAndSetSlotCount(int amount) { + this.slotsCount = amount; + inventoryContents = new ItemStack[amount]; + } + + public void readFromNBT(NBTTagCompound tag) { + if (tag.hasKey("size")) { + this.slotsCount = tag.getInteger("size"); + } + NBTTagList nbttaglist = tag.getTagList("Items", 10); + inventoryContents = new ItemStack[slotsCount]; + for (int i = 0; i < nbttaglist.tagCount(); i++) { + NBTTagCompound stacktag = nbttaglist.getCompoundTagAt(i); + int j = stacktag.getByte("Slot"); + if (j >= 0 && j < inventoryContents.length) { + inventoryContents[j] = ItemStack.loadItemStackFromNBT(stacktag); + } + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + this.inventoryContents[i] = itemstack; + + if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) { + itemstack.stackSize = getInventoryStackLimit(); + } + } + + public void writeToNBT(NBTTagCompound tag) { + tag.setInteger("size", getSizeInventory()); + NBTTagList nbttaglist = new NBTTagList(); + for (int i = 0; i < inventoryContents.length; i++) { + if (inventoryContents[i] != null) { + NBTTagCompound stacktag = new NBTTagCompound(); + stacktag.setByte("Slot", (byte) i); + inventoryContents[i].writeToNBT(stacktag); + nbttaglist.appendTag(stacktag); + } + } + tag.setTag("Items", nbttaglist); + } + + /** + * This bastard never even gets called, so don't rely on it. + */ + @Override + public void markDirty() {} + + public void copyFrom(IInventory inventory) { + for (int i = 0; i < inventory.getSizeInventory(); i++) { + if (i < getSizeInventory()) { + ItemStack stack = inventory.getStackInSlot(i); + if (stack != null) { + setInventorySlotContents(i, stack.copy()); + } else { + setInventorySlotContents(i, null); + } + } + } + } + + public List contents() { + return Arrays.asList(inventoryContents); + } + + @Override + public String getInventoryName() { + return this.inventoryTitle; + } + + @Override + public boolean hasCustomInventoryName() { + return this.isInvNameLocalized; + } + + @Override + public void openInventory() {} + + @Override + public void closeInventory() {} + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/ItemNBTHelper.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/ItemNBTHelper.java new file mode 100644 index 00000000..7680bf61 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/ItemNBTHelper.java @@ -0,0 +1,109 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public final class ItemNBTHelper { + + // SETTERS /////////////////////////////////////////////////////////////////// + public static NBTTagCompound getCompound(ItemStack stack) { + if (stack.getTagCompound() == null) stack.setTagCompound(new NBTTagCompound()); + return stack.getTagCompound(); + } + + public static ItemStack setByte(ItemStack stack, String tag, byte b) { + NBTTagCompound compound = getCompound(stack); + compound.setByte(tag, b); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setBoolean(ItemStack stack, String tag, boolean b) { + NBTTagCompound compound = getCompound(stack); + compound.setBoolean(tag, b); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setShort(ItemStack stack, String tag, short s) { + NBTTagCompound compound = getCompound(stack); + compound.setShort(tag, s); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setInteger(ItemStack stack, String tag, int i) { + NBTTagCompound compound = getCompound(stack); + compound.setInteger(tag, i); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setLong(ItemStack stack, String tag, long i) { + NBTTagCompound compound = getCompound(stack); + compound.setLong(tag, i); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setFloat(ItemStack stack, String tag, float f) { + NBTTagCompound compound = getCompound(stack); + compound.setFloat(tag, f); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setDouble(ItemStack stack, String tag, double d) { + NBTTagCompound compound = getCompound(stack); + compound.setDouble(tag, d); + stack.setTagCompound(compound); + return stack; + } + + public static ItemStack setString(ItemStack stack, String tag, String s) { + NBTTagCompound compound = getCompound(stack); + compound.setString(tag, s); + stack.setTagCompound(compound); + return stack; + } + + // GETTERS /////////////////////////////////////////////////////////////////// + + public static boolean verifyExistance(ItemStack stack, String tag) { + NBTTagCompound compound = stack.getTagCompound(); + if (compound == null) return false; + else return stack.getTagCompound().hasKey(tag); + } + + public static byte getByte(ItemStack stack, String tag, byte defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getByte(tag) : defaultExpected; + } + + public static boolean getBoolean(ItemStack stack, String tag, boolean defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getBoolean(tag) : defaultExpected; + } + + public static short getShort(ItemStack stack, String tag, short defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getShort(tag) : defaultExpected; + } + + public static int getInteger(ItemStack stack, String tag, int defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getInteger(tag) : defaultExpected; + } + + public static long getLong(ItemStack stack, String tag, long defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getLong(tag) : defaultExpected; + } + + public static float getFloat(ItemStack stack, String tag, float defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getFloat(tag) : defaultExpected; + } + + public static double getDouble(ItemStack stack, String tag, double defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getDouble(tag) : defaultExpected; + } + + public static String getString(ItemStack stack, String tag, String defaultExpected) { + return verifyExistance(stack, tag) ? stack.getTagCompound().getString(tag) : defaultExpected; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/PlayerUtils.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/PlayerUtils.java new file mode 100644 index 00000000..12c388c6 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/PlayerUtils.java @@ -0,0 +1,19 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +import net.minecraft.server.MinecraftServer; + +import cpw.mods.fml.common.FMLCommonHandler; + +public class PlayerUtils { + + public static boolean isOp(String paramString) { + MinecraftServer localMinecraftServer = FMLCommonHandler.instance().getMinecraftServerInstance(); + paramString = paramString.trim(); + for (String str : localMinecraftServer.getConfigurationManager().func_152606_n()) { + if (paramString.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/SimplexNoise.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/SimplexNoise.java new file mode 100644 index 00000000..f7655208 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/SimplexNoise.java @@ -0,0 +1,479 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +/** + * Simplex Noise in 2D, 3D and 4D. Based on the example code of this paper: + * http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf + * + * @author Stefan Gustavson, Linkping University, Sweden (stegu at itn dot liu dot se) + * + * Slight optimizations & restructuring by + * @author Karsten Schmidt (info at toxi dot co dot uk) + * + */ +public class SimplexNoise { + + private static final double SQRT3 = Math.sqrt(3.0); + private static final double SQRT5 = Math.sqrt(5.0); + + /** + * Skewing and unskewing factors for 2D, 3D and 4D, some of them pre-multiplied. + */ + private static final double F2 = 0.5 * (SQRT3 - 1.0); + + private static final double G2 = (3.0 - SQRT3) / 6.0; + private static final double G22 = G2 * 2.0 - 1; + + private static final double F3 = 1.0 / 3.0; + private static final double G3 = 1.0 / 6.0; + + private static final double F4 = (SQRT5 - 1.0) / 4.0; + private static final double G4 = (5.0 - SQRT5) / 20.0; + private static final double G42 = G4 * 2.0; + private static final double G43 = G4 * 3.0; + private static final double G44 = G4 * 4.0 - 1.0; + + /** + * Gradient vectors for 3D (pointing to mid points of all edges of a unit cube) + */ + private static final int[][] grad3 = { { 1, 1, 0 }, { -1, 1, 0 }, { 1, -1, 0 }, { -1, -1, 0 }, { 1, 0, 1 }, + { -1, 0, 1 }, { 1, 0, -1 }, { -1, 0, -1 }, { 0, 1, 1 }, { 0, -1, 1 }, { 0, 1, -1 }, { 0, -1, -1 } }; + + /** + * Gradient vectors for 4D (pointing to mid points of all edges of a unit 4D hypercube) + */ + private static final int[][] grad4 = { { 0, 1, 1, 1 }, { 0, 1, 1, -1 }, { 0, 1, -1, 1 }, { 0, 1, -1, -1 }, + { 0, -1, 1, 1 }, { 0, -1, 1, -1 }, { 0, -1, -1, 1 }, { 0, -1, -1, -1 }, { 1, 0, 1, 1 }, { 1, 0, 1, -1 }, + { 1, 0, -1, 1 }, { 1, 0, -1, -1 }, { -1, 0, 1, 1 }, { -1, 0, 1, -1 }, { -1, 0, -1, 1 }, { -1, 0, -1, -1 }, + { 1, 1, 0, 1 }, { 1, 1, 0, -1 }, { 1, -1, 0, 1 }, { 1, -1, 0, -1 }, { -1, 1, 0, 1 }, { -1, 1, 0, -1 }, + { -1, -1, 0, 1 }, { -1, -1, 0, -1 }, { 1, 1, 1, 0 }, { 1, 1, -1, 0 }, { 1, -1, 1, 0 }, { 1, -1, -1, 0 }, + { -1, 1, 1, 0 }, { -1, 1, -1, 0 }, { -1, -1, 1, 0 }, { -1, -1, -1, 0 } }; + + /** + * Permutation table + */ + private static final int[] p = { 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225, 140, 36, + 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148, 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, + 203, 117, 35, 11, 32, 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175, 74, 165, 71, + 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122, 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, + 245, 40, 244, 102, 143, 54, 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169, 200, 196, + 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64, 52, 217, 226, 250, 124, 123, 5, 202, 38, + 147, 118, 126, 255, 82, 85, 212, 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213, + 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9, 129, 22, 39, 253, 19, 98, 108, 110, + 79, 113, 224, 232, 178, 185, 112, 104, 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, + 162, 241, 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157, 184, 84, 204, 176, 115, + 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93, 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, + 61, 156, 180 }; + + /** + * To remove the need for index wrapping, double the permutation table length + */ + private static int[] perm = new int[0x200]; + /** + * A lookup table to traverse the simplex around a given point in 4D. Details can be found where this table is used, + * in the 4D noise method. + */ + private static final int[][] simplex = { { 0, 1, 2, 3 }, { 0, 1, 3, 2 }, { 0, 0, 0, 0 }, { 0, 2, 3, 1 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 1, 2, 3, 0 }, { 0, 2, 1, 3 }, { 0, 0, 0, 0 }, + { 0, 3, 1, 2 }, { 0, 3, 2, 1 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 1, 3, 2, 0 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 1, 2, 0, 3 }, { 0, 0, 0, 0 }, { 1, 3, 0, 2 }, { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 3, 0, 1 }, { 2, 3, 1, 0 }, { 1, 0, 2, 3 }, { 1, 0, 3, 2 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 3, 1 }, { 0, 0, 0, 0 }, { 2, 1, 3, 0 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 2, 0, 1, 3 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, + { 3, 0, 1, 2 }, { 3, 0, 2, 1 }, { 0, 0, 0, 0 }, { 3, 1, 2, 0 }, { 2, 1, 0, 3 }, { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 3, 1, 0, 2 }, { 0, 0, 0, 0 }, { 3, 2, 0, 1 }, { 3, 2, 1, 0 } }; + + static { + for (int i = 0; i < 0x200; i++) { + perm[i] = p[i & 0xff]; + } + } + + /** + * Computes dot product in 2D. + * + * @param g 2-vector (grid offset) + * @param x + * @param y + * @return dot product + */ + private static double dot(int g[], double x, double y) { + return g[0] * x + g[1] * y; + } + + /** + * Computes dot product in 3D. + * + * @param g 3-vector (grid offset) + * @param x + * @param y + * @param z + * @return dot product + */ + private static double dot(int g[], double x, double y, double z) { + return g[0] * x + g[1] * y + g[2] * z; + } + + /** + * Computes dot product in 4D. + * + * @param g 4-vector (grid offset) + * @param x + * @param y + * @param z + * @param w + * @return dot product + */ + private static double dot(int g[], double x, double y, double z, double w) { + return g[0] * x + g[1] * y + g[2] * z + g[3] * w; + } + + /** + * This method is a *lot* faster than using (int)Math.floor(x). + * + * @param x value to be floored + * @return + */ + private static final int fastfloor(double x) { + return x >= 0 ? (int) x : (int) x - 1; + } + + /** + * Computes 2D Simplex Noise. + * + * @param x coordinate + * @param y coordinate + * @return noise value in range -1 ... +1. + */ + public static double noise(double x, double y) { + double n0 = 0, n1 = 0, n2 = 0; // Noise contributions from the three + // corners + // Skew the input space to determine which simplex cell we're in + double s = (x + y) * F2; // Hairy factor for 2D + int i = fastfloor(x + s); + int j = fastfloor(y + s); + double t = (i + j) * G2; + double x0 = x - (i - t); // The x,y distances from the cell origin + double y0 = y - (j - t); + // For the 2D case, the simplex shape is an equilateral triangle. + // Determine which simplex we are in. + int i1, j1; // Offsets for second (middle) corner of simplex in (i,j) + if (x0 > y0) { + i1 = 1; + j1 = 0; + } // lower triangle, XY order: (0,0)->(1,0)->(1,1) + else { + i1 = 0; + j1 = 1; + } // upper triangle, YX order: (0,0)->(0,1)->(1,1) + // A step of (1,0) in (i,j) means a step of (1-c,-c) in (x,y), and + // a step of (0,1) in (i,j) means a step of (-c,1-c) in (x,y), where + // c = (3-sqrt(3))/6 + double x1 = x0 - i1 + G2; // Offsets for middle corner in (x,y) unskewed + double y1 = y0 - j1 + G2; + double x2 = x0 + G22; // Offsets for last corner in (x,y) unskewed + double y2 = y0 + G22; + // Work out the hashed gradient indices of the three simplex corners + int ii = i & 0xff; + int jj = j & 0xff; + // Calculate the contribution from the three corners + double t0 = 0.5 - x0 * x0 - y0 * y0; + if (t0 > 0) { + t0 *= t0; + int gi0 = perm[ii + perm[jj]] % 12; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0); // (x,y) of grad3 used for + // 2D gradient + } + double t1 = 0.5 - x1 * x1 - y1 * y1; + if (t1 > 0) { + t1 *= t1; + int gi1 = perm[ii + i1 + perm[jj + j1]] % 12; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1); + } + double t2 = 0.5 - x2 * x2 - y2 * y2; + if (t2 > 0) { + t2 *= t2; + int gi2 = perm[ii + 1 + perm[jj + 1]] % 12; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to return values in the interval [-1,1]. + return 70.0 * (n0 + n1 + n2); + } + + /** + * Computes 3D Simplex Noise. + * + * @param x coordinate + * @param y coordinate + * @param z coordinate + * @return noise value in range -1 ... +1 + */ + public static double noise(double x, double y, double z) { + double n0 = 0, n1 = 0, n2 = 0, n3 = 0; + // Noise contributions from the + // four corners + // Skew the input space to determine which simplex cell we're in + // final double F3 = 1.0 / 3.0; + double s = (x + y + z) * F3; // Very nice and simple skew factor + // for 3D + int i = fastfloor(x + s); + int j = fastfloor(y + s); + int k = fastfloor(z + s); + // final double G3 = 1.0 / 6.0; // Very nice and simple unskew factor, + // too + double t = (i + j + k) * G3; + double x0 = x - (i - t); // The x,y,z distances from the cell origin + double y0 = y - (j - t); + double z0 = z - (k - t); + // For the 3D case, the simplex shape is a slightly irregular + // tetrahedron. + // Determine which simplex we are in. + int i1, j1, k1; // Offsets for second corner of simplex in (i,j,k) + // coords + int i2, j2, k2; // Offsets for third corner of simplex in (i,j,k) coords + if (x0 >= y0) { + if (y0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 1; + k2 = 0; + } // X Y Z order + else if (x0 >= z0) { + i1 = 1; + j1 = 0; + k1 = 0; + i2 = 1; + j2 = 0; + k2 = 1; + } // X Z Y order + else { + i1 = 0; + j1 = 0; + k1 = 1; + i2 = 1; + j2 = 0; + k2 = 1; + } // Z X Y order + } else { // x0 0) { + t0 *= t0; + int gi0 = perm[ii + perm[jj + perm[kk]]] % 12; + n0 = t0 * t0 * dot(grad3[gi0], x0, y0, z0); + } + double t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1; + if (t1 > 0) { + t1 *= t1; + int gi1 = perm[ii + i1 + perm[jj + j1 + perm[kk + k1]]] % 12; + n1 = t1 * t1 * dot(grad3[gi1], x1, y1, z1); + } + double t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2; + if (t2 > 0) { + t2 *= t2; + int gi2 = perm[ii + i2 + perm[jj + j2 + perm[kk + k2]]] % 12; + n2 = t2 * t2 * dot(grad3[gi2], x2, y2, z2); + } + double t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3; + if (t3 > 0) { + t3 *= t3; + int gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1]]] % 12; + n3 = t3 * t3 * dot(grad3[gi3], x3, y3, z3); + } + // Add contributions from each corner to get the final noise value. + // The result is scaled to stay just inside [-1,1] + return 32.0 * (n0 + n1 + n2 + n3); + } + + /** + * Computes 4D Simplex Noise. + * + * @param x coordinate + * @param y coordinate + * @param z coordinate + * @param w coordinate + * @return noise value in range -1 ... +1 + */ + public static double noise(double x, double y, double z, double w) { + // The skewing and unskewing factors are hairy again for the 4D case + double n0 = 0, n1 = 0, n2 = 0, n3 = 0, n4 = 0; // Noise contributions + // from the five corners + // Skew the (x,y,z,w) space to determine which cell of 24 simplices + double s = (x + y + z + w) * F4; // Factor for 4D skewing + int i = fastfloor(x + s); + int j = fastfloor(y + s); + int k = fastfloor(z + s); + int l = fastfloor(w + s); + double t = (i + j + k + l) * G4; // Factor for 4D unskewing + double x0 = x - (i - t); // The x,y,z,w distances from the cell origin + double y0 = y - (j - t); + double z0 = z - (k - t); + double w0 = w - (l - t); + // For the 4D case, the simplex is a 4D shape I won't even try to + // describe. + // To find out which of the 24 possible simplices we're in, we need to + // determine the magnitude ordering of x0, y0, z0 and w0. + // The method below is a good way of finding the ordering of x,y,z,w and + // then find the correct traversal order for the simplex were in. + // First, six pair-wise comparisons are performed between each possible + // pair of the four coordinates, and the results are used to add up + // binary bits for an integer index. + int c = 0; + if (x0 > y0) { + c = 0x20; + } + if (x0 > z0) { + c |= 0x10; + } + if (y0 > z0) { + c |= 0x08; + } + if (x0 > w0) { + c |= 0x04; + } + if (y0 > w0) { + c |= 0x02; + } + if (z0 > w0) { + c |= 0x01; + } + int i1, j1, k1, l1; // The integer offsets for the second simplex corner + int i2, j2, k2, l2; // The integer offsets for the third simplex corner + int i3, j3, k3, l3; // The integer offsets for the fourth simplex corner + // simplex[c] is a 4-vector with the numbers 0, 1, 2 and 3 in some + // order. Many values of c will never occur, since e.g. x>y>z>w makes + // x= 3 ? 1 : 0; + j1 = sc[1] >= 3 ? 1 : 0; + k1 = sc[2] >= 3 ? 1 : 0; + l1 = sc[3] >= 3 ? 1 : 0; + // The number 2 in the "simplex" array is at the second largest + // coordinate. + i2 = sc[0] >= 2 ? 1 : 0; + j2 = sc[1] >= 2 ? 1 : 0; + k2 = sc[2] >= 2 ? 1 : 0; + l2 = sc[3] >= 2 ? 1 : 0; + // The number 1 in the "simplex" array is at the second smallest + // coordinate. + i3 = sc[0] >= 1 ? 1 : 0; + j3 = sc[1] >= 1 ? 1 : 0; + k3 = sc[2] >= 1 ? 1 : 0; + l3 = sc[3] >= 1 ? 1 : 0; + // The fifth corner has all coordinate offsets = 1, so no need to look + // that up. + double x1 = x0 - i1 + G4; // Offsets for second corner in (x,y,z,w) + double y1 = y0 - j1 + G4; + double z1 = z0 - k1 + G4; + double w1 = w0 - l1 + G4; + + double x2 = x0 - i2 + G42; // Offsets for third corner in (x,y,z,w) + double y2 = y0 - j2 + G42; + double z2 = z0 - k2 + G42; + double w2 = w0 - l2 + G42; + + double x3 = x0 - i3 + G43; // Offsets for fourth corner in (x,y,z,w) + double y3 = y0 - j3 + G43; + double z3 = z0 - k3 + G43; + double w3 = w0 - l3 + G43; + + double x4 = x0 + G44; // Offsets for last corner in (x,y,z,w) + double y4 = y0 + G44; + double z4 = z0 + G44; + double w4 = w0 + G44; + + // Work out the hashed gradient indices of the five simplex corners + int ii = i & 0xff; + int jj = j & 0xff; + int kk = k & 0xff; + int ll = l & 0xff; + + // Calculate the contribution from the five corners + double t0 = 0.6 - x0 * x0 - y0 * y0 - z0 * z0 - w0 * w0; + if (t0 > 0) { + t0 *= t0; + int gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] % 32; + n0 = t0 * t0 * dot(grad4[gi0], x0, y0, z0, w0); + } + double t1 = 0.6 - x1 * x1 - y1 * y1 - z1 * z1 - w1 * w1; + if (t1 > 0) { + t1 *= t1; + int gi1 = perm[ii + i1 + perm[jj + j1 + perm[kk + k1 + perm[ll + l1]]]] % 32; + n1 = t1 * t1 * dot(grad4[gi1], x1, y1, z1, w1); + } + double t2 = 0.6 - x2 * x2 - y2 * y2 - z2 * z2 - w2 * w2; + if (t2 > 0) { + t2 *= t2; + int gi2 = perm[ii + i2 + perm[jj + j2 + perm[kk + k2 + perm[ll + l2]]]] % 32; + n2 = t2 * t2 * dot(grad4[gi2], x2, y2, z2, w2); + } + double t3 = 0.6 - x3 * x3 - y3 * y3 - z3 * z3 - w3 * w3; + if (t3 > 0) { + t3 *= t3; + int gi3 = perm[ii + i3 + perm[jj + j3 + perm[kk + k3 + perm[ll + l3]]]] % 32; + n3 = t3 * t3 * dot(grad4[gi3], x3, y3, z3, w3); + } + double t4 = 0.6 - x4 * x4 - y4 * y4 - z4 * z4 - w4 * w4; + if (t4 > 0) { + t4 *= t4; + int gi4 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32; + n4 = t4 * t4 * dot(grad4[gi4], x4, y4, z4, w4); + } + // Sum up and scale the result to cover the range [-1,1] + return 27.0 * (n0 + n1 + n2 + n3 + n4); + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Teleporter.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Teleporter.java new file mode 100644 index 00000000..8c07c850 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Teleporter.java @@ -0,0 +1,320 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.play.server.S07PacketRespawn; +import net.minecraft.network.play.server.S1DPacketEntityEffect; +import net.minecraft.network.play.server.S1FPacketSetExperience; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import net.minecraft.world.WorldServer; + +import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.common.utills.LogHelper; + +import cpw.mods.fml.common.FMLCommonHandler; + +public class Teleporter { + + public static class TeleportLocation { + + protected double xCoord; + protected double yCoord; + protected double zCoord; + protected int dimension; + protected float pitch; + protected float yaw; + protected String name; + protected String dimentionName = ""; + protected boolean writeProtected = false; + + public TeleportLocation() {} + + public TeleportLocation(double x, double y, double z, int dimension) { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.dimension = dimension; + this.pitch = 0; + this.yaw = 0; + } + + public TeleportLocation(double x, double y, double z, int dimension, float pitch, float yaw) { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.dimension = dimension; + this.pitch = pitch; + this.yaw = yaw; + } + + public TeleportLocation(double x, double y, double z, int dimension, float pitch, float yaw, String name) { + this.xCoord = x; + this.yCoord = y; + this.zCoord = z; + this.dimension = dimension; + this.pitch = pitch; + this.yaw = yaw; + this.name = name; + } + + public double getXCoord() { + return xCoord; + } + + public double getYCoord() { + return yCoord; + } + + public double getZCoord() { + return zCoord; + } + + public int getDimension() { + return dimension; + } + + public String getDimensionName() { + return dimentionName; + } + + public float getPitch() { + return pitch; + } + + public float getYaw() { + return yaw; + } + + public String getName() { + return name; + } + + public boolean getWriteProtected() { + return writeProtected; + } + + public void setXCoord(double x) { + xCoord = x; + } + + public void setYCoord(double y) { + yCoord = y; + } + + public void setZCoord(double z) { + zCoord = z; + } + + public void setDimension(int d) { + dimension = d; + } + + public void setPitch(float p) { + pitch = p; + } + + public void setYaw(float y) { + yaw = y; + } + + public void setName(String s) { + name = s; + } + + public void setWriteProtected(boolean b) { + writeProtected = b; + } + + public void writeToNBT(NBTTagCompound compound) { + compound.setDouble("X", xCoord); + compound.setDouble("Y", yCoord); + compound.setDouble("Z", zCoord); + compound.setInteger("Dimension", dimension); + compound.setFloat("Pitch", pitch); + compound.setFloat("Yaw", yaw); + compound.setString("Name", name); + compound.setString("DimentionName", dimentionName); + compound.setBoolean("WP", writeProtected); + } + + public void readFromNBT(NBTTagCompound compound) { + xCoord = compound.getDouble("X"); + yCoord = compound.getDouble("Y"); + zCoord = compound.getDouble("Z"); + dimension = compound.getInteger("Dimension"); + pitch = compound.getFloat("Pitch"); + yaw = compound.getFloat("Yaw"); + name = compound.getString("Name"); + dimentionName = compound.getString("DimentionName"); + writeProtected = compound.getBoolean("WP"); + } + + public void sendEntityToCoords(Entity entity) { + entity.worldObj.playSoundEffect( + entity.posX, + entity.posY, + entity.posZ, + "draconicevolution:portal", + 0.1F, + entity.worldObj.rand.nextFloat() * 0.1F + 0.9F); + + teleportEntity(entity, this); + + entity.worldObj.playSoundEffect( + entity.posX, + entity.posY, + entity.posZ, + "draconicevolution:portal", + 0.1F, + entity.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + + public void setDimentionName(String dimentionName) { + this.dimentionName = dimentionName; + } + } + + @SuppressWarnings("unchecked") + private static Entity teleportEntity(Entity entity, TeleportLocation destination) { + if (entity == null || entity.worldObj.isRemote) return entity; + + World startWorld = entity.worldObj; + World destinationWorld = DraconicEvolution.proxy.getMCServer().worldServerForDimension(destination.dimension); + + if (destinationWorld == null) { + LogHelper.error("Destination world does not exist!"); + return entity; + } + + Entity mount = entity.ridingEntity; + if (entity.ridingEntity != null) { + entity.mountEntity(null); + mount = teleportEntity(mount, destination); + } + + boolean interDimensional = startWorld.provider.dimensionId != destinationWorld.provider.dimensionId; + + startWorld.updateEntityWithOptionalForce(entity, false); // added + + if ((entity instanceof EntityPlayerMP) && interDimensional) { + EntityPlayerMP player = (EntityPlayerMP) entity; + player.closeScreen(); // added + player.dimension = destination.dimension; + player.playerNetServerHandler.sendPacket( + new S07PacketRespawn( + player.dimension, + player.worldObj.difficultySetting, + destinationWorld.getWorldInfo().getTerrainType(), + player.theItemInWorldManager.getGameType())); + ((WorldServer) startWorld).getPlayerManager().removePlayer(player); + + startWorld.playerEntities.remove(player); + startWorld.updateAllPlayersSleepingFlag(); + int i = entity.chunkCoordX; + int j = entity.chunkCoordZ; + if ((entity.addedToChunk) && (startWorld.getChunkProvider().chunkExists(i, j))) { + startWorld.getChunkFromChunkCoords(i, j).removeEntity(entity); + startWorld.getChunkFromChunkCoords(i, j).isModified = true; + } + startWorld.loadedEntityList.remove(entity); + startWorld.onEntityRemoved(entity); + } + + entity.setLocationAndAngles( + destination.xCoord, + destination.yCoord, + destination.zCoord, + destination.yaw, + destination.pitch); + + ((WorldServer) destinationWorld).theChunkProviderServer + .loadChunk((int) destination.xCoord >> 4, (int) destination.zCoord >> 4); + + destinationWorld.theProfiler.startSection("placing"); + if (interDimensional) { + if (!(entity instanceof EntityPlayer)) { + NBTTagCompound entityNBT = new NBTTagCompound(); + entity.isDead = false; + entityNBT.setString("id", EntityList.getEntityString(entity)); + entity.writeToNBT(entityNBT); + entity.isDead = true; + entity = EntityList.createEntityFromNBT(entityNBT, destinationWorld); + if (entity == null) { + LogHelper.error("Failed to teleport entity to new location"); + return null; + } + entity.dimension = destinationWorld.provider.dimensionId; + } + destinationWorld.spawnEntityInWorld(entity); + entity.setWorld(destinationWorld); + } + entity.setLocationAndAngles( + destination.xCoord, + destination.yCoord, + destination.zCoord, + destination.yaw, + entity.rotationPitch); + + destinationWorld.updateEntityWithOptionalForce(entity, false); + entity.setLocationAndAngles( + destination.xCoord, + destination.yCoord, + destination.zCoord, + destination.yaw, + entity.rotationPitch); + + if ((entity instanceof EntityPlayerMP)) { + EntityPlayerMP player = (EntityPlayerMP) entity; + if (interDimensional) { + player.mcServer.getConfigurationManager().func_72375_a(player, (WorldServer) destinationWorld); + } + player.playerNetServerHandler.setPlayerLocation( + destination.xCoord, + destination.yCoord, + destination.zCoord, + player.rotationYaw, + player.rotationPitch); + } + + destinationWorld.updateEntityWithOptionalForce(entity, false); + + if (((entity instanceof EntityPlayerMP)) && interDimensional) { + EntityPlayerMP player = (EntityPlayerMP) entity; + player.theItemInWorldManager.setWorld((WorldServer) destinationWorld); + player.mcServer.getConfigurationManager() + .updateTimeAndWeatherForPlayer(player, (WorldServer) destinationWorld); + player.mcServer.getConfigurationManager().syncPlayerInventory(player); + + for (PotionEffect potionEffect : (Iterable) player.getActivePotionEffects()) { + player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potionEffect)); + } + + player.playerNetServerHandler.sendPacket( + new S1FPacketSetExperience(player.experience, player.experienceTotal, player.experienceLevel)); + FMLCommonHandler.instance().firePlayerChangedDimensionEvent( + player, + startWorld.provider.dimensionId, + destinationWorld.provider.dimensionId); + } + entity.setLocationAndAngles( + destination.xCoord, + destination.yCoord, + destination.zCoord, + destination.yaw, + entity.rotationPitch); + + if (mount != null) { + entity.mountEntity(mount); + if ((entity instanceof EntityPlayerMP)) { + destinationWorld.updateEntityWithOptionalForce(entity, true); + } + } + destinationWorld.theProfiler.endSection(); + entity.fallDistance = 0; + return entity; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Utills.java b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Utills.java new file mode 100644 index 00000000..b3aebf51 --- /dev/null +++ b/src/main/java/com/brandon3055/draconicevolution/brandonscore/common/utills/Utills.java @@ -0,0 +1,158 @@ +package com.brandon3055.draconicevolution.brandonscore.common.utills; + +import net.minecraft.command.IEntitySelector; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.registry.GameData; + +/** + * Created by Brandon on 25/07/2014. + */ +@SuppressWarnings("unused") +public class Utills { + + public static IEntitySelector selectLivingBase = new IEntitySelector() { + + @Override + public boolean isEntityApplicable(Entity entity) { + return entity instanceof EntityLivingBase; + } + }; + + public static IEntitySelector selectPlayer = new IEntitySelector() { + + @Override + public boolean isEntityApplicable(Entity entity) { + return entity instanceof EntityPlayer; + } + }; + + /** + * Calculates the exact distance between two points in 3D space + * + * @param x1 point A x + * @param y1 point A y + * @param z1 point A z + * @param x2 point B x + * @param y2 point B y + * @param z2 point B z + * @return The distance between point A and point B + */ + public static double getDistanceAtoB(double x1, double y1, double z1, double x2, double y2, double z2) { + double dx = x1 - x2; + double dy = y1 - y2; + double dz = z1 - z2; + return Math.sqrt((dx * dx + dy * dy + dz * dz)); + } + + /** + * Calculates the exact distance between two points in 2D space + * + * @param x1 point A x + * @param z1 point A z + * @param x2 point B x + * @param z2 point B z + * @return The distance between point A and point B + */ + public static double getDistanceAtoB(double x1, double z1, double x2, double z2) { + double dx = x1 - x2; + double dz = z1 - z2; + return Math.sqrt((dx * dx + dz * dz)); + } + + public static double getDistanceSq(double x1, double y1, double z1, double x2, double y2, double z2) { + double dx = x1 - x2; + double dy = y1 - y2; + double dz = z1 - z2; + return dx * dx + dy * dy + dz * dz; + } + + public static double getDistanceSq(double x1, double z1, double x2, double z2) { + double dx = x1 - x2; + double dz = z1 - z2; + return dx * dx + dz * dz; + } + + /** + * Returns true if this is a client connected to a remote server. + */ + public static boolean isConnectedToDedicatedServer() { + return FMLCommonHandler.instance().getMinecraftServerInstance() == null; + } + + /** + * Get itemstack from name of item or block name. + */ + public static ItemStack getStackFromName(String name, int meta) { + if (name.contains("tile.")) { + name = name.replace("draconicevolution", "DraconicEvolution").replace("tile.", ""); + if (GameData.getBlockRegistry().getObject(name) != null) + return new ItemStack(GameData.getBlockRegistry().getObject(name), 1, meta); + } + if (name.contains("item.")) { + name = name.replace("draconicevolution", "DraconicEvolution").replace("item.", ""); + if (GameData.getItemRegistry().getObject(name) != null) + return new ItemStack(GameData.getItemRegistry().getObject(name), 1, meta); + } + return null; + } + + public static double round(double number, double multiplier) { + return Math.round(number * multiplier) / multiplier; + } + + /** + * Update the blocks an all 6 sides of a block. + */ + public static void updateNeabourBlocks(World world, int x, int y, int z) { + world.notifyBlocksOfNeighborChange(x, y, z, world.getBlock(x, y, z)); + world.notifyBlocksOfNeighborChange(x - 1, y, z, world.getBlock(x, y, z)); + world.notifyBlocksOfNeighborChange(x + 1, y, z, world.getBlock(x, y, z)); + world.notifyBlocksOfNeighborChange(x, y - 1, z, world.getBlock(x, y, z)); + world.notifyBlocksOfNeighborChange(x, y + 1, z, world.getBlock(x, y, z)); + world.notifyBlocksOfNeighborChange(x, y, z - 1, world.getBlock(x, y, z)); + world.notifyBlocksOfNeighborChange(x, y, z + 1, world.getBlock(x, y, z)); + } + + /** + * Determine the orientation of a block based on the position of the entity that placed it. + */ + public static int determineOrientation(int x, int y, int z, EntityLivingBase entity) { + if (MathHelper.abs((float) entity.posX - (float) x) < 2.0F + && MathHelper.abs((float) entity.posZ - (float) z) < 2.0F) { + double d0 = entity.posY + 1.82D - (double) entity.yOffset; + + if (d0 - (double) y > 2.0D) return 0; + + if ((double) y - d0 > 0.0D) return 1; + } + + int l = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + return l == 0 ? 3 : (l == 1 ? 4 : (l == 2 ? 2 : (l == 3 ? 5 : 0))); + } + + public static int getNearestMultiple(int number, int multiple) { + int result = number; + + if (number < 0) result *= -1; + + if (result % multiple == 0) return number; + else if (result % multiple < multiple / 2) result = result - result % multiple; + else result = result + (multiple - result % multiple); + + if (number < 0) result *= -1; + + return result; + } + + /** Simple method to convert a Double object to a primitive int */ + public static int toInt(double d) { + return (int) d; + } +} diff --git a/src/main/java/com/brandon3055/draconicevolution/client/ClientProxy.java b/src/main/java/com/brandon3055/draconicevolution/client/ClientProxy.java index d3064391..8de2dcec 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/ClientProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/ClientProxy.java @@ -2,7 +2,6 @@ package com.brandon3055.draconicevolution.client; import static com.brandon3055.draconicevolution.integration.nei.IMCForNEI.IMCSender; -import net.minecraft.client.Minecraft; import net.minecraft.client.audio.ISound; import net.minecraft.client.particle.EntityFX; import net.minecraft.item.Item; @@ -390,10 +389,6 @@ public class ClientProxy extends CommonProxy { return beam; } - public boolean isOp(String paramString) { - return Minecraft.getMinecraft().theWorld.getWorldInfo().getGameType().isCreative(); - } - @Override public void spawnParticle(Object particle, int range) { if (particle instanceof EntityFX && ((EntityFX) particle).worldObj.isRemote) diff --git a/src/main/java/com/brandon3055/draconicevolution/client/creativetab/DETab.java b/src/main/java/com/brandon3055/draconicevolution/client/creativetab/DETab.java index f347d41a..2cf43759 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/creativetab/DETab.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/creativetab/DETab.java @@ -5,7 +5,7 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIDraconiumChest.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIDraconiumChest.java index 301b4a37..effd7ab2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIDraconiumChest.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIDraconiumChest.java @@ -17,8 +17,8 @@ import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest; import com.brandon3055.draconicevolution.common.lib.References; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIEnergyInfuser.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIEnergyInfuser.java index 244a042f..005fc48b 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIEnergyInfuser.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIEnergyInfuser.java @@ -14,7 +14,7 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIFlowGate.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIFlowGate.java index 47fe5f2e..7e88d46c 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIFlowGate.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIFlowGate.java @@ -10,11 +10,13 @@ import net.minecraft.util.StatCollector; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import com.brandon3055.brandonscore.client.utills.GuiHelper; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 30/6/2015. */ @@ -87,7 +89,7 @@ public class GUIFlowGate extends GuiScreen { 0x00FF00); String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": " - + Utills.addCommas(tile.getActualFlow()); + + formatNumber(tile.getActualFlow()); fontRendererObj.drawString(flow, guiCrt - (fontRendererObj.getStringWidth(flow) / 2), guiTop + 76, 0x2c2c2c); if (!tile.flowOverridden) { diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGenerator.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGenerator.java index d894c3ed..569d3712 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGenerator.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGenerator.java @@ -13,7 +13,7 @@ import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.common.container.ContainerGenerator; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.TileGenerator; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGrinder.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGrinder.java index 69b8ebdf..a6fcc2b6 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGrinder.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIGrinder.java @@ -13,7 +13,7 @@ import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.common.container.ContainerGrinder; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.TileGrinder; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUITeleporter.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUITeleporter.java index 9531e260..63822fce 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUITeleporter.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUITeleporter.java @@ -20,10 +20,10 @@ import net.minecraft.util.StatCollector; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Teleporter.TeleportLocation; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.lib.References; @@ -43,7 +43,7 @@ public class GUITeleporter extends GuiScreen { References.MODID.toLowerCase(), "textures/gui/TeleporterMKII.png"); private ItemStack teleporterItem; - protected List locations = new ArrayList(0); + protected List locations = new ArrayList<>(0); private int selected = 0; private int selectionOffset = 0; @@ -446,7 +446,7 @@ public class GUITeleporter extends GuiScreen { } else { if (!textBeingEdited.getText().isEmpty()) { getLocationSafely(selected + selectionOffset).setName(textBeingEdited.getText()); - TeleportLocation location = new TeleportLocation(); + Teleporter.TeleportLocation location = new Teleporter.TeleportLocation(); location.setName(textBeingEdited.getText()); DraconicEvolution.network.sendToServer( new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset)); @@ -460,7 +460,7 @@ public class GUITeleporter extends GuiScreen { } if (button.id == 1) { - TeleportLocation location = new TeleportLocation( + Teleporter.TeleportLocation location = new Teleporter.TeleportLocation( player.posX, player.posY - 1.62, player.posZ, @@ -484,14 +484,14 @@ public class GUITeleporter extends GuiScreen { if (button.id == 3 || button.id == 7) { if (button.id == 3) { if (selected > 0) { - TeleportLocation temp = getLocationSafely(selected + selectionOffset); + Teleporter.TeleportLocation temp = getLocationSafely(selected + selectionOffset); locations.set(selected + selectionOffset, getLocationSafely(selected + selectionOffset - 1)); locations.set(selected + selectionOffset - 1, temp); selected--; } } else { if (selected < Math.min(11, locations.size() - 1)) { - TeleportLocation temp = getLocationSafely(selected + selectionOffset); + Teleporter.TeleportLocation temp = getLocationSafely(selected + selectionOffset); locations.set(selected + selectionOffset, getLocationSafely(selected + selectionOffset + 1)); locations.set(selected + selectionOffset + 1, temp); selected++; @@ -624,7 +624,7 @@ public class GUITeleporter extends GuiScreen { // TeleportLocation location = new TeleportLocation(tagLocation.getDouble("X"), tagLocation.getDouble("Y"), // tagLocation.getDouble("Z"), tagLocation.getInteger("Dimension"), tagLocation.getFloat("Pitch"), // tagLocation.getFloat("Yaw"), tagLocation.getString("Name")); - TeleportLocation location = new TeleportLocation(); + Teleporter.TeleportLocation location = new Teleporter.TeleportLocation(); location.readFromNBT(tagLocation); location.setWriteProtected(tagLocation.getBoolean("WP")); locations.add(location); @@ -632,7 +632,7 @@ public class GUITeleporter extends GuiScreen { } private void addCurrentLocationToList(String name) { - TeleportLocation currentLocation = new TeleportLocation( + Teleporter.TeleportLocation currentLocation = new Teleporter.TeleportLocation( player.posX, player.posY - 1.62, player.posZ, @@ -644,8 +644,8 @@ public class GUITeleporter extends GuiScreen { locations.add(currentLocation); } - private TeleportLocation getLocationSafely(int index) { + private Teleporter.TeleportLocation getLocationSafely(int index) { if (index < locations.size() && index >= 0) return locations.get(index); - return new TeleportLocation(0, 0, 0, 0, 0, 0, EnumChatFormatting.DARK_RED + "[Index Error]"); + return new Teleporter.TeleportLocation(0, 0, 0, 0, 0, 0, EnumChatFormatting.DARK_RED + "[Index Error]"); } } diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIUpgradeModifier.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIUpgradeModifier.java index a3b51368..d0f12f50 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIUpgradeModifier.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GUIUpgradeModifier.java @@ -15,7 +15,7 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.container.ContainerUpgradeModifier; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/GuiHudConfig.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/GuiHudConfig.java index 42255c0e..065a6960 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/GuiHudConfig.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/GuiHudConfig.java @@ -11,8 +11,8 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase; -import com.brandon3055.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIBase; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; /** diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIManual.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIManual.java index 8f639046..652131e7 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIManual.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIManual.java @@ -11,6 +11,8 @@ import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentBase; +import com.brandon3055.draconicevolution.brandonscore.client.utills.ClientUtills; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.gui.GuiConfirmOpenLink; @@ -25,14 +27,12 @@ import org.apache.commons.io.IOUtils; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentButton; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentCollection; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTextureButton; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTexturedRect; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase; -import com.brandon3055.brandonscore.client.utills.ClientUtills; -import com.brandon3055.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentButton; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentCollection; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTextureButton; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTexturedRect; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentContributorsPage; import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentIndexButton; import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentManualPage; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIReactor.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIReactor.java index cb398589..74ef60c2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIReactor.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIReactor.java @@ -11,19 +11,21 @@ import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentButton; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentCollection; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTextureButton; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTexturedRect; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase; -import com.brandon3055.brandonscore.client.utills.GuiHelper; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentButton; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentCollection; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTextureButton; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTexturedRect; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIBase; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.container.ContainerReactor; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore.ReactorState; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by brandon3055 on 30/7/2015. */ @@ -184,7 +186,7 @@ public class GUIReactor extends GUIBase { if (core.maxFieldCharge > 0) { text.add(Utills.round(core.fieldCharge / core.maxFieldCharge * 100D, 100D) + "%"); } - text.add(Utills.addCommas((int) core.fieldCharge) + " / " + Utills.addCommas((int) core.maxFieldCharge)); + text.add(formatNumber((int) core.fieldCharge) + " / " + formatNumber((int) core.maxFieldCharge)); drawHoveringText(text, mouseX, mouseY, fontRendererObj); } else if (GuiHelper.isInRect(197, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) { text.add(StatCollector.translateToLocal("gui.de.energySaturation.txt")); @@ -193,7 +195,7 @@ public class GUIReactor extends GUIBase { Utills.round((double) core.energySaturation / (double) core.maxEnergySaturation * 100D, 100D) + "%"); } - text.add(Utills.addCommas(core.energySaturation) + " / " + Utills.addCommas(core.maxEnergySaturation)); + text.add(formatNumber(core.energySaturation) + " / " + formatNumber(core.maxEnergySaturation)); drawHoveringText(text, mouseX, mouseY, fontRendererObj); } else if (GuiHelper.isInRect(221, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) { text.add(StatCollector.translateToLocal("gui.de.fuelConversion.txt")); @@ -259,15 +261,15 @@ public class GUIReactor extends GUIBase { 2 + 2 * 24, 0); fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.genRate.name"), 55, 16 + 2 * 24, 0x0000FF); - fontRendererObj.drawString(Utills.addCommas((int) core.generationRate) + "RF/t", 60, 2 + 3 * 24, 0); + fontRendererObj.drawString(formatNumber((int) core.generationRate) + "RF/t", 60, 2 + 3 * 24, 0); fontRendererObj .drawString(StatCollector.translateToLocal("gui.de.fieldInputRate.name"), 55, 16 + 3 * 24, 0x0000FF); fontRendererObj - .drawString(Utills.addCommas((int) Math.min(inputRate, Integer.MAX_VALUE)) + "RF/t", 60, 2 + 4 * 24, 0); + .drawString(formatNumber((int) Math.min(inputRate, Integer.MAX_VALUE)) + "RF/t", 60, 2 + 4 * 24, 0); fontRendererObj .drawString(StatCollector.translateToLocal("gui.de.fuelConversion.name"), 55, 16 + 4 * 24, 0x0000FF); fontRendererObj.drawString( - Utills.addCommas((int) Math.round(core.fuelUseRate * 1000000D)) + "nb/t", + formatNumber((int) Math.round(core.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 24, 0); diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolConfig.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolConfig.java index a2f94e89..6889a56e 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolConfig.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolConfig.java @@ -11,16 +11,16 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.util.StringUtils; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentButton; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentCollection; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentItemRenderer; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTextField; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTexturedRect; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentBase; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentButton; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentCollection; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentItemRenderer; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTextField; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTexturedRect; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIBase; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.gui.GuiHudConfig; import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentConfigItemButton; import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldAdjuster; @@ -35,6 +35,8 @@ import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IInventoryTool; import com.brandon3055.draconicevolution.common.utills.ItemConfigField; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 26/12/2014. */ @@ -325,7 +327,7 @@ public class GUIToolConfig extends GUIBase { List list = new ArrayList(); list.add( StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": " - + Utills.addCommas(properties.calculateEnergyCost())); + + formatNumber(properties.calculateEnergyCost())); list.add( StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": " + properties.arrowDamage * (properties.arrowSpeed * 3)); diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolInventory.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolInventory.java index 5b30b4cf..88f6e8e7 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolInventory.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/componentguis/GUIToolInventory.java @@ -6,12 +6,12 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentButton; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentCollection; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentItemRenderer; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentSlotBackground; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentTexturedRect; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentButton; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentCollection; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentItemRenderer; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentSlotBackground; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentTexturedRect; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIBase; import com.brandon3055.draconicevolution.common.container.ContainerAdvTool; import com.brandon3055.draconicevolution.common.lib.References; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentConfigItemButton.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentConfigItemButton.java index 97b2956c..10112933 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentConfigItemButton.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentConfigItemButton.java @@ -9,7 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentBase; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IInventoryTool; @@ -20,8 +20,7 @@ import com.brandon3055.draconicevolution.common.utills.ItemConfigField; */ public class ComponentConfigItemButton extends ComponentBase { - private static final ResourceLocation texture = new ResourceLocation( - References.RESOURCESPREFIX + "textures/gui/Widgets.png"); + private static final ResourceLocation texture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png"); public int slot; private InventoryPlayer inventory; public boolean hasValidItem = false; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentContributorsPage.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentContributorsPage.java index 95ce811e..32690885 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentContributorsPage.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentContributorsPage.java @@ -17,10 +17,10 @@ import net.minecraft.util.StringUtils; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingBase; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase; -import com.brandon3055.brandonscore.client.utills.ClientUtills; -import com.brandon3055.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.client.utills.ClientUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.handler.ContributorHandler; import com.brandon3055.draconicevolution.common.handler.ContributorHandler.Contributor; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldAdjuster.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldAdjuster.java index 408fb2c0..750038a4 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldAdjuster.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldAdjuster.java @@ -6,9 +6,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase; -import com.brandon3055.brandonscore.client.utills.GuiHelper; -import com.brandon3055.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentBase; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldButton.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldButton.java index 327bc8ae..8a4330c2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldButton.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentFieldButton.java @@ -3,14 +3,14 @@ package com.brandon3055.draconicevolution.client.gui.guicomponents; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; import net.minecraft.client.Minecraft; import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase; -import com.brandon3055.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentBase; import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentIndexButton.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentIndexButton.java index a23a9d81..b7a16483 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentIndexButton.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentIndexButton.java @@ -6,9 +6,9 @@ import net.minecraft.item.ItemStack; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingBase; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentManualPage.java b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentManualPage.java index ebb09312..f9763bf3 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentManualPage.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/gui/guicomponents/ComponentManualPage.java @@ -21,11 +21,11 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import org.apache.commons.io.FilenameUtils; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingBase; -import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase; -import com.brandon3055.brandonscore.client.utills.GuiHelper; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.ComponentScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.client.gui.guicomponents.GUIScrollingBase; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/handler/ClientEventHandler.java b/src/main/java/com/brandon3055/draconicevolution/client/handler/ClientEventHandler.java index 434543f4..33c16f98 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/handler/ClientEventHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/handler/ClientEventHandler.java @@ -20,8 +20,8 @@ import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.utills.DataUtills.XZPair; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.handler.ContributorHandler; @@ -45,7 +45,7 @@ import cpw.mods.fml.relauncher.SideOnly; */ public class ClientEventHandler { - public static Map> playerShieldStatus = new HashMap>(); + public static Map> playerShieldStatus = new HashMap<>(); public static int elapsedTicks; private static float previousFOB = 0f; @@ -72,9 +72,9 @@ public class ClientEventHandler { if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT) return; - for (Iterator>> i = playerShieldStatus.entrySet().iterator(); i - .hasNext();) { - Map.Entry> entry = i.next(); + for (Iterator>> i = playerShieldStatus.entrySet() + .iterator(); i.hasNext();) { + Map.Entry> entry = i.next(); if (elapsedTicks - entry.getValue().getValue() > 5) i.remove(); } diff --git a/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java b/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java index 5fe39a2f..0dc49fb9 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/handler/HudHandler.java @@ -1,5 +1,7 @@ package com.brandon3055.draconicevolution.client.handler; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + import java.util.ArrayList; import java.util.List; @@ -14,8 +16,7 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.client.utills.GuiHelper; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.client.utills.GuiHelper; import com.brandon3055.draconicevolution.client.gui.GuiHudConfig; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler; @@ -213,7 +214,7 @@ public class HudHandler { GL11.glTranslated(-x, -y, 0); String shield = Math.round(shieldPoints) + "/" + (int) maxShieldPoints; String entropy = "EN: " + (int) shieldEntropy + "%"; - String energy = "RF: " + Utills.formatNumber(rfTotal); + String energy = "RF: " + formatNumber(rfTotal); float fade = Math.min(armorStatsFadeOut, 1F); if (!rotated) { fontRenderer diff --git a/src/main/java/com/brandon3055/draconicevolution/client/keybinding/KeyInputHandler.java b/src/main/java/com/brandon3055/draconicevolution/client/keybinding/KeyInputHandler.java index 3ab05f39..918070fc 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/keybinding/KeyInputHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/keybinding/KeyInputHandler.java @@ -13,8 +13,8 @@ import net.minecraft.util.MovingObjectPosition; import org.lwjgl.input.Mouse; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.items.tools.Magnet; import com.brandon3055.draconicevolution.common.items.tools.baseclasses.ToolHandler; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/item/RenderMobSoul.java b/src/main/java/com/brandon3055/draconicevolution/client/render/item/RenderMobSoul.java index b22f3e22..51b73912 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/item/RenderMobSoul.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/item/RenderMobSoul.java @@ -10,7 +10,7 @@ import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper; public class RenderMobSoul implements IItemRenderer { diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/particle/ParticleEnergyBeam.java b/src/main/java/com/brandon3055/draconicevolution/client/render/particle/ParticleEnergyBeam.java index 7b03d8ca..32d9314f 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/particle/ParticleEnergyBeam.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/particle/ParticleEnergyBeam.java @@ -10,7 +10,7 @@ import net.minecraft.world.World; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.handler.ClientEventHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.lib.References; @@ -90,7 +90,6 @@ public class ParticleEnergyBeam extends EntityFX { double xOff = xDist / dist; double zOff = zDist / dist; if (xOff == 0 && zOff == 0) xOff = 1; - // LogHelper.info(xOff + " " + zOff); double offM = 0.4D; if (offsetMode == 2 || offsetMode == 3) setPosition(posX - xOff * offM, posY, posZ - zOff * offM); diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/particle/Particles.java b/src/main/java/com/brandon3055/draconicevolution/client/render/particle/Particles.java index 52f436c8..89070644 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/particle/Particles.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/particle/Particles.java @@ -11,7 +11,7 @@ import net.minecraftforge.client.model.IModelCustom; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.common.entity.EntityDragonProjectile; import com.brandon3055.draconicevolution.common.lib.References; diff --git a/src/main/java/com/brandon3055/draconicevolution/client/render/tile/RenderTileTeleporterStand.java b/src/main/java/com/brandon3055/draconicevolution/client/render/tile/RenderTileTeleporterStand.java index ec2c717f..c27dd1c0 100644 --- a/src/main/java/com/brandon3055/draconicevolution/client/render/tile/RenderTileTeleporterStand.java +++ b/src/main/java/com/brandon3055/draconicevolution/client/render/tile/RenderTileTeleporterStand.java @@ -20,8 +20,8 @@ import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.model.ModelTeleporterStand; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.items.tools.TeleporterMKII; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java b/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java index 042575ab..36f96128 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/CommonProxy.java @@ -1,13 +1,17 @@ package com.brandon3055.draconicevolution.common; import net.minecraft.client.audio.ISound; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.oredict.OreDictionary; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.FileHandler; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.ProcessHandler; import com.brandon3055.draconicevolution.client.creativetab.DETab; import com.brandon3055.draconicevolution.client.gui.GuiHandler; import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyBeam; @@ -108,6 +112,8 @@ import cpw.mods.fml.relauncher.Side; public class CommonProxy { public void preInit(FMLPreInitializationEvent event) { + FileHandler.init(event); + ProcessHandler.init(); ConfigHandler.init(event.getSuggestedConfigurationFile()); BalanceConfigHandler.init(event.getModConfigurationDirectory()); registerEventListeners(event.getSide()); @@ -119,29 +125,6 @@ public class CommonProxy { registerOres(); DraconicEvolution.reaperEnchant = new EnchantmentReaper(ConfigHandler.reaperEnchantID); - // - // Potion[] potionTypes = null; - // LogHelper.info("Expanding Potion array size to 256"); - // - // for (Field f : Potion.class.getDeclaredFields()) { - // f.setAccessible(true); - // - // try { - // if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) { - // Field modfield = Field.class.getDeclaredField("modifiers"); - // modfield.setAccessible(true); - // modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL); - // potionTypes = (Potion[]) f.get(null); - // final Potion[] newPotionTypes = new Potion[256]; - // System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length); - // f.set(null, newPotionTypes); - // } - // } - // catch (Exception e) { - // LogHelper.error("Severe error, please report this to the mod author:"); - // e.printStackTrace(); - // } - // } Achievements.addModAchievements(); LogHelper.info("Finished PreInitialization"); @@ -281,7 +264,6 @@ public class CommonProxy { EntityRegistry.registerModEntity(EntityPersistentItem.class, "Persistent Item", 1, DraconicEvolution.instance, 32, 5, true); EntityRegistry.registerModEntity(EntityDraconicArrow.class, "Arrow", 2, DraconicEvolution.instance, 32, 5, true); EntityRegistry.registerModEntity(EntityEnderArrow.class, "Ender Arrow", 3, DraconicEvolution.instance, 32, 1, true); - // EntityRegistry.registerModEntity(EntityChaosDrill.class, "Chaos Drill", 4, DraconicEvolution.instance, 10, 5, false); EntityRegistry.registerModEntity(EntityDragonHeart.class, "Dragon Heart Item", 5, DraconicEvolution.instance, 32, 5, true); EntityRegistry.registerModEntity(EntityChaosGuardian.class, "ChaosGuardian", 6, DraconicEvolution.instance, 256, 1, true); EntityRegistry.registerModEntity(EntityDragonProjectile.class, "DragonProjectile", 7, DraconicEvolution.instance, 256, 1, true); @@ -311,4 +293,43 @@ public class CommonProxy { public ISound playISound(ISound sound) { return null; } + + public boolean isDedicatedServer() { + return true; + } + + public MinecraftServer getMCServer() { + return FMLCommonHandler.instance().getMinecraftServerInstance(); + } + + public World getClientWorld() { + return null; + } + + public boolean isOp(String paramString) { + MinecraftServer localMinecraftServer = FMLCommonHandler.instance().getMinecraftServerInstance(); + paramString = paramString.trim(); + for (String str : localMinecraftServer.getConfigurationManager().func_152606_n()) { + if (paramString.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + public boolean isSpaceDown() { + return false; + } + + public boolean isCtrlDown() { + return false; + } + + public boolean isShiftDown() { + return false; + } + + public EntityPlayer getClientPlayer() { + return null; + } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/achievements/Achievements.java b/src/main/java/com/brandon3055/draconicevolution/common/achievements/Achievements.java index 58f155f3..9c8ffc39 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/achievements/Achievements.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/achievements/Achievements.java @@ -9,7 +9,7 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.AchievementPage; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/BlockCustomDrop.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/BlockCustomDrop.java index e4a0e98f..46566c12 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/BlockCustomDrop.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/BlockCustomDrop.java @@ -10,7 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.InventoryUtils; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InventoryUtils; import com.google.common.collect.Lists; /** diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/CKeyStone.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/CKeyStone.java index 880a486a..8c854b66 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/CKeyStone.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/CKeyStone.java @@ -12,8 +12,8 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.blocks.itemblocks.CKeyStoneItemBlock; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/CustomSpawner.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/CustomSpawner.java index e3ac38c3..e497d769 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/CustomSpawner.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/CustomSpawner.java @@ -23,9 +23,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/TeleporterStand.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/TeleporterStand.java index 2f7d9561..02822f62 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/TeleporterStand.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/TeleporterStand.java @@ -14,8 +14,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.items.tools.TeleporterMKI; import com.brandon3055.draconicevolution.common.lib.References; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/EnergyCrystal.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/EnergyCrystal.java index a7a03211..5b6c4a99 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/EnergyCrystal.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/EnergyCrystal.java @@ -17,8 +17,8 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.BlockDE; import com.brandon3055.draconicevolution.common.blocks.itemblocks.EnergyCrystalItemBlock; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/FlowGate.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/FlowGate.java index a14f1914..3e7fc5be 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/FlowGate.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/machine/FlowGate.java @@ -17,8 +17,8 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.gui.GuiHandler; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorEnergyInjector.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorEnergyInjector.java index 6e1f315c..7cbabf1a 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorEnergyInjector.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorEnergyInjector.java @@ -12,8 +12,8 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.BlockDE; import com.brandon3055.draconicevolution.common.lib.References; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorStabilizer.java b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorStabilizer.java index a4f167b7..6d2b4681 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorStabilizer.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/blocks/multiblock/ReactorStabilizer.java @@ -1,5 +1,6 @@ package com.brandon3055.draconicevolution.common.blocks.multiblock; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.client.renderer.texture.IIconRegister; @@ -11,7 +12,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.BlockDE; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerDissEnchanter.java b/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerDissEnchanter.java index 98800dc9..bf1dc13e 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerDissEnchanter.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/container/ContainerDissEnchanter.java @@ -1,5 +1,6 @@ package com.brandon3055.draconicevolution.common.container; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -9,7 +10,6 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.inventory.SlotOutput; import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter; import com.brandon3055.draconicevolution.integration.ModHelper; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosion.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosion.java index 38978734..388abbcd 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosion.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosion.java @@ -5,9 +5,9 @@ import java.util.Random; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.handlers.IProcess; -import com.brandon3055.brandonscore.common.handlers.ProcessHandler; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.IProcess; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.ProcessHandler; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; /** * Created by brandon3055 on 12/8/2015. diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosionTrace.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosionTrace.java index 92319b7a..dc81290a 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosionTrace.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/ChaosImplosionTrace.java @@ -7,7 +7,7 @@ import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.handlers.IProcess; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.IProcess; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.ReactorExplosion; /** diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosDrill.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosDrill.java index 695a1d24..846808ae 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosDrill.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosDrill.java @@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.entity; import java.util.ArrayList; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosGuardian.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosGuardian.java index e5e91a4e..4945577e 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosGuardian.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosGuardian.java @@ -25,7 +25,7 @@ import net.minecraft.util.Vec3; import net.minecraft.util.WeightedRandom; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard; import com.brandon3055.draconicevolution.common.utills.DamageSourceChaos; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosVortex.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosVortex.java index 721d9569..df0b8831 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosVortex.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityChaosVortex.java @@ -7,8 +7,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.handlers.ProcessHandler; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.ProcessHandler; import com.brandon3055.draconicevolution.client.render.particle.Particles; import com.brandon3055.draconicevolution.common.network.GenericParticlePacket; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonHeart.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonHeart.java index d4c242c2..1a531208 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonHeart.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonHeart.java @@ -13,7 +13,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.handler.ParticleHandler; import com.brandon3055.draconicevolution.client.render.particle.Particles; import com.brandon3055.draconicevolution.common.ModBlocks; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonProjectile.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonProjectile.java index 58002deb..0d4bf0b9 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonProjectile.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityDragonProjectile.java @@ -17,9 +17,9 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.Teleporter; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.handler.ParticleHandler; import com.brandon3055.draconicevolution.client.render.particle.Particles; import com.brandon3055.draconicevolution.common.network.GenericParticlePacket; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityEnderArrow.java b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityEnderArrow.java index 1144022f..76227471 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityEnderArrow.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/entity/EntityEnderArrow.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.entity; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; @@ -18,7 +19,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; -import com.brandon3055.brandonscore.common.utills.Utills; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/handler/ContributorHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/handler/ContributorHandler.java index c6565a3f..46f22841 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/handler/ContributorHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/handler/ContributorHandler.java @@ -19,8 +19,8 @@ import net.minecraftforge.client.event.RenderPlayerEvent; import org.apache.commons.io.IOUtils; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.handlers.FileHandler; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.FileHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.model.special.ModelContributorWings; import com.brandon3055.draconicevolution.common.network.ContributorPacket; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/handler/CraftingHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/handler/CraftingHandler.java index c1163cf8..e360bdab 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/handler/CraftingHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/handler/CraftingHandler.java @@ -1,5 +1,6 @@ package com.brandon3055.draconicevolution.common.handler; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -8,7 +9,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.utills.LogHelper; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/handler/MinecraftForgeEventHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/handler/MinecraftForgeEventHandler.java index 4fcb78b8..6b479b85 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/handler/MinecraftForgeEventHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/handler/MinecraftForgeEventHandler.java @@ -6,6 +6,7 @@ import java.lang.reflect.Method; import java.util.List; import java.util.Random; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.entity.EntityPlayerSP; @@ -45,11 +46,10 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.entity.player.PlayerUseItemEvent; import net.minecraftforge.event.world.WorldEvent; -import com.brandon3055.brandonscore.common.handlers.ProcessHandler; -import com.brandon3055.brandonscore.common.utills.DataUtills; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.ProcessHandler; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.achievements.Achievements; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/inventory/InventoryTool.java b/src/main/java/com/brandon3055/draconicevolution/common/inventory/InventoryTool.java index f6fab981..2c7e4aad 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/inventory/InventoryTool.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/inventory/InventoryTool.java @@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.StringUtils; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.container.ContainerAdvTool; import com.brandon3055.draconicevolution.common.utills.IInventoryTool; import com.brandon3055.draconicevolution.common.utills.LogHelper; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java b/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java index db6905a2..287141da 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/DraconicCore.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.items; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @@ -9,7 +10,6 @@ import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/Key.java b/src/main/java/com/brandon3055/draconicevolution/common/items/Key.java index c4b71a43..b3e36123 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/Key.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/Key.java @@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.items; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.lib.Strings; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java b/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java index fa056817..638518a2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/MobSoul.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.items; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; @@ -15,7 +16,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.lib.Strings; import com.brandon3055.draconicevolution.common.utills.LogHelper; @@ -36,10 +36,10 @@ public class MobSoul extends ItemDE { @Override public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) { String name = ItemNBTHelper.getString(stack, "Name", "Pig"); - list.add("" + EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul1.txt")); - list.add("" + EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul2.txt")); - list.add("" + EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul3.txt")); - list.add("" + EnumChatFormatting.DARK_PURPLE + name); + list.add(EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul1.txt")); + list.add(EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul2.txt")); + list.add(EnumChatFormatting.WHITE + StatCollector.translateToLocal("info.mobSoul3.txt")); + list.add(EnumChatFormatting.DARK_PURPLE + name); } @Override diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java index 6126f5bc..7aa63c20 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/CustomArmorHandler.java @@ -6,6 +6,7 @@ import java.util.Map; import java.util.UUID; import java.util.WeakHashMap; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.IAttribute; @@ -19,8 +20,6 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; @@ -261,12 +260,12 @@ public class CustomArmorHandler { && summery.flightVModifier > 0) { // float percentIncrease = summery.flightVModifier; - if (BrandonsCore.proxy.isSpaceDown() && !BrandonsCore.proxy.isShiftDown()) { + if (DraconicEvolution.proxy.isSpaceDown() && !DraconicEvolution.proxy.isShiftDown()) { // LogHelper.info(player.motionY); player.motionY = 0.225F * summery.flightVModifier; } - if (BrandonsCore.proxy.isShiftDown() && !BrandonsCore.proxy.isSpaceDown()) { + if (DraconicEvolution.proxy.isShiftDown() && !DraconicEvolution.proxy.isSpaceDown()) { player.motionY = -0.225F * summery.flightVModifier; } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/DraconicArmor.java b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/DraconicArmor.java index a188281c..85f32300 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/DraconicArmor.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/DraconicArmor.java @@ -4,6 +4,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -26,10 +29,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.model.ModelDraconicArmor; import com.brandon3055.draconicevolution.client.model.ModelDraconicArmorOld; @@ -62,6 +61,8 @@ import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.nodes.IRevealer; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 3/07/2014. */ @@ -516,17 +517,17 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IConfigur InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.ShieldCapacity.txt") + ": " + InfoHelper.HITC() - + (int) getProtectionPoints(stack)); + + formatNumber((int) getProtectionPoints(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.ShieldRecovery.txt") + ": " + InfoHelper.HITC() - + Utills.round(getRecoveryPoints(stack) * 0.2D, 10) + + formatNumber(getRecoveryPoints(stack) * 0.2D) + " EPS"); return strings; @@ -579,7 +580,7 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IConfigur @Override public float getJumpModifier(ItemStack stack, EntityPlayer player) { if (IConfigurableItem.ProfileHelper.getBoolean(stack, "ArmorSprintOnly", false)) { - return player.isSprinting() || BrandonsCore.proxy.isCtrlDown() + return player.isSprinting() || DraconicEvolution.proxy.isCtrlDown() ? IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorJumpMult", 0f) : IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorJumpMult", 0f) / 5F; } else return IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorJumpMult", 0f); @@ -588,7 +589,7 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IConfigur @Override public boolean hasHillStep(ItemStack stack, EntityPlayer player) { if (IConfigurableItem.ProfileHelper.getBoolean(stack, "ArmorSprintOnly", false)) { - return (player.isSprinting() || BrandonsCore.proxy.isCtrlDown()) + return (player.isSprinting() || DraconicEvolution.proxy.isCtrlDown()) && IConfigurableItem.ProfileHelper.getBoolean(stack, "ArmorHillStep", true); } else return IConfigurableItem.ProfileHelper.getBoolean(stack, "ArmorHillStep", true); } @@ -607,7 +608,7 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IConfigur @Override public float getFlightSpeedModifier(ItemStack stack, EntityPlayer player) { if (IConfigurableItem.ProfileHelper.getBoolean(stack, "EffectiveOnSprint", false)) { - return BrandonsCore.proxy.isCtrlDown() + return DraconicEvolution.proxy.isCtrlDown() ? IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorFlightSpeedMult", 0f) : 0F; } else return IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorFlightSpeedMult", 0f); @@ -616,7 +617,7 @@ public class DraconicArmor extends ItemArmor implements ISpecialArmor, IConfigur @Override public float getFlightVModifier(ItemStack stack, EntityPlayer player) { if (IConfigurableItem.ProfileHelper.getBoolean(stack, "EffectiveOnSprint", false)) { - return BrandonsCore.proxy.isCtrlDown() + return DraconicEvolution.proxy.isCtrlDown() ? IConfigurableItem.ProfileHelper.getFloat(stack, "VerticalAcceleration", 0F) : 0F; } else return IConfigurableItem.ProfileHelper.getFloat(stack, "VerticalAcceleration", 0F); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/WyvernArmor.java b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/WyvernArmor.java index 69ad04d2..9645e1ee 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/armor/WyvernArmor.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/armor/WyvernArmor.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.armor; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.model.ModelBiped; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -23,10 +25,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.ISpecialArmor; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.model.ModelDraconicArmorOld; import com.brandon3055.draconicevolution.client.model.ModelWyvernArmor; @@ -53,6 +51,8 @@ import thaumcraft.api.IVisDiscountGear; import thaumcraft.api.IWarpingGear; import thaumcraft.api.aspects.Aspect; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 3/07/2014. */ @@ -395,17 +395,17 @@ public class WyvernArmor extends ItemArmor implements ISpecialArmor, IConfigurab InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.ShieldCapacity.txt") + ": " + InfoHelper.HITC() - + (int) getProtectionPoints(stack)); + + formatNumber((int) getProtectionPoints(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.ShieldRecovery.txt") + ": " + InfoHelper.HITC() - + Utills.round(getRecoveryPoints(stack) * 0.2D, 10) + + formatNumber(getRecoveryPoints(stack) * 0.2D) + " EPS"); return strings; @@ -457,7 +457,7 @@ public class WyvernArmor extends ItemArmor implements ISpecialArmor, IConfigurab @Override public float getJumpModifier(ItemStack stack, EntityPlayer player) { if (IConfigurableItem.ProfileHelper.getBoolean(stack, "ArmorSprintOnly", false)) { - return player.isSprinting() || BrandonsCore.proxy.isCtrlDown() + return player.isSprinting() || DraconicEvolution.proxy.isCtrlDown() ? IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorJumpMult", 0f) : IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorJumpMult", 0f) / 5F; } else return IConfigurableItem.ProfileHelper.getFloat(stack, "ArmorJumpMult", 0f); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/AdminSpawnEgg.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/AdminSpawnEgg.java index dc4b29dd..8e53fc54 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/AdminSpawnEgg.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/AdminSpawnEgg.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; @@ -12,7 +13,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.items.ItemDE; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java index 8d5be87b..13af472d 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicDistructionStaff.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnumEnchantmentType; @@ -15,7 +16,6 @@ import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.client.render.IRenderTweak; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler; @@ -32,6 +32,8 @@ import com.brandon3055.draconicevolution.common.utills.ItemConfigField; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + public class DraconicDistructionStaff extends MiningTool implements IInventoryTool, IRenderTweak, IEnergyContainerWeaponItem { @@ -215,7 +217,7 @@ public class DraconicDistructionStaff extends MiningTool InfoHelper.ITC() + StatCollector.translateToLocal("info.de.attackDamage.txt") + ": " + InfoHelper.HITC() - + ToolHandler.getBaseAttackDamage(stack)); + + formatNumber( ToolHandler.getBaseAttackDamage(stack))); return list; } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicHoe.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicHoe.java index 848823c3..15d6a503 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicHoe.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconicHoe.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -22,9 +24,6 @@ import net.minecraftforge.event.entity.player.UseHoeEvent; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.render.IRenderTweak; import com.brandon3055.draconicevolution.common.ModItems; @@ -45,6 +44,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + public class DraconicHoe extends ItemHoe implements IEnergyContainerItem, IRenderTweak, IUpgradableItem, IConfigurableItem, IHudDisplayItem { @@ -358,16 +359,16 @@ public class DraconicHoe extends ItemHoe InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(itemstack))); + + formatNumber(getMaxEnergyStored(itemstack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " + StatCollector.translateToLocal("gui.de.DigAOE.txt") + ": " + InfoHelper.HITC() - + digaoe + + formatNumber(digaoe) + "x" - + digaoe); + + formatNumber(digaoe)); return strings; } @@ -388,9 +389,9 @@ public class DraconicHoe extends ItemHoe InfoHelper.ITC() + StatCollector.translateToLocal("info.de.charge.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getEnergyStored(stack)) + + formatNumber(getEnergyStored(stack)) + " / " - + Utills.formatNumber(capacity)); + + formatNumber(capacity)); return list; } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconiumFluxCapacitor.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconiumFluxCapacitor.java index ec6ba877..ce2b72bb 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconiumFluxCapacitor.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/DraconiumFluxCapacitor.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; @@ -14,9 +16,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler; @@ -29,6 +28,8 @@ import cofh.api.energy.IEnergyContainerItem; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 24/11/2014. */ @@ -174,7 +175,6 @@ public class DraconiumFluxCapacitor extends RFItemBase implements IUpgradableIte + StatCollector.translateToLocal( "info.de.capacitorMode" + ItemNBTHelper.getShort(stack, "Mode", (short) 0) + ".txt")); - // InfoHelper.addLore(stack, list); } ToolBase.holdCTRLForUpgrades(list, stack); InfoHelper.addEnergyInfo(stack, list); @@ -187,8 +187,7 @@ public class DraconiumFluxCapacitor extends RFItemBase implements IUpgradableIte @Override public List getUpgrades(ItemStack itemstack) { - return new ArrayList() { - + return new ArrayList<>() { { add(EnumUpgrade.RF_CAPACITY); } @@ -240,7 +239,7 @@ public class DraconiumFluxCapacitor extends RFItemBase implements IUpgradableIte InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); return strings; } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java index f0cff832..d80f81a7 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Magnet.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.client.renderer.texture.IIconRegister; @@ -23,8 +25,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerPickupXpEvent; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/SafetyMatch.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/SafetyMatch.java index 1e0d241e..58aacb0f 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/SafetyMatch.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/SafetyMatch.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -11,7 +12,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.ModItems; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java index ece6353b..c8fcff1b 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKI.java @@ -15,10 +15,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Teleporter.TeleportLocation; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem; import com.brandon3055.draconicevolution.common.items.ItemDE; @@ -109,7 +108,7 @@ public class TeleporterMKI extends ItemDE { ItemNBTHelper.setString( stack, "DimentionName", - BrandonsCore.proxy.getMCServer().worldServerForDimension(player.dimension).provider + DraconicEvolution.proxy.getMCServer().worldServerForDimension(player.dimension).provider .getDimensionName()); } return stack; @@ -176,10 +175,10 @@ public class TeleporterMKI extends ItemDE { return new EntityPersistentItem(world, location, itemstack); } - public TeleportLocation getLocation(ItemStack stack) { + public Teleporter.TeleportLocation getLocation(ItemStack stack) { if (!ItemNBTHelper.getBoolean(stack, "IsSet", false)) return null; - TeleportLocation location = new TeleportLocation(); + Teleporter.TeleportLocation location = new Teleporter.TeleportLocation(); location.readFromNBT(stack.getTagCompound()); return location; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java index aeb07301..2886b1af 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/TeleporterMKII.java @@ -16,10 +16,10 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Teleporter.TeleportLocation; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.client.gui.GuiHandler; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem; @@ -187,7 +187,7 @@ public class TeleporterMKII extends TeleporterMKI implements IHudDisplayItem { } @Override - public TeleportLocation getLocation(ItemStack stack) { + public Teleporter.TeleportLocation getLocation(ItemStack stack) { short selected = ItemNBTHelper.getShort(stack, "Selection", (short) 0); int selrctionOffset = ItemNBTHelper.getInteger(stack, "SelectionOffset", 0); NBTTagCompound compound = stack.getTagCompound(); @@ -195,7 +195,7 @@ public class TeleporterMKII extends TeleporterMKI implements IHudDisplayItem { NBTTagList list = (NBTTagList) compound.getTag("Locations"); if (list == null) return null; - TeleportLocation destination = new TeleportLocation(); + Teleporter.TeleportLocation destination = new Teleporter.TeleportLocation(); destination.readFromNBT(list.getCompoundTagAt(selected + selrctionOffset)); if (destination.getName().isEmpty()) return null; @@ -205,7 +205,7 @@ public class TeleporterMKII extends TeleporterMKI implements IHudDisplayItem { @Override public List getDisplayData(ItemStack stack) { List list = new ArrayList(); - TeleportLocation location = getLocation(stack); + Teleporter.TeleportLocation location = getLocation(stack); if (location != null) { list.add(location.getName()); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Wrench.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Wrench.java index e117d4d1..1df23a14 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Wrench.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/Wrench.java @@ -3,6 +3,7 @@ package com.brandon3055.draconicevolution.common.items.tools; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -13,7 +14,6 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.items.ItemDE; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/MiningTool.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/MiningTool.java index 854fa306..70af6a9d 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/MiningTool.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/MiningTool.java @@ -5,6 +5,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.block.material.MaterialLiquid; import net.minecraft.client.Minecraft; @@ -30,15 +32,14 @@ import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.event.world.BlockEvent; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IUpgradableItem; import com.brandon3055.draconicevolution.common.utills.ItemConfigField; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 2/01/2015. Modified by bartimaeusnek on 23/05/2018 */ @@ -389,39 +390,39 @@ public abstract class MiningTool extends ToolBase implements IUpgradableItem { InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " + StatCollector.translateToLocal("gui.de.DigAOE.txt") + ": " + InfoHelper.HITC() - + digaoe + + formatNumber(digaoe) + "x" - + digaoe); + + formatNumber(digaoe)); if (depth > 0) strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " + StatCollector.translateToLocal("gui.de.DigDepth.txt") + ": " + InfoHelper.HITC() - + depth); + + formatNumber(depth)); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " + StatCollector.translateToLocal("gui.de.DigSpeed.txt") + ": " + InfoHelper.HITC() - + getEfficiency(stack)); + + formatNumber(getEfficiency(stack))); if (attackaoe > 0) strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " + StatCollector.translateToLocal("gui.de.AttackAOE.txt") + ": " + InfoHelper.HITC() - + attackaoe + + formatNumber(attackaoe) + "x" - + attackaoe); + + formatNumber(attackaoe)); return strings; } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/RFItemBase.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/RFItemBase.java index 45b699d9..eb6fcc1e 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/RFItemBase.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/RFItemBase.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.tools.baseclasses; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.item.Item; @@ -12,9 +14,6 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem; import com.brandon3055.draconicevolution.common.items.ItemDE; @@ -26,6 +25,8 @@ import cofh.api.energy.IEnergyContainerItem; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 8/01/2015. */ @@ -166,9 +167,9 @@ public class RFItemBase extends ItemDE implements IEnergyContainerItem, IConfigu InfoHelper.ITC() + StatCollector.translateToLocal("info.de.charge.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getEnergyStored(stack)) + + formatNumber(getEnergyStored(stack)) + " / " - + Utills.formatNumber(capacity)); + + formatNumber(capacity)); } return list; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/ToolBase.java b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/ToolBase.java index 7bf76f09..71b3b61c 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/ToolBase.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/tools/baseclasses/ToolBase.java @@ -4,6 +4,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; @@ -19,10 +22,6 @@ import net.minecraftforge.common.ForgeHooks; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.DataUtills; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.keybinding.KeyBindings; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; @@ -250,9 +249,9 @@ public class ToolBase extends RFItemBase { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (!world.isRemote && !BrandonsCore.proxy.isDedicatedServer()) { + if (!world.isRemote && !DraconicEvolution.proxy.isDedicatedServer()) { handleModeChange(stack, player, InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown()); - } else if (world.isRemote && BrandonsCore.proxy.getMCServer() == null) { + } else if (world.isRemote && DraconicEvolution.proxy.getMCServer() == null) { handleModeChange(stack, player, InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown()); DraconicEvolution.network .sendToServer(new ToolModePacket(InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown())); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicBow.java b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicBow.java index 74b5f2a8..b56c4e0d 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicBow.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicBow.java @@ -1,5 +1,7 @@ package com.brandon3055.draconicevolution.common.items.weapons; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + import java.util.ArrayList; import java.util.List; @@ -17,11 +19,9 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem; import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler; @@ -298,7 +298,7 @@ public class DraconicBow extends ItemBow InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " @@ -306,7 +306,7 @@ public class DraconicBow extends ItemBow + ": " + InfoHelper.HITC() + "+" - + EnumUpgrade.ARROW_SPEED.getUpgradePoints(stack) * 100 + + formatNumber(EnumUpgrade.ARROW_SPEED.getUpgradePoints(stack) * 100) + "%"); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") @@ -314,13 +314,13 @@ public class DraconicBow extends ItemBow + StatCollector.translateToLocal("gui.de.ArrowDamage.txt") + ": " + InfoHelper.HITC() - + EnumUpgrade.ARROW_DAMAGE.getUpgradePoints(stack) + + formatNumber(EnumUpgrade.ARROW_DAMAGE.getUpgradePoints(stack)) + ""); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.DrawSpeed.txt") + ": " + InfoHelper.HITC() - + properties.getDrawTicks() / 20D + + formatNumber(properties.getDrawTicks() / 20D) + "s"); return list; @@ -369,9 +369,10 @@ public class DraconicBow extends ItemBow public List getDisplayData(ItemStack stack) { List list = new ArrayList(); - if (BrandonsCore.proxy.getClientPlayer() != null && BrandonsCore.proxy.getClientPlayer().getItemInUse() != null - && BrandonsCore.proxy.getClientPlayer().getItemInUseDuration() > 2) { - EntityPlayer player = BrandonsCore.proxy.getClientPlayer(); + if (DraconicEvolution.proxy.getClientPlayer() != null + && DraconicEvolution.proxy.getClientPlayer().getItemInUse() != null + && DraconicEvolution.proxy.getClientPlayer().getItemInUseDuration() > 2) { + EntityPlayer player = DraconicEvolution.proxy.getClientPlayer(); BowHandler.BowProperties properties = new BowHandler.BowProperties(stack, player); int power = (int) Math .min(((float) player.getItemInUseDuration() / (float) properties.getDrawTicks() * 100F), 100F); @@ -395,19 +396,19 @@ public class DraconicBow extends ItemBow InfoHelper.ITC() + StatCollector.translateToLocal("info.de.charge.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getEnergyStored(stack)) + + formatNumber(getEnergyStored(stack)) + " / " - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); - if (BrandonsCore.proxy.getClientPlayer() != null) { + if (DraconicEvolution.proxy.getClientPlayer() != null) { BowHandler.BowProperties properties = new BowHandler.BowProperties( stack, - BrandonsCore.proxy.getClientPlayer()); + DraconicEvolution.proxy.getClientPlayer()); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": " + InfoHelper.HITC() - + Utills.addCommas(properties.calculateEnergyCost())); + + formatNumber(properties.calculateEnergyCost())); if (!properties.canFire() && properties.cantFireMessage != null) list.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal(properties.cantFireMessage)); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java index ac038d80..3b0d3ed0 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/DraconicSword.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.weapons; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; @@ -20,10 +22,6 @@ import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.render.IRenderTweak; import com.brandon3055.draconicevolution.common.ModItems; @@ -45,6 +43,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + public class DraconicSword extends ItemSword implements IEnergyContainerWeaponItem, IInventoryTool, IRenderTweak, IUpgradableItem, IHudDisplayItem { @@ -305,7 +305,7 @@ public class DraconicSword extends ItemSword InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("info.de.attackDamage.txt") + ": " @@ -317,9 +317,9 @@ public class DraconicSword extends ItemSword + StatCollector.translateToLocal("gui.de.AttackAOE.txt") + ": " + InfoHelper.HITC() - + attackaoe + + formatNumber(attackaoe) + "x" - + attackaoe); + + formatNumber(attackaoe)); return strings; } @@ -335,9 +335,9 @@ public class DraconicSword extends ItemSword @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (!world.isRemote && !BrandonsCore.proxy.isDedicatedServer()) { + if (!world.isRemote && !DraconicEvolution.proxy.isDedicatedServer()) { ToolBase.handleModeChange(stack, player, InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown()); - } else if (world.isRemote && BrandonsCore.proxy.getMCServer() == null) { + } else if (world.isRemote && DraconicEvolution.proxy.getMCServer() == null) { ToolBase.handleModeChange(stack, player, InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown()); DraconicEvolution.network .sendToServer(new ToolModePacket(InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown())); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernBow.java b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernBow.java index bb681d00..0a9093bb 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernBow.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernBow.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.weapons; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; @@ -17,10 +19,6 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.entity.EntityPersistentItem; @@ -38,6 +36,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + public class WyvernBow extends ItemBow implements IInventoryTool, IUpgradableItem, IEnergyContainerWeaponItem, IHudDisplayItem { @@ -299,7 +299,7 @@ public class WyvernBow extends ItemBow InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " @@ -307,16 +307,16 @@ public class WyvernBow extends ItemBow + ": " + InfoHelper.HITC() + "+" - + EnumUpgrade.ARROW_SPEED.getUpgradePoints(stack) * 100 + + formatNumber(EnumUpgrade.ARROW_SPEED.getUpgradePoints(stack) * 100) + "%"); list.add( InfoHelper.ITC() + StatCollector.translateToLocal( - "gui.de.ArrowDamage.txt") + ": " + InfoHelper.HITC() + properties.arrowDamage + ""); + "gui.de.ArrowDamage.txt") + ": " + InfoHelper.HITC() + properties.arrowDamage); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.DrawSpeed.txt") + ": " + InfoHelper.HITC() - + properties.getDrawTicks() / 20D + + formatNumber(properties.getDrawTicks() / 20D) + "s"); return list; @@ -360,9 +360,9 @@ public class WyvernBow extends ItemBow public List getDisplayData(ItemStack stack) { List list = new ArrayList(); - if (BrandonsCore.proxy.getClientPlayer() != null - && BrandonsCore.proxy.getClientPlayer().getItemInUse() != null) { - EntityPlayer player = BrandonsCore.proxy.getClientPlayer(); + if (DraconicEvolution.proxy.getClientPlayer() != null + && DraconicEvolution.proxy.getClientPlayer().getItemInUse() != null) { + EntityPlayer player = DraconicEvolution.proxy.getClientPlayer(); BowHandler.BowProperties properties = new BowHandler.BowProperties(stack, player); int power = (int) Math .min(((float) player.getItemInUseDuration() / (float) properties.getDrawTicks() * 100F), 100F); @@ -386,19 +386,19 @@ public class WyvernBow extends ItemBow InfoHelper.ITC() + StatCollector.translateToLocal("info.de.charge.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getEnergyStored(stack)) + + formatNumber(getEnergyStored(stack)) + " / " - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); - if (BrandonsCore.proxy.getClientPlayer() != null) { + if (DraconicEvolution.proxy.getClientPlayer() != null) { BowHandler.BowProperties properties = new BowHandler.BowProperties( stack, - BrandonsCore.proxy.getClientPlayer()); + DraconicEvolution.proxy.getClientPlayer()); list.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": " + InfoHelper.HITC() - + Utills.addCommas(properties.calculateEnergyCost())); + + formatNumber(properties.calculateEnergyCost())); if (!properties.canFire() && properties.cantFireMessage != null) list.add(EnumChatFormatting.DARK_RED + StatCollector.translateToLocal(properties.cantFireMessage)); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernSword.java b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernSword.java index 3113c70a..2798da89 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernSword.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/items/weapons/WyvernSword.java @@ -3,6 +3,8 @@ package com.brandon3055.draconicevolution.common.items.weapons; import java.util.ArrayList; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; @@ -21,10 +23,6 @@ import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.render.IRenderTweak; import com.brandon3055.draconicevolution.common.ModItems; @@ -46,6 +44,8 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + public class WyvernSword extends ItemSword implements IEnergyContainerWeaponItem, IInventoryTool, IRenderTweak, IUpgradableItem, IHudDisplayItem { @@ -307,21 +307,21 @@ public class WyvernSword extends ItemSword InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.RFCapacity.txt") + ": " + InfoHelper.HITC() - + Utills.formatNumber(getMaxEnergyStored(stack))); + + formatNumber(getMaxEnergyStored(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("info.de.attackDamage.txt") + ": " + InfoHelper.HITC() - + ToolHandler.getBaseAttackDamage(stack)); + + formatNumber(ToolHandler.getBaseAttackDamage(stack))); strings.add( InfoHelper.ITC() + StatCollector.translateToLocal("gui.de.max.txt") + " " + StatCollector.translateToLocal("gui.de.AttackAOE.txt") + ": " + InfoHelper.HITC() - + attackaoe + + formatNumber(attackaoe) + "x" - + attackaoe); + + formatNumber(attackaoe)); return strings; } @@ -337,9 +337,9 @@ public class WyvernSword extends ItemSword @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (!world.isRemote && !BrandonsCore.proxy.isDedicatedServer()) { + if (!world.isRemote && !DraconicEvolution.proxy.isDedicatedServer()) { ToolBase.handleModeChange(stack, player, InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown()); - } else if (world.isRemote && BrandonsCore.proxy.getMCServer() == null) { + } else if (world.isRemote && DraconicEvolution.proxy.getMCServer() == null) { ToolBase.handleModeChange(stack, player, InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown()); DraconicEvolution.network .sendToServer(new ToolModePacket(InfoHelper.isShiftKeyDown(), InfoHelper.isCtrlKeyDown())); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/ButtonPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/ButtonPacket.java index 2be68695..3403417b 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/ButtonPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/ButtonPacket.java @@ -1,9 +1,9 @@ package com.brandon3055.draconicevolution.common.network; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.gui.GuiHandler; import com.brandon3055.draconicevolution.common.container.ContainerDissEnchanter; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/ContributorPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/ContributorPacket.java index d9babbc7..4f0a0137 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/ContributorPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/ContributorPacket.java @@ -2,7 +2,6 @@ package com.brandon3055.draconicevolution.common.network; import net.minecraft.entity.player.EntityPlayer; -import com.brandon3055.brandonscore.BrandonsCore; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.common.handler.ContributorHandler; @@ -58,7 +57,7 @@ public class ContributorPacket implements IMessage { DraconicEvolution.network.sendToAll(message); } else { - EntityPlayer player = BrandonsCore.proxy.getClientPlayer(); + EntityPlayer player = DraconicEvolution.proxy.getClientPlayer(); if (!contributor1.isUserValid(player) || message.contributor.equals(player.getCommandSenderName())) { return null; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/GenericParticlePacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/GenericParticlePacket.java index db9ce037..35e63f9c 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/GenericParticlePacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/GenericParticlePacket.java @@ -1,6 +1,6 @@ package com.brandon3055.draconicevolution.common.network; -import com.brandon3055.brandonscore.BrandonsCore; +import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.handler.ParticleHandler; import com.brandon3055.draconicevolution.client.render.particle.Particles; @@ -75,7 +75,7 @@ public class GenericParticlePacket implements IMessage { Particles.DragonProjectileParticle particle; for (int i = 0; i < 100; i++) { particle = new Particles.DragonProjectileParticle( - BrandonsCore.proxy.getClientWorld(), + DraconicEvolution.proxy.getClientWorld(), message.posX, message.posY, message.posZ, @@ -92,7 +92,7 @@ public class GenericParticlePacket implements IMessage { Particles.DragonProjectileParticle particle; for (int i = 0; i < 100; i++) { particle = new Particles.DragonProjectileParticle( - BrandonsCore.proxy.getClientWorld(), + DraconicEvolution.proxy.getClientWorld(), message.posX, message.posY, message.posZ, @@ -108,7 +108,7 @@ public class GenericParticlePacket implements IMessage { case CHAOS_IMPLOSION: { ParticleHandler.spawnCustomParticle( new Particles.ChaosImplosionParticle( - BrandonsCore.proxy.getClientWorld(), + DraconicEvolution.proxy.getClientWorld(), message.posX, message.posY, message.posZ, @@ -119,7 +119,7 @@ public class GenericParticlePacket implements IMessage { case ARROW_SHOCK_WAVE: { ParticleHandler.spawnCustomParticle( new Particles.ArrowShockParticle( - BrandonsCore.proxy.getClientWorld(), + DraconicEvolution.proxy.getClientWorld(), message.posX, message.posY, message.posZ, @@ -127,17 +127,17 @@ public class GenericParticlePacket implements IMessage { 256); for (int i = 0; i < 100; i++) { Particles.ArrowParticle particle = new Particles.ArrowParticle( - BrandonsCore.proxy.getClientWorld(), - message.posX - 0.25 + BrandonsCore.proxy.getClientWorld().rand.nextDouble() * 0.5, - message.posY + BrandonsCore.proxy.getClientWorld().rand.nextDouble() * 0.5, - message.posZ - 0.25 + BrandonsCore.proxy.getClientWorld().rand.nextDouble() * 0.5, + DraconicEvolution.proxy.getClientWorld(), + message.posX - 0.25 + DraconicEvolution.proxy.getClientWorld().rand.nextDouble() * 0.5, + message.posY + DraconicEvolution.proxy.getClientWorld().rand.nextDouble() * 0.5, + message.posZ - 0.25 + DraconicEvolution.proxy.getClientWorld().rand.nextDouble() * 0.5, 0xff6000, - 0.2F + BrandonsCore.proxy.getClientWorld().rand.nextFloat() * 10f); + 0.2F + DraconicEvolution.proxy.getClientWorld().rand.nextFloat() * 10f); double mm = 2; - particle.motionX = (BrandonsCore.proxy.getClientWorld().rand.nextDouble() - 0.5) * mm; - particle.motionY = (BrandonsCore.proxy.getClientWorld().rand.nextDouble() - 0.5) * mm; - particle.motionZ = (BrandonsCore.proxy.getClientWorld().rand.nextDouble() - 0.5) * mm; + particle.motionX = (DraconicEvolution.proxy.getClientWorld().rand.nextDouble() - 0.5) * mm; + particle.motionY = (DraconicEvolution.proxy.getClientWorld().rand.nextDouble() - 0.5) * mm; + particle.motionZ = (DraconicEvolution.proxy.getClientWorld().rand.nextDouble() - 0.5) * mm; ParticleHandler.spawnCustomParticle(particle, 64); } break; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/ItemConfigPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/ItemConfigPacket.java index 8631bfb3..c574aa0a 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/ItemConfigPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/ItemConfigPacket.java @@ -2,12 +2,12 @@ package com.brandon3055.draconicevolution.common.network; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.lib.References; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import com.brandon3055.brandonscore.common.lib.References; -import com.brandon3055.brandonscore.common.utills.DataUtills; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.ItemConfigField; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/ShieldHitPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/ShieldHitPacket.java index a989a1fc..99356bc9 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/ShieldHitPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/ShieldHitPacket.java @@ -1,10 +1,10 @@ package com.brandon3055.draconicevolution.common.network; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; -import com.brandon3055.brandonscore.common.utills.DataUtills; import com.brandon3055.draconicevolution.client.handler.ClientEventHandler; import cpw.mods.fml.common.network.simpleimpl.IMessage; @@ -48,7 +48,7 @@ public class ShieldHitPacket implements IMessage { Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(message.playerID); if (entity instanceof EntityPlayer) ClientEventHandler.playerShieldStatus.put( (EntityPlayer) entity, - new DataUtills.XZPair(message.shieldPowerF, ClientEventHandler.elapsedTicks)); + new DataUtills.XZPair<>(message.shieldPowerF, ClientEventHandler.elapsedTicks)); return null; } } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/SpeedRequestPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/SpeedRequestPacket.java index 7b47b8c8..278eeee9 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/SpeedRequestPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/SpeedRequestPacket.java @@ -1,6 +1,6 @@ package com.brandon3055.draconicevolution.common.network; -import com.brandon3055.brandonscore.BrandonsCore; +import com.brandon3055.draconicevolution.brandonscore.common.utills.PlayerUtils; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.handler.MinecraftForgeEventHandler; import com.brandon3055.draconicevolution.common.utills.LogHelper; @@ -40,7 +40,7 @@ public class SpeedRequestPacket implements IMessage { public IMessage onMessage(SpeedRequestPacket message, MessageContext ctx) { if (ctx.side == Side.SERVER) { if (ConfigHandler.speedLimitDimList.contains(ctx.getServerHandler().playerEntity.dimension) - || (BrandonsCore.proxy.isOp(ctx.getServerHandler().playerEntity.getCommandSenderName()) + || (PlayerUtils.isOp(ctx.getServerHandler().playerEntity.getCommandSenderName()) && !ConfigHandler.speedLimitops)) return new SpeedRequestPacket(20F); return new SpeedRequestPacket(ConfigHandler.maxPlayerSpeed); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/TeleporterPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/TeleporterPacket.java index 3b93b5f6..df4c3cf2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/TeleporterPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/TeleporterPacket.java @@ -5,9 +5,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Teleporter.TeleportLocation; +import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.ConfigHandler; @@ -34,7 +34,7 @@ public class TeleporterPacket implements IMessage { private int data = 0; private boolean dataB; private byte function = -1; - private TeleportLocation location; + private Teleporter.TeleportLocation location; public TeleporterPacket() {} @@ -44,12 +44,12 @@ public class TeleporterPacket implements IMessage { this.dataB = b; } - public TeleporterPacket(TeleportLocation location, int function) { + public TeleporterPacket(Teleporter.TeleportLocation location, int function) { this.location = location; this.function = (byte) function; } - public TeleporterPacket(TeleportLocation location, int function, int data) { + public TeleporterPacket(Teleporter.TeleportLocation location, int function, int data) { this.data = data; this.location = location; this.function = (byte) function; @@ -96,7 +96,7 @@ public class TeleporterPacket implements IMessage { public void fromBytes(ByteBuf bytes) { function = bytes.readByte(); if (function == ADDDESTINATION || function == UPDATEDESTINATION) { - location = new TeleportLocation(); + location = new Teleporter.TeleportLocation(); location.setXCoord(bytes.readDouble()); location.setYCoord(bytes.readDouble()); location.setZCoord(bytes.readDouble()); @@ -121,7 +121,7 @@ public class TeleporterPacket implements IMessage { } if (function == UPDATENAME) { - location = new TeleportLocation(); + location = new Teleporter.TeleportLocation(); location.setName(ByteBufUtils.readUTF8String(bytes)); data = bytes.readInt(); } @@ -146,7 +146,7 @@ public class TeleporterPacket implements IMessage { if (message.function == ADDDESTINATION) { NBTTagCompound tag = new NBTTagCompound(); message.location.setDimentionName( - BrandonsCore.proxy.getMCServer() + DraconicEvolution.proxy.getMCServer() .worldServerForDimension(message.location.getDimension()).provider.getDimensionName()); message.location.writeToNBT(tag); list.appendTag(tag); @@ -181,7 +181,7 @@ public class TeleporterPacket implements IMessage { if (message.function == UPDATEDESTINATION) { NBTTagCompound tag = list.getCompoundTagAt(message.data); message.location.setDimentionName( - BrandonsCore.proxy.getMCServer() + DraconicEvolution.proxy.getMCServer() .worldServerForDimension(message.location.getDimension()).provider.getDimensionName()); message.location.writeToNBT(tag); list.func_150304_a(message.data, tag); @@ -211,7 +211,7 @@ public class TeleporterPacket implements IMessage { int fuel = ItemNBTHelper.getInteger(teleporter, "Fuel", 0); if (!ctx.getServerHandler().playerEntity.capabilities.isCreativeMode) ItemNBTHelper.setInteger(teleporter, "Fuel", fuel - 1); - TeleportLocation destination = new TeleportLocation(); + Teleporter.TeleportLocation destination = new Teleporter.TeleportLocation(); destination.readFromNBT(list.getCompoundTagAt(message.data)); destination.sendEntityToCoords(ctx.getServerHandler().playerEntity); } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/network/TileObjectPacket.java b/src/main/java/com/brandon3055/draconicevolution/common/network/TileObjectPacket.java index c5ffacb5..7cc6fe59 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/network/TileObjectPacket.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/network/TileObjectPacket.java @@ -1,8 +1,8 @@ package com.brandon3055.draconicevolution.common.network; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; import net.minecraft.client.Minecraft; -import com.brandon3055.brandonscore.common.utills.DataUtills; import com.brandon3055.draconicevolution.common.container.ContainerDataSync; import com.brandon3055.draconicevolution.common.tileentities.TileObjectSync; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileCKeyStone.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileCKeyStone.java index 16890022..420110d1 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileCKeyStone.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileCKeyStone.java @@ -1,5 +1,6 @@ package com.brandon3055.draconicevolution.common.tileentities; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -10,7 +11,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.ModItems; /** diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDissEnchanter.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDissEnchanter.java index 21293e56..4365c3a4 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDissEnchanter.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDissEnchanter.java @@ -17,7 +17,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.ForgeHooks; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; /** * Created by Brandon on 27/06/2014. diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDraconiumChest.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDraconiumChest.java index dcd5ed5f..30f16519 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDraconiumChest.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileDraconiumChest.java @@ -16,7 +16,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.InventoryUtils; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InventoryUtils; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.DraconiumChest; import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java index a49ef899..58ece1ca 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/TileTestBlock.java @@ -2,6 +2,7 @@ package com.brandon3055.draconicevolution.common.tileentities; import static net.minecraftforge.common.util.ForgeDirection.UP; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; @@ -11,7 +12,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyBeam; import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyField; import com.brandon3055.draconicevolution.common.utills.EnergyStorage; @@ -20,7 +20,7 @@ import com.brandon3055.draconicevolution.common.utills.LogHelper; import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyReceiver; -/** +/** todo review * Created by Brandon on 24/06/2014. */ public class TileTestBlock extends TileEntity implements IEnergyHandler { @@ -35,11 +35,6 @@ public class TileTestBlock extends TileEntity implements IEnergyHandler { @Override public void updateEntity() { - // beam = DraconicEvolution.proxy.energyBeam(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 0.5, 4.5, 0.5, - // 100, true, beam); - // ring = DraconicEvolution.proxy.energyField(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, - // ClientEventHandler.elapsedTicks % 100, true, ring); - if (worldObj.isRemote) return; for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { if (worldObj.getTileEntity( @@ -49,57 +44,6 @@ public class TileTestBlock extends TileEntity implements IEnergyHandler { ((IEnergyReceiver) worldObj.getTileEntity(xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ)) .receiveEnergy(d.getOpposite(), Integer.MAX_VALUE, false); } - // LogHelper.info(Integer.MAX_VALUE); - // if (1==1)return; - - // for (Field f : StatList.class.getDeclaredFields()) { - // f.setAccessible(true); - // - // try { - // if (f.getName().equals("oneShotStats")) { - // f.set(null, new HashMap()); - // } - // } - // catch (Exception e) { - // LogHelper.error("Severe error, please report this to the mod author:"); - // LogHelper.error(e); - // } - // } - - // for (Field f : AchievementPage.class.getDeclaredFields()) {// - // f.setAccessible(true); - // - // try { - // if (f.getName().equals("achievementPages")) { - // f.set(null, new LinkedList()); - // } - // } - // catch (Exception e) { - // LogHelper.error("Severe error, please report this to the mod author:"); - // LogHelper.error(e); - // } - // } - - // Achievements.addModAchievements(); - // Achievements.registerAchievementPane(); - - // if (worldObj.isRemote) modelRotation += 0.5; - - // LogHelper.info(modelCoreRotation); - - // int test = 4; - // //if (!worldObj.isRemote) - // //System.out.println(energy.getEnergyStored()); - // - // if ((this.energy.getEnergyStored() > 0)) { - // - // TileEntity tile = worldObj.getTileEntity(xCoord + UP.offsetX, yCoord + UP.offsetY, zCoord + UP.offsetZ); - // - // if ((tile instanceof IEnergyHandler)) { - // this.energy.extractEnergy(((IEnergyHandler)tile).receiveEnergy(UP.getOpposite(), - // this.energy.extractEnergy(maxInput, true), false), false); - // } - // } } @Override diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileRemoteEnergyBase.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileRemoteEnergyBase.java index 8e25d71b..b2ba16cf 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileRemoteEnergyBase.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileRemoteEnergyBase.java @@ -14,10 +14,10 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentTranslation; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.DataUtills; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler; import com.brandon3055.draconicevolution.common.items.tools.Wrench; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileWirelessEnergyTransceiver.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileWirelessEnergyTransceiver.java index 35e99064..7733f701 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileWirelessEnergyTransceiver.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/energynet/TileWirelessEnergyTransceiver.java @@ -10,8 +10,8 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.render.particle.ParticleEnergyField; import com.brandon3055.draconicevolution.client.render.particle.Particles; import com.brandon3055.draconicevolution.common.handler.BalanceConfigHandler; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluidGate.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluidGate.java index ecee21b6..887ab9b4 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluidGate.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluidGate.java @@ -1,5 +1,6 @@ package com.brandon3055.draconicevolution.common.tileentities.gates; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; @@ -7,10 +8,11 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.utills.LogHelper; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 29/6/2015. */ @@ -65,7 +67,7 @@ public class TileFluidGate extends TileGate implements IFluidHandler { @Override public String getFlowSetting(int selector) { - return selector == 0 ? Utills.addCommas(flowRSLow) + " MB/t" : Utills.addCommas(flowRSHigh) + " MB/t"; + return selector == 0 ? formatNumber(flowRSLow) + " MB/t" : formatNumber(flowRSHigh) + " MB/t"; } @Override diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluxGate.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluxGate.java index aff1f2ed..72bf038d 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluxGate.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileFluxGate.java @@ -3,11 +3,12 @@ package com.brandon3055.draconicevolution.common.tileentities.gates; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.lib.References; import cofh.api.energy.IEnergyReceiver; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + /** * Created by Brandon on 29/6/2015. */ @@ -84,7 +85,7 @@ public class TileFluxGate extends TileGate implements IEnergyReceiver { @Override public String getFlowSetting(int selector) { - return selector == 0 ? Utills.addCommas(flowRSLow) + " RF/t" : Utills.addCommas(flowRSHigh) + " RF/t"; + return selector == 0 ? formatNumber(flowRSLow) + " RF/t" : formatNumber(flowRSHigh) + " RF/t"; } @Override diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileGate.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileGate.java index 5642d3b7..acfed751 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileGate.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/gates/TileGate.java @@ -6,7 +6,7 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.tileentities.TileObjectSync; import com.brandon3055.draconicevolution.integration.computers.IDEPeripheral; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileDislocatorReceptacle.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileDislocatorReceptacle.java index ee0b2315..24e1a8a2 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileDislocatorReceptacle.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileDislocatorReceptacle.java @@ -9,7 +9,7 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; -import com.brandon3055.brandonscore.common.utills.Teleporter; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Teleporter; import com.brandon3055.draconicevolution.common.items.tools.TeleporterMKI; import com.brandon3055.draconicevolution.common.utills.PortalHelper; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java index 02610032..d98579f5 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TileEnergyStorageCore.java @@ -1,5 +1,7 @@ package com.brandon3055.draconicevolution.common.tileentities.multiblocktiles; +import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber; + import java.util.ArrayList; import java.util.List; @@ -13,8 +15,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.common.utills.InfoHelper; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.blocks.multiblock.InvisibleMultiblock; import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation; @@ -500,11 +501,11 @@ public class TileEnergyStorageCore extends TileObjectSync { information.add( StatCollector.translateToLocal("info.de.charge.txt") + ": " + InfoHelper.ITC() - + Utills.formatNumber(energy) + + formatNumber(energy) + " / " - + Utills.formatNumber(capacity) + + formatNumber(capacity) + " [" - + Utills.addCommas(energy) + + formatNumber(energy) + " RF]"); return information; } diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TilePortalBlock.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TilePortalBlock.java index 367d9134..d38af1cd 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TilePortalBlock.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/TilePortalBlock.java @@ -1,10 +1,10 @@ package com.brandon3055.draconicevolution.common.tileentities.multiblocktiles; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.client.render.particle.Particles; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosion.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosion.java index 55ee064c..30539bd7 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosion.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosion.java @@ -3,9 +3,9 @@ package com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.re import net.minecraft.util.DamageSource; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.handlers.IProcess; -import com.brandon3055.brandonscore.common.handlers.ProcessHandler; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.IProcess; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.ProcessHandler; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; /** * Created by brandon3055 on 12/8/2015. diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosionTrace.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosionTrace.java index e460dc3c..5e5d9400 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosionTrace.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/ReactorExplosionTrace.java @@ -9,7 +9,7 @@ import net.minecraft.init.Blocks; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.handlers.IProcess; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.IProcess; /** * Created by brandon3055 on 12/8/2015. diff --git a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/TileReactorCore.java b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/TileReactorCore.java index 0c73f2dd..e965dbec 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/TileReactorCore.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/tileentities/multiblocktiles/reactor/TileReactorCore.java @@ -28,10 +28,9 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; -import com.brandon3055.brandonscore.BrandonsCore; -import com.brandon3055.brandonscore.common.handlers.ProcessHandler; -import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.ProcessHandler; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.client.ReactorSound; import com.brandon3055.draconicevolution.client.gui.GuiHandler; import com.brandon3055.draconicevolution.client.render.particle.Particles; @@ -145,7 +144,7 @@ public class TileReactorCore extends TileObjectSync implements IInventory { } private void checkPlayerCollision() { - EntityPlayer player = BrandonsCore.proxy.getClientPlayer(); + EntityPlayer player = DraconicEvolution.proxy.getClientPlayer(); double distance = Utills .getDistanceAtoB(player.posX, player.posY, player.posZ, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5); double coreRadiusWithMargin = getCoreRadius() + 0.5; @@ -650,6 +649,7 @@ public class TileReactorCore extends TileObjectSync implements IInventory { maxFieldCharge = compound.getDouble("maxFieldCharge"); } + // todo review wtf public Object[] callMethod(String methodName, Object... args) { if (args.length > 0) { throw new IllegalArgumentException("This method does not accept arguments"); diff --git a/src/main/java/com/brandon3055/draconicevolution/common/utills/IConfigurableItem.java b/src/main/java/com/brandon3055/draconicevolution/common/utills/IConfigurableItem.java index b927c209..3df0fc30 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/utills/IConfigurableItem.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/utills/IConfigurableItem.java @@ -2,12 +2,11 @@ package com.brandon3055.draconicevolution.common.utills; import java.util.List; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; - /** * Created by Brandon on 29/12/2014. */ diff --git a/src/main/java/com/brandon3055/draconicevolution/common/utills/IUpgradableItem.java b/src/main/java/com/brandon3055/draconicevolution/common/utills/IUpgradableItem.java index fd2aeda3..4bf3ac46 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/utills/IUpgradableItem.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/utills/IUpgradableItem.java @@ -6,7 +6,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.draconicevolution.common.lib.References; import cofh.api.energy.IEnergyContainerItem; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/utills/ItemConfigField.java b/src/main/java/com/brandon3055/draconicevolution/common/utills/ItemConfigField.java index 2e35efe2..2c7ff27f 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/utills/ItemConfigField.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/utills/ItemConfigField.java @@ -4,9 +4,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.util.StringUtils; -import com.brandon3055.brandonscore.common.utills.DataUtills; -import com.brandon3055.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.DraconicEvolution; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.InfoHelper; import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.network.ItemConfigPacket; diff --git a/src/main/java/com/brandon3055/draconicevolution/common/utills/ShapedOreEnergyRecipe.java b/src/main/java/com/brandon3055/draconicevolution/common/utills/ShapedOreEnergyRecipe.java index e902a028..a9063e19 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/utills/ShapedOreEnergyRecipe.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/utills/ShapedOreEnergyRecipe.java @@ -1,13 +1,12 @@ package com.brandon3055.draconicevolution.common.utills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.ItemNBTHelper; import net.minecraft.block.Block; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; -import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; - import cofh.api.energy.IEnergyContainerItem; /** diff --git a/src/main/java/com/brandon3055/draconicevolution/common/world/ChaosWorldGenHandler.java b/src/main/java/com/brandon3055/draconicevolution/common/world/ChaosWorldGenHandler.java index 757d61e5..dd5e3738 100644 --- a/src/main/java/com/brandon3055/draconicevolution/common/world/ChaosWorldGenHandler.java +++ b/src/main/java/com/brandon3055/draconicevolution/common/world/ChaosWorldGenHandler.java @@ -7,10 +7,10 @@ import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.world.World; -import com.brandon3055.brandonscore.common.handlers.IProcess; -import com.brandon3055.brandonscore.common.utills.DataUtills; -import com.brandon3055.brandonscore.common.utills.SimplexNoise; -import com.brandon3055.brandonscore.common.utills.Utills; +import com.brandon3055.draconicevolution.brandonscore.common.handlers.IProcess; +import com.brandon3055.draconicevolution.brandonscore.common.utills.DataUtills; +import com.brandon3055.draconicevolution.brandonscore.common.utills.SimplexNoise; +import com.brandon3055.draconicevolution.brandonscore.common.utills.Utills; import com.brandon3055.draconicevolution.common.ModBlocks; import com.brandon3055.draconicevolution.common.entity.EntityChaosCrystal; import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;