mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-10-26 14:24:14 +00:00
Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43d06e5d9b | ||
|
|
2cf58dd01e | ||
|
|
65a44b0080 | ||
|
|
2d544acf07 | ||
|
|
e8567d198a | ||
|
|
774c31fd07 | ||
|
|
6a6b6b717b | ||
|
|
8111250d48 | ||
|
|
6cfc6d0d3b | ||
|
|
d3816082d4 | ||
|
|
61e1f57705 | ||
|
|
2aa7044536 | ||
|
|
f9043a3efe | ||
|
|
866d69dc60 | ||
|
|
e2c36ad40d | ||
|
|
9b11f36aca | ||
|
|
e874342bc2 | ||
|
|
ea1f64ca6d | ||
|
|
5c1711dcca | ||
|
|
ab75311283 | ||
|
|
26a65a6345 | ||
|
|
6d8b0a0e72 |
No files matched your search
+9
-8
@@ -1,17 +1,18 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:BrandonsCore:1.2.0-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.2:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.12.4-GTNH:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.39-GTNH:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.4.8:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.4:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:OpenComputers:1.12.16-GTNH:api") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.8.58-GTNH:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.4.10:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.7.1:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.117:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.8.9: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.246:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.6:dev") {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Backhand:1.8.2:dev") {transitive = false}
|
||||
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false}
|
||||
compileOnly("curse.maven:computercraft-67504:2269339") {transitive = false}
|
||||
|
||||
+30
-3
@@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||
developmentEnvironmentUserName = Developer
|
||||
|
||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
||||
# See https://github.com/bsideup/jabel for details on how this works.
|
||||
enableModernJavaSyntax = true
|
||||
# Enables modern Java syntax support. Valid values:
|
||||
# - false: No modern syntax, Java 8 only
|
||||
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||
# - modern: Native modern Java bytecode, no downgrading
|
||||
enableModernJavaSyntax = jabel
|
||||
|
||||
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||
# and should *not* be used in most situations. -1 disables this.
|
||||
# forceToolchainVersion = -1
|
||||
|
||||
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||
# downgradeTargetVersion = 8
|
||||
|
||||
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||
|
||||
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||
# - shade: Shade minimized stubs into the jar
|
||||
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||
# - (empty): Warning reminding you to configure stubs
|
||||
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||
# jvmDowngraderStubsProvider =
|
||||
|
||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||
@@ -209,3 +233,6 @@ customArchiveBaseName = Draconic-Evolution
|
||||
# This is meant to be set in $HOME/.gradle/gradle.properties.
|
||||
# ideaCheckSpotlessOnBuild = true
|
||||
|
||||
# Non-GTNH properties
|
||||
org.gradle.configuration-cache = true
|
||||
org.gradle.parallel = true
|
||||
@@ -0,0 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/4945f00643ec68e7c7a6b66f90124f89/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/99a42fd36e2e41c7c8ed49f423f49fdf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.18'
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.brandon3055.draconicevolution.client.creativetab.DETab;
|
||||
import com.brandon3055.draconicevolution.common.CommonProxy;
|
||||
import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
@@ -23,15 +23,14 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
version = References.VERSION,
|
||||
canBeDeactivated = false,
|
||||
guiFactory = References.GUIFACTORY,
|
||||
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;"
|
||||
+ "after:ThermalFoundation;"
|
||||
+ "required-after:BrandonsCore@[1.0.0.11,);")
|
||||
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;" + "after:ThermalFoundation;")
|
||||
public class DraconicEvolution {
|
||||
|
||||
@Mod.Instance(References.MODID)
|
||||
public static DraconicEvolution instance;
|
||||
|
||||
@SidedProxy(clientSide = References.CLIENTPROXYLOCATION, serverSide = References.SERVERPROXYLOCATION)
|
||||
@SidedProxy(
|
||||
clientSide = "com.brandon3055.draconicevolution.client.ClientProxy",
|
||||
serverSide = "com.brandon3055.draconicevolution.common.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public static CreativeTabs tabToolsWeapons = new DETab(
|
||||
|
||||
@@ -4,7 +4,7 @@ import java.util.Random;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.brandonscore.common.utills.DataUtills;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
|
||||
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
||||
import com.brandon3055.draconicevolution.common.world.WorldGenEnderComet;
|
||||
@@ -43,12 +43,8 @@ public class GeneratorOverride {
|
||||
*/
|
||||
public static void generateChaosChunk(World world, int chunkX, int chunkZ, int centerX, int centerZ,
|
||||
Random random) {
|
||||
ChaosWorldGenHandler.generateChunk(
|
||||
world,
|
||||
chunkX,
|
||||
chunkZ,
|
||||
new DataUtills.XZPair<Integer, Integer>(centerX, centerZ),
|
||||
random);
|
||||
ChaosWorldGenHandler
|
||||
.generateChunk(world, chunkX, chunkZ, new DataUtils.XZPair<Integer, Integer>(centerX, centerZ), random);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,9 @@ import static com.brandon3055.draconicevolution.integration.nei.IMCForNEI.IMCSen
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.ISound;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
@@ -114,54 +116,6 @@ public class ClientProxy extends CommonProxy {
|
||||
super.preInit(event);
|
||||
|
||||
ResourceHandler.init(event);
|
||||
|
||||
// downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() +
|
||||
// "/mods/derspack";
|
||||
// downloadLocation = downloadLocation.replaceAll("\\\\", "/");
|
||||
//
|
||||
// File rescourcePack = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/derspack");
|
||||
//
|
||||
//
|
||||
// //File file = new File(downloadLocation);
|
||||
// if (!rescourcePack.exists()) rescourcePack.mkdir();
|
||||
//
|
||||
// LogHelper.info("Downloading Images");
|
||||
//
|
||||
// try {
|
||||
// URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg");
|
||||
// String fileName = url.getFile();
|
||||
// //String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/"));
|
||||
// File dll = new File(rescourcePack, fileName.substring(fileName.lastIndexOf("/")));
|
||||
//
|
||||
// InputStream is = url.openStream();
|
||||
// OutputStream os = new FileOutputStream(dll);
|
||||
//
|
||||
// ByteStreams.copy(is, os);
|
||||
//
|
||||
// is.close();
|
||||
// os.close();
|
||||
// }catch (IOException e){
|
||||
// LogHelper.info(e);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// List defaultResourcePacks = Lists.newArrayList();
|
||||
// Field f = ReflectionHelper.findField(Minecraft.class, "defaultResourcePacks", "field_110449_ao");
|
||||
// f.setAccessible(true);
|
||||
// try {
|
||||
// defaultResourcePacks = (List)f.get(Minecraft.getMinecraft());
|
||||
// defaultResourcePacks.add(new FolderResourcePack(rescourcePack));
|
||||
// for (Object o : defaultResourcePacks){
|
||||
// if (o instanceof FolderResourcePack) LogHelper.info(((FolderResourcePack) o).getPackName());
|
||||
// if (o instanceof FileResourcePack) LogHelper.info(((FileResourcePack)o).getPackName());
|
||||
// }
|
||||
//
|
||||
// f.set(Minecraft.getMinecraft(), defaultResourcePacks);
|
||||
// }
|
||||
// catch (IllegalAccessException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -390,10 +344,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)
|
||||
@@ -405,4 +355,39 @@ public class ClientProxy extends CommonProxy {
|
||||
FMLClientHandler.instance().getClient().getSoundHandler().playSound(sound);
|
||||
return sound;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
@@ -5,9 +5,9 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerTemplate;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileContainerTemplate;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIContainerTemplate extends GuiContainer {
|
||||
|
||||
public EntityPlayer player;
|
||||
private TileContainerTemplate tile;
|
||||
|
||||
public GUIContainerTemplate(InventoryPlayer invPlayer, TileContainerTemplate tile) {
|
||||
super(new ContainerTemplate(invPlayer, tile));
|
||||
|
||||
xSize = 176;
|
||||
ySize = 140;
|
||||
|
||||
this.tile = tile;
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
|
||||
// bindTexture(texture);
|
||||
|
||||
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
super.updateScreen();
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@ 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.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -14,7 +16,7 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
|
||||
@@ -118,10 +120,9 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt"));
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ tile.energy.getEnergyStored()
|
||||
EnumChatFormatting.DARK_BLUE + formatNumber(tile.energy.getEnergyStored())
|
||||
+ "/"
|
||||
+ tile.energy.getMaxEnergyStored());
|
||||
+ formatNumber(tile.energy.getMaxEnergyStored()));
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
GL11.glPopAttrib();
|
||||
@@ -134,10 +135,9 @@ public class GUIEnergyInfuser extends GuiContainer {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add(StatCollector.translateToLocal("gui.de.itemStorage.txt"));
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ item.getEnergyStored(tile.getStackInSlot(0))
|
||||
EnumChatFormatting.DARK_BLUE + formatNumber(item.getEnergyStored(tile.getStackInSlot(0)))
|
||||
+ "/"
|
||||
+ item.getMaxEnergyStored(tile.getStackInSlot(0)));
|
||||
+ formatNumber(item.getMaxEnergyStored(tile.getStackInSlot(0))));
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
GL11.glPopAttrib();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -10,9 +12,8 @@ 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.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
|
||||
|
||||
/**
|
||||
@@ -87,7 +88,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) {
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
|
||||
@@ -73,46 +75,30 @@ public class GUIGenerator extends GuiContainer {
|
||||
18,
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
|
||||
fontRendererObj.drawStringWithShadow("Generator", guiLeft + 64, guiTop + 0, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow(
|
||||
StatCollector.translateToLocal("tile.draconicevolution:generator.name"),
|
||||
guiLeft + 64,
|
||||
guiTop,
|
||||
0x00FFFF);
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
if (GuiHelper.isInRect(83, 10, 12, 40, x, y)) {
|
||||
ArrayList<String> internal = new ArrayList<String>();
|
||||
internal.add("Internal Storage");
|
||||
internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt"));
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ tile.getEnergyStored(ForgeDirection.UP)
|
||||
EnumChatFormatting.DARK_BLUE + formatNumber(tile.getEnergyStored(ForgeDirection.UP))
|
||||
+ "/"
|
||||
+ tile.getMaxEnergyStored(ForgeDirection.UP));
|
||||
+ formatNumber(tile.getMaxEnergyStored(ForgeDirection.UP)));
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int X, int Y) {
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
/*
|
||||
* if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) { ArrayList<String> internal = new ArrayList<String>();
|
||||
* internal.add("Internal Storage"); internal.add("" + EnumChatFormatting.DARK_BLUE +
|
||||
* tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
|
||||
* drawHoveringText(internal, x, y, fontRendererObj); }
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
// ID
|
||||
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
guiUpdateTick++;
|
||||
@@ -123,6 +109,4 @@ public class GUIGenerator extends GuiContainer {
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
// ####Draw at############ read from size
|
||||
// drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.brandon3055.draconicevolution.client.gui;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@@ -13,7 +14,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
@@ -69,7 +70,7 @@ public class GUIGrinder extends GuiContainer {
|
||||
guiLeft + 83,
|
||||
guiTop + 11 + (int) (power * 40),
|
||||
xSize,
|
||||
0 + (int) (power * 40),
|
||||
(int) (power * 40),
|
||||
12,
|
||||
40 - (int) (power * 40)); // Power bar
|
||||
drawTexturedModalRect(
|
||||
@@ -81,7 +82,7 @@ public class GUIGrinder extends GuiContainer {
|
||||
18 - (int) (fuel * 13)); // Power bar
|
||||
if (tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 100, guiTop + 37, xSize, 66, 13, 13);
|
||||
|
||||
fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop + 0, 0x00FFFF);
|
||||
fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop, 0x00FFFF);
|
||||
|
||||
int x = X - guiLeft;
|
||||
int y = Y - guiTop;
|
||||
@@ -91,39 +92,25 @@ public class GUIGrinder extends GuiContainer {
|
||||
if (tile.isExternallyPowered()) {
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ tile.getEnergyStored(ForgeDirection.UP)
|
||||
+ formatNumber(tile.getEnergyStored(ForgeDirection.UP))
|
||||
+ "/"
|
||||
+ tile.getMaxEnergyStored(ForgeDirection.UP));
|
||||
+ formatNumber(tile.getMaxEnergyStored(ForgeDirection.UP)));
|
||||
} else {
|
||||
internal.add(
|
||||
"" + EnumChatFormatting.DARK_BLUE
|
||||
+ tile.getInternalBuffer().getEnergyStored()
|
||||
+ formatNumber(tile.getInternalBuffer().getEnergyStored())
|
||||
+ "/"
|
||||
+ tile.getInternalBuffer().getMaxEnergyStored());
|
||||
+ formatNumber(tile.getInternalBuffer().getMaxEnergyStored()));
|
||||
}
|
||||
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
// ID
|
||||
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
guiUpdateTick++;
|
||||
@@ -134,6 +121,4 @@ public class GUIGrinder extends GuiContainer {
|
||||
super.updateScreen();
|
||||
}
|
||||
|
||||
// ####Draw at############ read from size
|
||||
// drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
|
||||
}
|
||||
@@ -20,14 +20,14 @@ 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.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Teleporter;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -43,7 +43,7 @@ public class GUITeleporter extends GuiScreen {
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/gui/TeleporterMKII.png");
|
||||
private ItemStack teleporterItem;
|
||||
protected List<TeleportLocation> locations = new ArrayList<TeleportLocation>(0);
|
||||
protected List<Teleporter.TeleportLocation> 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]");
|
||||
}
|
||||
}
|
||||
@@ -15,13 +15,13 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.brandonscore.client.utills.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem.EnumUpgrade;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem.EnumUpgrade;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -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.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
|
||||
/**
|
||||
|
||||
+10
-10
@@ -25,23 +25,23 @@ 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.client.gui.guicomponents.ComponentContributorsPage;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentIndexButton;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.ClientUtils;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTextureButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.container.DummyContainer;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
||||
/**
|
||||
@@ -547,7 +547,7 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
|
||||
|
||||
@Override
|
||||
public void confirmClicked(boolean confirmed, int id) {
|
||||
if (confirmed) ClientUtills.openLink("https://www.patreon.com/brandon3055");
|
||||
if (confirmed) ClientUtils.openLink("https://www.patreon.com/brandon3055");
|
||||
mc.displayGuiScreen(this);
|
||||
}
|
||||
}
|
||||
+21
-22
@@ -1,5 +1,7 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,18 +13,18 @@ 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.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTextureButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
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 com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/7/2015.
|
||||
@@ -182,24 +184,24 @@ public class GUIReactor extends GUIBase {
|
||||
} else if (GuiHelper.isInRect(33, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
|
||||
text.add(StatCollector.translateToLocal("gui.de.fieldStrength.txt"));
|
||||
if (core.maxFieldCharge > 0) {
|
||||
text.add(Utills.round(core.fieldCharge / core.maxFieldCharge * 100D, 100D) + "%");
|
||||
text.add(Utils.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"));
|
||||
if (core.maxEnergySaturation > 0) {
|
||||
text.add(
|
||||
Utills.round((double) core.energySaturation / (double) core.maxEnergySaturation * 100D, 100D)
|
||||
Utils.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"));
|
||||
if (core.reactorFuel + core.convertedFuel > 0) {
|
||||
text.add(
|
||||
Utills.round(
|
||||
Utils.round(
|
||||
((double) core.convertedFuel + core.conversionUnit)
|
||||
/ ((double) core.convertedFuel + (double) core.reactorFuel)
|
||||
* 100D,
|
||||
@@ -207,7 +209,7 @@ public class GUIReactor extends GUIBase {
|
||||
}
|
||||
text.add(core.convertedFuel + " / " + (core.convertedFuel + core.reactorFuel));
|
||||
text.add(
|
||||
"Full: " + (Utills.round(
|
||||
"Full: " + (Utils.round(
|
||||
(float) (core.convertedFuel + core.reactorFuel) / ConfigHandler.reactorFuelStorage * 100,
|
||||
1000)) + "%");
|
||||
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
|
||||
@@ -251,26 +253,23 @@ public class GUIReactor extends GUIBase {
|
||||
private void drawStatistics() {
|
||||
double inputRate = core.fieldDrain / (1D - (core.fieldCharge / core.maxFieldCharge));
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.tempLoad.name"), 55, 16, 0x0000FF);
|
||||
fontRendererObj.drawString(Utills.round(core.tempDrainFactor * 100D, 1D) + "%", 60, 2 + 24, 0);
|
||||
fontRendererObj.drawString(Utils.round(core.tempDrainFactor * 100D, 1D) + "%", 60, 2 + 24, 0);
|
||||
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.mass.name"), 55, 16 + 24, 0x0000FF);
|
||||
fontRendererObj.drawString(
|
||||
Utills.round((core.reactorFuel + core.convertedFuel) / 1296D, 100) + "m^3",
|
||||
Utils.round((core.reactorFuel + core.convertedFuel) / 1296D, 100) + "m^3",
|
||||
60,
|
||||
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",
|
||||
60,
|
||||
2 + 5 * 24,
|
||||
0);
|
||||
fontRendererObj
|
||||
.drawString(formatNumber((int) Math.round(core.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 24, 0);
|
||||
}
|
||||
|
||||
private void drawStatus() {
|
||||
|
||||
+14
-13
@@ -1,5 +1,7 @@
|
||||
package com.brandon3055.draconicevolution.client.gui.componentguis;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,29 +13,28 @@ 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.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentConfigItemButton;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldAdjuster;
|
||||
import com.brandon3055.draconicevolution.client.gui.guicomponents.ComponentFieldButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentItemRenderer;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTextField;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 26/12/2014.
|
||||
@@ -325,7 +326,7 @@ public class GUIToolConfig extends GUIBase {
|
||||
List<String> list = new ArrayList<String>();
|
||||
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));
|
||||
|
||||
+6
-6
@@ -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.client.utils.guicomponents.ComponentButton;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentCollection;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentItemRenderer;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentSlotBackground;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentTexturedRect;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIBase;
|
||||
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 7/03/2015.
|
||||
|
||||
+4
-4
@@ -9,11 +9,11 @@ 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.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 29/12/2014.
|
||||
|
||||
+5
-5
@@ -17,13 +17,13 @@ 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.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.ClientUtils;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ContributorHandler.Contributor;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 5/11/2015.
|
||||
@@ -188,7 +188,7 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
|
||||
@Override
|
||||
public void confirmClicked(boolean confirmed, int button) {
|
||||
mc.displayGuiScreen(this.gui);
|
||||
if (confirmed) ClientUtills.openLink(lastClickURL);
|
||||
if (confirmed) ClientUtils.openLink(lastClickURL);
|
||||
}
|
||||
|
||||
private static ModelBiped modelBiped = new ModelBiped(0.0265F);
|
||||
|
||||
+6
-6
@@ -6,13 +6,13 @@ 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.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 1/01/2015.
|
||||
@@ -212,7 +212,7 @@ public class ComponentFieldAdjuster extends ComponentBase {
|
||||
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem) {
|
||||
DataUtills.writeObjectToCompound(
|
||||
DataUtils.writeObjectToCompound(
|
||||
IConfigurableItem.ProfileHelper.getProfileCompound(stack),
|
||||
field.value,
|
||||
field.datatype,
|
||||
|
||||
+5
-5
@@ -9,12 +9,12 @@ 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.client.gui.componentguis.GUIToolConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentBase;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemConfigField;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 31/12/2014.
|
||||
@@ -96,7 +96,7 @@ public class ComponentFieldButton extends ComponentBase {
|
||||
field.sendChanges();
|
||||
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
|
||||
if (stack != null && stack.getItem() instanceof IConfigurableItem) {
|
||||
DataUtills.writeObjectToCompound(
|
||||
DataUtils.writeObjectToCompound(
|
||||
IConfigurableItem.ProfileHelper.getProfileCompound(stack),
|
||||
field.value,
|
||||
field.datatype,
|
||||
|
||||
+4
-4
@@ -6,11 +6,11 @@ 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.client.gui.componentguis.ManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 7/03/2015.
|
||||
@@ -23,7 +23,7 @@ public class ComponentIndexButton extends ComponentScrollingBase {
|
||||
public ComponentIndexButton(int x, int y, GUIScrollingBase gui, ManualPage page) {
|
||||
super(x, y, gui);
|
||||
this.page = page;
|
||||
stack = Utills.getStackFromName(page.name, page.meta);
|
||||
stack = Utils.getStackFromName(page.name, page.meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+8
-8
@@ -21,14 +21,14 @@ 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.client.gui.componentguis.ManualPage;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.client.utils.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.ComponentScrollingBase;
|
||||
import com.brandon3055.draconicevolution.client.utils.guicomponents.GUIScrollingBase;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 19/03/2015.
|
||||
@@ -48,7 +48,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
super(x, y, gui);
|
||||
this.page = page;
|
||||
pageLength = 25;
|
||||
stack = Utills.getStackFromName(page.name, page.meta);
|
||||
stack = Utils.getStackFromName(page.name, page.meta);
|
||||
ContentComponent title = new ContentComponent("title." + page.getLocalizedName(), pageLength, this);
|
||||
pageLength += title.getHeight();
|
||||
contentList.add(title);
|
||||
@@ -157,7 +157,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
|
||||
} else if (type == 2) {
|
||||
String s = content.substring(content.indexOf("[c]") + 3);
|
||||
String name = s.substring(0, s.lastIndexOf(":"));
|
||||
ItemStack stack = Utills.getStackFromName(name, Integer.parseInt(s.substring(s.lastIndexOf(":") + 1)));
|
||||
ItemStack stack = Utils.getStackFromName(name, Integer.parseInt(s.substring(s.lastIndexOf(":") + 1)));
|
||||
result = stack;
|
||||
|
||||
if (stack != null) {
|
||||
|
||||
+6
-6
@@ -20,7 +20,6 @@ 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.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
@@ -32,7 +31,8 @@ import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.DraconicBow;
|
||||
import com.brandon3055.draconicevolution.common.items.weapons.WyvernBow;
|
||||
import com.brandon3055.draconicevolution.common.network.MountUpdatePacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -45,7 +45,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
*/
|
||||
public class ClientEventHandler {
|
||||
|
||||
public static Map<EntityPlayer, XZPair<Float, Integer>> playerShieldStatus = new HashMap<EntityPlayer, XZPair<Float, Integer>>();
|
||||
public static Map<EntityPlayer, DataUtils.XZPair<Float, Integer>> 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<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = playerShieldStatus.entrySet().iterator(); i
|
||||
.hasNext();) {
|
||||
Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next();
|
||||
for (Iterator<Map.Entry<EntityPlayer, DataUtils.XZPair<Float, Integer>>> i = playerShieldStatus.entrySet()
|
||||
.iterator(); i.hasNext();) {
|
||||
Map.Entry<EntityPlayer, DataUtils.XZPair<Float, Integer>> entry = i.next();
|
||||
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
|
||||
}
|
||||
|
||||
|
||||
@@ -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,13 +16,12 @@ 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.client.gui.GuiHudConfig;
|
||||
import com.brandon3055.draconicevolution.client.utils.GuiHelper;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayItem;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -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
|
||||
|
||||
@@ -26,9 +26,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual;
|
||||
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.client.utils.CustomResourceLocation;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
|
||||
|
||||
+3
-3
@@ -13,7 +13,6 @@ 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.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.Magnet;
|
||||
@@ -23,8 +22,9 @@ import com.brandon3055.draconicevolution.common.network.MagnetTogglePacket;
|
||||
import com.brandon3055.draconicevolution.common.network.MagnetToggleSelfPickupPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.PlacedItemPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.InventoryUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.IConfigurableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.InventoryUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
+19
-1
@@ -3,6 +3,7 @@ package com.brandon3055.draconicevolution.client.model;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
|
||||
@@ -173,7 +174,14 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
bipedRightLeg.rotateAngleZ = 0F;
|
||||
|
||||
setRotationAngles(0, 0, 0, 0, 0, 0, null);
|
||||
} else super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
} else {
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
if (entity instanceof EntityPlayer) {
|
||||
if (cpw.mods.fml.common.Loader.isModLoaded("backhand")) {
|
||||
BackhandHelper.applyFix(this, (EntityPlayer) entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.bipedHead.render(1F / 13F);
|
||||
this.bipedRightArm.render(1F / 15F);
|
||||
@@ -205,4 +213,14 @@ public class ModelDraconicArmor extends ModelBiped {
|
||||
this.bipedRightArm.rotateAngleZ = 0.0F;
|
||||
this.bipedLeftArm.rotateAngleZ = 0.0F;
|
||||
}
|
||||
|
||||
private static class BackhandHelper {
|
||||
|
||||
public static void applyFix(ModelDraconicArmor model, EntityPlayer player) {
|
||||
if (xonin.backhand.api.core.BackhandUtils.getOffhandItem(player) != null) {
|
||||
model.bipedLeftArm.rotateAngleX = model.bipedLeftArm.rotateAngleX * 0.5F - ((float) Math.PI / 10F);
|
||||
model.bipedLeftArm.rotateAngleY = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.utills.ICustomItemData;
|
||||
import com.brandon3055.draconicevolution.common.utils.ICustomItemData;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 16/11/2014.
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 17/8/2015.
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
public class RenderMobSoul implements IItemRenderer {
|
||||
|
||||
|
||||
+2
-3
@@ -10,10 +10,10 @@ import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.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;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 8/02/2015.
|
||||
@@ -83,14 +83,13 @@ public class ParticleEnergyBeam extends EntityFX {
|
||||
this.tZ = tZ;
|
||||
|
||||
if (offsetMode > 0) {
|
||||
double dist = Utills.getDistanceAtoB(x, z, tX, tZ);
|
||||
double dist = Utils.getDistanceAtoB(x, z, tX, tZ);
|
||||
if (dist == 0) dist = 0.1;
|
||||
double xDist = x - tX;
|
||||
double zDist = z - tZ;
|
||||
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);
|
||||
|
||||
+9
-9
@@ -11,10 +11,10 @@ import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.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;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -710,8 +710,8 @@ public class Particles {
|
||||
// super.onUpdate();
|
||||
if (particleAge >= particleMaxAge || this.getDistanceSq(targetX, targetY, targetZ) < 0.05) setDead();
|
||||
|
||||
double d1 = Utills.getDistanceAtoB(startX, startY, startZ, targetX, targetY, targetZ);
|
||||
double d2 = Utills.getDistanceAtoB(posX, posY, posZ, targetX, targetY, targetZ);
|
||||
double d1 = Utils.getDistanceAtoB(startX, startY, startZ, targetX, targetY, targetZ);
|
||||
double d2 = Utils.getDistanceAtoB(posX, posY, posZ, targetX, targetY, targetZ);
|
||||
particleScale = ((float) (d2 / d1)) * baseScale;
|
||||
|
||||
particleAge++;
|
||||
@@ -1198,16 +1198,16 @@ public class Particles {
|
||||
prevPosZ = posZ;
|
||||
|
||||
if (mode == 0) {
|
||||
if (Utills.getDistanceAtoB(posX, posY, posZ, focalX, focalY, focalZ) < 0.2 && particleAge > 5) mode = 1;
|
||||
double d = Utills.getDistanceAtoB(focalX, focalY, focalZ, shardX, shardY, shardZ);
|
||||
if (Utils.getDistanceAtoB(posX, posY, posZ, focalX, focalY, focalZ) < 0.2 && particleAge > 5) mode = 1;
|
||||
double d = Utils.getDistanceAtoB(focalX, focalY, focalZ, shardX, shardY, shardZ);
|
||||
float motionMod = 0.1F;
|
||||
motionX += (focalX - posX) / d * motionMod;
|
||||
motionY += (focalY - posY) / d * motionMod;
|
||||
motionZ += (focalZ - posZ) / d * motionMod;
|
||||
}
|
||||
if (mode == 1) {
|
||||
if (Utills.getDistanceAtoB(posX, posY, posZ, shardX, shardY, shardZ) < 1) setDead();
|
||||
double d = Utills.getDistanceAtoB(focalX, focalY, focalZ, shardX, shardY, shardZ);
|
||||
if (Utils.getDistanceAtoB(posX, posY, posZ, shardX, shardY, shardZ) < 1) setDead();
|
||||
double d = Utils.getDistanceAtoB(focalX, focalY, focalZ, shardX, shardY, shardZ);
|
||||
particleScale = 1F - (float) d * 0.01F;
|
||||
float motionMod = 1F;
|
||||
motionX = (shardX - focalX) / d * motionMod;
|
||||
@@ -1216,8 +1216,8 @@ public class Particles {
|
||||
}
|
||||
|
||||
if (mode == 10) {
|
||||
if (Utills.getDistanceAtoB(posX, posY, posZ, shardX, shardY, shardZ) < 0.3) setDead();
|
||||
double d = Utills.getDistanceAtoB(focalX, focalY, focalZ, shardX, shardY, shardZ);
|
||||
if (Utils.getDistanceAtoB(posX, posY, posZ, shardX, shardY, shardZ) < 0.3) setDead();
|
||||
double d = Utils.getDistanceAtoB(focalX, focalY, focalZ, shardX, shardY, shardZ);
|
||||
float motionMod = 0.4F;
|
||||
motionX = (shardX - focalX) / d * motionMod;
|
||||
motionY = (shardY - focalY) / d * motionMod;
|
||||
|
||||
+3
-3
@@ -20,13 +20,13 @@ 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.client.model.ModelTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.TeleporterMKII;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 25/10/2014.
|
||||
@@ -136,7 +136,7 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
|
||||
double pitchAngle = Math.toDegrees(
|
||||
Math.atan2(
|
||||
yDiff,
|
||||
Utills.getDistanceAtoB(
|
||||
Utils.getDistanceAtoB(
|
||||
player.posX,
|
||||
player.posY,
|
||||
player.posZ,
|
||||
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.client.render.tile;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileTestBlock;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 24/07/2014.
|
||||
*/
|
||||
public class RenderTileTestBlock extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final ResourceLocation iner_model_texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/models/power_sphere_layer_1.png");
|
||||
private static final ResourceLocation outer_model_texture = new ResourceLocation(
|
||||
References.MODID.toLowerCase(),
|
||||
"textures/models/power_sphere_layer_2.png");
|
||||
private IModelCustom iner_model;
|
||||
private IModelCustom outer_model;
|
||||
|
||||
public RenderTileTestBlock() {
|
||||
iner_model = AdvancedModelLoader
|
||||
.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
|
||||
// outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(),
|
||||
// "models/power_sphere_layer_2.obj"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float var8) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 100, (float) 100);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
// GL11.glDepthMask(false);
|
||||
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
|
||||
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(((TileTestBlock) var1).modelRotation, 0F, 1F, 0.5F);
|
||||
// GL11.glColor4f(2F, 2F, 2F, 1F);
|
||||
iner_model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glScalef(1.1F, 1.1F, 1.1F);
|
||||
GL11.glDepthMask(false);
|
||||
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(outer_model_texture);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glRotatef(((TileTestBlock) var1).modelRotation * 0.5F, 0F, -1F, -0.5F);
|
||||
GL11.glColor4f(0.5F, 2F, 2F, 0.7F);
|
||||
outer_model.renderAll();
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.brandon3055.draconicevolution.client.utils;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 11/11/2015.
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientUtils {
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.brandon3055.draconicevolution.client.utill;
|
||||
package com.brandon3055.draconicevolution.client.utils;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.brandon3055.draconicevolution.client.utils;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
+224
@@ -0,0 +1,224 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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) {}
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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<String> list = new ArrayList<String>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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<ComponentBase> components = new ArrayList<ComponentBase>();
|
||||
protected int xSize;
|
||||
protected int ySize;
|
||||
protected List<String> deadGroups = new ArrayList<String>();
|
||||
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<ComponentBase> 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<ComponentBase> list = new ArrayList<ComponentBase>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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;
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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;
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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();
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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) {}
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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) {}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package com.brandon3055.draconicevolution.client.utils.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);
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
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;
|
||||
@@ -58,7 +60,6 @@ import com.brandon3055.draconicevolution.common.network.TileObjectPacket;
|
||||
import com.brandon3055.draconicevolution.common.network.ToolModePacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCKeyStone;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileContainerTemplate;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
|
||||
@@ -73,7 +74,6 @@ import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorA
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TilePotentiometer;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileSunDial;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileTestBlock;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileWeatherController;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
|
||||
@@ -91,8 +91,10 @@ import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.Til
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorEnergyInjector;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer;
|
||||
import com.brandon3055.draconicevolution.common.utills.DragonChunkLoader;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.DragonChunkLoader;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.FileHandler;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.ProcessHandler;
|
||||
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
|
||||
import com.brandon3055.draconicevolution.integration.computers.CCOCIntegration;
|
||||
|
||||
@@ -108,6 +110,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 +123,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");
|
||||
@@ -232,10 +213,6 @@ public class CommonProxy {
|
||||
GameRegistry.registerTileEntity(TileChaosShard.class, References.RESOURCESPREFIX + "TileChaosShard");
|
||||
GameRegistry.registerTileEntity(TileUpgradeModifier.class, References.RESOURCESPREFIX + "TileEnhancementModifier");
|
||||
GameRegistry.registerTileEntity(TileDislocatorInhibitor.class, References.RESOURCESPREFIX + "TileDislocatorInhibitor");
|
||||
if (DraconicEvolution.debug) {
|
||||
GameRegistry.registerTileEntity(TileTestBlock.class, References.RESOURCESPREFIX + "TileTestBlock");
|
||||
GameRegistry.registerTileEntity(TileContainerTemplate.class, References.RESOURCESPREFIX + "TileContainerTemplate");
|
||||
}
|
||||
// spotless:on
|
||||
}
|
||||
|
||||
@@ -281,7 +258,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 +287,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;
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.blocks.BlockContainerTemplate;
|
||||
import com.brandon3055.draconicevolution.common.blocks.BlockDE;
|
||||
import com.brandon3055.draconicevolution.common.blocks.CKeyStone;
|
||||
import com.brandon3055.draconicevolution.common.blocks.ChaosCrystal;
|
||||
@@ -22,7 +20,6 @@ import com.brandon3055.draconicevolution.common.blocks.Potentiometer;
|
||||
import com.brandon3055.draconicevolution.common.blocks.RainSensor;
|
||||
import com.brandon3055.draconicevolution.common.blocks.SafetyFlame;
|
||||
import com.brandon3055.draconicevolution.common.blocks.TeleporterStand;
|
||||
import com.brandon3055.draconicevolution.common.blocks.TestBlock;
|
||||
import com.brandon3055.draconicevolution.common.blocks.XRayBlock;
|
||||
import com.brandon3055.draconicevolution.common.blocks.machine.DislocatorInhibitor;
|
||||
import com.brandon3055.draconicevolution.common.blocks.machine.DissEnchanter;
|
||||
@@ -58,7 +55,6 @@ public class ModBlocks {
|
||||
public static BlockDE weatherController;
|
||||
public static BlockDE sunDial;
|
||||
public static BlockDE draconiumOre;
|
||||
public static BlockDE testBlock;
|
||||
public static BlockDE grinder;
|
||||
public static BlockDE potentiometer;
|
||||
public static BlockDE rainSensor;
|
||||
@@ -141,11 +137,6 @@ public class ModBlocks {
|
||||
|
||||
if (isEnabled(chaosShardAtmos)) GameRegistry.registerBlock(chaosShardAtmos, "chaosShardAtmos");
|
||||
|
||||
if (DraconicEvolution.debug) {
|
||||
testBlock = new TestBlock();
|
||||
containerTemplate = new BlockContainerTemplate();
|
||||
}
|
||||
|
||||
resurrectionStone = new ItemStack(ModBlocks.draconiumBlock, 1, 1);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,9 +9,9 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.common.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.client.gui.GuiHandler;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileContainerTemplate;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 27/06/2014.
|
||||
*/
|
||||
public class BlockContainerTemplate extends BlockContainerDE {
|
||||
|
||||
public BlockContainerTemplate() {
|
||||
super(Material.iron);
|
||||
this.setBlockName(Strings.containerTemplateName);
|
||||
this.setCreativeTab(DraconicEvolution.tabBlocksItems);
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setHardness(1f);
|
||||
this.setResistance(200.0f);
|
||||
ModBlocks.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "machine_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileContainerTemplate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float prx,
|
||||
float pry, float prz) {
|
||||
if (!world.isRemote) {
|
||||
FMLNetworkHandler
|
||||
.openGui(player, DraconicEvolution.instance, GuiHandler.GUIID_CONTAINER_TEMPLATE, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return super.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te != null && te instanceof IInventory) {
|
||||
IInventory inventory = (IInventory) te;
|
||||
|
||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
|
||||
if (stack != null) {
|
||||
float spawnX = x + world.rand.nextFloat();
|
||||
float spawnY = y + world.rand.nextFloat();
|
||||
float spawnZ = z + world.rand.nextFloat();
|
||||
|
||||
EntityItem droppedItem = new EntityItem(world, spawnX, spawnY, spawnZ, stack);
|
||||
|
||||
float multiplier = 0.05F;
|
||||
|
||||
droppedItem.motionX = (-0.5F + world.rand.nextFloat()) * multiplier;
|
||||
droppedItem.motionY = (4 + world.rand.nextFloat()) * multiplier;
|
||||
droppedItem.motionZ = (-0.5F + world.rand.nextFloat()) * multiplier;
|
||||
|
||||
world.spawnEntityInWorld(droppedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
}
|
||||
@@ -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.common.utils.InventoryUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,6 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
@@ -20,6 +19,7 @@ import com.brandon3055.draconicevolution.common.blocks.itemblocks.CKeyStoneItemB
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCKeyStone;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -23,16 +23,16 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.brandon3055.draconicevolution.common.blocks.itemblocks.DraconiumChest
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.utills.ICustomItemData;
|
||||
import com.brandon3055.draconicevolution.common.utils.ICustomItemData;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -14,13 +14,13 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.items.tools.TeleporterMKI;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
|
||||
import com.brandon3055.draconicevolution.common.utils.Teleporter;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
|
||||
import com.brandon3055.draconicevolution.common.utills.ICustomItemData;
|
||||
import com.brandon3055.draconicevolution.common.utils.ICustomItemData;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 13/11/2014.
|
||||
|
||||
+11
-15
@@ -1,5 +1,8 @@
|
||||
package com.brandon3055.draconicevolution.common.blocks.machine;
|
||||
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumber;
|
||||
import static com.gtnewhorizon.gtnhlib.util.numberformatting.NumberFormatUtil.formatNumberCompact;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,7 +20,6 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.blocks.BlockDE;
|
||||
@@ -30,7 +32,8 @@ import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnerg
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileRemoteEnergyBase;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -40,13 +43,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
*/
|
||||
public class EnergyCrystal extends BlockDE implements IHudDisplayBlock {
|
||||
|
||||
public static final byte RELAY_TIER_1 = 0;
|
||||
public static final byte RELAY_TIER_2 = 1;
|
||||
public static final byte TRANSCEIVER_TIER_1 = 2;
|
||||
public static final byte TRANSCEIVER_TIER_2 = 3;
|
||||
public static final byte WIRELESS_TRANSCEIVER_TIER_1 = 3;
|
||||
public static final byte WIRELESS_TRANSCEIVER_TIER_2 = 4;
|
||||
|
||||
public EnergyCrystal() {
|
||||
super(Material.glass);
|
||||
this.setBlockName(Strings.energyCrystalName);
|
||||
@@ -232,8 +228,8 @@ public class EnergyCrystal extends BlockDE implements IHudDisplayBlock {
|
||||
list.add(
|
||||
InfoHelper.HITC() + StatCollector
|
||||
.translateToLocal(this.getUnlocalizedName() + world.getBlockMetadata(x, y, z) + ".name"));
|
||||
list.add("RF: " + tile.getEnergyStored(ForgeDirection.DOWN));
|
||||
list.add("Cap: " + tile.getCapacity() + "%");
|
||||
list.add("RF: " + formatNumberCompact(tile.getEnergyStored(ForgeDirection.DOWN)));
|
||||
list.add("Cap: " + formatNumber(tile.getCapacity()) + "%");
|
||||
if (tile instanceof TileEnergyTransceiver) {
|
||||
String x5 = ((TileEnergyTransceiver) tile).getPowerTier() > 0
|
||||
&& ((TileEnergyTransceiver) tile).transferBoost
|
||||
@@ -247,16 +243,16 @@ public class EnergyCrystal extends BlockDE implements IHudDisplayBlock {
|
||||
if (tile instanceof TileRemoteEnergyBase) {
|
||||
list.add(
|
||||
StatCollector.translateToLocal("info.de.connections.txt") + ": "
|
||||
+ ((TileRemoteEnergyBase) tile).linkedDevices.size()
|
||||
+ formatNumber(((TileRemoteEnergyBase) tile).linkedDevices.size())
|
||||
+ "/"
|
||||
+ tile.getMaxConnections());
|
||||
+ formatNumber(tile.getMaxConnections()));
|
||||
}
|
||||
if (tile instanceof TileWirelessEnergyTransceiver) {
|
||||
list.add(
|
||||
StatCollector.translateToLocal("info.de.wirelessConnections.txt") + ": "
|
||||
+ ((TileWirelessEnergyTransceiver) tile).receiverList.size()
|
||||
+ formatNumber(((TileWirelessEnergyTransceiver) tile).receiverList.size())
|
||||
+ "/"
|
||||
+ ((TileWirelessEnergyTransceiver) tile).getmaxWirelessConnections());
|
||||
+ formatNumber(((TileWirelessEnergyTransceiver) tile).getmaxWirelessConnections()));
|
||||
}
|
||||
|
||||
if (tile instanceof TileRemoteEnergyBase) {
|
||||
|
||||
@@ -17,7 +17,6 @@ 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.client.gui.GuiHandler;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
@@ -28,6 +27,7 @@ import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileFluidGate;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileFluxGate;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -174,7 +174,7 @@ public class FlowGate extends BlockDE {
|
||||
|
||||
((TileGate) worldObj.getTileEntity(x, y, z)).output = facing;
|
||||
worldObj.setBlockMetadataWithNotify(x, y, z, facing.ordinal() + (type * 6), 2);
|
||||
Utills.updateNeabourBlocks(worldObj, x, y, z);
|
||||
Utils.updateNeabourBlocks(worldObj, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import com.brandon3055.draconicevolution.common.blocks.itemblocks.LRDItemBlock;
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@ import com.brandon3055.draconicevolution.common.blocks.BlockDE;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileInvisibleMultiblock;
|
||||
import com.brandon3055.draconicevolution.common.utills.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.IHudDisplayBlock;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
+2
-2
@@ -12,12 +12,12 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.blocks.BlockDE;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorEnergyInjector;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -83,7 +83,7 @@ public class ReactorEnergyInjector extends BlockDE implements ITileEntityProvide
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||
ForgeDirection facing = ForgeDirection.getOrientation(Utills.determineOrientation(x, y, z, entity));
|
||||
ForgeDirection facing = ForgeDirection.getOrientation(Utils.determineOrientation(x, y, z, entity));
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileReactorEnergyInjector injector) {
|
||||
injector.facing = entity.isSneaking() ? facing.getOpposite() : facing;
|
||||
|
||||
+2
-2
@@ -11,13 +11,13 @@ 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;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -86,7 +86,7 @@ public class ReactorStabilizer extends BlockDE implements ITileEntityProvider {
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||
ForgeDirection facing = ForgeDirection.getOrientation(Utills.determineOrientation(x, y, z, entity));
|
||||
ForgeDirection facing = ForgeDirection.getOrientation(Utils.determineOrientation(x, y, z, entity));
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileReactorStabilizer stabilizer) {
|
||||
stabilizer.facing = entity.isSneaking() ? facing.getOpposite() : facing;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.inventory.InventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utils.IInventoryTool;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 13/01/2015.
|
||||
|
||||
+1
-1
@@ -9,9 +9,9 @@ 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.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.integration.ModHelper;
|
||||
|
||||
public class ContainerDissEnchanter extends Container {
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.inventory.GenericInventory;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore.ReactorState;
|
||||
import com.brandon3055.draconicevolution.common.utills.OreDictionaryHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.OreDictionaryHelper;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 30/7/2015.
|
||||
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
package com.brandon3055.draconicevolution.common.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileContainerTemplate;
|
||||
|
||||
public class ContainerTemplate extends Container {
|
||||
|
||||
private TileContainerTemplate tile;
|
||||
private EntityPlayer player;
|
||||
|
||||
public ContainerTemplate(InventoryPlayer invPlayer, TileContainerTemplate tile) {
|
||||
this.tile = tile;
|
||||
this.player = invPlayer.player;
|
||||
|
||||
for (int x = 0; x < 9; x++) {
|
||||
addSlotToContainer(new Slot(invPlayer, x, 8 + 18 * x, 116));
|
||||
}
|
||||
|
||||
for (int y = 0; y < 3; y++) {
|
||||
for (int x = 0; x < 9; x++) {
|
||||
addSlotToContainer(new Slot(invPlayer, x + y * 9 + 9, 8 + 18 * x, 58 + y * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int x = 0; x < 9; x++) {
|
||||
addSlotToContainer(new Slot(tile, x, 8 + 18 * x, 10));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return tile.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int i) {
|
||||
Slot slot = getSlot(i);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
ItemStack result = stack.copy();
|
||||
|
||||
if (i >= 36) {
|
||||
if (!mergeItemStack(stack, 0, 36, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!isStackValidForInventory(stack, 0)
|
||||
|| !mergeItemStack(stack, 36, 36 + tile.getSizeInventory(), false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (stack.stackSize == 0) {
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, stack);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean isStackValidForInventory(ItemStack stack, int slot) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -11,8 +11,8 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem.EnumUpgrade;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem.EnumUpgrade;
|
||||
|
||||
public class ContainerUpgradeModifier extends ContainerDataSync {
|
||||
|
||||
|
||||
@@ -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.common.utils.Utils;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.IProcess;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.ProcessHandler;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 12/8/2015.
|
||||
@@ -44,7 +44,7 @@ public class ChaosImplosion implements IProcess {
|
||||
|
||||
for (int x = xCoord - size; x < xCoord + size; x++) {
|
||||
for (int z = zCoord - size; z < zCoord + size; z++) {
|
||||
double dist = Utills.getDistanceAtoB(x, z, xCoord, zCoord);
|
||||
double dist = Utils.getDistanceAtoB(x, z, xCoord, zCoord);
|
||||
if (dist < OD && dist >= ID) {
|
||||
float tracePower = power - (float) (expansion / 10D);
|
||||
tracePower *= 1F + ((random.nextFloat() - 0.5F) * 0.2);
|
||||
|
||||
+1
-1
@@ -7,8 +7,8 @@ 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.common.tileentities.multiblocktiles.reactor.ReactorExplosion;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.IProcess;
|
||||
|
||||
/**
|
||||
* Created by brandon3055 on 12/8/2015.
|
||||
|
||||
@@ -7,9 +7,9 @@ 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;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 14/09/2014.
|
||||
@@ -73,7 +73,7 @@ public class EntityChaosDrill extends Entity {
|
||||
for (int x = (int) posX - r; x <= (int) posX + r; x++) {
|
||||
for (int z = (int) posZ - r; z <= (int) posZ + r; z++) {
|
||||
for (int y = (int) posY - r; y <= (int) posY + r; y++) {
|
||||
int dist = (int) (Utills.getDistanceAtoB(x, y, z, (int) posX, (int) posY, (int) posZ));
|
||||
int dist = (int) (Utils.getDistanceAtoB(x, y, z, (int) posX, (int) posY, (int) posZ));
|
||||
if (dist <= r) {
|
||||
if (!worldObj.isAirBlock(x, y, z)) {
|
||||
if (blocks.size() <= dist) {
|
||||
|
||||
+19
-21
@@ -25,11 +25,11 @@ 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.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
|
||||
import com.brandon3055.draconicevolution.common.utills.DamageSourceChaos;
|
||||
import com.brandon3055.draconicevolution.common.utills.DragonChunkLoader;
|
||||
import com.brandon3055.draconicevolution.common.utils.DamageSourceChaos;
|
||||
import com.brandon3055.draconicevolution.common.utils.DragonChunkLoader;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 4/07/2014.
|
||||
@@ -181,7 +181,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
|
||||
customAIUpdate();
|
||||
if (behaviour == EnumBehaviour.FIREBOMB
|
||||
&& Utills.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) <= 3)
|
||||
&& Utils.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) <= 3)
|
||||
moveSpeedMultiplier = 0;
|
||||
}
|
||||
|
||||
@@ -259,8 +259,8 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
if (behaviour == EnumBehaviour.CIRCLE_PLAYER) {
|
||||
this.targetX = this.target.posX + (int) (Math.cos(circlePosition) * 60);
|
||||
this.targetZ = this.target.posZ + (int) (Math.sin(circlePosition) * 60);
|
||||
moveSpeedMultiplier = 1F + Math
|
||||
.min(((float) Utills.getDistanceAtoB(targetX, targetZ, posX, posZ) / 50) * 3F, 3F);
|
||||
moveSpeedMultiplier = 1F
|
||||
+ Math.min(((float) Utils.getDistanceAtoB(targetX, targetZ, posX, posZ) / 50) * 3F, 3F);
|
||||
} else {
|
||||
this.targetX = this.target.posX;
|
||||
this.targetZ = this.target.posZ;
|
||||
@@ -526,7 +526,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
break;
|
||||
|
||||
case GO_HOME:
|
||||
if (Utills.getDistanceAtoB(posX, posZ, homeX, homeZ) < 70) selectNewBehaviour();
|
||||
if (Utils.getDistanceAtoB(posX, posZ, homeX, homeZ) < 70) selectNewBehaviour();
|
||||
break;
|
||||
|
||||
case GUARDING:
|
||||
@@ -536,12 +536,12 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
break;
|
||||
|
||||
case CHARGING:
|
||||
if (Utills.getDistanceAtoB(posX, posZ, homeX, homeZ) > 300) behaviour = EnumBehaviour.GO_HOME;
|
||||
if (Utils.getDistanceAtoB(posX, posZ, homeX, homeZ) > 300) behaviour = EnumBehaviour.GO_HOME;
|
||||
break;
|
||||
|
||||
case CIRCLE_PLAYER:
|
||||
circlePosition += (0.02F * circleDirection);
|
||||
if (Utills.getDistanceAtoB(posX, posZ, homeX, homeZ) > 300 || posY > 250)
|
||||
if (Utils.getDistanceAtoB(posX, posZ, homeX, homeZ) > 300 || posY > 250)
|
||||
behaviour = EnumBehaviour.GO_HOME;
|
||||
break;
|
||||
|
||||
@@ -611,18 +611,18 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
if (worldObj.isRemote || behaviour == EnumBehaviour.DEAD) return;
|
||||
|
||||
if (behaviour == EnumBehaviour.FIREBOMB
|
||||
&& Utills.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) <= 3) {
|
||||
&& Utils.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) <= 3) {
|
||||
if (target == null || ticksExisted % 100 == 0) setNewTarget();
|
||||
if (target != null) {
|
||||
double distance = Utills
|
||||
double distance = Utils
|
||||
.getDistanceAtoB(target.posX, target.posZ, dragonPartHead.posX, dragonPartHead.posZ);
|
||||
if (Utills.getDistanceAtoB(target.posX, target.posZ, posX, posZ) < 5) distance *= -1;
|
||||
if (Utils.getDistanceAtoB(target.posX, target.posZ, posX, posZ) < 5) distance *= -1;
|
||||
float anglePitch = (float) Math.toDegrees(Math.atan2(target.posY - dragonPartHead.posY, distance))
|
||||
* -1F;
|
||||
float angleYaw = (float) Math
|
||||
.toDegrees(Math.atan2(target.posX - dragonPartHead.posX, target.posZ - posZ)) * -1F;
|
||||
rotationPitch = anglePitch;
|
||||
if (Utills.getDistanceAtoB(target.posX, target.posZ, posX, posZ) > 8) rotationYaw = angleYaw + 180;
|
||||
if (Utils.getDistanceAtoB(target.posX, target.posZ, posX, posZ) > 8) rotationYaw = angleYaw + 180;
|
||||
|
||||
if (ticksExisted % 2 == 0) {
|
||||
EntityDragonProjectile projectile = new EntityDragonProjectile(
|
||||
@@ -690,8 +690,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
switch (attackInProgress) {
|
||||
case ATTACK_FIREBALL_CHARGE:
|
||||
if (target == null && behaviour == EnumBehaviour.CHARGING) target = attackTarget;
|
||||
if (Utills
|
||||
.getDistanceAtoB(posX, posY, posZ, attackTarget.posX, attackTarget.posY, attackTarget.posZ)
|
||||
if (Utils.getDistanceAtoB(posX, posY, posZ, attackTarget.posX, attackTarget.posY, attackTarget.posZ)
|
||||
> 10) {
|
||||
if (attackTimer % 2 == 0) {
|
||||
EntityDragonProjectile projectile = new EntityDragonProjectile(
|
||||
@@ -704,7 +703,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
worldObj.spawnEntityInWorld(projectile);
|
||||
}
|
||||
|
||||
double distance = Utills.getDistanceAtoB(
|
||||
double distance = Utils.getDistanceAtoB(
|
||||
attackTarget.posX,
|
||||
attackTarget.posZ,
|
||||
dragonPartHead.posX,
|
||||
@@ -757,8 +756,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
attackInProgress = -1;
|
||||
return;
|
||||
}
|
||||
if (Utills
|
||||
.getDistanceAtoB(posX, posY, posZ, attackTarget.posX, attackTarget.posY, attackTarget.posZ)
|
||||
if (Utils.getDistanceAtoB(posX, posY, posZ, attackTarget.posX, attackTarget.posY, attackTarget.posZ)
|
||||
> 15) {
|
||||
if (attackTimer % 2 == 0) {
|
||||
EntityDragonProjectile projectile = new EntityDragonProjectile(
|
||||
@@ -771,7 +769,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
worldObj.spawnEntityInWorld(projectile);
|
||||
}
|
||||
|
||||
double distance = Utills.getDistanceAtoB(
|
||||
double distance = Utils.getDistanceAtoB(
|
||||
attackTarget.posX,
|
||||
attackTarget.posZ,
|
||||
dragonPartHead.posX,
|
||||
@@ -837,7 +835,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
case CHARGING:
|
||||
break;
|
||||
case FIREBOMB:
|
||||
if (Utills.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) > 3) {
|
||||
if (Utils.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) > 3) {
|
||||
targetX = homeX;
|
||||
targetY = homeY + 30;
|
||||
targetZ = homeZ;
|
||||
@@ -956,7 +954,7 @@ public class EntityChaosGuardian extends EntityDragon { // summon DraconicEvolut
|
||||
|
||||
break;
|
||||
case FIREBOMB:
|
||||
if ((target == null && Utills.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) <= 3)
|
||||
if ((target == null && Utils.getDistanceAtoB(posX, posY, posZ, homeX, homeY + 30, homeZ) <= 3)
|
||||
|| rand.nextInt(5) == 0)
|
||||
selectNewBehaviour();
|
||||
if (damageSource.getEntity() instanceof EntityPlayer && damageSource.getEntity() != target
|
||||
|
||||
+1
-1
@@ -7,10 +7,10 @@ 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.client.render.particle.Particles;
|
||||
import com.brandon3055.draconicevolution.common.network.GenericParticlePacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.ProcessHandler;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@ import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
|
||||
import com.brandon3055.draconicevolution.common.utills.DamageSourceChaos;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.DamageSourceChaos;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 4/07/2014.
|
||||
|
||||
+2
-2
@@ -13,13 +13,13 @@ 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.client.handler.ParticleHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.Particles;
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.blocks.DraconiumBlock;
|
||||
import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper.TileLocation;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -129,7 +129,7 @@ public class EntityDragonHeart extends Entity {
|
||||
AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||
for (EntityItem item : items) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if (Utills.getDistanceAtoB(posX, posY + 0.5, posZ, item.posX, item.posY, item.posZ) < 1) {
|
||||
if (Utils.getDistanceAtoB(posX, posY + 0.5, posZ, item.posX, item.posY, item.posZ) < 1) {
|
||||
if (coresConsumed == 16 || worldObj.isRemote) break;
|
||||
if (stack.getItem() != ModItems.draconicCore) {
|
||||
item.motionX = 1;
|
||||
|
||||
+6
-6
@@ -17,12 +17,12 @@ 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.client.handler.ParticleHandler;
|
||||
import com.brandon3055.draconicevolution.client.render.particle.Particles;
|
||||
import com.brandon3055.draconicevolution.common.network.GenericParticlePacket;
|
||||
import com.brandon3055.draconicevolution.common.utils.Teleporter;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
@@ -160,7 +160,7 @@ public class EntityDragonProjectile extends Entity {
|
||||
}
|
||||
|
||||
if (isChaser && !worldObj.isRemote) {
|
||||
double tDist = Utills.getDistanceAtoB(target.posX, target.posY, target.posZ, posX, posY, posZ);
|
||||
double tDist = Utils.getDistanceAtoB(target.posX, target.posY, target.posZ, posX, posY, posZ);
|
||||
if (tDist <= 0) tDist = 0.1;
|
||||
|
||||
double x = (target.posX - posX) / tDist;
|
||||
@@ -183,7 +183,7 @@ public class EntityDragonProjectile extends Entity {
|
||||
private boolean checkTargetCondition() {
|
||||
if (worldObj.isRemote) return false;
|
||||
|
||||
double targetDistance = Utills.getDistanceAtoB(posX, posY, posZ, target.posX, target.posY, target.posZ);
|
||||
double targetDistance = Utils.getDistanceAtoB(posX, posY, posZ, target.posX, target.posY, target.posZ);
|
||||
|
||||
Entity entityHit = getHitEntity();
|
||||
if (entityHit instanceof EntityDragonPart) entityHit = null;
|
||||
@@ -272,7 +272,7 @@ public class EntityDragonProjectile extends Entity {
|
||||
List<EntityLivingBase> list = worldObj.getEntitiesWithinAABBExcludingEntity(
|
||||
shooter,
|
||||
boundingBox.expand(60, 60, 60),
|
||||
Utills.selectPlayer);
|
||||
Utils.selectPlayer);
|
||||
for (i = +0; i > 0; i--) {
|
||||
newProjectile = new EntityDragonProjectile(
|
||||
worldObj,
|
||||
@@ -367,7 +367,7 @@ public class EntityDragonProjectile extends Entity {
|
||||
entityLivingBase.hurtResistantTime = 0;
|
||||
entityLivingBase.attackEntityFrom(
|
||||
source,
|
||||
damage / (float) (Utills.getDistanceAtoB(
|
||||
damage / (float) (Utils.getDistanceAtoB(
|
||||
entityLivingBase.posX,
|
||||
entityLivingBase.posY,
|
||||
entityLivingBase.posZ,
|
||||
|
||||
@@ -18,7 +18,7 @@ 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 com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -463,7 +463,7 @@ public class EntityEnderArrow extends EntityDraconicArrow {
|
||||
int y = (int) Math.floor(posY);
|
||||
int z = (int) Math.floor(posZ);
|
||||
|
||||
double travelDist = Utills.getDistanceAtoB(startX, startY, startZ, x, y, z);
|
||||
double travelDist = Utils.getDistanceAtoB(startX, startY, startZ, x, y, z);
|
||||
float travelDmg = (float) (travelDist / 5D);
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(
|
||||
entityplayermp,
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.utills.IUpgradableItem.EnumUpgrade;
|
||||
import com.brandon3055.draconicevolution.common.utils.IUpgradableItem.EnumUpgrade;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
public class ConfigHandler {
|
||||
|
||||
|
||||
+2
-2
@@ -19,12 +19,12 @@ 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.client.handler.ResourceHandler;
|
||||
import com.brandon3055.draconicevolution.client.model.special.ModelContributorWings;
|
||||
import com.brandon3055.draconicevolution.common.network.ContributorPacket;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.FileHandler;
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ 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;
|
||||
import com.brandon3055.draconicevolution.common.utills.ShapedOreEnergyRecipe;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.ShapedOreEnergyRecipe;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
@@ -7,7 +7,7 @@ import net.minecraft.util.ChatComponentText;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
+7
-7
@@ -45,10 +45,6 @@ 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.common.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.ModItems;
|
||||
@@ -60,7 +56,11 @@ import com.brandon3055.draconicevolution.common.items.armor.CustomArmorHandler;
|
||||
import com.brandon3055.draconicevolution.common.network.MountUpdatePacket;
|
||||
import com.brandon3055.draconicevolution.common.network.SpeedRequestPacket;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.DataUtils;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.Utils;
|
||||
import com.brandon3055.draconicevolution.common.utils.handlers.ProcessHandler;
|
||||
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
@@ -454,10 +454,10 @@ public class MinecraftForgeEventHandler {
|
||||
@SubscribeEvent
|
||||
public void entityJoinWorld(EntityJoinWorldEvent event) {
|
||||
if (!event.world.isRemote && event.entity instanceof EntityEnderCrystal && event.entity.dimension == 1) {
|
||||
DataUtills.XZPair<Integer, Integer> location = ChaosWorldGenHandler
|
||||
DataUtils.XZPair<Integer, Integer> location = ChaosWorldGenHandler
|
||||
.getClosestChaosSpawn((int) event.entity.posX / 16, (int) event.entity.posZ / 16);
|
||||
if ((location.x != 0 || location.z != 0)
|
||||
&& Utills.getDistanceAtoB(event.entity.posX, event.entity.posZ, location.x, location.z) < 500) {
|
||||
&& Utils.getDistanceAtoB(event.entity.posX, event.entity.posZ, location.x, location.z) < 500) {
|
||||
ProcessHandler.addProcess(new ChaosWorldGenHandler.CrystalRemover(event.entity));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ 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.common.container.ContainerAdvTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.IInventoryTool;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 13/01/2015.
|
||||
|
||||
@@ -9,13 +9,13 @@ 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;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
|
||||
import com.brandon3055.draconicevolution.common.utills.LogHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.InfoHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -7,10 +7,10 @@ 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;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -15,10 +15,10 @@ 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;
|
||||
import com.brandon3055.draconicevolution.common.utils.ItemNBTHelper;
|
||||
import com.brandon3055.draconicevolution.common.utils.LogHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -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
|
||||
|
||||
Loaded 100 of 200 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user