[ci skip] spotlessApply with the new settings

This commit is contained in:
Jason Mitchell committed 2023-01-28 18:59:08 -08:00
1 parent be1f68f9c8
commit eba5e16f16
348 files changed
+9787 -8771

No files matched your search

@@ -1,10 +1,14 @@
package com.brandon3055.draconicevolution; package com.brandon3055.draconicevolution;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import com.brandon3055.draconicevolution.client.creativetab.DETab; import com.brandon3055.draconicevolution.client.creativetab.DETab;
import com.brandon3055.draconicevolution.common.CommonProxy; import com.brandon3055.draconicevolution.common.CommonProxy;
import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry; import com.brandon3055.draconicevolution.common.lib.OreDoublingRegistry;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.LogHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper;
import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInitializationEvent;
@@ -12,8 +16,6 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
@Mod( @Mod(
modid = References.MODID, modid = References.MODID,
@@ -32,10 +34,16 @@ public class DraconicEvolution {
@SidedProxy(clientSide = References.CLIENTPROXYLOCATION, serverSide = References.SERVERPROXYLOCATION) @SidedProxy(clientSide = References.CLIENTPROXYLOCATION, serverSide = References.SERVERPROXYLOCATION)
public static CommonProxy proxy; public static CommonProxy proxy;
public static CreativeTabs tabToolsWeapons = public static CreativeTabs tabToolsWeapons = new DETab(
new DETab(CreativeTabs.getNextID(), References.MODID, "toolsAndWeapons", 0); CreativeTabs.getNextID(),
public static CreativeTabs tabBlocksItems = References.MODID,
new DETab(CreativeTabs.getNextID(), References.MODID, "blocksAndItems", 1); "toolsAndWeapons",
0);
public static CreativeTabs tabBlocksItems = new DETab(
CreativeTabs.getNextID(),
References.MODID,
"blocksAndItems",
1);
public static final String networkChannelName = "DEvolutionNC"; public static final String networkChannelName = "DEvolutionNC";
public static SimpleNetworkWrapper network; public static SimpleNetworkWrapper network;
@@ -52,13 +60,13 @@ public class DraconicEvolution {
public static void preInit(final FMLPreInitializationEvent event) { public static void preInit(final FMLPreInitializationEvent event) {
if (debug) LogHelper.info("Initialization"); if (debug) LogHelper.info("Initialization");
// event.getModMetadata().autogenerated = false; // event.getModMetadata().autogenerated = false;
// event.getModMetadata().credits = ""; // event.getModMetadata().credits = "";
// event.getModMetadata().description = "This is a mod originally made for the Tolkiencraft mod pack"; // event.getModMetadata().description = "This is a mod originally made for the Tolkiencraft mod pack";
// event.getModMetadata().authorList = Arrays.asList("brandon3055"); // event.getModMetadata().authorList = Arrays.asList("brandon3055");
// event.getModMetadata().logoFile = "banner.png"; // event.getModMetadata().logoFile = "banner.png";
// event.getModMetadata().url = "http://www.brandon3055.com/"; // event.getModMetadata().url = "http://www.brandon3055.com/";
// event.getModMetadata().version = References.VERSION + "-MC1.7.10"; // event.getModMetadata().version = References.VERSION + "-MC1.7.10";
proxy.preInit(event); proxy.preInit(event);
} }
@@ -68,9 +76,9 @@ public class DraconicEvolution {
if (debug) System.out.println("init()"); if (debug) System.out.println("init()");
proxy.init(event); proxy.init(event);
// === // ===
// === // ===
} }
@Mod.EventHandler @Mod.EventHandler
@@ -1,12 +1,14 @@
package com.brandon3055.draconicevolution.api; package com.brandon3055.draconicevolution.api;
import java.util.Random;
import net.minecraft.world.World;
import com.brandon3055.brandonscore.common.utills.DataUtills; import com.brandon3055.brandonscore.common.utills.DataUtills;
import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler; import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator; import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
import com.brandon3055.draconicevolution.common.world.WorldGenEnderComet; import com.brandon3055.draconicevolution.common.world.WorldGenEnderComet;
import com.brandon3055.draconicevolution.common.world.WorldGenEnderIsland; import com.brandon3055.draconicevolution.common.world.WorldGenEnderIsland;
import java.util.Random;
import net.minecraft.world.World;
/** /**
* Created by Brandon on 11/7/2015. * Created by Brandon on 11/7/2015.
@@ -29,9 +31,9 @@ public class GeneratorOverride {
} }
/** /**
* This can be used to generate a chaos island at a given set of coordinates * This can be used to generate a chaos island at a given set of coordinates This method needs to be called foe
* This method needs to be called foe every chunk in a 360 x 360 block area. * every chunk in a 360 x 360 block area. Its ok to run it on a larger area it just wont do anything to chunks
* Its ok to run it on a larger area it just wont do anything to chunks outside that area. * outside that area.
* *
* @param chunkX the x pos of the chunk being generated (this is the xCoord divided by 16 not the xCoord itself) * @param chunkX the x pos of the chunk being generated (this is the xCoord divided by 16 not the xCoord itself)
* @param chunkZ the z pos of the chunk being generated (this is the zCoord divided by 16 not the zCoord itself) * @param chunkZ the z pos of the chunk being generated (this is the zCoord divided by 16 not the zCoord itself)
@@ -39,10 +41,14 @@ public class GeneratorOverride {
* @param centerZ this should be the center of the area you are spawning the island it (this is the actual zCoord) * @param centerZ this should be the center of the area you are spawning the island it (this is the actual zCoord)
* @param random a random * @param random a random
*/ */
public static void generateChaosChunk( public static void generateChaosChunk(World world, int chunkX, int chunkZ, int centerX, int centerZ,
World world, int chunkX, int chunkZ, int centerX, int centerZ, Random random) { Random random) {
ChaosWorldGenHandler.generateChunk( ChaosWorldGenHandler.generateChunk(
world, chunkX, chunkZ, new DataUtills.XZPair<Integer, Integer>(centerX, centerZ), random); world,
chunkX,
chunkZ,
new DataUtills.XZPair<Integer, Integer>(centerX, centerZ),
random);
} }
/** /**
@@ -4,6 +4,7 @@ package com.brandon3055.draconicevolution.api;
* Created by Brandon on 6/03/2015. * Created by Brandon on 6/03/2015.
*/ */
public interface IExtendedRFStorage { public interface IExtendedRFStorage {
/** /**
* I will probably leave these here forever but i highly recommend switching as i may remove then at some point. * I will probably leave these here forever but i highly recommend switching as i may remove then at some point.
*/ */
@@ -1,5 +1,14 @@
package com.brandon3055.draconicevolution.client; package com.brandon3055.draconicevolution.client;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler; import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
import com.brandon3055.draconicevolution.client.handler.HudHandler; import com.brandon3055.draconicevolution.client.handler.HudHandler;
@@ -33,6 +42,7 @@ import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.rea
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorEnergyInjector; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorEnergyInjector;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer;
import com.brandon3055.draconicevolution.common.utills.UpdateChecker; import com.brandon3055.draconicevolution.common.utills.UpdateChecker;
import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -40,16 +50,9 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
public class ClientProxy extends CommonProxy { public class ClientProxy extends CommonProxy {
private static final boolean debug = DraconicEvolution.debug; private static final boolean debug = DraconicEvolution.debug;
public static String downloadLocation; public static String downloadLocation;
@@ -60,52 +63,52 @@ public class ClientProxy extends CommonProxy {
ResourceHandler.init(event); ResourceHandler.init(event);
// downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + // downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() +
// "/mods/derspack"; // "/mods/derspack";
// downloadLocation = downloadLocation.replaceAll("\\\\", "/"); // downloadLocation = downloadLocation.replaceAll("\\\\", "/");
// //
// File rescourcePack = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/derspack"); // File rescourcePack = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/derspack");
// //
// //
// //File file = new File(downloadLocation); // //File file = new File(downloadLocation);
// if (!rescourcePack.exists()) rescourcePack.mkdir(); // if (!rescourcePack.exists()) rescourcePack.mkdir();
// //
// LogHelper.info("Downloading Images"); // LogHelper.info("Downloading Images");
// //
// try { // try {
// URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg"); // URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg");
// String fileName = url.getFile(); // String fileName = url.getFile();
// //String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/")); // //String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/"));
// File dll = new File(rescourcePack, fileName.substring(fileName.lastIndexOf("/"))); // File dll = new File(rescourcePack, fileName.substring(fileName.lastIndexOf("/")));
// //
// InputStream is = url.openStream(); // InputStream is = url.openStream();
// OutputStream os = new FileOutputStream(dll); // OutputStream os = new FileOutputStream(dll);
// //
// ByteStreams.copy(is, os); // ByteStreams.copy(is, os);
// //
// is.close(); // is.close();
// os.close(); // os.close();
// }catch (IOException e){ // }catch (IOException e){
// LogHelper.info(e); // LogHelper.info(e);
// } // }
// //
// //
// List defaultResourcePacks = Lists.newArrayList(); // List defaultResourcePacks = Lists.newArrayList();
// Field f = ReflectionHelper.findField(Minecraft.class, "defaultResourcePacks", "field_110449_ao"); // Field f = ReflectionHelper.findField(Minecraft.class, "defaultResourcePacks", "field_110449_ao");
// f.setAccessible(true); // f.setAccessible(true);
// try { // try {
// defaultResourcePacks = (List)f.get(Minecraft.getMinecraft()); // defaultResourcePacks = (List)f.get(Minecraft.getMinecraft());
// defaultResourcePacks.add(new FolderResourcePack(rescourcePack)); // defaultResourcePacks.add(new FolderResourcePack(rescourcePack));
// for (Object o : defaultResourcePacks){ // for (Object o : defaultResourcePacks){
// if (o instanceof FolderResourcePack) LogHelper.info(((FolderResourcePack) o).getPackName()); // if (o instanceof FolderResourcePack) LogHelper.info(((FolderResourcePack) o).getPackName());
// if (o instanceof FileResourcePack) LogHelper.info(((FileResourcePack)o).getPackName()); // if (o instanceof FileResourcePack) LogHelper.info(((FileResourcePack)o).getPackName());
// } // }
// //
// f.set(Minecraft.getMinecraft(), defaultResourcePacks); // f.set(Minecraft.getMinecraft(), defaultResourcePacks);
// } // }
// catch (IllegalAccessException e) { // catch (IllegalAccessException e) {
// e.printStackTrace(); // e.printStackTrace();
// } // }
} }
@@ -114,8 +117,7 @@ public class ClientProxy extends CommonProxy {
super.init(event); super.init(event);
FMLCommonHandler.instance().bus().register(new KeyInputHandler()); FMLCommonHandler.instance().bus().register(new KeyInputHandler());
FMLCommonHandler.instance().bus().register(new ClientEventHandler()); FMLCommonHandler.instance().bus().register(new ClientEventHandler());
if (ConfigHandler.enableVersionChecker) if (ConfigHandler.enableVersionChecker) FMLCommonHandler.instance().bus().register(new UpdateChecker());
FMLCommonHandler.instance().bus().register(new UpdateChecker());
MinecraftForge.EVENT_BUS.register(new HudHandler()); MinecraftForge.EVENT_BUS.register(new HudHandler());
MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
KeyBindings.init(); KeyBindings.init();
@@ -154,12 +156,15 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.draconicSword, ModItems.draconicSword,
new RenderTool( new RenderTool(
"models/tools/DraconicSword.obj", "textures/models/tools/DraconicSword.png", (IRenderTweak) "models/tools/DraconicSword.obj",
ModItems.draconicSword)); "textures/models/tools/DraconicSword.png",
(IRenderTweak) ModItems.draconicSword));
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.wyvernPickaxe, ModItems.wyvernPickaxe,
new RenderTool("models/tools/Pickaxe.obj", "textures/models/tools/Pickaxe.png", (IRenderTweak) new RenderTool(
ModItems.wyvernPickaxe)); "models/tools/Pickaxe.obj",
"textures/models/tools/Pickaxe.png",
(IRenderTweak) ModItems.wyvernPickaxe));
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.draconicPickaxe, ModItems.draconicPickaxe,
new RenderTool( new RenderTool(
@@ -174,8 +179,10 @@ public class ClientProxy extends CommonProxy {
(IRenderTweak) ModItems.draconicAxe)); (IRenderTweak) ModItems.draconicAxe));
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.wyvernShovel, ModItems.wyvernShovel,
new RenderTool("models/tools/Shovel.obj", "textures/models/tools/Shovel.png", (IRenderTweak) new RenderTool(
ModItems.wyvernShovel)); "models/tools/Shovel.obj",
"textures/models/tools/Shovel.png",
(IRenderTweak) ModItems.wyvernShovel));
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.draconicShovel, ModItems.draconicShovel,
new RenderTool( new RenderTool(
@@ -184,8 +191,10 @@ public class ClientProxy extends CommonProxy {
(IRenderTweak) ModItems.draconicShovel)); (IRenderTweak) ModItems.draconicShovel));
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.wyvernSword, ModItems.wyvernSword,
new RenderTool("models/tools/Sword.obj", "textures/models/tools/Sword.png", (IRenderTweak) new RenderTool(
ModItems.wyvernSword)); "models/tools/Sword.obj",
"textures/models/tools/Sword.png",
(IRenderTweak) ModItems.wyvernSword));
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.draconicDestructionStaff, ModItems.draconicDestructionStaff,
new RenderTool( new RenderTool(
@@ -195,30 +204,33 @@ public class ClientProxy extends CommonProxy {
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
ModItems.draconicHoe, ModItems.draconicHoe,
new RenderTool( new RenderTool(
"models/tools/DraconicHoe.obj", "textures/models/tools/DraconicHoe.png", (IRenderTweak) "models/tools/DraconicHoe.obj",
ModItems.draconicHoe)); "textures/models/tools/DraconicHoe.png",
(IRenderTweak) ModItems.draconicHoe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBowModel(true)); MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBowModel(true));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBowModel(false)); MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBowModel(false));
} }
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient
Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest()); .registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient
Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen()); .registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient
Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser()); .registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyCrystal), new RenderCrystal()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyCrystal), new RenderCrystal());
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer()); Item.getItemFromBlock(ModBlocks.reactorStabilizer),
new RenderReactorStabilizer());
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector()); Item.getItemFromBlock(ModBlocks.reactorEnergyInjector),
MinecraftForgeClient.registerItemRenderer( new RenderReactorEnergyInjector());
Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore()); MinecraftForgeClient
.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.earthBlock), new RenderEarthItem()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.earthBlock), new RenderEarthItem());
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient
Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard()); .registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
MinecraftForgeClient.registerItemRenderer( MinecraftForgeClient
Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier()); .registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
// ISimpleBlockRendering // ISimpleBlockRendering
RenderingRegistry.registerBlockHandler(new RenderTeleporterStand()); RenderingRegistry.registerBlockHandler(new RenderTeleporterStand());
@@ -241,8 +253,8 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileWirelessEnergyTransceiver.class, new RenderTileCrystal()); ClientRegistry.bindTileEntitySpecialRenderer(TileWirelessEnergyTransceiver.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorCore.class, new RenderTileReactorCore()); ClientRegistry.bindTileEntitySpecialRenderer(TileReactorCore.class, new RenderTileReactorCore());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorStabilizer.class, new RenderTileReactorStabilizer()); ClientRegistry.bindTileEntitySpecialRenderer(TileReactorStabilizer.class, new RenderTileReactorStabilizer());
ClientRegistry.bindTileEntitySpecialRenderer( ClientRegistry
TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector()); .bindTileEntitySpecialRenderer(TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard()); ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard());
ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier()); ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier());
@@ -262,19 +274,8 @@ public class ClientProxy extends CommonProxy {
} }
@Override @Override
public ParticleEnergyBeam energyBeam( public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz,
World worldObj, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
double x,
double y,
double z,
double tx,
double ty,
double tz,
int powerFlow,
boolean advanced,
ParticleEnergyBeam oldBeam,
boolean render,
int beamType) {
if (!worldObj.isRemote) return null; if (!worldObj.isRemote) return null;
ParticleEnergyBeam beam = oldBeam; ParticleEnergyBeam beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50); boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50);
@@ -295,15 +296,8 @@ public class ClientProxy extends CommonProxy {
} }
@Override @Override
public ParticleEnergyField energyField( public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced,
World worldObj, ParticleEnergyField oldBeam, boolean render) {
double x,
double y,
double z,
int type,
boolean advanced,
ParticleEnergyField oldBeam,
boolean render) {
if (!worldObj.isRemote) return null; if (!worldObj.isRemote) return null;
ParticleEnergyField beam = oldBeam; ParticleEnergyField beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50); boolean inRange = ParticleHandler.isInRange(x, y, z, 50);
@@ -1,15 +1,17 @@
package com.brandon3055.draconicevolution.client; package com.brandon3055.draconicevolution.client;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
import net.minecraft.client.audio.ITickableSound; import net.minecraft.client.audio.ITickableSound;
import net.minecraft.client.audio.PositionedSound; import net.minecraft.client.audio.PositionedSound;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
/** /**
* Created by brandon3055 on 4/10/2015. * Created by brandon3055 on 4/10/2015.
*/ */
public class ReactorSound extends PositionedSound implements ITickableSound { public class ReactorSound extends PositionedSound implements ITickableSound {
private static ResourceLocation sound = new ResourceLocation(References.RESOURCESPREFIX + "coreSound"); private static ResourceLocation sound = new ResourceLocation(References.RESOURCESPREFIX + "coreSound");
public boolean donePlaying = false; public boolean donePlaying = false;
private TileReactorCore tile; private TileReactorCore tile;
@@ -36,23 +38,24 @@ public class ReactorSound extends PositionedSound implements ITickableSound {
if (tile.reactionTemperature > 8000) { if (tile.reactionTemperature > 8000) {
volume += (float) ((tile.reactionTemperature - 8000D) / 1000D); volume += (float) ((tile.reactionTemperature - 8000D) / 1000D);
} }
if (tile.reactionTemperature > 2000 if (tile.reactionTemperature > 2000 && tile.maxFieldCharge > 0
&& tile.maxFieldCharge > 0
&& tile.fieldCharge < (tile.maxFieldCharge * 0.2D)) { && tile.fieldCharge < (tile.maxFieldCharge * 0.2D)) {
volume += 2D - ((tile.fieldCharge / tile.maxFieldCharge) * 10D); volume += 2D - ((tile.fieldCharge / tile.maxFieldCharge) * 10D);
} }
if (tile.reactionTemperature > 2000 if (tile.reactionTemperature > 2000 && tile.reactorFuel + tile.convertedFuel > 0
&& tile.reactorFuel + tile.convertedFuel > 0
&& tile.reactorFuel < (double) (tile.reactorFuel + tile.convertedFuel) * 0.2D) { && tile.reactorFuel < (double) (tile.reactorFuel + tile.convertedFuel) * 0.2D) {
volume += 2D - ((tile.reactorFuel / (tile.reactorFuel + tile.convertedFuel)) * 10D); volume += 2D - ((tile.reactorFuel / (tile.reactorFuel + tile.convertedFuel)) * 10D);
} }
field_147663_c = 0.5F + volume / 2F; field_147663_c = 0.5F + volume / 2F;
if (tile.isInvalid() if (tile.isInvalid() || !tile.getWorldObj().getChunkFromBlockCoords(tile.xCoord, tile.zCoord).isChunkLoaded) { // ||
|| !tile.getWorldObj() // player
.getChunkFromBlockCoords(tile.xCoord, tile.zCoord) // ==
.isChunkLoaded) { // || player == null || tile.getDistanceFrom(player.posX, player.posY, // null
// ||
// tile.getDistanceFrom(player.posX,
// player.posY,
// player.posZ) > 512){ // player.posZ) > 512){
donePlaying = true; donePlaying = true;
repeat = false; repeat = false;
@@ -1,25 +1,27 @@
package com.brandon3055.draconicevolution.client.creativetab; package com.brandon3055.draconicevolution.client.creativetab;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.draconicevolution.common.ModBlocks;
import com.brandon3055.draconicevolution.common.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; 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 cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class DETab extends CreativeTabs { public class DETab extends CreativeTabs {
private String label; private String label;
private int tab; private int tab;
static ItemStack iconStackStaff; static ItemStack iconStackStaff;
public static void initialize() { public static void initialize() {
if (ModItems.isEnabled(ModItems.draconicDestructionStaff)) if (ModItems.isEnabled(ModItems.draconicDestructionStaff)) iconStackStaff = ItemNBTHelper
iconStackStaff = .setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 30000000);
ItemNBTHelper.setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 30000000);
else iconStackStaff = new ItemStack(Items.stick); else iconStackStaff = new ItemStack(Items.stick);
} }
@@ -1,16 +1,18 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.client.config.GuiConfig; import cpw.mods.fml.client.config.GuiConfig;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
/** /**
* Created by Brandon on 6/08/2014. * Created by Brandon on 6/08/2014.
*/ */
public class ConfigGUI extends GuiConfig { public class ConfigGUI extends GuiConfig {
public ConfigGUI(GuiScreen parent) { public ConfigGUI(GuiScreen parent) {
super( super(
parent, parent,
@@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
public class CustomGuiButton extends GuiButton { public class CustomGuiButton extends GuiButton {
@@ -17,8 +18,7 @@ public class CustomGuiButton extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer; FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(buttonTextures); minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = p_146112_2_ >= this.xPosition this.field_146123_n = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition
&& p_146112_3_ >= this.yPosition
&& p_146112_2_ < this.xPosition + this.width && p_146112_2_ < this.xPosition + this.width
&& p_146112_3_ < this.yPosition + this.height; && p_146112_3_ < this.yPosition + this.height;
int k = this.getHoverState(this.field_146123_n); int k = this.getHoverState(this.field_146123_n);
@@ -1,14 +1,17 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import cpw.mods.fml.client.IModGuiFactory;
import java.util.Set; import java.util.Set;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.client.IModGuiFactory;
/** /**
* Created by Brandon on 6/08/2014. * Created by Brandon on 6/08/2014.
*/ */
public class DEGUIFactory implements IModGuiFactory { public class DEGUIFactory implements IModGuiFactory {
@Override @Override
public void initialize(Minecraft minecraftInstance) {} public void initialize(Minecraft minecraftInstance) {}
@@ -1,18 +1,21 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
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;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; 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) @SideOnly(Side.CLIENT)
public class GUIContainerTemplate extends GuiContainer { public class GUIContainerTemplate extends GuiContainer {
@@ -29,8 +32,9 @@ public class GUIContainerTemplate extends GuiContainer {
this.player = invPlayer.player; this.player = invPlayer.player;
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/.png"); References.MODID.toLowerCase(),
"textures/gui/.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -1,12 +1,5 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerDissEnchanter;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
@@ -14,8 +7,18 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerDissEnchanter;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIDissEnchanter extends GuiContainer { public class GUIDissEnchanter extends GuiContainer {
@@ -34,8 +37,9 @@ public class GUIDissEnchanter extends GuiContainer {
this.player = invPlayer.player; this.player = invPlayer.player;
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DissEnchanter.png"); References.MODID.toLowerCase(),
"textures/gui/DissEnchanter.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -1,21 +1,9 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import codechicken.nei.VisiblityData;
import codechicken.nei.api.INEIGuiHandler;
import codechicken.nei.api.TaggedInventoryArea;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
@@ -26,17 +14,37 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import codechicken.nei.VisiblityData;
import codechicken.nei.api.INEIGuiHandler;
import codechicken.nei.api.TaggedInventoryArea;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.container.ContainerDraconiumChest;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems") @Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems")
public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler { public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
public EntityPlayer player; public EntityPlayer player;
private TileDraconiumChest tile; private TileDraconiumChest tile;
private static final ResourceLocation textureLeft = private static final ResourceLocation textureLeft = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestLeft.png"); References.MODID.toLowerCase(),
private static final ResourceLocation textureRight = "textures/gui/DraconicChestLeft.png");
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestRight.png"); private static final ResourceLocation textureRight = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/gui/DraconicChestRight.png");
private int lastAutoFeed = -1; private int lastAutoFeed = -1;
public GUIDraconiumChest(InventoryPlayer invPlayer, TileDraconiumChest tile) { public GUIDraconiumChest(InventoryPlayer invPlayer, TileDraconiumChest tile) {
@@ -69,12 +77,16 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
int arrowHight = (int) (((float) tile.smeltingProgressTime / (float) tile.smeltingCompleateTime) * 22f); int arrowHight = (int) (((float) tile.smeltingProgressTime / (float) tile.smeltingCompleateTime) * 22f);
drawTexturedModalRect( drawTexturedModalRect(
guiLeft + 140, guiTop + 192 + 22 - arrowHight, 140, 216 + 22 - arrowHight, 16, arrowHight); guiLeft + 140,
guiTop + 192 + 22 - arrowHight,
140,
216 + 22 - arrowHight,
16,
arrowHight);
Minecraft.getMinecraft().getTextureManager().bindTexture(textureRight); Minecraft.getMinecraft().getTextureManager().bindTexture(textureRight);
int energyWidth = (int) (((float) tile.getEnergyStored(ForgeDirection.DOWN) int energyWidth = (int) (((float) tile.getEnergyStored(ForgeDirection.DOWN)
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)) * 90f);
* 90f);
drawTexturedModalRect(guiLeft + 44, guiTop + 235, 131, 236, energyWidth, 16); drawTexturedModalRect(guiLeft + 44, guiTop + 235, 131, 236, energyWidth, 16);
int flameHight = (int) (((float) tile.smeltingBurnSpeed / (float) tile.smeltingMaxBurnSpeed) * 13f); int flameHight = (int) (((float) tile.smeltingBurnSpeed / (float) tile.smeltingMaxBurnSpeed) * 13f);
@@ -89,8 +101,10 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
// 0x00FFFF); // 0x00FFFF);
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
list.add(String.valueOf(tile.getEnergyStored(ForgeDirection.DOWN)) + "/" list.add(
+ String.valueOf(tile.getMaxEnergyStored(ForgeDirection.DOWN)) + "RF"); String.valueOf(tile.getEnergyStored(ForgeDirection.DOWN)) + "/"
+ String.valueOf(tile.getMaxEnergyStored(ForgeDirection.DOWN))
+ "RF");
if (GuiHelper.isInRect(44, 235, 90, 16, x - guiLeft, y - guiTop)) if (GuiHelper.isInRect(44, 235, 90, 16, x - guiLeft, y - guiTop))
drawHoveringText(list, x - guiLeft, y - guiTop, fontRendererObj); drawHoveringText(list, x - guiLeft, y - guiTop, fontRendererObj);
list.clear(); list.clear();
@@ -1,14 +1,8 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import cofh.api.energy.IEnergyContainerItem;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
@@ -17,8 +11,19 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import cofh.api.energy.IEnergyContainerItem;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.container.ContainerEnergyInfuser;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIEnergyInfuser extends GuiContainer { public class GUIEnergyInfuser extends GuiContainer {
@@ -36,16 +41,17 @@ public class GUIEnergyInfuser extends GuiContainer {
this.player = invPlayer.player; this.player = invPlayer.player;
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/EnergyInfuser.png"); References.MODID.toLowerCase(),
"textures/gui/EnergyInfuser.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture); Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (tile.getStackInSlot(0) == null) if (tile.getStackInSlot(0) == null) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel box // box
float power = (float) tile.energy.getEnergyStored() / (float) tile.energy.getMaxEnergyStored() * -1F + 1F; float power = (float) tile.energy.getEnergyStored() / (float) tile.energy.getMaxEnergyStored() * -1F + 1F;
drawTexturedModalRect( drawTexturedModalRect(
@@ -56,15 +62,12 @@ public class GUIEnergyInfuser extends GuiContainer {
8, 8,
45 - (int) (power * 45)); // Power bar 45 - (int) (power * 45)); // Power bar
if (tile.running if (tile.running && tile.getStackInSlot(0) != null
&& tile.getStackInSlot(0) != null
&& tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) { && tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
IEnergyContainerItem item = IEnergyContainerItem item = (IEnergyContainerItem) tile.getStackInSlot(0).getItem();
(IEnergyContainerItem) tile.getStackInSlot(0).getItem();
float charge = (float) item.getEnergyStored(tile.getStackInSlot(0)) float charge = (float) item.getEnergyStored(tile.getStackInSlot(0))
/ (float) item.getMaxEnergyStored(tile.getStackInSlot(0)) / (float) item.getMaxEnergyStored(tile.getStackInSlot(0))
* -1F * -1F + 1F;
+ 1F;
drawTexturedModalRect( drawTexturedModalRect(
guiLeft + 119, guiLeft + 119,
guiTop + 7 + (int) (charge * 45), guiTop + 7 + (int) (charge * 45),
@@ -115,23 +118,27 @@ public class GUIEnergyInfuser extends GuiContainer {
if (GuiHelper.isInRect(48, 6, 9, 46, x, y)) { if (GuiHelper.isInRect(48, 6, 9, 46, x, y)) {
ArrayList<String> internal = new ArrayList<String>(); ArrayList<String> internal = new ArrayList<String>();
internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt")); internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt"));
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.energy.getEnergyStored() + "/" internal.add(
+ tile.energy.getMaxEnergyStored()); "" + EnumChatFormatting.DARK_BLUE
+ tile.energy.getEnergyStored()
+ "/"
+ tile.energy.getMaxEnergyStored());
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj); drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
GL11.glPopAttrib(); GL11.glPopAttrib();
} }
if (GuiHelper.isInRect(118, 6, 10, 46, x, y) if (GuiHelper.isInRect(118, 6, 10, 46, x, y) && tile.running
&& tile.running
&& tile.getStackInSlot(0) != null && tile.getStackInSlot(0) != null
&& tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) { && tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
IEnergyContainerItem item = IEnergyContainerItem item = (IEnergyContainerItem) tile.getStackInSlot(0).getItem();
(IEnergyContainerItem) tile.getStackInSlot(0).getItem();
ArrayList<String> internal = new ArrayList<String>(); ArrayList<String> internal = new ArrayList<String>();
internal.add(StatCollector.translateToLocal("gui.de.itemStorage.txt")); internal.add(StatCollector.translateToLocal("gui.de.itemStorage.txt"));
internal.add("" + EnumChatFormatting.DARK_BLUE + item.getEnergyStored(tile.getStackInSlot(0)) + "/" internal.add(
+ item.getMaxEnergyStored(tile.getStackInSlot(0))); "" + EnumChatFormatting.DARK_BLUE
+ item.getEnergyStored(tile.getStackInSlot(0))
+ "/"
+ item.getMaxEnergyStored(tile.getStackInSlot(0)));
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT); GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj); drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
GL11.glPopAttrib(); GL11.glPopAttrib();
@@ -1,16 +1,19 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.EnumChatFormatting;
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.client.utills.GuiHelper;
import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate; import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
/** /**
* Created by Brandon on 30/6/2015. * Created by Brandon on 30/6/2015.
@@ -56,31 +59,32 @@ public class GUIFlowGate extends GuiScreen {
String flowRSHeigh = tile.getFlowSetting(1); String flowRSHeigh = tile.getFlowSetting(1);
fontRendererObj.drawString( fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"), StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"),
guiCrt guiCrt - (fontRendererObj
- (fontRendererObj.getStringWidth( .getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSHigh.name")) / 2),
StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"))
/ 2),
guiTop + 20, guiTop + 20,
0xff0000); 0xff0000);
fontRendererObj.drawString( fontRendererObj.drawString(
flowRSHeigh, guiCrt - (fontRendererObj.getStringWidth(flowRSHeigh) / 2), guiTop + 31, 0x2c2c2c); flowRSHeigh,
guiCrt - (fontRendererObj.getStringWidth(flowRSHeigh) / 2),
guiTop + 31,
0x2c2c2c);
fontRendererObj.drawString( fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.flowGateRSLow.name"), StatCollector.translateToLocal("gui.de.flowGateRSLow.name"),
guiCrt guiCrt - (fontRendererObj
- (fontRendererObj.getStringWidth( .getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSLow.name")) / 2),
StatCollector.translateToLocal("gui.de.flowGateRSLow.name"))
/ 2),
guiTop + 50, guiTop + 50,
0x660000); 0x660000);
fontRendererObj.drawString( fontRendererObj.drawString(
flowRSLow, guiCrt - (fontRendererObj.getStringWidth(flowRSLow) / 2), guiTop + 61, 0x2c2c2c); flowRSLow,
} else guiCrt - (fontRendererObj.getStringWidth(flowRSLow) / 2),
drawCenteredString( guiTop + 61,
fontRendererObj, 0x2c2c2c);
StatCollector.translateToLocal("gui.de.flowGateOverridden.txt"), } else drawCenteredString(
width / 2, fontRendererObj,
height / 2 - 30, StatCollector.translateToLocal("gui.de.flowGateOverridden.txt"),
0x00FF00); width / 2,
height / 2 - 30,
0x00FF00);
String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": " String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": "
+ Utills.addCommas(tile.getActualFlow()); + Utills.addCommas(tile.getActualFlow());
@@ -108,34 +112,35 @@ public class GUIFlowGate extends GuiScreen {
boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
if (GuiHelper.isInRect(guiLeft + 20, guiTop + 20, 18, 18, x, y)) { if (GuiHelper.isInRect(guiLeft + 20, guiTop + 20, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " " hoverText.add(
+ tile.getToolTip(1, shift, ctrl)); StatCollector.translateToLocal("gui.de.decrement.name") + " "
+ tile.getToolTip(1, shift, ctrl));
} }
if (GuiHelper.isInRect(guiLeft + 159, guiTop + 20, 18, 18, x, y)) { if (GuiHelper.isInRect(guiLeft + 159, guiTop + 20, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " " hoverText.add(
+ tile.getToolTip(1, shift, ctrl)); StatCollector.translateToLocal("gui.de.increment.name") + " "
+ tile.getToolTip(1, shift, ctrl));
} }
if (GuiHelper.isInRect(guiLeft + 20, guiTop + 50, 18, 18, x, y)) { if (GuiHelper.isInRect(guiLeft + 20, guiTop + 50, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " " hoverText.add(
+ tile.getToolTip(0, shift, ctrl)); StatCollector.translateToLocal("gui.de.decrement.name") + " "
+ tile.getToolTip(0, shift, ctrl));
} }
if (GuiHelper.isInRect(guiLeft + 159, guiTop + 50, 18, 18, x, y)) { if (GuiHelper.isInRect(guiLeft + 159, guiTop + 50, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " " hoverText.add(
+ tile.getToolTip(0, shift, ctrl)); StatCollector.translateToLocal("gui.de.increment.name") + " "
+ tile.getToolTip(0, shift, ctrl));
} }
if (!hoverText.isEmpty()) { if (!hoverText.isEmpty()) {
hoverText.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("gui.de.pressOrScroll.name")); hoverText.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("gui.de.pressOrScroll.name"));
drawHoveringText( drawHoveringText(
hoverText, hoverText,
x x - (x < width / 2 ? fontRendererObj.getStringWidth(
- (x < width / 2 StatCollector.translateToLocal("gui.de.decrement.name") + " "
? fontRendererObj.getStringWidth( + tile.getToolTip(1, shift, ctrl))
StatCollector.translateToLocal("gui.de.decrement.name") + " " + 25 : 0),
+ tile.getToolTip(1, shift, ctrl))
+ 25
: 0),
y, y,
fontRendererObj); fontRendererObj);
} }
@@ -1,12 +1,7 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
@@ -15,8 +10,17 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileGenerator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIGenerator extends GuiContainer { public class GUIGenerator extends GuiContainer {
@@ -34,8 +38,9 @@ public class GUIGenerator extends GuiContainer {
this.player = invPlayer.player; this.player = invPlayer.player;
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png"); References.MODID.toLowerCase(),
"textures/gui/GGrinder.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) { protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) {
@@ -45,13 +50,12 @@ public class GUIGenerator extends GuiContainer {
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18); // fuel box drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18); // fuel box
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18); // flame box drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18); // flame box
if (tile.getStackInSlot(0) == null) if (tile.getStackInSlot(0) == null) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel box // box
float power = (float) tile.getEnergyStored(ForgeDirection.DOWN) float power = (float) tile.getEnergyStored(ForgeDirection.DOWN)
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)
* -1 * -1 + 1;
+ 1;
float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1; float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1;
drawTexturedModalRect( drawTexturedModalRect(
@@ -76,8 +80,11 @@ public class GUIGenerator extends GuiContainer {
if (GuiHelper.isInRect(83, 10, 12, 40, x, y)) { if (GuiHelper.isInRect(83, 10, 12, 40, x, y)) {
ArrayList<String> internal = new ArrayList<String>(); ArrayList<String> internal = new ArrayList<String>();
internal.add("Internal Storage"); internal.add("Internal Storage");
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" internal.add(
+ tile.getMaxEnergyStored(ForgeDirection.UP)); "" + EnumChatFormatting.DARK_BLUE
+ tile.getEnergyStored(ForgeDirection.UP)
+ "/"
+ tile.getMaxEnergyStored(ForgeDirection.UP));
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj); drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
} }
} }
@@ -87,13 +94,12 @@ public class GUIGenerator extends GuiContainer {
int x = X - guiLeft; int x = X - guiLeft;
int y = Y - guiTop; int y = Y - guiTop;
/* if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) { /*
ArrayList<String> internal = new ArrayList<String>(); * if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) { ArrayList<String> internal = new ArrayList<String>();
internal.add("Internal Storage"); * internal.add("Internal Storage"); internal.add("" + EnumChatFormatting.DARK_BLUE +
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP)); * tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
drawHoveringText(internal, x, y, fontRendererObj); * drawHoveringText(internal, x, y, fontRendererObj); }
} */
*/
} }
@Override @Override
@@ -117,6 +123,6 @@ public class GUIGenerator extends GuiContainer {
super.updateScreen(); super.updateScreen();
} }
// ####Draw at############ read from size // ####Draw at############ read from size
// drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38); // drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
} }
@@ -1,12 +1,7 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
@@ -15,8 +10,17 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileGrinder;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIGrinder extends GuiContainer { public class GUIGrinder extends GuiContainer {
@@ -34,8 +38,9 @@ public class GUIGrinder extends GuiContainer {
this.player = invPlayer.player; this.player = invPlayer.player;
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png"); References.MODID.toLowerCase(),
"textures/gui/GGrinder.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) { protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) {
@@ -51,14 +56,12 @@ public class GUIGrinder extends GuiContainer {
float power; float power;
if (tile.isExternallyPowered()) { if (tile.isExternallyPowered()) {
power = (float) tile.getEnergyStored(ForgeDirection.DOWN) power = (float) tile.getEnergyStored(ForgeDirection.DOWN)
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)
* -1 * -1 + 1;
+ 1;
} else { } else {
power = (float) tile.getInternalBuffer().getEnergyStored() power = (float) tile.getInternalBuffer().getEnergyStored()
/ (float) tile.getInternalBuffer().getMaxEnergyStored() / (float) tile.getInternalBuffer().getMaxEnergyStored()
* -1 * -1 + 1;
+ 1;
} }
float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1; float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1;
@@ -86,12 +89,17 @@ public class GUIGrinder extends GuiContainer {
ArrayList<String> internal = new ArrayList<String>(); ArrayList<String> internal = new ArrayList<String>();
internal.add("Energy Buffer"); internal.add("Energy Buffer");
if (tile.isExternallyPowered()) { if (tile.isExternallyPowered()) {
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" internal.add(
+ tile.getMaxEnergyStored(ForgeDirection.UP)); "" + EnumChatFormatting.DARK_BLUE
+ tile.getEnergyStored(ForgeDirection.UP)
+ "/"
+ tile.getMaxEnergyStored(ForgeDirection.UP));
} else { } else {
internal.add("" + EnumChatFormatting.DARK_BLUE internal.add(
+ tile.getInternalBuffer().getEnergyStored() + "/" "" + EnumChatFormatting.DARK_BLUE
+ tile.getInternalBuffer().getMaxEnergyStored()); + tile.getInternalBuffer().getEnergyStored()
+ "/"
+ tile.getInternalBuffer().getMaxEnergyStored());
} }
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj); drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
} }
@@ -126,6 +134,6 @@ public class GUIGrinder extends GuiContainer {
super.updateScreen(); super.updateScreen();
} }
// ####Draw at############ read from size // ####Draw at############ read from size
// drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38); // drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
} }
@@ -1,23 +1,27 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ParticleGenPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ParticleGenPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
public class GUIParticleGenerator extends GuiScreen { public class GUIParticleGenerator extends GuiScreen {
private final int xSize = 212; private final int xSize = 212;
private final int ySize = 198; private final int ySize = 198;
private ResourceLocation guiTexture = private ResourceLocation guiTexture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/ParticleGenerator.png"); References.MODID.toLowerCase(),
"textures/gui/ParticleGenerator.png");
private int page = 1; private int page = 1;
private int infoPage = 0; private int infoPage = 0;
private boolean hasInitialized = false; private boolean hasInitialized = false;
@@ -80,32 +84,33 @@ public class GUIParticleGenerator extends GuiScreen {
syncWithServer(); syncWithServer();
} }
String[] InfoText = { String[] InfoText = { ""
"" + "The Particle Generator is a decorative device that allows you to create your own custom particle effects. "
+ "The Particle Generator is a decorative device that allows you to create your own custom particle effects. " + "It is fairly easy you use this device you simply adjust the fields (variables) in the interface to change how the generated particles look and behave. "
+ "It is fairly easy you use this device you simply adjust the fields (variables) in the interface to change how the generated particles look and behave. " + "This block is a work in progress and new features and particles are likely to be added in future versions. "
+ "This block is a work in progress and new features and particles are likely to be added in future versions. " + "The following is a list of all of the fields in the interface and what they do.",
+ "The following is a list of all of the fields in the interface and what they do.", "The first thing to note is that most fields have a random modifier which will add a random number between 0 and whatever max (or min) value you give it to the field. "
"The first thing to note is that most fields have a random modifier which will add a random number between 0 and whatever max (or min) value you give it to the field. " + "-The first 3 fields (Red, Green & Blue) control the colour of the particle. Most people should be familiar with this colour system if not google RGB colours. Note: the max value for each colour can not go higher then 255 so the colour field limits the random modifier e.g. if the colour field is set to 255 and the random modifier is set to 20 the result will always be 255",
+ "-The first 3 fields (Red, Green & Blue) control the colour of the particle. Most people should be familiar with this colour system if not google RGB colours. Note: the max value for each colour can not go higher then 255 so the colour field limits the random modifier e.g. if the colour field is set to 255 and the random modifier is set to 20 the result will always be 255", "-The next 3 fields (Motion X, Y & Z) control the direction and speed of the particle "
"-The next 3 fields (Motion X, Y & Z) control the direction and speed of the particle " + "-The \"Life\" field sets how long (in ticks) before the particle despawns. "
+ "-The \"Life\" field sets how long (in ticks) before the particle despawns. " + "-The \"Size\" field sets the size of the particle. "
+ "-The \"Size\" field sets the size of the particle. " + "-The next 3 fields (Spawn X, Y & Z) Sets the spawn location of the particle (relative to the location of the particle generator)",
+ "-The next 3 fields (Spawn X, Y & Z) Sets the spawn location of the particle (relative to the location of the particle generator)", "-The \"Delay\" field sets the delay (in ticks) between each particle spawn e.g. 1=20/s, 20=1/s, 100=1/5s "
"-The \"Delay\" field sets the delay (in ticks) between each particle spawn e.g. 1=20/s, 20=1/s, 100=1/5s " + "-The \"Fade\" field sets how long (in ticks) it takes the partile to fade out of existance. Note: This adds to the life of the particle "
+ "-The \"Fade\" field sets how long (in ticks) it takes the partile to fade out of existance. Note: This adds to the life of the particle " + "-The \"Gravity\" field sets how the particle is affected by gravity. "
+ "-The \"Gravity\" field sets how the particle is affected by gravity. " + "-\"Block Collision\" Toggles weather or not the particle will collide with blocks "
+ "-\"Block Collision\" Toggles weather or not the particle will collide with blocks " + "-\"Particle Selected\" Switches between the different particles available.",
+ "-\"Particle Selected\" Switches between the different particles available.", EnumChatFormatting.DARK_RED + " Redstone Control"
EnumChatFormatting.DARK_RED + " Redstone Control" + EnumChatFormatting.BLACK + EnumChatFormatting.BLACK
+ "\nBy default a redstone signal is required for the generator to run." + "\nBy default a redstone signal is required for the generator to run."
+ "\n\nHowever if you shift right click the generator with an empty hand it will switch to inverted mode." + "\n\nHowever if you shift right click the generator with an empty hand it will switch to inverted mode."
+ "\nThe redstone mode is indicated by the 8 cubes at the corners of the block.", + "\nThe redstone mode is indicated by the 8 cubes at the corners of the block.",
EnumChatFormatting.DARK_RED + " Computer Control" + EnumChatFormatting.BLACK EnumChatFormatting.DARK_RED + " Computer Control"
+ "\nThe Generator can be controlled via a computer" + "\nIt exposes a relatively straight forward API:" + EnumChatFormatting.BLACK
+ "\n\n setGeneratorProperty(property, value)\n getGeneratorState()\n resetGeneratorState()" + "\nThe Generator can be controlled via a computer"
+ "\n\nGenerator state is obtained as a whole from getGeneratorState, whereas properties are modified one at a time using setGeneratorProperty. Property names are strings and mostly correspond to button labels in the GUI." + "\nIt exposes a relatively straight forward API:"
}; + "\n\n setGeneratorProperty(property, value)\n getGeneratorState()\n resetGeneratorState()"
+ "\n\nGenerator state is obtained as a whole from getGeneratorState, whereas properties are modified one at a time using setGeneratorProperty. Property names are strings and mostly correspond to button labels in the GUI." };
// @formatter:off // @formatter:off
@Override @Override
@@ -1,14 +1,7 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerPlayerDetector;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.PlayerDetectorButtonPacket;
import com.brandon3055.draconicevolution.common.network.PlayerDetectorStringPacket;
import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorAdvanced;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.gui.GuiTextField;
@@ -16,8 +9,19 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerPlayerDetector;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.PlayerDetectorButtonPacket;
import com.brandon3055.draconicevolution.common.network.PlayerDetectorStringPacket;
import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorAdvanced;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIPlayerDetector extends GuiContainer { public class GUIPlayerDetector extends GuiContainer {
@@ -49,8 +53,9 @@ public class GUIPlayerDetector extends GuiContainer {
syncWithServer(); syncWithServer();
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/PlayerDetector.png"); References.MODID.toLowerCase(),
"textures/gui/PlayerDetector.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -158,8 +163,8 @@ public class GUIPlayerDetector extends GuiContainer {
names[selected] = selectedNameText.getText(); names[selected] = selectedNameText.getText();
selectedNameText.setText(""); selectedNameText.setText("");
selectedNameText.setFocused(false); selectedNameText.setFocused(false);
DraconicEvolution.network.sendToServer( DraconicEvolution.network
new PlayerDetectorStringPacket((byte) selected, names[selected])); .sendToServer(new PlayerDetectorStringPacket((byte) selected, names[selected]));
selected = -1; selected = -1;
} }
} else super.keyTyped(par1, par2); } else super.keyTyped(par1, par2);
@@ -1,18 +1,21 @@
package com.brandon3055.draconicevolution.client.gui; 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.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerSunDial; import com.brandon3055.draconicevolution.common.container.ContainerSunDial;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.TeleporterPacket; import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileSunDial; import com.brandon3055.draconicevolution.common.tileentities.TileSunDial;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUISunDial extends GuiContainer { public class GUISunDial extends GuiContainer {
@@ -1,17 +1,8 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
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.common.ModItems;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@@ -25,15 +16,30 @@ import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11; 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.common.ModItems;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUITeleporter extends GuiScreen { public class GUITeleporter extends GuiScreen {
private final int xSize = 182; private final int xSize = 182;
private final int ySize = 141; private final int ySize = 141;
private ResourceLocation guiTexture = private ResourceLocation guiTexture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/TeleporterMKII.png"); References.MODID.toLowerCase(),
"textures/gui/TeleporterMKII.png");
private ItemStack teleporterItem; private ItemStack teleporterItem;
protected List<TeleportLocation> locations = new ArrayList<TeleportLocation>(0); protected List<TeleportLocation> locations = new ArrayList<TeleportLocation>(0);
@@ -168,26 +174,22 @@ public class GUITeleporter extends GuiScreen {
int posY = (this.height - ySize) / 2; int posY = (this.height - ySize) / 2;
if (locations.size() <= 0) return; if (locations.size() <= 0) return;
fontRendererObj.drawString( fontRendererObj.drawString(
EnumChatFormatting.GOLD + "X: " EnumChatFormatting.GOLD + "X: " + (int) getLocationSafely(selected + selectionOffset).getXCoord(),
+ (int) getLocationSafely(selected + selectionOffset).getXCoord(),
posX + 114, posX + 114,
posY + 7, posY + 7,
0x000000); 0x000000);
fontRendererObj.drawString( fontRendererObj.drawString(
EnumChatFormatting.GOLD + "Y: " EnumChatFormatting.GOLD + "Y: " + (int) getLocationSafely(selected + selectionOffset).getYCoord(),
+ (int) getLocationSafely(selected + selectionOffset).getYCoord(),
posX + 114, posX + 114,
posY + 16, posY + 16,
0x000000); 0x000000);
fontRendererObj.drawString( fontRendererObj.drawString(
EnumChatFormatting.GOLD + "Z: " EnumChatFormatting.GOLD + "Z: " + (int) getLocationSafely(selected + selectionOffset).getZCoord(),
+ (int) getLocationSafely(selected + selectionOffset).getZCoord(),
posX + 114, posX + 114,
posY + 25, posY + 25,
0x000000); 0x000000);
fontRendererObj.drawString( fontRendererObj.drawString(
EnumChatFormatting.GOLD + "" EnumChatFormatting.GOLD + "" + getLocationSafely(selected + selectionOffset).getDimensionName(),
+ getLocationSafely(selected + selectionOffset).getDimensionName(),
posX + 114, posX + 114,
posY + 34, posY + 34,
0x000000); 0x000000);
@@ -245,21 +247,19 @@ public class GUITeleporter extends GuiScreen {
if (GuiHelper.isInRect(99, 8 + i * 11, 8, 7, x - posX, y - posY)) { if (GuiHelper.isInRect(99, 8 + i * 11, 8, 7, x - posX, y - posY)) {
getLocationSafely(i + selectionOffset) getLocationSafely(i + selectionOffset)
.setWriteProtected( .setWriteProtected(!getLocationSafely(i + selectionOffset).getWriteProtected());
!getLocationSafely(i + selectionOffset).getWriteProtected()); DraconicEvolution.network.sendToServer(
DraconicEvolution.network.sendToServer(new TeleporterPacket( new TeleporterPacket(
TeleporterPacket.UPDATELOCK, TeleporterPacket.UPDATELOCK,
i + selectionOffset, i + selectionOffset,
getLocationSafely(i + selectionOffset).getWriteProtected())); getLocationSafely(i + selectionOffset).getWriteProtected()));
} }
} }
if (selectionChanged) if (selectionChanged) DraconicEvolution.network
DraconicEvolution.network.sendToServer( .sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false)); if (offsetChanged) DraconicEvolution.network
if (offsetChanged) .sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
updateButtons(); updateButtons();
super.mouseClicked(x, y, button); super.mouseClicked(x, y, button);
@@ -294,12 +294,10 @@ public class GUITeleporter extends GuiScreen {
updateButtons(); updateButtons();
} }
if (selectionChanged) if (selectionChanged) DraconicEvolution.network
DraconicEvolution.network.sendToServer( .sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false)); if (offsetChanged) DraconicEvolution.network
if (offsetChanged) .sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
super.handleMouseInput(); super.handleMouseInput();
} }
@@ -312,13 +310,12 @@ public class GUITeleporter extends GuiScreen {
if ((selected + selectionOffset) + 1 > locations.size()) { if ((selected + selectionOffset) + 1 > locations.size()) {
selected = 0; selected = 0;
selectionOffset = 0; selectionOffset = 0;
DraconicEvolution.network.sendToServer( DraconicEvolution.network
new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false)); .sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
DraconicEvolution.network.sendToServer( DraconicEvolution.network
new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false)); .sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
} }
if (locations.size() == 0 if (locations.size() == 0 || getLocationSafely(selected + selectionOffset).getWriteProtected()) {
|| getLocationSafely(selected + selectionOffset).getWriteProtected()) {
((GuiButton) buttonList.get(0)).enabled = false; ((GuiButton) buttonList.get(0)).enabled = false;
((GuiButton) buttonList.get(1)).enabled = false; ((GuiButton) buttonList.get(1)).enabled = false;
((GuiButton) buttonList.get(2)).enabled = false; ((GuiButton) buttonList.get(2)).enabled = false;
@@ -347,25 +344,73 @@ public class GUITeleporter extends GuiScreen {
// updateTeleporter(); // updateTeleporter();
buttonList.add(new GuiButtonAHeight( buttonList.add(
0, posX + 112, posY + 45, 66, 12, StatCollector.translateToLocal("button.de.rename.txt"))); new GuiButtonAHeight(
buttonList.add(new GuiButtonAHeight( 0,
1, posX + 112, posY + 58, 66, 12, StatCollector.translateToLocal("button.de.setHere.txt"))); posX + 112,
buttonList.add(new GuiButtonAHeight( posY + 45,
2, posX + 112, posY + 71, 66, 12, StatCollector.translateToLocal("button.de.remove.txt"))); 66,
12,
StatCollector.translateToLocal("button.de.rename.txt")));
buttonList.add(
new GuiButtonAHeight(
1,
posX + 112,
posY + 58,
66,
12,
StatCollector.translateToLocal("button.de.setHere.txt")));
buttonList.add(
new GuiButtonAHeight(
2,
posX + 112,
posY + 71,
66,
12,
StatCollector.translateToLocal("button.de.remove.txt")));
buttonList.add(new GuiButtonAHeight( buttonList.add(
3, posX + 112, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.UP.txt"))); new GuiButtonAHeight(
3,
posX + 112,
posY + 99,
33,
12,
StatCollector.translateToLocal("button.de.UP.txt")));
buttonList.add(new GuiButtonAHeight( buttonList.add(
4, posX + 112, posY + 112, 66, 12, StatCollector.translateToLocal("button.de.addNew.txt"))); new GuiButtonAHeight(
buttonList.add(new GuiButtonAHeight( 4,
5, posX + 112, posY + 125, 66, 12, StatCollector.translateToLocal("button.de.addFuel.txt"))); posX + 112,
buttonList.add(new GuiButtonAHeight( posY + 112,
6, posX + xSize - 63, posY - 15, 60, 15, StatCollector.translateToLocal("button.de.cancel.txt"))); 66,
12,
StatCollector.translateToLocal("button.de.addNew.txt")));
buttonList.add(
new GuiButtonAHeight(
5,
posX + 112,
posY + 125,
66,
12,
StatCollector.translateToLocal("button.de.addFuel.txt")));
buttonList.add(
new GuiButtonAHeight(
6,
posX + xSize - 63,
posY - 15,
60,
15,
StatCollector.translateToLocal("button.de.cancel.txt")));
buttonList.add(new GuiButtonAHeight( buttonList.add(
7, posX + 112 + 34, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.DOWN.txt"))); new GuiButtonAHeight(
7,
posX + 112 + 34,
posY + 99,
33,
12,
StatCollector.translateToLocal("button.de.DOWN.txt")));
((GuiButton) buttonList.get(6)).visible = false; ((GuiButton) buttonList.get(6)).visible = false;
textBeingEdited = new GuiTextField(fontRendererObj, posX + 3, posY - 14, xSize - 67, 12); textBeingEdited = new GuiTextField(fontRendererObj, posX + 3, posY - 14, xSize - 67, 12);
@@ -392,8 +437,7 @@ public class GUITeleporter extends GuiScreen {
if (!editingExisting) { if (!editingExisting) {
editingExisting = true; editingExisting = true;
textBeingEdited.setVisible(true); textBeingEdited.setVisible(true);
textBeingEdited.setText( textBeingEdited.setText(getLocationSafely(selected + selectionOffset).getName());
getLocationSafely(selected + selectionOffset).getName());
textBeingEdited.setSelectionPos(0); textBeingEdited.setSelectionPos(0);
textBeingEdited.setFocused(true); textBeingEdited.setFocused(true);
((GuiButton) buttonList.get(6)).visible = true; ((GuiButton) buttonList.get(6)).visible = true;
@@ -404,8 +448,8 @@ public class GUITeleporter extends GuiScreen {
location.setName(textBeingEdited.getText()); location.setName(textBeingEdited.getText());
DraconicEvolution.network.sendToServer( DraconicEvolution.network.sendToServer(
new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset)); new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset));
((GuiButton) buttonList.get(0)).displayString = ((GuiButton) buttonList.get(0)).displayString = StatCollector
StatCollector.translateToLocal("button.de.rename.txt"); .translateToLocal("button.de.rename.txt");
editingExisting = false; editingExisting = false;
textBeingEdited.setVisible(false); textBeingEdited.setVisible(false);
((GuiButton) buttonList.get(6)).visible = false; ((GuiButton) buttonList.get(6)).visible = false;
@@ -475,8 +519,8 @@ public class GUITeleporter extends GuiScreen {
} else { } else {
if (!textBeingEdited.getText().isEmpty()) { if (!textBeingEdited.getText().isEmpty()) {
addCurrentLocationToList(textBeingEdited.getText()); addCurrentLocationToList(textBeingEdited.getText());
((GuiButton) buttonList.get(4)).displayString = ((GuiButton) buttonList.get(4)).displayString = StatCollector
StatCollector.translateToLocal("button.de.addNew.txt"); .translateToLocal("button.de.addNew.txt");
editingNew = false; editingNew = false;
textBeingEdited.setVisible(false); textBeingEdited.setVisible(false);
((GuiButton) buttonList.get(6)).visible = false; ((GuiButton) buttonList.get(6)).visible = false;
@@ -514,13 +558,11 @@ public class GUITeleporter extends GuiScreen {
public void keyTyped(char key, int keyN) { public void keyTyped(char key, int keyN) {
if (this.textBeingEdited.textboxKeyTyped(key, keyN)) { if (this.textBeingEdited.textboxKeyTyped(key, keyN)) {
if (editingNew) { if (editingNew) {
((GuiButton) buttonList.get(4)).enabled = ((GuiButton) buttonList.get(4)).enabled = !textBeingEdited.getText().isEmpty();
!textBeingEdited.getText().isEmpty();
((GuiButton) buttonList.get(4)).displayString = StatCollector.translateToLocal("button.de.commit.txt"); ((GuiButton) buttonList.get(4)).displayString = StatCollector.translateToLocal("button.de.commit.txt");
} }
if (editingExisting) { if (editingExisting) {
((GuiButton) buttonList.get(0)).enabled = ((GuiButton) buttonList.get(0)).enabled = !textBeingEdited.getText().isEmpty();
!textBeingEdited.getText().isEmpty();
((GuiButton) buttonList.get(0)).displayString = StatCollector.translateToLocal("button.de.commit.txt"); ((GuiButton) buttonList.get(0)).displayString = StatCollector.translateToLocal("button.de.commit.txt");
} }
return; return;
@@ -544,13 +586,11 @@ public class GUITeleporter extends GuiScreen {
this.mc.setIngameFocus(); this.mc.setIngameFocus();
} }
if (tick % 5 == 0 if (tick % 5 == 0 && locations.size() > 0
&& locations.size() > 0 && getLocationSafely(selected + selectionOffset).getDimensionName().equals("")
&& getLocationSafely(selected + selectionOffset)
.getDimensionName()
.equals("")
&& player.getHeldItem() != null && player.getHeldItem() != null
&& player.getHeldItem().getItem() == ModItems.teleporterMKII) readDataFromItem(player.getHeldItem()); && player.getHeldItem().getItem() == ModItems.teleporterMKII)
readDataFromItem(player.getHeldItem());
tick++; tick++;
if (tick >= 10) { if (tick >= 10) {
@@ -1,16 +1,8 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
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 cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
@@ -20,8 +12,20 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
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 cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIUpgradeModifier extends GuiContainer { public class GUIUpgradeModifier extends GuiContainer {
@@ -34,8 +38,8 @@ public class GUIUpgradeModifier extends GuiContainer {
private List<EnumUpgrade> itemUpgrades = new ArrayList<EnumUpgrade>(); private List<EnumUpgrade> itemUpgrades = new ArrayList<EnumUpgrade>();
private ContainerUpgradeModifier containerEM; private ContainerUpgradeModifier containerEM;
public GUIUpgradeModifier( public GUIUpgradeModifier(InventoryPlayer invPlayer, TileUpgradeModifier tile,
InventoryPlayer invPlayer, TileUpgradeModifier tile, ContainerUpgradeModifier containerEM) { ContainerUpgradeModifier containerEM) {
super(containerEM); super(containerEM);
this.containerEM = containerEM; this.containerEM = containerEM;
@@ -154,24 +158,21 @@ public class GUIUpgradeModifier extends GuiContainer {
for (int i = 0; i <= coreTier; i++) { for (int i = 0; i <= coreTier; i++) {
// Check + buttons // Check + buttons
if (coreInInventory[i] if (coreInInventory[i] && coreSlots > usedSlots
&& coreSlots > usedSlots
&& GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y) && GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y)
&& upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) { && upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
containerEM.sendObjectToServer(null, upgrade.index, i * 2); containerEM.sendObjectToServer(null, upgrade.index, i * 2);
Minecraft.getMinecraft() Minecraft.getMinecraft().getSoundHandler().playSound(
.getSoundHandler() PositionedSoundRecord
.playSound(PositionedSoundRecord.func_147674_a( .func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
} }
// Check - buttons // Check - buttons
if (appliedCores[i] > 0 && GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y)) { if (appliedCores[i] > 0 && GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y)) {
containerEM.sendObjectToServer(null, upgrade.index, 1 + i * 2); containerEM.sendObjectToServer(null, upgrade.index, 1 + i * 2);
Minecraft.getMinecraft() Minecraft.getMinecraft().getSoundHandler().playSound(
.getSoundHandler() PositionedSoundRecord
.playSound(PositionedSoundRecord.func_147674_a( .func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
} }
} }
} }
@@ -218,12 +219,11 @@ public class GUIUpgradeModifier extends GuiContainer {
drawTexturedModalRect(xPos + 16, yPos + 33 + i * 18, 56 + (hovering ? 8 : 0), 208, 8, 8); drawTexturedModalRect(xPos + 16, yPos + 33 + i * 18, 56 + (hovering ? 8 : 0), 208, 8, 8);
} }
} }
for (int i = 0; i <= coreTier; i++) for (int i = 0; i <= coreTier; i++) fontRendererObj.drawString(
fontRendererObj.drawString( String.valueOf(appliedCores[i]),
String.valueOf(appliedCores[i]), xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(appliedCores[i])) / 2,
xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(appliedCores[i])) / 2, yPos + 29 + i * 18,
yPos + 29 + i * 18, 0xFFFFFF);
0xFFFFFF);
fontRendererObj.drawString( fontRendererObj.drawString(
String.valueOf(upgrade.getUpgradePoints(stack)), String.valueOf(upgrade.getUpgradePoints(stack)),
xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(upgrade.getUpgradePoints(stack))) / 2, xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(upgrade.getUpgradePoints(stack))) / 2,
@@ -232,15 +232,18 @@ public class GUIUpgradeModifier extends GuiContainer {
} }
fontRendererObj.drawStringWithShadow( fontRendererObj.drawStringWithShadow(
StatCollector.translateToLocal("gui.de.cores.txt"), guiLeft + 4, guiTop + 4, 0x00ff00); StatCollector.translateToLocal("gui.de.cores.txt"),
fontRendererObj.drawString( guiLeft + 4,
StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000); guiTop + 4,
0x00ff00);
fontRendererObj
.drawString(StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000);
fontRendererObj.drawString(">" + coreSlots, guiLeft + 4, guiTop + 25, 0x000000); fontRendererObj.drawString(">" + coreSlots, guiLeft + 4, guiTop + 25, 0x000000);
fontRendererObj.drawString( fontRendererObj
StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000); .drawString(StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
fontRendererObj.drawString(">" + usedSlots, guiLeft + 4, guiTop + 46, 0x000000); fontRendererObj.drawString(">" + usedSlots, guiLeft + 4, guiTop + 46, 0x000000);
fontRendererObj.drawString( fontRendererObj
StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000); .drawString(StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
fontRendererObj.drawString(">" + (coreSlots - usedSlots), guiLeft + 4, guiTop + 67, 0x000000); fontRendererObj.drawString(">" + (coreSlots - usedSlots), guiLeft + 4, guiTop + 67, 0x000000);
} }
@@ -265,10 +268,12 @@ public class GUIUpgradeModifier extends GuiContainer {
if (GuiHelper.isInRect(xPos + 3, yPos - 9, 18, 8, x, y)) { if (GuiHelper.isInRect(xPos + 3, yPos - 9, 18, 8, x, y)) {
List list = new ArrayList(); List list = new ArrayList();
list.add(StatCollector.translateToLocal("gui.de.basePoints.txt") + ": " list.add(
+ upgradableItem.getBaseUpgradePoints(upgrade.index)); StatCollector.translateToLocal("gui.de.basePoints.txt") + ": "
list.add(StatCollector.translateToLocal("gui.de.maxPoints.txt") + ": " + upgradableItem.getBaseUpgradePoints(upgrade.index));
+ upgradableItem.getMaxUpgradePoints(upgrade.index, stack)); list.add(
StatCollector.translateToLocal("gui.de.maxPoints.txt") + ": "
+ upgradableItem.getMaxUpgradePoints(upgrade.index, stack));
list.add(StatCollector.translateToLocal("gui.de.pointCost.txt") + ": " + upgrade.pointConversion); list.add(StatCollector.translateToLocal("gui.de.pointCost.txt") + ": " + upgrade.pointConversion);
drawHoveringText(list, x, y, fontRendererObj); drawHoveringText(list, x, y, fontRendererObj);
} }
@@ -277,9 +282,10 @@ public class GUIUpgradeModifier extends GuiContainer {
if (GuiHelper.isInRect(xPos + 9, yPos + 25 + i * 18, 6, 15, x, y)) { if (GuiHelper.isInRect(xPos + 9, yPos + 25 + i * 18, 6, 15, x, y)) {
List list = new ArrayList(); List list = new ArrayList();
double value = Math.pow(2, i) / upgrade.pointConversion; double value = Math.pow(2, i) / upgrade.pointConversion;
String string = StatCollector.translateToLocal("gui.de.value.txt") + ": " + value + " " String string = StatCollector.translateToLocal("gui.de.value.txt") + ": "
+ (value == 1 + value
? StatCollector.translateToLocal("gui.de.point.txt") + " "
+ (value == 1 ? StatCollector.translateToLocal("gui.de.point.txt")
: StatCollector.translateToLocal("gui.de.points.txt")); : StatCollector.translateToLocal("gui.de.points.txt"));
list.add(string.replace(".0", "")); list.add(string.replace(".0", ""));
drawHoveringText(list, x, y, fontRendererObj); drawHoveringText(list, x, y, fontRendererObj);
@@ -1,20 +1,23 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerWeatherController;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileWeatherController;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerWeatherController;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileWeatherController;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class GUIWeatherController extends GuiContainer { public class GUIWeatherController extends GuiContainer {
@@ -34,8 +37,9 @@ public class GUIWeatherController extends GuiContainer {
this.player = invPlayer.player; this.player = invPlayer.player;
} }
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/WeatherController.png"); References.MODID.toLowerCase(),
"textures/gui/WeatherController.png");
@Override @Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -4,6 +4,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
@@ -21,8 +22,7 @@ public class GuiButtonAHeight extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer; FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(buttonTextures); minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = mouseX >= this.xPosition this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width && mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height; && mouseY < this.yPosition + this.height;
int k = this.getHoverState(this.field_146123_n); int k = this.getHoverState(this.field_146123_n);
@@ -30,7 +30,12 @@ public class GuiButtonAHeight extends GuiButton {
OpenGlHelper.glBlendFunc(770, 771, 1, 0); OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect( this.drawTexturedModalRect(
this.xPosition, this.yPosition, 0, 46 + k * 20, width % 2 + this.width / 2, this.height); this.xPosition,
this.yPosition,
0,
46 + k * 20,
width % 2 + this.width / 2,
this.height);
this.drawTexturedModalRect( this.drawTexturedModalRect(
width % 2 + this.xPosition + this.width / 2, width % 2 + this.xPosition + this.width / 2,
this.yPosition, this.yPosition,
@@ -5,17 +5,19 @@ import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 17/09/2014. * Created by Brandon on 17/09/2014.
*/ */
public class GuiButtonTextOnly extends GuiButton { public class GuiButtonTextOnly extends GuiButton {
public String LINKED_PAGE; public String LINKED_PAGE;
public int textColour; public int textColour;
public GuiButtonTextOnly( public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage,
int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, int colour) { int colour) {
super(id, xPos, yPos, width, hight, displayString); super(id, xPos, yPos, width, hight, displayString);
this.LINKED_PAGE = linkedPage; this.LINKED_PAGE = linkedPage;
this.textColour = colour; this.textColour = colour;
@@ -27,8 +29,7 @@ public class GuiButtonTextOnly extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer; FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(buttonTextures); minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = mouseX >= this.xPosition this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
&& mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width && mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height; && mouseY < this.yPosition + this.height;
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
@@ -1,5 +1,9 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual; import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual;
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIReactor; import com.brandon3055.draconicevolution.client.gui.componentguis.GUIReactor;
@@ -9,11 +13,9 @@ import com.brandon3055.draconicevolution.common.inventory.InventoryTool;
import com.brandon3055.draconicevolution.common.tileentities.*; import com.brandon3055.draconicevolution.common.tileentities.*;
import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate; import com.brandon3055.draconicevolution.common.tileentities.gates.TileGate;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class GuiHandler implements IGuiHandler { public class GuiHandler implements IGuiHandler {
@@ -104,12 +106,12 @@ public class GuiHandler implements IGuiHandler {
} }
break; break;
// case GUIID_CONTAINER_TEMPLATE: // case GUIID_CONTAINER_TEMPLATE:
// TileEntity containerTemp = world.getTileEntity(x, y, z); // TileEntity containerTemp = world.getTileEntity(x, y, z);
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) { // if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
// return new ContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp); // return new ContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
// } // }
// break; // break;
} }
return null; return null;
@@ -179,12 +181,15 @@ public class GuiHandler implements IGuiHandler {
TileEntity reactor = world.getTileEntity(x, y, z); TileEntity reactor = world.getTileEntity(x, y, z);
if (reactor != null && reactor instanceof TileReactorCore) { if (reactor != null && reactor instanceof TileReactorCore) {
return new GUIReactor( return new GUIReactor(
player, (TileReactorCore) reactor, new ContainerReactor(player, (TileReactorCore) reactor)); player,
(TileReactorCore) reactor,
new ContainerReactor(player, (TileReactorCore) reactor));
} }
break; break;
case GUIID_TOOL_CONFIG: case GUIID_TOOL_CONFIG:
return new GUIToolConfig( return new GUIToolConfig(
player, new ContainerAdvTool(player.inventory, new InventoryTool(player, null))); player,
new ContainerAdvTool(player.inventory, new InventoryTool(player, null)));
case GUIID_FLOW_GATE: case GUIID_FLOW_GATE:
return world.getTileEntity(x, y, z) instanceof TileGate return world.getTileEntity(x, y, z) instanceof TileGate
? new GUIFlowGate((TileGate) world.getTileEntity(x, y, z)) ? new GUIFlowGate((TileGate) world.getTileEntity(x, y, z))
@@ -199,12 +204,12 @@ public class GuiHandler implements IGuiHandler {
} }
break; break;
// case GUIID_CONTAINER_TEMPLATE: // case GUIID_CONTAINER_TEMPLATE:
// TileEntity containerTemp = world.getTileEntity(x, y, z); // TileEntity containerTemp = world.getTileEntity(x, y, z);
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) { // if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
// return new GUIContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp); // return new GUIContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
// } // }
// break; // break;
} }
return null; return null;
@@ -1,21 +1,25 @@
package com.brandon3055.draconicevolution.client.gui; package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIBase;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
/** /**
* Created by brandon3055 on 11/2/2016. * Created by brandon3055 on 11/2/2016.
*/ */
public class GuiHudConfig extends GuiScreen { public class GuiHudConfig extends GuiScreen {
private GUIBase parent; private GUIBase parent;
private GuiButton buttonHudFade; private GuiButton buttonHudFade;
private GuiButton buttonArmorFade; private GuiButton buttonArmorFade;
@@ -39,35 +43,76 @@ public class GuiHudConfig extends GuiScreen {
buttonList.add(new GuiButtonAHeight(0, x - 35, y + 95, 70, 15, StatCollector.translateToLocal("gui.back"))); buttonList.add(new GuiButtonAHeight(0, x - 35, y + 95, 70, 15, StatCollector.translateToLocal("gui.back")));
buttonList.add(new GuiButtonAHeight( buttonList.add(
1, x + 2, y - 37, 80, 15, StatCollector.translateToLocal("button.de.scaleUp.txt"))); new GuiButtonAHeight(
buttonList.add(new GuiButtonAHeight( 1,
2, x - 81, y - 37, 80, 15, StatCollector.translateToLocal("button.de.scaleDown.txt"))); x + 2,
y - 37,
80,
15,
StatCollector.translateToLocal("button.de.scaleUp.txt")));
buttonList.add(
new GuiButtonAHeight(
2,
x - 81,
y - 37,
80,
15,
StatCollector.translateToLocal("button.de.scaleDown.txt")));
buttonList.add(buttonHudFade = new GuiButtonAHeight(3, x - 81, y - 20, 163, 15, "")); buttonList.add(buttonHudFade = new GuiButtonAHeight(3, x - 81, y - 20, 163, 15, ""));
buttonList.add(new GuiButtonAHeight( buttonList.add(
9, x - 81, y - 3, 163, 15, StatCollector.translateToLocal("button.de.toggleHidden.txt"))); new GuiButtonAHeight(
9,
x - 81,
y - 3,
163,
15,
StatCollector.translateToLocal("button.de.toggleHidden.txt")));
buttonList.add(new GuiButtonAHeight( buttonList.add(
4, x + 2, y + 25, 80, 15, StatCollector.translateToLocal("button.de.scaleUp.txt"))); new GuiButtonAHeight(
buttonList.add(new GuiButtonAHeight( 4,
5, x - 81, y + 25, 80, 15, StatCollector.translateToLocal("button.de.scaleDown.txt"))); x + 2,
y + 25,
80,
15,
StatCollector.translateToLocal("button.de.scaleUp.txt")));
buttonList.add(
new GuiButtonAHeight(
5,
x - 81,
y + 25,
80,
15,
StatCollector.translateToLocal("button.de.scaleDown.txt")));
buttonList.add(buttonArmorFade = new GuiButtonAHeight(6, x - 81, y + 42, 163, 15, "")); buttonList.add(buttonArmorFade = new GuiButtonAHeight(6, x - 81, y + 42, 163, 15, ""));
buttonList.add(buttonArmorNumeric = new GuiButtonAHeight(7, x + 2, y + 59, 80, 15, "")); buttonList.add(buttonArmorNumeric = new GuiButtonAHeight(7, x + 2, y + 59, 80, 15, ""));
buttonList.add(new GuiButtonAHeight( buttonList.add(
8, x - 81, y + 59, 80, 15, StatCollector.translateToLocal("button.de.rotate.txt"))); new GuiButtonAHeight(
buttonList.add(new GuiButtonAHeight( 8,
10, x - 81, y + 76, 163, 15, StatCollector.translateToLocal("button.de.toggleHidden.txt"))); x - 81,
y + 59,
80,
15,
StatCollector.translateToLocal("button.de.rotate.txt")));
buttonList.add(
new GuiButtonAHeight(
10,
x - 81,
y + 76,
163,
15,
StatCollector.translateToLocal("button.de.toggleHidden.txt")));
} }
@Override @Override
public void updateScreen() { public void updateScreen() {
buttonHudFade.displayString = buttonHudFade.displayString = StatCollector
StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[6] + ".txt"); .translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[6] + ".txt");
buttonArmorFade.displayString = buttonArmorFade.displayString = StatCollector
StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[7] + ".txt"); .translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[7] + ".txt");
buttonArmorNumeric.displayString = StatCollector.translateToLocal("button.de.numeric.txt") + " " buttonArmorNumeric.displayString = StatCollector.translateToLocal("button.de.numeric.txt") + " "
+ (ConfigHandler.hudSettings[9] == 0 + (ConfigHandler.hudSettings[9] == 0 ? StatCollector.translateToLocal("gui.de.off.txt")
? StatCollector.translateToLocal("gui.de.off.txt")
: StatCollector.translateToLocal("gui.de.on.txt")); : StatCollector.translateToLocal("gui.de.on.txt"));
} }
@@ -104,17 +149,15 @@ public class GuiHudConfig extends GuiScreen {
else ConfigHandler.hudSettings[11] = 0; else ConfigHandler.hudSettings[11] = 0;
} }
ConfigHandler.config ConfigHandler.config.get(
.get( "Gui Stuff",
"Gui Stuff", "HUD Settings",
"HUD Settings", new int[] { 7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1 },
new int[] {7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1}, "Used to store the position of the armor ant tool HUD's. This should not be modified",
"Used to store the position of the armor ant tool HUD's. This should not be modified", Integer.MIN_VALUE,
Integer.MIN_VALUE, Integer.MAX_VALUE,
Integer.MAX_VALUE, true,
true, 12).set(ConfigHandler.hudSettings);
12)
.set(ConfigHandler.hudSettings);
ConfigHandler.config.save(); ConfigHandler.config.save();
} }
@@ -152,9 +195,17 @@ public class GuiHudConfig extends GuiScreen {
0xFFFFFF); 0xFFFFFF);
drawCenteredString( drawCenteredString(
fontRendererObj, ConfigHandler.hudSettings[4] + "%", width / 2 + 97, height / 2 - 63, 0xFFFFFF); fontRendererObj,
ConfigHandler.hudSettings[4] + "%",
width / 2 + 97,
height / 2 - 63,
0xFFFFFF);
drawCenteredString( drawCenteredString(
fontRendererObj, ConfigHandler.hudSettings[5] + "%", width / 2 + 97, height / 2 - 1, 0xFFFFFF); fontRendererObj,
ConfigHandler.hudSettings[5] + "%",
width / 2 + 97,
height / 2 - 1,
0xFFFFFF);
super.drawScreen(x, y, partial); super.drawScreen(x, y, partial);
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@@ -185,15 +236,12 @@ public class GuiHudConfig extends GuiScreen {
if (GuiHelper.isInRect(armorX - 19, armorY - 19, 39, 39, x, y) if (GuiHelper.isInRect(armorX - 19, armorY - 19, 39, 39, x, y)
|| GuiHelper.isInRect(hudX - 19, hudY - 19, 39, 39, x, y)) { || GuiHelper.isInRect(hudX - 19, hudY - 19, 39, 39, x, y)) {
drawHoveringText( drawHoveringText(new ArrayList<String>() {
new ArrayList<String>() {
{ {
add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt2.txt")); add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt2.txt"));
} }
}, }, x, y, fontRendererObj);
x,
y,
fontRendererObj);
} }
} }
@@ -224,17 +272,15 @@ public class GuiHudConfig extends GuiScreen {
protected void mouseMovedOrUp(int x, int y, int action) { protected void mouseMovedOrUp(int x, int y, int action) {
super.mouseMovedOrUp(x, y, action); super.mouseMovedOrUp(x, y, action);
draggingHud = draggingArmor = false; draggingHud = draggingArmor = false;
ConfigHandler.config ConfigHandler.config.get(
.get( "Gui Stuff",
"Gui Stuff", "HUD Settings",
"HUD Settings", new int[] { 7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1 },
new int[] {7, 874, 100, 100, 100, 100, 0, 0, 0, 0, 1, 1}, "Used to store the position of the armor ant tool HUD's. This should not be modified",
"Used to store the position of the armor ant tool HUD's. This should not be modified", Integer.MIN_VALUE,
Integer.MIN_VALUE, Integer.MAX_VALUE,
Integer.MAX_VALUE, true,
true, 12).set(ConfigHandler.hudSettings);
12)
.set(ConfigHandler.hudSettings);
ConfigHandler.config.save(); ConfigHandler.config.save();
} }
@@ -4,17 +4,19 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 30/6/2015. * Created by Brandon on 30/6/2015.
*/ */
public class GuiTextureButton extends GuiButton { public class GuiTextureButton extends GuiButton {
public int textureXPos; public int textureXPos;
public int textureYPos; public int textureYPos;
public GuiTextureButton( public GuiTextureButton(int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise,
int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise, String text) { String text) {
super(id, xPos, yPos, xSise, ySise, text); super(id, xPos, yPos, xSise, ySise, text);
this.textureXPos = textureXPos; this.textureXPos = textureXPos;
this.textureYPos = textureYPos; this.textureYPos = textureYPos;
@@ -25,8 +27,7 @@ public class GuiTextureButton extends GuiButton {
if (this.visible) { if (this.visible) {
FontRenderer fontrenderer = mc.fontRenderer; FontRenderer fontrenderer = mc.fontRenderer;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = x >= this.xPosition this.field_146123_n = x >= this.xPosition && y >= this.yPosition
&& y >= this.yPosition
&& x < this.xPosition + this.width && x < this.xPosition + this.width
&& y < this.yPosition + this.height; && y < this.yPosition + this.height;
int k = this.getHoverState(this.field_146123_n); int k = this.getHoverState(this.field_146123_n);
@@ -34,7 +35,12 @@ public class GuiTextureButton extends GuiButton {
OpenGlHelper.glBlendFunc(770, 771, 1, 0); OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect( this.drawTexturedModalRect(
this.xPosition, this.yPosition, textureXPos, textureYPos + k * height, this.width, this.height); this.xPosition,
this.yPosition,
textureXPos,
textureYPos + k * height,
this.width,
this.height);
this.mouseDragged(mc, x, y); this.mouseDragged(mc, x, y);
int l = 14737632; int l = 14737632;
@@ -1,5 +1,23 @@
package com.brandon3055.draconicevolution.client.gui.componentguis; package com.brandon3055.draconicevolution.client.gui.componentguis;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiConfirmOpenLink;
import net.minecraft.client.gui.GuiYesNoCallback;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.resources.IResource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.apache.commons.io.IOUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.client.gui.guicomponents.*; import com.brandon3055.brandonscore.client.gui.guicomponents.*;
import com.brandon3055.brandonscore.client.utills.ClientUtills; import com.brandon3055.brandonscore.client.utills.ClientUtills;
import com.brandon3055.brandonscore.common.utills.InfoHelper; import com.brandon3055.brandonscore.common.utills.InfoHelper;
@@ -13,21 +31,6 @@ import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.LogHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper;
import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonReader;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiConfirmOpenLink;
import net.minecraft.client.gui.GuiYesNoCallback;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.resources.IResource;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.apache.commons.io.IOUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 6/03/2015. * Created by Brandon on 6/03/2015.
@@ -44,12 +47,16 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
public GUIManual() { public GUIManual() {
super(new DummyContainer(), 255, 325); super(new DummyContainer(), 255, 325);
if (currentPage != null) { if (currentPage != null) {
collection collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE);
.addComponent(new ComponentManualPage(0, 0, this, currentPage)) collection.addComponent(
.setGroup(GR_PAGE); new ComponentButton(
collection 102,
.addComponent(new ComponentButton( 314,
102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt"))) 50,
12,
1,
this,
StatCollector.translateToLocal("button.de.back.txt")))
.setGroup(GR_PAGE); .setGroup(GR_PAGE);
collection.setOnlyGroupEnabled(GR_BACKGROUND); collection.setOnlyGroupEnabled(GR_BACKGROUND);
collection.setGroupEnabled(GR_PAGE, true); collection.setGroupEnabled(GR_PAGE, true);
@@ -64,11 +71,8 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
loadPages(); loadPages();
if (previousScale == -1) adjustGuiScale(); if (previousScale == -1) adjustGuiScale();
if (!Minecraft.getMinecraft() if (!Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode().equals(lang))
.getLanguageManager() loadPages();
.getCurrentLanguage()
.getLanguageCode()
.equals(lang)) loadPages();
LogHelper.info(ContributorHandler.contributors); LogHelper.info(ContributorHandler.contributors);
} }
@@ -125,50 +129,60 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
protected ComponentCollection assembleComponents() { protected ComponentCollection assembleComponents() {
collection = new ComponentCollection(0, 0, xSize, ySize, this); collection = new ComponentCollection(0, 0, xSize, ySize, this);
collection collection.addComponent(
.addComponent(new ComponentTexturedRect( new ComponentTexturedRect(0, 0, 255, 255, ResourceHandler.getResource("textures/gui/manualTop.png")))
0, 0, 255, 255, ResourceHandler.getResource("textures/gui/manualTop.png")))
.setGroup(GR_BACKGROUND); .setGroup(GR_BACKGROUND);
collection collection.addComponent(
.addComponent(new ComponentTexturedRect( new ComponentTexturedRect(
0, 255, 255, 69, ResourceHandler.getResource("textures/gui/manualBottom.png")))
.setGroup(GR_BACKGROUND);
collection
.addComponent(new ComponentTexturedRect(
7, 100, 0, 0, 255, 255, ResourceHandler.getResource("textures/gui/images/debanner.png"), true))
.setGroup(GR_INTRO)
.setName("BANNER");
collection
.addComponent(new ComponentButton(
75,
260,
100,
20,
0, 0,
this, 255,
StatCollector.translateToLocal("info.de.manual.indexButton.txt"), 255,
StatCollector.translateToLocal("info.de.manual.indexButtonTip.txt"))) 69,
.setGroup(GR_INTRO); ResourceHandler.getResource("textures/gui/manualBottom.png")))
collection .setGroup(GR_BACKGROUND);
.addComponent(new ComponentButton(
75, collection.addComponent(
285, new ComponentTexturedRect(
7,
100, 100,
20, 0,
2, 0,
this, 255,
StatCollector.translateToLocal("info.de.manual.contributorsButton.txt"), 255,
StatCollector.translateToLocal("info.de.manual.contributorsButtonInfo.txt"))) ResourceHandler.getResource("textures/gui/images/debanner.png"),
true))
.setGroup(GR_INTRO).setName("BANNER");
collection
.addComponent(
new ComponentButton(
75,
260,
100,
20,
0,
this,
StatCollector.translateToLocal("info.de.manual.indexButton.txt"),
StatCollector.translateToLocal("info.de.manual.indexButtonTip.txt")))
.setGroup(GR_INTRO); .setGroup(GR_INTRO);
collection collection
.addComponent(new ComponentContributorsPage(0, 0, this)) .addComponent(
.setGroup(GR_CONTRIBUTORS) new ComponentButton(
75,
285,
100,
20,
2,
this,
StatCollector.translateToLocal("info.de.manual.contributorsButton.txt"),
StatCollector.translateToLocal("info.de.manual.contributorsButtonInfo.txt")))
.setGroup(GR_INTRO);
collection.addComponent(new ComponentContributorsPage(0, 0, this)).setGroup(GR_CONTRIBUTORS)
.setName("CONTRIBUTORS"); .setName("CONTRIBUTORS");
collection collection
.addComponent(new ComponentTextureButton( .addComponent(
new ComponentTextureButton(
140, 140,
290, 290,
0, 0,
@@ -179,14 +193,11 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
this, this,
"", "",
"", "",
ResourceHandler.getResource("textures/gui/patreon.png")) ResourceHandler.getResource("textures/gui/patreon.png")).forceFullRender())
.forceFullRender())
.setGroup(GR_CONTRIBUTORS); .setGroup(GR_CONTRIBUTORS);
for (int i = 0; i < pageList.size(); i++) { for (int i = 0; i < pageList.size(); i++) {
collection collection.addComponent(new ComponentIndexButton(20, 20 + i * 20, this, pageList.get(i))).setGroup(GR_INDEX)
.addComponent(new ComponentIndexButton(20, 20 + i * 20, this, pageList.get(i)))
.setGroup(GR_INDEX)
.setName("INDEX_BUTTON_" + i); .setName("INDEX_BUTTON_" + i);
pageLength += 20; pageLength += 20;
} }
@@ -212,13 +223,14 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D); barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D);
} else if (collection.getComponent("CONTRIBUTORS") != null } else if (collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS").isEnabled()) { && collection.getComponent("CONTRIBUTORS").isEnabled()) {
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS"); ComponentContributorsPage page = (ComponentContributorsPage) collection
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D); .getComponent("CONTRIBUTORS");
} else if (collection.getComponent("OPEN_PAGE") != null barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
&& collection.getComponent("OPEN_PAGE").isEnabled()) { } else
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE"); if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D); ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
} barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
}
} }
@Override @Override
@@ -226,8 +238,7 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
super.drawScreen(mouseX, mouseY, par3); super.drawScreen(mouseX, mouseY, par3);
int posX = (this.width - xSize) / 2; int posX = (this.width - xSize) / 2;
int posY = (this.height - ySize) / 2; int posY = (this.height - ySize) / 2;
if (collection.getComponent("BANNER") != null if (collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled())
&& collection.getComponent("BANNER").isEnabled())
fontRendererObj.drawSplitString( fontRendererObj.drawSplitString(
StatCollector.translateToLocal("info.de.manual.introTxt.txt"), StatCollector.translateToLocal("info.de.manual.introTxt.txt"),
posX + 20, posX + 20,
@@ -235,8 +246,7 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
150, 150,
0x000000); 0x000000);
if (collection.getComponent("BANNER") != null if (collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled()) return;
&& collection.getComponent("BANNER").isEnabled()) return;
ResourceHandler.bindResource("textures/gui/Widgets.png"); ResourceHandler.bindResource("textures/gui/Widgets.png");
GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(guiLeft, guiTop, 118, 20, 17, 17); drawTexturedModalRect(guiLeft, guiTop, 118, 20, 17, 17);
@@ -255,24 +265,22 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
public void updateScreen() { public void updateScreen() {
super.updateScreen(); super.updateScreen();
disableScrollBar = collection.getComponent("BANNER") != null disableScrollBar = collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled();
&& collection.getComponent("BANNER").isEnabled();
if (!scrollPressed if (!scrollPressed && collection.getComponent("INDEX_BUTTON_0") != null
&& collection.getComponent("INDEX_BUTTON_0") != null
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) { && collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D); barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D);
} else if (!scrollPressed } else if (!scrollPressed && collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS").isEnabled()) { && collection.getComponent("CONTRIBUTORS").isEnabled()) {
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS"); ComponentContributorsPage page = (ComponentContributorsPage) collection
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D); .getComponent("CONTRIBUTORS");
} else if (!scrollPressed barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
&& collection.getComponent("OPEN_PAGE") != null } else
&& collection.getComponent("OPEN_PAGE").isEnabled()) { if (!scrollPressed && collection.getComponent("OPEN_PAGE") != null
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE"); && collection.getComponent("OPEN_PAGE").isEnabled()) {
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D); ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
} barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
}
if (worldUpdateIn > -1) worldUpdateIn--; if (worldUpdateIn > -1) worldUpdateIn--;
if (worldUpdateIn == 0) collection.setWorldAndResolution(mc, width, height); if (worldUpdateIn == 0) collection.setWorldAndResolution(mc, width, height);
@@ -348,13 +356,10 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
} }
public static void loadPages() { public static void loadPages() {
lang = Minecraft.getMinecraft() lang = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
.getLanguageManager()
.getCurrentLanguage()
.getLanguageCode();
ResourceLocation rsLocation = ResourceLocation rsLocation = new ResourceLocation(
new ResourceLocation(References.RESOURCESPREFIX + "manual/manual-" + lang + ".json"); References.RESOURCESPREFIX + "manual/manual-" + lang + ".json");
IResource resource = null; IResource resource = null;
try { try {
@@ -456,13 +461,13 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
} }
reader.endObject(); reader.endObject();
if (isValidPage(name)) if (isValidPage(name)) pageList.add(
pageList.add(new ManualPage( new ManualPage(
name, name,
images.toArray(new String[images.size()]), images.toArray(new String[images.size()]),
content.toArray(new String[content.size()]), content.toArray(new String[content.size()]),
nameL, nameL,
meta)); meta));
} }
reader.endArray(); reader.endArray();
reader.close(); reader.close();
@@ -479,21 +484,23 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
if (buttonPressed) return; if (buttonPressed) return;
for (ComponentBase c : collection.getComponents()) { for (ComponentBase c : collection.getComponents()) {
if (c instanceof ComponentIndexButton if (c instanceof ComponentIndexButton && c.isEnabled()
&& c.isEnabled()
&& ((ComponentIndexButton) c).isOnScreen() && ((ComponentIndexButton) c).isOnScreen()
&& c.isMouseOver(x - guiLeft, y - guiTop)) { && c.isMouseOver(x - guiLeft, y - guiTop)) {
Minecraft.getMinecraft() Minecraft.getMinecraft().getSoundHandler()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
currentPage = ((ComponentIndexButton) c).getPage(); currentPage = ((ComponentIndexButton) c).getPage();
collection collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE)
.addComponent(new ComponentManualPage(0, 0, this, currentPage))
.setGroup(GR_PAGE)
.setName("OPEN_PAGE"); .setName("OPEN_PAGE");
collection collection.addComponent(
.addComponent(new ComponentButton( new ComponentButton(
102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt"))) 102,
314,
50,
12,
1,
this,
StatCollector.translateToLocal("button.de.back.txt")))
.setGroup(GR_PAGE); .setGroup(GR_PAGE);
collection.setOnlyGroupEnabled(GR_BACKGROUND); collection.setOnlyGroupEnabled(GR_BACKGROUND);
collection.setGroupEnabled(GR_PAGE, true); collection.setGroupEnabled(GR_PAGE, true);
@@ -504,19 +511,20 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
@Override @Override
public void barMoved(double position) { public void barMoved(double position) {
if (collection.getComponent("INDEX_BUTTON_0") != null if (collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled())
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) scrollOffset = (int) (position * scrollLimit); scrollOffset = (int) (position * scrollLimit);
else if (collection.getComponent("CONTRIBUTORS") != null else if (collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS").isEnabled()) { && collection.getComponent("CONTRIBUTORS").isEnabled()) {
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS"); ComponentContributorsPage page = (ComponentContributorsPage) collection
if (page.scrollLimit < 0) return; .getComponent("CONTRIBUTORS");
page.scrollOffset = (int) (position * page.scrollLimit); if (page.scrollLimit < 0) return;
} else if (collection.getComponent("OPEN_PAGE") != null page.scrollOffset = (int) (position * page.scrollLimit);
&& collection.getComponent("OPEN_PAGE").isEnabled()) { } else
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE"); if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
if (page.scrollLimit < 0) return; ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
page.scrollOffset = (int) (position * page.scrollLimit); if (page.scrollLimit < 0) return;
} page.scrollOffset = (int) (position * page.scrollLimit);
}
} }
private static boolean isValidPage(String name) { private static boolean isValidPage(String name) {
@@ -1,24 +1,28 @@
package com.brandon3055.draconicevolution.client.gui.componentguis; package com.brandon3055.draconicevolution.client.gui.componentguis;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.client.gui.guicomponents.*; import com.brandon3055.brandonscore.client.gui.guicomponents.*;
import com.brandon3055.brandonscore.client.utills.GuiHelper; import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.container.ContainerReactor; import com.brandon3055.draconicevolution.common.container.ContainerReactor;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 30/7/2015. * Created by brandon3055 on 30/7/2015.
*/ */
public class GUIReactor extends GUIBase { public class GUIReactor extends GUIBase {
private TileReactorCore reactor; private TileReactorCore reactor;
private ContainerReactor container; private ContainerReactor container;
private static boolean showStats = false; private static boolean showStats = false;
@@ -34,8 +38,8 @@ public class GUIReactor extends GUIBase {
collection = new ComponentCollection(0, 0, 248, 222, this); collection = new ComponentCollection(0, 0, 248, 222, this);
collection.addComponent( collection.addComponent(
new ComponentTexturedRect(0, 0, xSize, ySize, ResourceHandler.getResource("textures/gui/Reactor.png"))); new ComponentTexturedRect(0, 0, xSize, ySize, ResourceHandler.getResource("textures/gui/Reactor.png")));
collection collection.addComponent(
.addComponent(new ComponentTextureButton( new ComponentTextureButton(
14, 14,
190, 190,
18, 18,
@@ -48,8 +52,8 @@ public class GUIReactor extends GUIBase {
StatCollector.translateToLocal("button.de.reactorCharge.txt"), StatCollector.translateToLocal("button.de.reactorCharge.txt"),
ResourceHandler.getResource("textures/gui/Widgets.png"))) ResourceHandler.getResource("textures/gui/Widgets.png")))
.setName("CHARGE"); .setName("CHARGE");
collection collection.addComponent(
.addComponent(new ComponentTextureButton( new ComponentTextureButton(
14, 14,
190, 190,
18, 18,
@@ -62,8 +66,8 @@ public class GUIReactor extends GUIBase {
StatCollector.translateToLocal("button.de.reactorStart.txt"), StatCollector.translateToLocal("button.de.reactorStart.txt"),
ResourceHandler.getResource("textures/gui/Widgets.png"))) ResourceHandler.getResource("textures/gui/Widgets.png")))
.setName("ACTIVATE"); .setName("ACTIVATE");
collection collection.addComponent(
.addComponent(new ComponentTextureButton( new ComponentTextureButton(
216, 216,
190, 190,
18, 18,
@@ -76,8 +80,8 @@ public class GUIReactor extends GUIBase {
StatCollector.translateToLocal("button.de.reactorStop.txt"), StatCollector.translateToLocal("button.de.reactorStop.txt"),
ResourceHandler.getResource("textures/gui/Widgets.png"))) ResourceHandler.getResource("textures/gui/Widgets.png")))
.setName("DEACTIVATE"); .setName("DEACTIVATE");
collection collection.addComponent(
.addComponent(new ComponentButton( new ComponentButton(
9, 9,
120, 120,
43, 43,
@@ -99,15 +103,15 @@ public class GUIReactor extends GUIBase {
drawTexturedModalRect(guiLeft + 14, guiTop + 139, 14, ySize, 18, 18); drawTexturedModalRect(guiLeft + 14, guiTop + 139, 14, ySize, 18, 18);
drawTexturedModalRect(guiLeft + 216, guiTop + 139, 32, ySize, 18, 18); drawTexturedModalRect(guiLeft + 216, guiTop + 139, 32, ySize, 18, 18);
fontRendererObj.drawString( fontRendererObj
StatCollector.translateToLocal("gui.de.insert.txt"), guiLeft + 8, guiTop + 159, 0); .drawString(StatCollector.translateToLocal("gui.de.insert.txt"), guiLeft + 8, guiTop + 159, 0);
fontRendererObj.drawString( fontRendererObj
StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 13, guiTop + 168, 0); .drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 13, guiTop + 168, 0);
fontRendererObj.drawString( fontRendererObj
StatCollector.translateToLocal("gui.de.extract.txt"), guiLeft + 206, guiTop + 159, 0); .drawString(StatCollector.translateToLocal("gui.de.extract.txt"), guiLeft + 206, guiTop + 159, 0);
fontRendererObj.drawString( fontRendererObj
StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 215, guiTop + 168, 0); .drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 215, guiTop + 168, 0);
} }
drawCenteredString(fontRendererObj, "Draconic Reactor", guiLeft + xSize / 2, guiTop + 4, 0x00FFFF); drawCenteredString(fontRendererObj, "Draconic Reactor", guiLeft + xSize / 2, guiTop + 4, 0x00FFFF);
} }
@@ -157,14 +161,13 @@ public class GUIReactor extends GUIBase {
} }
String status = StatCollector.translateToLocal("gui.de.status.txt") + ": " String status = StatCollector.translateToLocal("gui.de.status.txt") + ": "
+ (reactor.reactorState == 0 + (reactor.reactorState == 0 ? EnumChatFormatting.DARK_GRAY
? EnumChatFormatting.DARK_GRAY : reactor.reactorState == 1 ? EnumChatFormatting.RED
: reactor.reactorState == 1
? EnumChatFormatting.RED
: reactor.reactorState == 2 ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.RED) : reactor.reactorState == 2 ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.RED)
+ StatCollector.translateToLocal("gui.de.status" + reactor.reactorState + ".txt"); + StatCollector.translateToLocal("gui.de.status" + reactor.reactorState + ".txt");
if (reactor.reactorState == 1 && reactor.canStart()) if (reactor.reactorState == 1 && reactor.canStart())
status = StatCollector.translateToLocal("gui.de.status.txt") + ": " + EnumChatFormatting.DARK_GREEN status = StatCollector.translateToLocal("gui.de.status.txt") + ": "
+ EnumChatFormatting.DARK_GREEN
+ StatCollector.translateToLocal("gui.de.status1_5.txt"); + StatCollector.translateToLocal("gui.de.status1_5.txt");
if (!showStats) fontRendererObj.drawString(status, xSize - 5 - fontRendererObj.getStringWidth(status), 125, 0); if (!showStats) fontRendererObj.drawString(status, xSize - 5 - fontRendererObj.getStringWidth(status), 125, 0);
} }
@@ -181,52 +184,64 @@ public class GUIReactor extends GUIBase {
text.add(StatCollector.translateToLocal("gui.de.fieldStrength.txt")); text.add(StatCollector.translateToLocal("gui.de.fieldStrength.txt"));
if (reactor.maxFieldCharge > 0) if (reactor.maxFieldCharge > 0)
text.add(Utills.round(reactor.fieldCharge / reactor.maxFieldCharge * 100D, 100D) + "%"); text.add(Utills.round(reactor.fieldCharge / reactor.maxFieldCharge * 100D, 100D) + "%");
text.add(Utills.addCommas((int) reactor.fieldCharge) + " / " text.add(
+ Utills.addCommas((int) reactor.maxFieldCharge)); // todo refine or remove Utills.addCommas((int) reactor.fieldCharge) + " / "
+ Utills.addCommas((int) reactor.maxFieldCharge)); // todo refine or remove
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(197, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) { } else if (GuiHelper.isInRect(197, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
text.add(StatCollector.translateToLocal("gui.de.energySaturation.txt")); text.add(StatCollector.translateToLocal("gui.de.energySaturation.txt"));
if (reactor.maxEnergySaturation > 0) if (reactor.maxEnergySaturation > 0) text.add(
text.add(Utills.round( Utills.round((double) reactor.energySaturation / (double) reactor.maxEnergySaturation * 100D, 100D)
(double) reactor.energySaturation / (double) reactor.maxEnergySaturation * 100D, 100D) + "%");
+ "%"); text.add(
text.add(Utills.addCommas(reactor.energySaturation) + " / " Utills.addCommas(reactor.energySaturation) + " / " + Utills.addCommas(reactor.maxEnergySaturation)); // todo
+ Utills.addCommas(reactor.maxEnergySaturation)); // todo refine or remove // refine
// or
// remove
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(221, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) { } else if (GuiHelper.isInRect(221, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
text.add(StatCollector.translateToLocal("gui.de.fuelConversion.txt")); text.add(StatCollector.translateToLocal("gui.de.fuelConversion.txt"));
if (reactor.reactorFuel + reactor.convertedFuel > 0) if (reactor.reactorFuel + reactor.convertedFuel > 0) text.add(
text.add(Utills.round( Utills.round(
((double) reactor.convertedFuel + reactor.conversionUnit) ((double) reactor.convertedFuel + reactor.conversionUnit)
/ ((double) reactor.convertedFuel + (double) reactor.reactorFuel) / ((double) reactor.convertedFuel + (double) reactor.reactorFuel)
* 100D, * 100D,
100D) 100D) + "%");
+ "%"); text.add(reactor.convertedFuel + " / " + (reactor.convertedFuel + reactor.reactorFuel)); // todo refine or
text.add(reactor.convertedFuel + " / " // remove
+ (reactor.convertedFuel + reactor.reactorFuel)); // todo refine or remove
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} }
if (showStats) { if (showStats) {
if (GuiHelper.isInRect(53, 15, 140, 18, mouseX - guiLeft, mouseY - guiTop)) { if (GuiHelper.isInRect(53, 15, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth( text.addAll(
StatCollector.translateToLocal("gui.de.reacTempLoadFactor.txt"), 200)); fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacTempLoadFactor.txt"),
200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 40, 140, 18, mouseX - guiLeft, mouseY - guiTop)) { } else if (GuiHelper.isInRect(53, 40, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth( text.addAll(
StatCollector.translateToLocal("gui.de.reacCoreMass.txt"), 200)); fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacCoreMass.txt"),
200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 65, 140, 18, mouseX - guiLeft, mouseY - guiTop)) { } else if (GuiHelper.isInRect(53, 65, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth( text.addAll(
StatCollector.translateToLocal("gui.de.reacGenRate.txt"), 200)); fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacGenRate.txt"),
200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 88, 140, 18, mouseX - guiLeft, mouseY - guiTop)) { } else if (GuiHelper.isInRect(53, 88, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth( text.addAll(
StatCollector.translateToLocal("gui.de.reacInputRate.txt"), 200)); fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacInputRate.txt"),
200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 113, 140, 18, mouseX - guiLeft, mouseY - guiTop)) { } else if (GuiHelper.isInRect(53, 113, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth( text.addAll(
StatCollector.translateToLocal("gui.de.reacConversionRate.txt"), 200)); fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacConversionRate.txt"),
200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj); drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} }
} }
@@ -239,17 +254,23 @@ public class GUIReactor extends GUIBase {
fontRendererObj.drawString(Utills.round(reactor.tempDrainFactor * 100D, 1D) + "%", 60, 2 + 24, 0); fontRendererObj.drawString(Utills.round(reactor.tempDrainFactor * 100D, 1D) + "%", 60, 2 + 24, 0);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.mass.name"), 55, 16 + 24, 0x0000FF); fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.mass.name"), 55, 16 + 24, 0x0000FF);
fontRendererObj.drawString( fontRendererObj.drawString(
Utills.round((reactor.reactorFuel + reactor.convertedFuel) / 1296D, 100) + "m^3", 60, 2 + 2 * 24, 0); Utills.round((reactor.reactorFuel + reactor.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(StatCollector.translateToLocal("gui.de.genRate.name"), 55, 16 + 2 * 24, 0x0000FF);
fontRendererObj.drawString(Utills.addCommas((int) reactor.generationRate) + "RF/t", 60, 2 + 3 * 24, 0); fontRendererObj.drawString(Utills.addCommas((int) reactor.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);
fontRendererObj
.drawString(StatCollector.translateToLocal("gui.de.fuelConversion.name"), 55, 16 + 4 * 24, 0x0000FF);
fontRendererObj.drawString( fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.fieldInputRate.name"), 55, 16 + 3 * 24, 0x0000FF); Utills.addCommas((int) Math.round(reactor.fuelUseRate * 1000000D)) + "nb/t",
fontRendererObj.drawString( 60,
Utills.addCommas((int) Math.min(inputRate, Integer.MAX_VALUE)) + "RF/t", 60, 2 + 4 * 24, 0); 2 + 5 * 24,
fontRendererObj.drawString( 0);
StatCollector.translateToLocal("gui.de.fuelConversion.name"), 55, 16 + 4 * 24, 0x0000FF);
fontRendererObj.drawString(
Utills.addCommas((int) Math.round(reactor.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 24, 0);
} }
@Override @Override
@@ -261,11 +282,12 @@ public class GUIReactor extends GUIBase {
collection.getComponent("DEACTIVATE").setEnabled(false); collection.getComponent("DEACTIVATE").setEnabled(false);
else collection.getComponent("DEACTIVATE").setEnabled(true); else collection.getComponent("DEACTIVATE").setEnabled(true);
if ((reactor.reactorState == TileReactorCore.STATE_OFFLINE if ((reactor.reactorState == TileReactorCore.STATE_OFFLINE
|| (reactor.reactorState == TileReactorCore.STATE_STOP && !reactor.canStart())) || (reactor.reactorState == TileReactorCore.STATE_STOP && !reactor.canStart())) && reactor.canCharge())
&& reactor.canCharge()) collection.getComponent("CHARGE").setEnabled(true); collection.getComponent("CHARGE").setEnabled(true);
else collection.getComponent("CHARGE").setEnabled(false); else collection.getComponent("CHARGE").setEnabled(false);
if ((reactor.reactorState == TileReactorCore.STATE_START || reactor.reactorState == TileReactorCore.STATE_STOP) if ((reactor.reactorState == TileReactorCore.STATE_START || reactor.reactorState == TileReactorCore.STATE_STOP)
&& reactor.canStart()) collection.getComponent("ACTIVATE").setEnabled(true); && reactor.canStart())
collection.getComponent("ACTIVATE").setEnabled(true);
else collection.getComponent("ACTIVATE").setEnabled(false); else collection.getComponent("ACTIVATE").setEnabled(false);
super.updateScreen(); super.updateScreen();
} }
@@ -1,5 +1,16 @@
package com.brandon3055.draconicevolution.client.gui.componentguis; package com.brandon3055.draconicevolution.client.gui.componentguis;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringUtils;
import com.brandon3055.brandonscore.client.gui.guicomponents.*; import com.brandon3055.brandonscore.client.gui.guicomponents.*;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.brandonscore.common.utills.Utills;
@@ -17,15 +28,6 @@ import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.IInventoryTool; import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
import com.brandon3055.draconicevolution.common.utills.ItemConfigField; import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringUtils;
/** /**
* Created by Brandon on 26/12/2014. * Created by Brandon on 26/12/2014.
@@ -33,8 +35,8 @@ import net.minecraft.util.StringUtils;
public class GUIToolConfig extends GUIBase { public class GUIToolConfig extends GUIBase {
public EntityPlayer player; public EntityPlayer player;
private static final ResourceLocation inventoryTexture = private static final ResourceLocation inventoryTexture = new ResourceLocation(
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png"); References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
private int screenLevel = 0; private int screenLevel = 0;
private ItemStack editingItem; private ItemStack editingItem;
private ContainerAdvTool container; private ContainerAdvTool container;
@@ -52,28 +54,28 @@ public class GUIToolConfig extends GUIBase {
public void initGui() { public void initGui() {
super.initGui(); super.initGui();
if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) { if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) {
ContributorHandler.Contributor contributor = ContributorHandler.Contributor contributor = ContributorHandler.contributors
ContributorHandler.contributors.get(player.getCommandSenderName()); .get(player.getCommandSenderName());
if (!contributor.isUserValid(player)) return; if (!contributor.isUserValid(player)) return;
buttonList.clear(); buttonList.clear();
if (contributor.contributionLevel >= 1) if (contributor.contributionLevel >= 1) buttonList.add(
buttonList.add(new GuiButton( new GuiButton(
0, 0,
guiLeft - 150, guiLeft - 150,
guiTop, guiTop,
150, 150,
20, 20,
"Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled"))); "Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled")));
if (contributor.contribution.toLowerCase().contains("patreon")) if (contributor.contribution.toLowerCase().contains("patreon")) buttonList.add(
buttonList.add(new GuiButton( new GuiButton(
1, 1,
guiLeft - 150, guiLeft - 150,
guiTop + 22, guiTop + 22,
150, 150,
20, 20,
"Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled"))); "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled")));
} }
} }
@@ -81,52 +83,61 @@ public class GUIToolConfig extends GUIBase {
protected void actionPerformed(GuiButton button) { protected void actionPerformed(GuiButton button) {
super.actionPerformed(button); super.actionPerformed(button);
if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) { if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) {
ContributorHandler.Contributor contributor = ContributorHandler.Contributor contributor = ContributorHandler.contributors
ContributorHandler.contributors.get(player.getCommandSenderName()); .get(player.getCommandSenderName());
if (!contributor.isUserValid(player)) return; if (!contributor.isUserValid(player)) return;
if (button.id == 0) { if (button.id == 0) {
contributor.contributorWingsEnabled = !contributor.contributorWingsEnabled; contributor.contributorWingsEnabled = !contributor.contributorWingsEnabled;
button.displayString = button.displayString = "Contributor Wings: "
"Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled"); + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled");
} else if (button.id == 1) { } else if (button.id == 1) {
contributor.patreonBadgeEnabled = !contributor.patreonBadgeEnabled; contributor.patreonBadgeEnabled = !contributor.patreonBadgeEnabled;
button.displayString = "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled"); button.displayString = "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled");
} }
DraconicEvolution.network.sendToServer(new ContributorPacket( DraconicEvolution.network.sendToServer(
player.getCommandSenderName(), new ContributorPacket(
contributor.contributorWingsEnabled, player.getCommandSenderName(),
contributor.patreonBadgeEnabled)); contributor.contributorWingsEnabled,
contributor.patreonBadgeEnabled));
} }
} }
@Override @Override
protected ComponentCollection assembleComponents() { protected ComponentCollection assembleComponents() {
ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this).setOpenBoarders(); ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this).setOpenBoarders();
c.addComponent(new ComponentTexturedRect(0, -15, 198, 20, inventoryTexture)) c.addComponent(new ComponentTexturedRect(0, -15, 198, 20, inventoryTexture)).setGroup("TEXT_TAB");
.setGroup("TEXT_TAB"); c.addComponent(new ComponentTexturedRect(0, 0, 198, 89, inventoryTexture)).setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 0, 198, 89, inventoryTexture))
.setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 13, 0, 9, 198, 80, inventoryTexture, false)) c.addComponent(new ComponentTexturedRect(0, 13, 0, 9, 198, 80, inventoryTexture, false))
.setGroup("BACKGROUND_EXTENSION"); .setGroup("BACKGROUND_EXTENSION");
c.addComponent(new ComponentButton(3, 26, 20, 12, 0, this, "<=", StatCollector.translateToLocal("gui.back"))) c.addComponent(new ComponentButton(3, 26, 20, 12, 0, this, "<=", StatCollector.translateToLocal("gui.back")))
.setGroup("BUTTONS") .setGroup("BUTTONS").setName("BACK_BUTTON");
.setName("BACK_BUTTON"); c.addComponent(
c.addComponent(new ComponentButton( new ComponentButton(
3, 39, 20, 12, 1, this, "Inv", StatCollector.translateToLocal("gui.de.itemInventory.txt"))) 3,
.setGroup("BUTTONS") 39,
.setName("INVENTORY_BUTTON"); 20,
c.addComponent(new ComponentFieldAdjuster(4, 34, null, this)) 12,
.setGroup("FIELD_BUTTONS") 1,
this,
"Inv",
StatCollector.translateToLocal("gui.de.itemInventory.txt")))
.setGroup("BUTTONS").setName("INVENTORY_BUTTON");
c.addComponent(new ComponentFieldAdjuster(4, 34, null, this)).setGroup("FIELD_BUTTONS")
.setName("FIELD_CONFIG_BUTTON_ARRAY"); .setName("FIELD_CONFIG_BUTTON_ARRAY");
c.addComponent(new ComponentButton( c.addComponent(
0, ySize, xSize, 14, 2, this, StatCollector.translateToLocal("gui.de.configureGuiElements.txt")) new ComponentButton(
.setGroup("INV_SCREEN")); 0,
ySize,
xSize,
14,
2,
this,
StatCollector.translateToLocal("gui.de.configureGuiElements.txt")).setGroup("INV_SCREEN"));
ComponentTextField textField = (ComponentTextField) new ComponentTextField(this, 3, -12, 191, 12) ComponentTextField textField = (ComponentTextField) new ComponentTextField(this, 3, -12, 191, 12)
.setLabel(StatCollector.translateToLocal("gui.de.profile.txt") + ":", 0xE0E0E0) .setLabel(StatCollector.translateToLocal("gui.de.profile.txt") + ":", 0xE0E0E0).setGroup("TEXT_TAB")
.setGroup("TEXT_TAB")
.setName("PROFILE_TEXT_FIELD"); .setName("PROFILE_TEXT_FIELD");
c.addComponent(textField); c.addComponent(textField);
return c; return c;
@@ -134,22 +145,18 @@ public class GUIToolConfig extends GUIBase {
protected void addDependentComponents() { protected void addDependentComponents() {
for (int x = 0; x < 9; x++) { for (int x = 0; x < 9; x++) {
collection collection.addComponent(new ComponentConfigItemButton(29 + 18 * x, 64, x, player)).setGroup("INV_SCREEN");
.addComponent(new ComponentConfigItemButton(29 + 18 * x, 64, x, player))
.setGroup("INV_SCREEN");
} }
for (int y = 0; y < 3; y++) { for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) { for (int x = 0; x < 9; x++) {
collection collection.addComponent(new ComponentConfigItemButton(29 + 18 * x, 7 + y * 18, x + y * 9 + 9, player))
.addComponent(new ComponentConfigItemButton(29 + 18 * x, 7 + y * 18, x + y * 9 + 9, player))
.setGroup("INV_SCREEN"); .setGroup("INV_SCREEN");
} }
} }
for (int y = 0; y < 4; y++) { for (int y = 0; y < 4; y++) {
collection collection.addComponent(new ComponentConfigItemButton(6, 7 + y * 19, 39 - y, player))
.addComponent(new ComponentConfigItemButton(6, 7 + y * 19, 39 - y, player))
.setGroup("INV_SCREEN"); .setGroup("INV_SCREEN");
} }
@@ -174,8 +181,7 @@ public class GUIToolConfig extends GUIBase {
int fieldOffsetY = 5; int fieldOffsetY = 5;
for (ComponentBase component : collection.getComponents()) { for (ComponentBase component : collection.getComponents()) {
if (component.isEnabled() if (component.isEnabled() && component instanceof ComponentConfigItemButton
&& component instanceof ComponentConfigItemButton
&& component.isMouseOver(x - this.guiLeft, y - this.guiTop) && component.isMouseOver(x - this.guiLeft, y - this.guiTop)
&& ((ComponentConfigItemButton) component).hasValidItem) { && ((ComponentConfigItemButton) component).hasValidItem) {
ItemStack stack = player.inventory.getStackInSlot(((ComponentConfigItemButton) component).slot); ItemStack stack = player.inventory.getStackInSlot(((ComponentConfigItemButton) component).slot);
@@ -186,8 +192,7 @@ public class GUIToolConfig extends GUIBase {
setEditingItem(stack, ((ComponentConfigItemButton) component).slot); setEditingItem(stack, ((ComponentConfigItemButton) component).slot);
setLevel(1); setLevel(1);
for (ItemConfigField field : item.getFields(stack, ((ComponentConfigItemButton) component).slot)) { for (ItemConfigField field : item.getFields(stack, ((ComponentConfigItemButton) component).slot)) {
collection collection.addComponent(new ComponentFieldButton(fieldOffsetX, fieldOffsetY, player, field, this))
.addComponent(new ComponentFieldButton(fieldOffsetX, fieldOffsetY, player, field, this))
.setGroup("LIST_SCREEN"); .setGroup("LIST_SCREEN");
fieldOffsetY += 12; fieldOffsetY += 12;
} }
@@ -218,8 +223,8 @@ public class GUIToolConfig extends GUIBase {
} else if (id == 1 && editingItem != null) { // inventory button } else if (id == 1 && editingItem != null) { // inventory button
setLevel(3); setLevel(3);
Minecraft.getMinecraft().displayGuiScreen(new GUIToolInventory(player, container, this)); Minecraft.getMinecraft().displayGuiScreen(new GUIToolInventory(player, container, this));
// LogHelper.info("Pre send container " + Minecraft.getMinecraft().thePlayer.openContainer); // LogHelper.info("Pre send container " + Minecraft.getMinecraft().thePlayer.openContainer);
// DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLINVENTORY, false)); // DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLINVENTORY, false));
} else if (id == 2) { } else if (id == 2) {
Minecraft.getMinecraft().displayGuiScreen(new GuiHudConfig(this)); Minecraft.getMinecraft().displayGuiScreen(new GuiHudConfig(this));
} }
@@ -238,22 +243,19 @@ public class GUIToolConfig extends GUIBase {
collection.setOnlyGroupEnabled("LIST_SCREEN"); collection.setOnlyGroupEnabled("LIST_SCREEN");
collection.setGroupEnabled("BACKGROUND", true); collection.setGroupEnabled("BACKGROUND", true);
collection.setGroupEnabled("BACKGROUND_EXTENSION", true); collection.setGroupEnabled("BACKGROUND_EXTENSION", true);
if (editingItem != null if (editingItem != null && editingItem.getItem() instanceof IConfigurableItem
&& editingItem.getItem() instanceof IConfigurableItem
&& ((IConfigurableItem) editingItem.getItem()).hasProfiles()) && ((IConfigurableItem) editingItem.getItem()).hasProfiles())
collection.setGroupEnabled("TEXT_TAB", true); collection.setGroupEnabled("TEXT_TAB", true);
collection.setComponentEnabled("BACK_BUTTON", true); collection.setComponentEnabled("BACK_BUTTON", true);
if (editingItem != null && editingItem.getItem() instanceof IInventoryTool) if (editingItem != null && editingItem.getItem() instanceof IInventoryTool)
collection.setComponentEnabled("INVENTORY_BUTTON", true); collection.setComponentEnabled("INVENTORY_BUTTON", true);
if (collection.getComponent("BACK_BUTTON") != null) if (collection.getComponent("BACK_BUTTON") != null) collection.getComponent("BACK_BUTTON").setY(26);
collection.getComponent("BACK_BUTTON").setY(26);
} else if (level == 2) { // field screen } else if (level == 2) { // field screen
collection.setOnlyGroupEnabled("FIELD_BUTTONS"); collection.setOnlyGroupEnabled("FIELD_BUTTONS");
collection.setGroupEnabled("BACKGROUND", true); collection.setGroupEnabled("BACKGROUND", true);
collection.setComponentEnabled("BACK_BUTTON", true); collection.setComponentEnabled("BACK_BUTTON", true);
if (collection.getComponent("BACK_BUTTON") != null) if (collection.getComponent("BACK_BUTTON") != null) collection.getComponent("BACK_BUTTON").setY(3);
collection.getComponent("BACK_BUTTON").setY(3); // slot = -1;
// slot = -1;
} else if (level == 3) { // inventory screen } else if (level == 3) { // inventory screen
} }
@@ -301,23 +303,26 @@ public class GUIToolConfig extends GUIBase {
super.drawGuiContainerForegroundLayer(mouseX, mouseY); super.drawGuiContainerForegroundLayer(mouseX, mouseY);
if (slot > -1) editingItem = player.inventory.getStackInSlot(slot); if (slot > -1) editingItem = player.inventory.getStackInSlot(slot);
if (slot > -1 if (slot > -1 && editingItem != null && editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
&& editingItem != null
&& editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player); BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player);
if (!properties.canFire() if (!properties.canFire() && properties.cantFireMessage != null
&& properties.cantFireMessage != null
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) { && !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
fontRendererObj.drawSplitString( fontRendererObj.drawSplitString(
StatCollector.translateToLocal(properties.cantFireMessage), 0, ySize + 5, xSize, 0xFF0000); StatCollector.translateToLocal(properties.cantFireMessage),
0,
ySize + 5,
xSize,
0xFF0000);
} }
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
list.add(StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": " list.add(
+ Utills.addCommas(properties.calculateEnergyCost())); StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": "
list.add(StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": " + Utills.addCommas(properties.calculateEnergyCost()));
+ properties.arrowDamage * (properties.arrowSpeed * 3)); list.add(
StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": "
+ properties.arrowDamage * (properties.arrowSpeed * 3));
drawHoveringText(list, xSize - 8, 0, fontRendererObj); drawHoveringText(list, xSize - 8, 0, fontRendererObj);
} }
} }
@@ -1,20 +1,22 @@
package com.brandon3055.draconicevolution.client.gui.componentguis; package com.brandon3055.draconicevolution.client.gui.componentguis;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.client.gui.guicomponents.*; import com.brandon3055.brandonscore.client.gui.guicomponents.*;
import com.brandon3055.draconicevolution.common.container.ContainerAdvTool; import com.brandon3055.draconicevolution.common.container.ContainerAdvTool;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 13/01/2015. * Created by Brandon on 13/01/2015.
*/ */
public class GUIToolInventory extends GUIBase { public class GUIToolInventory extends GUIBase {
private static final ResourceLocation inventoryTexture = private static final ResourceLocation inventoryTexture = new ResourceLocation(
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png"); References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
private ContainerAdvTool container; private ContainerAdvTool container;
private String inventoryName; private String inventoryName;
@@ -38,10 +40,8 @@ public class GUIToolInventory extends GUIBase {
@Override @Override
protected ComponentCollection assembleComponents() { protected ComponentCollection assembleComponents() {
ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this); ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this);
c.addComponent(new ComponentTexturedRect(0, 130 - 89, 198, 89, inventoryTexture)) c.addComponent(new ComponentTexturedRect(0, 130 - 89, 198, 89, inventoryTexture)).setGroup("BACKGROUND");
.setGroup("BACKGROUND"); c.addComponent(new ComponentTexturedRect(0, 0, 198, 80, inventoryTexture)).setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 0, 198, 80, inventoryTexture))
.setGroup("BACKGROUND");
c.addComponent(new ComponentButton(172, 3, 18, 12, 0, this, "<=", "Back")); c.addComponent(new ComponentButton(172, 3, 18, 12, 0, this, "<=", "Back"));
for (int i = 0; i < 5; i++) { for (int i = 0; i < 5; i++) {
@@ -68,8 +68,7 @@ public class GUIToolInventory extends GUIBase {
collection.addComponent(new ComponentSlotBackground(7 + x * 18, 18)).setGroup("INVENTORY"); collection.addComponent(new ComponentSlotBackground(7 + x * 18, 18)).setGroup("INVENTORY");
ComponentSlotBackground.addInventorySlots(collection, 7, 44, container.inventoryItemSlot); ComponentSlotBackground.addInventorySlots(collection, 7, 44, container.inventoryItemSlot);
if (container.inventoryItemSlot > 35) if (container.inventoryItemSlot > 35)
collection collection.addComponent(new ComponentItemRenderer(6, 18, container.inventoryTool.inventoryItem))
.addComponent(new ComponentItemRenderer(6, 18, container.inventoryTool.inventoryItem))
.setGroup("INVENTORY"); .setGroup("INVENTORY");
} }
@@ -1,9 +1,11 @@
package com.brandon3055.draconicevolution.client.gui.componentguis; package com.brandon3055.draconicevolution.client.gui.componentguis;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
/** /**
* Created by Brandon on 7/03/2015. * Created by Brandon on 7/03/2015.
*/ */
@@ -29,24 +31,23 @@ public class ManualPage {
} }
public String getImageResourceName(String url) { public String getImageResourceName(String url) {
// try // try
// { // {
LogHelper.info(url); LogHelper.info(url);
return FilenameUtils.getName(url); return FilenameUtils.getName(url);
// String fileName = new URL(url).getFile(); // String fileName = new URL(url).getFile();
// return fileName.substring(fileName.indexOf("/") + 1); // return fileName.substring(fileName.indexOf("/") + 1);
// } // }
// catch (MalformedURLException e) // catch (MalformedURLException e)
// { // {
// e.printStackTrace(); // e.printStackTrace();
// return ""; // return "";
// } // }
} }
public String getLocalizedName() { public String getLocalizedName() {
if (nameL != null) return nameL; if (nameL != null) return nameL;
return (name.contains("item.") || name.contains("tile.")) return (name.contains("item.") || name.contains("tile.")) ? StatCollector.translateToLocal(name + ".name")
? StatCollector.translateToLocal(name + ".name")
: name.contains("info.") ? name.substring(name.indexOf("info.") + 5) : "Invalid Name Data"; : name.contains("info.") ? name.substring(name.indexOf("info.") + 5) : "Invalid Name Data";
} }
} }
@@ -1,25 +1,27 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents; package com.brandon3055.draconicevolution.client.gui.guicomponents;
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
/** /**
* Created by Brandon on 29/12/2014. * Created by Brandon on 29/12/2014.
*/ */
public class ComponentConfigItemButton extends ComponentBase { public class ComponentConfigItemButton extends ComponentBase {
private static final ResourceLocation texture = private static final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png"); References.RESOURCESPREFIX + "textures/gui/Widgets.png");
public int slot; public int slot;
private InventoryPlayer inventory; private InventoryPlayer inventory;
public boolean hasValidItem = false; public boolean hasValidItem = false;
@@ -34,10 +36,8 @@ public class ComponentConfigItemButton extends ComponentBase {
public void refreshState() { public void refreshState() {
hasValidItem = (inventory.getStackInSlot(slot) != null hasValidItem = (inventory.getStackInSlot(slot) != null
&& ((inventory.getStackInSlot(slot).getItem() instanceof IConfigurableItem && ((inventory.getStackInSlot(slot).getItem() instanceof IConfigurableItem
&& !((IConfigurableItem) && !((IConfigurableItem) inventory.getStackInSlot(slot).getItem())
inventory.getStackInSlot(slot).getItem()) .getFields(inventory.getStackInSlot(slot), slot).isEmpty())
.getFields(inventory.getStackInSlot(slot), slot)
.isEmpty())
|| inventory.getStackInSlot(slot).getItem() instanceof IInventoryTool)); || inventory.getStackInSlot(slot).getItem() instanceof IInventoryTool));
} }
@@ -70,8 +70,7 @@ public class ComponentConfigItemButton extends ComponentBase {
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) { public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
if (isMouseOver(mouseX, mouseY) && hasValidItem) { if (isMouseOver(mouseX, mouseY) && hasValidItem) {
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
List<ItemConfigField> fields = ((IConfigurableItem) List<ItemConfigField> fields = ((IConfigurableItem) inventory.getStackInSlot(slot).getItem())
inventory.getStackInSlot(slot).getItem())
.getFields(inventory.getStackInSlot(slot), slot); .getFields(inventory.getStackInSlot(slot), slot);
for (ItemConfigField field : fields) { for (ItemConfigField field : fields) {
list.add(field.getLocalizedName() + ": " + field.getFormattedValue()); list.add(field.getLocalizedName() + ": " + field.getFormattedValue());
@@ -83,8 +82,7 @@ public class ComponentConfigItemButton extends ComponentBase {
@Override @Override
public void mouseClicked(int x, int y, int button) { public void mouseClicked(int x, int y, int button) {
if (hasValidItem) { if (hasValidItem) {
Minecraft.getMinecraft() Minecraft.getMinecraft().getSoundHandler()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
} }
} }
@@ -1,16 +1,10 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents; package com.brandon3055.draconicevolution.client.gui.guicomponents;
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.common.handler.ContributorHandler;
import com.brandon3055.draconicevolution.common.handler.ContributorHandler.Contributor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.GuiConfirmOpenLink; import net.minecraft.client.gui.GuiConfirmOpenLink;
@@ -20,8 +14,17 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraft.util.StringUtils; import net.minecraft.util.StringUtils;
import org.lwjgl.opengl.GL11; 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.common.handler.ContributorHandler;
import com.brandon3055.draconicevolution.common.handler.ContributorHandler.Contributor;
/** /**
* Created by brandon3055 on 5/11/2015. * Created by brandon3055 on 5/11/2015.
*/ */
@@ -40,7 +43,7 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
@Override @Override
public void handleScrollInput(int direction) { public void handleScrollInput(int direction) {
// page.scrollOffset += direction * 10; // page.scrollOffset += direction * 10;
scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10); scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10);
if (scrollOffset < 0) scrollOffset = 0; if (scrollOffset < 0) scrollOffset = 0;
if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight(); if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight();
@@ -82,8 +85,7 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!(yOffset > 25 && yOffset < 324)) continue; if (!(yOffset > 25 && yOffset < 324)) continue;
if (mouseX > 15 if (mouseX > 15 && mouseX < 245
&& mouseX < 245
&& mouseY < yOffset + 5 && mouseY < yOffset + 5
&& mouseY > yOffset - 25 && mouseY > yOffset - 25
&& !patreonButtonHighlighted) { && !patreonButtonHighlighted) {
@@ -101,10 +103,10 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
renderPlayer(contributor.ign); renderPlayer(contributor.ign);
GL11.glPopMatrix(); GL11.glPopMatrix();
fontRendererObj.drawStringWithShadow( fontRendererObj
EnumChatFormatting.GOLD + contributor.name, 50, yOffset - 20, 0x000000); .drawStringWithShadow(EnumChatFormatting.GOLD + contributor.name, 50, yOffset - 20, 0x000000);
fontRendererObj.drawString( fontRendererObj
EnumChatFormatting.DARK_BLUE + contributor.contribution, 50, yOffset - 10, 0x000000); .drawString(EnumChatFormatting.DARK_BLUE + contributor.contribution, 50, yOffset - 10, 0x000000);
} }
} }
@@ -120,8 +122,7 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!(yOffset > 20 && yOffset < 330)) continue; if (!(yOffset > 20 && yOffset < 330)) continue;
if (mouseX > 15 if (mouseX > 15 && mouseX < 245
&& mouseX < 245
&& mouseY < yOffset + 5 && mouseY < yOffset + 5
&& mouseY > yOffset - 25 && mouseY > yOffset - 25
&& !patreonButtonHighlighted) { && !patreonButtonHighlighted) {
@@ -142,17 +143,17 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!StringUtils.isNullOrEmpty(contributor.website)) { if (!StringUtils.isNullOrEmpty(contributor.website)) {
list.add(""); list.add("");
list.add("Website: " + EnumChatFormatting.BLUE + contributor.website); list.add("Website: " + EnumChatFormatting.BLUE + contributor.website);
list.add(EnumChatFormatting.GRAY list.add(
+ StatCollector.translateToLocal("info.de.manual.clickToGoToSite.txt")); EnumChatFormatting.GRAY
+ StatCollector.translateToLocal("info.de.manual.clickToGoToSite.txt"));
} }
drawHoveringText(list, offsetX - 7, offsetY + yOffset + 20, fontRendererObj); drawHoveringText(list, offsetX - 7, offsetY + yOffset + 20, fontRendererObj);
} }
} }
if (!ContributorHandler.successfulLoad) if (!ContributorHandler.successfulLoad) fontRendererObj
fontRendererObj.drawString( .drawString("[Error] Failed to download contributors list", offsetX + 20, offsetY + 40, 0xFF0000);
"[Error] Failed to download contributors list", offsetX + 20, offsetY + 40, 0xFF0000);
} }
@Override @Override
@@ -174,8 +175,7 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!(yOffset > 20 && yOffset < 330) || patreonButtonHighlighted) continue; if (!(yOffset > 20 && yOffset < 330) || patreonButtonHighlighted) continue;
if (x > 15 if (x > 15 && x < 245
&& x < 245
&& y < yOffset + 5 && y < yOffset + 5
&& y > yOffset - 25 && y > yOffset - 25
&& !StringUtils.isNullOrEmpty(contributor.website)) { && !StringUtils.isNullOrEmpty(contributor.website)) {
@@ -1,5 +1,11 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents; package com.brandon3055.draconicevolution.client.gui.guicomponents;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
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.gui.guicomponents.ComponentBase;
import com.brandon3055.brandonscore.client.utills.GuiHelper; import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.brandonscore.common.utills.DataUtills; import com.brandon3055.brandonscore.common.utills.DataUtills;
@@ -7,18 +13,14 @@ import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.ItemConfigField; import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
/** /**
* Created by Brandon on 1/01/2015. * Created by Brandon on 1/01/2015.
*/ */
public class ComponentFieldAdjuster extends ComponentBase { public class ComponentFieldAdjuster extends ComponentBase {
private static final ResourceLocation widgets =
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png"); private static final ResourceLocation widgets = new ResourceLocation(
References.RESOURCESPREFIX + "textures/gui/Widgets.png");
protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png");
public ItemConfigField field; public ItemConfigField field;
@@ -103,20 +105,19 @@ public class ComponentFieldAdjuster extends ComponentBase {
fieldValue = String.valueOf((double) Math.round(d * 100f) / 100D); fieldValue = String.valueOf((double) Math.round(d * 100f) / 100D);
} }
// if (field.datatype == References.FLOAT_ID) { // if (field.datatype == References.FLOAT_ID) {
// float d = (Float)field.value; // float d = (Float)field.value;
// fieldValue = String.valueOf((double)Math.round((double)(d*100f)) / 100D); // fieldValue = String.valueOf((double)Math.round((double)(d*100f)) / 100D);
// } // }
int centre = fontRendererObj.getStringWidth(fieldName) / 2; int centre = fontRendererObj.getStringWidth(fieldName) / 2;
fontRendererObj.drawString(fieldName, x + getWidth() / 2 - centre, y - 12, 0x00000); fontRendererObj.drawString(fieldName, x + getWidth() / 2 - centre, y - 12, 0x00000);
drawCenteredString(fontRendererObj, fieldValue, x + getWidth() / 2, y + 6, 0xffffff); drawCenteredString(fontRendererObj, fieldValue, x + getWidth() / 2, y + 6, 0xffffff);
if (field.modifier == null || field.modifier.equals("AOE")) if (field.modifier == null || field.modifier.equals("AOE")) drawCenteredString(
drawCenteredString( fontRendererObj,
fontRendererObj, StatCollector.translateToLocal("gui.de.max.txt") + " " + field.getMaxFormattedValue(),
StatCollector.translateToLocal("gui.de.max.txt") + " " + field.getMaxFormattedValue(), x + getWidth() / 2,
x + getWidth() / 2, y + 20,
y + 20, 0xFFFFFF);
0xFFFFFF);
if (isDecimal() || isNonDecimal()) { if (isDecimal() || isNonDecimal()) {
fontRendererObj.drawString("---", 7, y + 6, 0x000000); fontRendererObj.drawString("---", 7, y + 6, 0x000000);
@@ -207,13 +208,15 @@ public class ComponentFieldAdjuster extends ComponentBase {
field.value = !(Boolean) field.value; field.value = !(Boolean) field.value;
break; break;
} }
Minecraft.getMinecraft() Minecraft.getMinecraft().getSoundHandler()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot); ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
if (stack != null && stack.getItem() instanceof IConfigurableItem) { if (stack != null && stack.getItem() instanceof IConfigurableItem) {
DataUtills.writeObjectToCompound( DataUtills.writeObjectToCompound(
IConfigurableItem.ProfileHelper.getProfileCompound(stack), field.value, field.datatype, field.name); IConfigurableItem.ProfileHelper.getProfileCompound(stack),
field.value,
field.datatype,
field.name);
} }
field.sendChanges(); field.sendChanges();
} }
@@ -225,12 +228,22 @@ public class ComponentFieldAdjuster extends ComponentBase {
this.drawTexturedModalRect(x, y, 0, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize)); this.drawTexturedModalRect(x, y, 0, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize));
this.drawTexturedModalRect( this.drawTexturedModalRect(
x + xSize / 2, y, 200 - xSize / 2, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize)); x + xSize / 2,
y,
200 - xSize / 2,
46 + k * 20,
xSize / 2,
20 - Math.max(0, 20 - ySize));
if (ySize < 20) { if (ySize < 20) {
this.drawTexturedModalRect(x, y + 3, 0, (46 + k * 20) + 20 - ySize + 3, xSize - 1, ySize - 3); this.drawTexturedModalRect(x, y + 3, 0, (46 + k * 20) + 20 - ySize + 3, xSize - 1, ySize - 3);
this.drawTexturedModalRect( this.drawTexturedModalRect(
x + xSize / 2, y + 3, 200 - xSize / 2, (46 + k * 20) + 20 - ySize + 3, xSize / 2, ySize - 3); x + xSize / 2,
y + 3,
200 - xSize / 2,
(46 + k * 20) + 20 - ySize + 3,
xSize / 2,
ySize - 3);
} }
} }
@@ -239,8 +252,7 @@ public class ComponentFieldAdjuster extends ComponentBase {
} }
private boolean isNonDecimal() { private boolean isNonDecimal() {
return field.datatype == References.INT_ID return field.datatype == References.INT_ID || field.datatype == References.SHORT_ID
|| field.datatype == References.SHORT_ID
|| field.datatype == References.BYTE_ID; || field.datatype == References.BYTE_ID;
} }
@@ -1,26 +1,28 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents; package com.brandon3055.draconicevolution.client.gui.guicomponents;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.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.client.gui.guicomponents.ComponentBase;
import com.brandon3055.brandonscore.common.utills.DataUtills; import com.brandon3055.brandonscore.common.utills.DataUtills;
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig; import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.ItemConfigField; import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
/** /**
* Created by Brandon on 31/12/2014. * Created by Brandon on 31/12/2014.
*/ */
public class ComponentFieldButton extends ComponentBase { public class ComponentFieldButton extends ComponentBase {
private static final ResourceLocation widgets = private static final ResourceLocation widgets = new ResourceLocation(
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png"); References.RESOURCESPREFIX + "textures/gui/Widgets.png");
public EntityPlayer player; public EntityPlayer player;
public int slot; public int slot;
@@ -87,8 +89,7 @@ public class ComponentFieldButton extends ComponentBase {
@Override @Override
public void mouseClicked(int x, int y, int button) { public void mouseClicked(int x, int y, int button) {
Minecraft.getMinecraft() Minecraft.getMinecraft().getSoundHandler()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
if (field.datatype == References.BOOLEAN_ID) { if (field.datatype == References.BOOLEAN_ID) {
field.value = !(Boolean) field.value; field.value = !(Boolean) field.value;
@@ -1,14 +1,16 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents; package com.brandon3055.draconicevolution.client.gui.guicomponents;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Items;
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.ComponentScrollingBase;
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase; import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase;
import com.brandon3055.brandonscore.common.utills.Utills; import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage; import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 7/03/2015. * Created by Brandon on 7/03/2015.
@@ -1,5 +1,22 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents; package com.brandon3055.draconicevolution.client.gui.guicomponents;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.*;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
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.ComponentScrollingBase;
import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase; import com.brandon3055.brandonscore.client.gui.guicomponents.GUIScrollingBase;
import com.brandon3055.brandonscore.client.utills.GuiHelper; import com.brandon3055.brandonscore.client.utills.GuiHelper;
@@ -8,25 +25,12 @@ import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage; import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation; import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.*;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.apache.commons.io.FilenameUtils;
import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 19/03/2015. * Created by Brandon on 19/03/2015.
*/ */
public class ComponentManualPage extends ComponentScrollingBase { public class ComponentManualPage extends ComponentScrollingBase {
public ManualPage page; public ManualPage page;
public List<ContentComponent> contentList = new ArrayList<ContentComponent>(); public List<ContentComponent> contentList = new ArrayList<ContentComponent>();
private int pageLength = 0; private int pageLength = 0;
@@ -56,7 +60,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
@Override @Override
public void handleScrollInput(int direction) { public void handleScrollInput(int direction) {
// scrollOffset += direction * 10; // scrollOffset += direction * 10;
scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10); scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10);
if (scrollOffset < 0) scrollOffset = 0; if (scrollOffset < 0) scrollOffset = 0;
if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight(); if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight();
@@ -154,8 +158,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
if (stack != null) { if (stack != null) {
for (IRecipe recipe : for (IRecipe recipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
(List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
if (recipe == null) continue; if (recipe == null) continue;
ItemStack result = recipe.getRecipeOutput(); ItemStack result = recipe.getRecipeOutput();
@@ -167,10 +170,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
recipes.add(recipe); recipes.add(recipe);
} }
Iterator iterator = FurnaceRecipes.smelting() Iterator iterator = FurnaceRecipes.smelting().getSmeltingList().entrySet().iterator();
.getSmeltingList()
.entrySet()
.iterator();
Map.Entry entry; Map.Entry entry;
while (iterator.hasNext()) { while (iterator.hasNext()) {
@@ -184,10 +184,8 @@ public class ComponentManualPage extends ComponentScrollingBase {
} }
public int getHeight() { public int getHeight() {
if (type == 1 if (type == 1 && (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))
&& (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content)) || (slide && ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))))) {
|| (slide
&& ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))))) {
CustomResourceLocation texture = slide CustomResourceLocation texture = slide
? ResourceHandler.downloadedImages.get(FilenameUtils.getName(content)) ? ResourceHandler.downloadedImages.get(FilenameUtils.getName(content))
: ResourceHandler.downloadedImages.get(FilenameUtils.getName(content)); : ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
@@ -211,7 +209,11 @@ public class ComponentManualPage extends ComponentScrollingBase {
int y = yPos - page.scrollOffset; int y = yPos - page.scrollOffset;
if (y > 310 || y < 5) return; if (y > 310 || y < 5) return;
page.drawCenteredString( page.drawCenteredString(
page.fontRendererObj, content.substring(content.indexOf("title.") + 6), 128, y, 0x00ffff); page.fontRendererObj,
content.substring(content.indexOf("title.") + 6),
128,
y,
0x00ffff);
if ((page.page.name.contains("tile.") || page.page.name.contains("item.")) && page.stack != null) { if ((page.page.name.contains("tile.") || page.page.name.contains("item.")) && page.stack != null) {
ResourceHandler.bindResource("textures/gui/Widgets.png"); ResourceHandler.bindResource("textures/gui/Widgets.png");
@@ -229,8 +231,9 @@ public class ComponentManualPage extends ComponentScrollingBase {
} }
private void renderImage() { private void renderImage() {
CustomResourceLocation image = CustomResourceLocation image = null; // slide ?
null; // slide ? ResourceHandler.downloadedImages.get(slides.get(page.slideTick % slides.size() - // ResourceHandler.downloadedImages.get(slides.get(page.slideTick %
// slides.size() -
// 1)) : ResourceHandler.downloadedImages.get(content); // 1)) : ResourceHandler.downloadedImages.get(content);
if (slide) { if (slide) {
int index = (page.slideTick / 20) % (slides.size()); int index = (page.slideTick / 20) % (slides.size());
@@ -297,13 +300,13 @@ public class ComponentManualPage extends ComponentScrollingBase {
if (y + yDown + posY < 0 || y + yDown + posY > 305) continue; if (y + yDown + posY < 0 || y + yDown + posY > 305) continue;
page.drawTexturedModalRect(x + posX, y + yDown + posY, 138, 0, 18, 18); page.drawTexturedModalRect(x + posX, y + yDown + posY, 138, 0, 18, 18);
ItemStack stack = (ItemStack) ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i
(getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack && getRecipeInput(recipe)[i] instanceof ItemStack
? getRecipeInput(recipe)[i] ? getRecipeInput(recipe)[i]
: getRecipeInput(recipe).length > i : getRecipeInput(recipe).length > i
&& getRecipeInput(recipe)[i] instanceof ArrayList && getRecipeInput(recipe)[i] instanceof ArrayList
? ((ArrayList) getRecipeInput(recipe)[i]).get(0) ? ((ArrayList) getRecipeInput(recipe)[i]).get(0)
: null); : null);
if (stack != null) { if (stack != null) {
if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE) stack.setItemDamage(0); if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE) stack.setItemDamage(0);
@@ -341,13 +344,13 @@ public class ComponentManualPage extends ComponentScrollingBase {
int y = i / 3 * 18; int y = i / 3 * 18;
if (y + yDown + posY < 0 || y + yDown + posY > 305) continue; if (y + yDown + posY < 0 || y + yDown + posY > 305) continue;
ItemStack stack = (ItemStack) ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i
(getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack && getRecipeInput(recipe)[i] instanceof ItemStack
? getRecipeInput(recipe)[i] ? getRecipeInput(recipe)[i]
: getRecipeInput(recipe).length > i : getRecipeInput(recipe).length > i
&& getRecipeInput(recipe)[i] instanceof ArrayList && getRecipeInput(recipe)[i] instanceof ArrayList
? ((ArrayList) getRecipeInput(recipe)[i]).get(0) ? ((ArrayList) getRecipeInput(recipe)[i]).get(0)
: null); : null);
if (stack != null) { if (stack != null) {
if (GuiHelper.isInRect(1 + x + posX, 1 + y + yDown + posY, 18, 18, mouseX, mouseY)) { if (GuiHelper.isInRect(1 + x + posX, 1 + y + yDown + posY, 18, 18, mouseX, mouseY)) {
@@ -403,8 +406,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
} }
private Object[] getRecipeInput(IRecipe recipe) { private Object[] getRecipeInput(IRecipe recipe) {
if (recipe instanceof ShapelessOreRecipe) if (recipe instanceof ShapelessOreRecipe) return ((ShapelessOreRecipe) recipe).getInput().toArray();
return ((ShapelessOreRecipe) recipe).getInput().toArray();
else if (recipe instanceof ShapedOreRecipe) return getShapedOreRecipe((ShapedOreRecipe) recipe); else if (recipe instanceof ShapedOreRecipe) return getShapedOreRecipe((ShapedOreRecipe) recipe);
else if (recipe instanceof ShapedRecipes) return ((ShapedRecipes) recipe).recipeItems; else if (recipe instanceof ShapedRecipes) return ((ShapedRecipes) recipe).recipeItems;
else if (recipe instanceof ShapelessRecipes) else if (recipe instanceof ShapelessRecipes)
@@ -1,5 +1,25 @@
package com.brandon3055.draconicevolution.client.handler; package com.brandon3055.draconicevolution.client.handler;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.common.utills.DataUtills.XZPair; import com.brandon3055.brandonscore.common.utills.DataUtills.XZPair;
import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.ModItems;
@@ -13,35 +33,19 @@ import com.brandon3055.draconicevolution.common.items.weapons.DraconicBow;
import com.brandon3055.draconicevolution.common.items.weapons.WyvernBow; import com.brandon3055.draconicevolution.common.items.weapons.WyvernBow;
import com.brandon3055.draconicevolution.common.network.MountUpdatePacket; import com.brandon3055.draconicevolution.common.network.MountUpdatePacket;
import com.brandon3055.draconicevolution.common.utills.LogHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper;
import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 28/10/2014. * Created by Brandon on 28/10/2014.
*/ */
public class ClientEventHandler { public class ClientEventHandler {
public static Map<EntityPlayer, XZPair<Float, Integer>> playerShieldStatus =
new HashMap<EntityPlayer, XZPair<Float, Integer>>(); public static Map<EntityPlayer, XZPair<Float, Integer>> playerShieldStatus = new HashMap<EntityPlayer, XZPair<Float, Integer>>();
public static int elapsedTicks; public static int elapsedTicks;
private static float previousFOB = 0f; private static float previousFOB = 0f;
@@ -68,9 +72,8 @@ public class ClientEventHandler {
if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT) if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT)
return; return;
for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = playerShieldStatus.entrySet().iterator(); i
playerShieldStatus.entrySet().iterator(); .hasNext();) {
i.hasNext(); ) {
Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next(); Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next();
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove(); if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
} }
@@ -122,17 +125,18 @@ public class ClientEventHandler {
|| event.entity.getHeldItem().getItem() instanceof DraconicBow) || event.entity.getHeldItem().getItem() instanceof DraconicBow)
&& Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) { && Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
BowHandler.BowProperties properties = BowHandler.BowProperties properties = new BowHandler.BowProperties(
new BowHandler.BowProperties(event.entity.getHeldItem(), event.entity); event.entity.getHeldItem(),
event.entity);
event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov; event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov;
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){ // if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f; // if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f; // else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
// bowZoom = true; // bowZoom = true;
// tickSet = elapsedTicks; // tickSet = elapsedTicks;
// } // }
} }
// endregion // endregion
@@ -141,11 +145,10 @@ public class ClientEventHandler {
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity); CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity);
if (summery != null && summery.speedModifier > 0) { if (summery != null && summery.speedModifier > 0) {
IAttributeInstance iattributeinstance = IAttributeInstance iattributeinstance = event.entity
event.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed); .getEntityAttribute(SharedMonsterAttributes.movementSpeed);
float f = (float) float f = (float) ((iattributeinstance.getAttributeValue()
((iattributeinstance.getAttributeValue() / (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
/ 2.0D);
event.newfov /= f; event.newfov /= f;
} }
@@ -211,8 +214,7 @@ public class ClientEventHandler {
EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer; EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer;
int i = 5 int i = 5 - (elapsedTicks - playerShieldStatus.get(event.entityPlayer).getValue());
- (elapsedTicks - playerShieldStatus.get(event.entityPlayer).getValue());
GL11.glColor4f(1F - p, 0F, p, i / 5F); GL11.glColor4f(1F - p, 0F, p, i / 5F);
@@ -1,17 +1,8 @@
package com.brandon3055.draconicevolution.client.handler; package com.brandon3055.draconicevolution.client.handler;
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.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 cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiChat; import net.minecraft.client.gui.GuiChat;
@@ -20,8 +11,21 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.StatCollector; import net.minecraft.util.StatCollector;
import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent;
import org.lwjgl.opengl.GL11; 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.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 cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** /**
* Created by Brandon on 26/01/2015. * Created by Brandon on 26/01/2015.
*/ */
@@ -46,9 +50,9 @@ public class HudHandler {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void drawHUD(RenderGameOverlayEvent.Post event) { public void drawHUD(RenderGameOverlayEvent.Post event) {
Minecraft mc = Minecraft.getMinecraft(); Minecraft mc = Minecraft.getMinecraft();
if (event.type != RenderGameOverlayEvent.ElementType.ALL if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo
|| mc.gameSettings.showDebugInfo || mc.currentScreen instanceof GuiChat)
|| mc.currentScreen instanceof GuiChat) return; return;
ScaledResolution resolution = event.resolution; ScaledResolution resolution = event.resolution;
width = resolution.getScaledWidth(); width = resolution.getScaledWidth();
@@ -112,15 +116,14 @@ public class HudHandler {
toolTipFadeOut = 1F; toolTipFadeOut = 1F;
armorStatsFadeOut = 1F; armorStatsFadeOut = 1F;
} }
} else if (mc.thePlayer.getHeldItem() != null } else
&& mc.thePlayer.getHeldItem().getItem() instanceof IHudDisplayItem) { if (mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof IHudDisplayItem) {
hudList = hudList = ((IHudDisplayItem) mc.thePlayer.getHeldItem().getItem())
((IHudDisplayItem) mc.thePlayer.getHeldItem().getItem()).getDisplayData(mc.thePlayer.getHeldItem()); .getDisplayData(mc.thePlayer.getHeldItem());
} }
MovingObjectPosition mop = mc.thePlayer.rayTrace(5, 0); MovingObjectPosition mop = mc.thePlayer.rayTrace(5, 0);
if (mop != null if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ) instanceof IHudDisplayBlock) { && mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ) instanceof IHudDisplayBlock) {
hudList = ((IHudDisplayBlock) mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ)) hudList = ((IHudDisplayBlock) mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ))
.getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ); .getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ);
@@ -134,17 +137,17 @@ public class HudHandler {
} }
showShieldHud = armorStatsFadeOut > 0F; showShieldHud = armorStatsFadeOut > 0F;
if (maxShieldPoints != summery.maxProtectionPoints if (maxShieldPoints != summery.maxProtectionPoints || shieldPoints != summery.protectionPoints
|| shieldPoints != summery.protectionPoints
|| shieldEntropy != summery.entropy || shieldEntropy != summery.entropy
|| rfTotal != summery.totalEnergyStored) armorStatsFadeOut = 5F; || rfTotal != summery.totalEnergyStored)
armorStatsFadeOut = 5F;
maxShieldPoints = summery.maxProtectionPoints; maxShieldPoints = summery.maxProtectionPoints;
shieldPoints = summery.protectionPoints; shieldPoints = summery.protectionPoints;
shieldPercentCharge = (int) (summery.protectionPoints / summery.maxProtectionPoints * 100D); shieldPercentCharge = (int) (summery.protectionPoints / summery.maxProtectionPoints * 100D);
shieldEntropy = summery.entropy; shieldEntropy = summery.entropy;
rfCharge = (int) rfCharge = (int) ((double) summery.totalEnergyStored / Math.max((double) summery.maxTotalEnergyStorage, 1D)
((double) summery.totalEnergyStored / Math.max((double) summery.maxTotalEnergyStorage, 1D) * 100D); * 100D);
rfTotal = summery.totalEnergyStored; rfTotal = summery.totalEnergyStored;
} }
@@ -192,7 +195,16 @@ public class HudHandler {
0, 0,
GuiHelper.PXL128); GuiHelper.PXL128);
GuiHelper.drawTexturedRect( GuiHelper.drawTexturedRect(
x + 13, y + 2 + 100 - rfCharge, 2, rfCharge, 28, 100 - rfCharge, 2, rfCharge, 0, GuiHelper.PXL128); x + 13,
y + 2 + 100 - rfCharge,
2,
rfCharge,
28,
100 - rfCharge,
2,
rfCharge,
0,
GuiHelper.PXL128);
if (ConfigHandler.hudSettings[9] == 1) { if (ConfigHandler.hudSettings[9] == 1) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
@@ -204,12 +216,12 @@ public class HudHandler {
String energy = "RF: " + Utills.formatNumber(rfTotal); String energy = "RF: " + Utills.formatNumber(rfTotal);
float fade = Math.min(armorStatsFadeOut, 1F); float fade = Math.min(armorStatsFadeOut, 1F);
if (!rotated) { if (!rotated) {
fontRenderer.drawStringWithShadow( fontRenderer
shield, x + 18, y + 74, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF); .drawStringWithShadow(shield, x + 18, y + 74, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow( fontRenderer
energy, x + 18, y + 84, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF); .drawStringWithShadow(energy, x + 18, y + 84, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow( fontRenderer
entropy, x + 18, y + 94, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF); .drawStringWithShadow(entropy, x + 18, y + 94, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
} else { } else {
fontRenderer.drawString( fontRenderer.drawString(
shield, shield,
@@ -221,8 +233,8 @@ public class HudHandler {
x - fontRenderer.getStringWidth(entropy), x - fontRenderer.getStringWidth(entropy),
y + 18, y + 18,
((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF); ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow( fontRenderer
energy, x - 102, y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF); .drawStringWithShadow(energy, x - 102, y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
} }
} }
@@ -235,42 +247,42 @@ public class HudHandler {
} }
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// GL11.glEnable(GL11.GL_ALPHA_TEST); // GL11.glEnable(GL11.GL_ALPHA_TEST);
// ResourceHandler.bindResource("textures/gui/HUD.png"); // ResourceHandler.bindResource("textures/gui/HUD.png");
// //
// if (rotated){ // if (rotated){
// GuiHelper.drawTexturedRect(x-(12*scale), y+scale, (int)(11*scale), (int)(13*scale), 2, 0, 11, 13, 0, // GuiHelper.drawTexturedRect(x-(12*scale), y+scale, (int)(11*scale), (int)(13*scale), 2, 0, 11, 13, 0,
// GuiHelper.PXL128); // GuiHelper.PXL128);
// x+=(104*scale); // x+=(104*scale);
// GL11.glTranslated(x, y, 0); // GL11.glTranslated(x, y, 0);
// GL11.glRotated(-90, 0, 0, -1); // GL11.glRotated(-90, 0, 0, -1);
// GL11.glTranslated(-x, -y, 0); // GL11.glTranslated(-x, -y, 0);
// } // }
// else GuiHelper.drawTexturedRect(x+(1*scale), y+(104*scale)+1, (int)(13*scale), (int)(15*scale), 2, 0, 11, 13, 0, // else GuiHelper.drawTexturedRect(x+(1*scale), y+(104*scale)+1, (int)(13*scale), (int)(15*scale), 2, 0, 11, 13, 0,
// GuiHelper.PXL128); // GuiHelper.PXL128);
// //
// GuiHelper.drawTexturedRect(x, y, (int)(17*scale), (int)(104*scale), 0, 15, 17, 104, 0, GuiHelper.PXL128); // GuiHelper.drawTexturedRect(x, y, (int)(17*scale), (int)(104*scale), 0, 15, 17, 104, 0, GuiHelper.PXL128);
// GuiHelper.drawTexturedRect(x+(2*scale), y+(2*scale)+(100-shieldPercentCharge), (int)(7*scale), shieldPercentCharge // GuiHelper.drawTexturedRect(x+(2*scale), y+(2*scale)+(100-shieldPercentCharge), (int)(7*scale), shieldPercentCharge
// *scale, 17, 100-shieldPercentCharge, 7, shieldPercentCharge, 0, GuiHelper.PXL128); // *scale, 17, 100-shieldPercentCharge, 7, shieldPercentCharge, 0, GuiHelper.PXL128);
// GuiHelper.drawTexturedRect(x+(10*scale), y+(2+(100-(int)shieldEntropy) * scale), (int)(2*scale), (int)shieldEntropy // GuiHelper.drawTexturedRect(x+(10*scale), y+(2+(100-(int)shieldEntropy) * scale), (int)(2*scale), (int)shieldEntropy
// * scale, 25, 100-(int)shieldEntropy, 2, (int)shieldEntropy, 0, GuiHelper.PXL128); // * scale, 25, 100-(int)shieldEntropy, 2, (int)shieldEntropy, 0, GuiHelper.PXL128);
// //
// if (ConfigHandler.hudSettings[9] == 1) { // if (ConfigHandler.hudSettings[9] == 1) {
// FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; // FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
// GL11.glTranslated(x, y, 0); // GL11.glTranslated(x, y, 0);
// GL11.glScaled(scale, scale, 1); // GL11.glScaled(scale, scale, 1);
// if (rotated) GL11.glRotated(90, 0, 0, -1); // if (rotated) GL11.glRotated(90, 0, 0, -1);
// GL11.glTranslated(-x, -y, 0); // GL11.glTranslated(-x, -y, 0);
// if (!rotated) { // if (!rotated) {
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x + 16, y + 84, 0xFFFFFF); // fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x + 16, y + 84, 0xFFFFFF);
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x + 16, y + 94, 0xFFFFFF); // fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x + 16, y + 94, 0xFFFFFF);
// }else { // }else {
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x - 102, y + 16, 0xFFFFFF); // fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x - 102, y + 16, 0xFFFFFF);
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x - fontRenderer.getStringWidth((int)shieldEntropy + // fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x - fontRenderer.getStringWidth((int)shieldEntropy +
// "%"), y + 16, 0xFFFFFF); // "%"), y + 16, 0xFFFFFF);
// } // }
// } // }
// //
// ResourceHandler.bindTexture(ResourceHandler.getResourceWOP("minecraft:textures/gui/icons.png")); // ResourceHandler.bindTexture(ResourceHandler.getResourceWOP("minecraft:textures/gui/icons.png"));
// GL11.glDisable(GL11.GL_ALPHA_TEST); // GL11.glDisable(GL11.GL_ALPHA_TEST);
// GL11.glPopMatrix(); // GL11.glPopMatrix();
@@ -7,6 +7,7 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
@@ -17,8 +18,7 @@ public final class ItemDisplayManager {
private int ticksCounter; private int ticksCounter;
private static final RenderItem renderItem = new RenderItem(); private static final RenderItem renderItem = new RenderItem();
private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer; private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
private static final TextureManager textureManager = private static final TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
Minecraft.getMinecraft().getTextureManager();
public ItemDisplayManager(int ticks) { public ItemDisplayManager(int ticks) {
this.ticks = ticks; this.ticks = ticks;
@@ -1,26 +1,22 @@
package com.brandon3055.draconicevolution.client.handler; package com.brandon3055.draconicevolution.client.handler;
import com.brandon3055.draconicevolution.client.render.particle.ParticleDistortion;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.brandon3055.draconicevolution.client.render.particle.ParticleDistortion;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleHandler { public class ParticleHandler {
private static Minecraft mc = Minecraft.getMinecraft(); private static Minecraft mc = Minecraft.getMinecraft();
private static World theWorld = mc.theWorld; private static World theWorld = mc.theWorld;
public static EntityFX spawnParticle( public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX,
String particleName, double motionY, double motionZ, float scale) {
double x,
double y,
double z,
double motionX,
double motionY,
double motionZ,
float scale) {
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) { if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
int var14 = mc.gameSettings.particleSetting; int var14 = mc.gameSettings.particleSetting;
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) { if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
@@ -38,7 +34,14 @@ public class ParticleHandler {
} else { } else {
if (particleName.equals("distortionParticle")) { if (particleName.equals("distortionParticle")) {
var21 = new ParticleDistortion( var21 = new ParticleDistortion(
theWorld, x, y, z, (float) motionX, (float) motionY, (float) motionZ, scale); theWorld,
x,
y,
z,
(float) motionX,
(float) motionY,
(float) motionZ,
scale);
} }
mc.effectRenderer.addEffect(var21); mc.effectRenderer.addEffect(var21);
@@ -1,37 +1,43 @@
package com.brandon3055.draconicevolution.client.handler; package com.brandon3055.draconicevolution.client.handler;
import java.awt.image.BufferedImage;
import java.io.*;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import javax.imageio.ImageIO;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.resources.FolderResourcePack;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.io.FilenameUtils;
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual; import com.brandon3055.draconicevolution.client.gui.componentguis.GUIManual;
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation; import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.LogHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper;
import com.google.common.io.ByteStreams; import com.google.common.io.ByteStreams;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.ReflectionHelper; import cpw.mods.fml.relauncher.ReflectionHelper;
import java.awt.image.BufferedImage;
import java.io.*;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import javax.imageio.ImageIO;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.resources.FolderResourcePack;
import net.minecraft.util.ResourceLocation;
import org.apache.commons.io.FilenameUtils;
/** /**
* Created by Brandon on 8/02/2015. * Created by Brandon on 8/02/2015.
*/ */
public class ResourceHandler { public class ResourceHandler {
public static ResourceHandler instance = new ResourceHandler(); public static ResourceHandler instance = new ResourceHandler();
private static ResourceLocation defaultParticles; private static ResourceLocation defaultParticles;
private static ResourceLocation particles = private static ResourceLocation particles = new ResourceLocation(
new ResourceLocation(References.RESOURCESPREFIX + "textures/particle/particles.png"); References.RESOURCESPREFIX + "textures/particle/particles.png");
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>(); private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
public static Map<String, CustomResourceLocation> downloadedImages = new HashMap<String, CustomResourceLocation>(); public static Map<String, CustomResourceLocation> downloadedImages = new HashMap<String, CustomResourceLocation>();
@@ -57,9 +63,8 @@ public class ResourceHandler {
public static void init(FMLPreInitializationEvent event) { public static void init(FMLPreInitializationEvent event) {
FMLCommonHandler.instance().bus().register(instance); FMLCommonHandler.instance().bus().register(instance);
if (event != null) if (event != null) savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath()
savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + "/config/draconicevolution";
+ "/config/draconicevolution";
GUIManual.loadPages(); GUIManual.loadPages();
downloadThread = new DownloadThread(GUIManual.imageURLs); downloadThread = new DownloadThread(GUIManual.imageURLs);
@@ -67,6 +72,7 @@ public class ResourceHandler {
} }
public static class DownloadThread extends Thread { public static class DownloadThread extends Thread {
private List<String> imageURLs; private List<String> imageURLs;
private boolean isFinished = false; private boolean isFinished = false;
private boolean wasSuccessful = true; private boolean wasSuccessful = true;
@@ -90,7 +96,9 @@ public class ResourceHandler {
downloadedImages.put( downloadedImages.put(
FilenameUtils.getName(fileName), FilenameUtils.getName(fileName),
new CustomResourceLocation( new CustomResourceLocation(
FilenameUtils.getName(fileName), bi.getWidth(), bi.getHeight())); FilenameUtils.getName(fileName),
bi.getWidth(),
bi.getHeight()));
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
LogHelper.error("Image Read Failed"); LogHelper.error("Image Read Failed");
e.printStackTrace(); e.printStackTrace();
@@ -219,10 +227,9 @@ public class ResourceHandler {
public static void bindDefaultParticles() { public static void bindDefaultParticles() {
if (defaultParticles == null) { if (defaultParticles == null) {
try { try {
defaultParticles = (ResourceLocation) ReflectionHelper.getPrivateValue( defaultParticles = (ResourceLocation) ReflectionHelper
EffectRenderer.class, null, "particleTextures", "field_110737_b"); .getPrivateValue(EffectRenderer.class, null, "particleTextures", "field_110737_b");
} catch (Exception e) { } catch (Exception e) {}
}
} }
if (defaultParticles != null) bindTexture(defaultParticles); if (defaultParticles != null) bindTexture(defaultParticles);
} }
@@ -1,11 +1,14 @@
package com.brandon3055.draconicevolution.client.keybinding; package com.brandon3055.draconicevolution.client.keybinding;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.settings.KeyBinding;
import org.lwjgl.input.Keyboard;
/** /**
* Created by Brandon on 14/08/2014. * Created by Brandon on 14/08/2014.
@@ -1,5 +1,14 @@
package com.brandon3055.draconicevolution.client.keybinding; package com.brandon3055.draconicevolution.client.keybinding;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import org.lwjgl.input.Mouse;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper; import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.draconicevolution.DraconicEvolution; import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.ModItems; import com.brandon3055.draconicevolution.common.ModItems;
@@ -9,17 +18,11 @@ import com.brandon3055.draconicevolution.common.network.MagnetTogglePacket;
import com.brandon3055.draconicevolution.common.network.PlacedItemPacket; import com.brandon3055.draconicevolution.common.network.PlacedItemPacket;
import com.brandon3055.draconicevolution.common.network.TeleporterPacket; import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem; import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent; import cpw.mods.fml.common.gameevent.InputEvent;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import org.lwjgl.input.Mouse;
/** /**
* Created by Brandon on 14/08/2014. * Created by Brandon on 14/08/2014.
@@ -33,39 +36,39 @@ public class KeyInputHandler {
handlePlaceItemKey(); handlePlaceItemKey();
} else if (KeyBindings.toolConfig.isPressed()) { } else if (KeyBindings.toolConfig.isPressed()) {
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false)); DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
} else if (KeyBindings.toolProfileChange.isPressed() } else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null
&& Minecraft.getMinecraft().thePlayer != null
&& Minecraft.getMinecraft().thePlayer.getItemInUse() == null) { && Minecraft.getMinecraft().thePlayer.getItemInUse() == null) {
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false)); DraconicEvolution.network
.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem(); ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
if (stack != null if (stack != null && stack.getItem() instanceof IConfigurableItem
&& stack.getItem() instanceof IConfigurableItem && ((IConfigurableItem) stack.getItem()).hasProfiles()) {
&& ((IConfigurableItem) stack.getItem()).hasProfiles()) { int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0); if (++preset >= 5) preset = 0;
if (++preset >= 5) preset = 0; ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
}
} else if (KeyBindings.toggleFlight.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (player.capabilities.allowFlying) {
if (player.capabilities.isFlying) {
player.capabilities.isFlying = false;
} else {
player.capabilities.isFlying = true;
if (player.onGround) {
player.setPosition(player.posX, player.posY + 0.05D, player.posZ);
player.motionY = 0;
} }
} else
if (KeyBindings.toggleFlight.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (player.capabilities.allowFlying) {
if (player.capabilities.isFlying) {
player.capabilities.isFlying = false;
} else {
player.capabilities.isFlying = true;
if (player.onGround) {
player.setPosition(player.posX, player.posY + 0.05D, player.posZ);
player.motionY = 0;
}
}
player.sendPlayerAbilities();
}
} else if (KeyBindings.toggleMagnet.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (player.inventory.hasItem(ModItems.magnet)) {
DraconicEvolution.network.sendToServer(new MagnetTogglePacket());
} }
player.sendPlayerAbilities();
} }
} else if (KeyBindings.toggleMagnet.isPressed()) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (player.inventory.hasItem(ModItems.magnet)) {
DraconicEvolution.network.sendToServer(new MagnetTogglePacket());
}
}
} }
private void handlePlaceItemKey() { private void handlePlaceItemKey() {
@@ -73,8 +76,8 @@ public class KeyInputHandler {
WorldClient world = Minecraft.getMinecraft().theWorld; WorldClient world = Minecraft.getMinecraft().theWorld;
MovingObjectPosition mop = ToolHandler.raytraceFromEntity(world, player, 4.5D); MovingObjectPosition mop = ToolHandler.raytraceFromEntity(world, player, 4.5D);
if (mop != null) { if (mop != null) {
DraconicEvolution.network.sendToServer( DraconicEvolution.network
new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ)); .sendToServer(new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ));
} }
} }
@@ -89,8 +92,7 @@ public class KeyInputHandler {
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false)); DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem(); ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
if (stack != null if (stack != null && stack.getItem() instanceof IConfigurableItem
&& stack.getItem() instanceof IConfigurableItem
&& ((IConfigurableItem) stack.getItem()).hasProfiles()) { && ((IConfigurableItem) stack.getItem()).hasProfiles()) {
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0); int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
if (++preset >= 5) preset = 0; if (++preset >= 5) preset = 0;
@@ -3,13 +3,14 @@ package com.brandon3055.draconicevolution.client.model;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* ModelChaosCrystal - Mojang-(Original) modified by brandon3055 * ModelChaosCrystal - Mojang-(Original) modified by brandon3055 Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelChaosCrystal extends ModelBase { public class ModelChaosCrystal extends ModelBase {
public ModelRenderer base; public ModelRenderer base;
public ModelRenderer glass; public ModelRenderer glass;
public ModelRenderer cube; public ModelRenderer cube;
@@ -1,10 +1,11 @@
package com.brandon3055.draconicevolution.client.model; package com.brandon3055.draconicevolution.client.model;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
public class ModelDraconicArmor extends ModelBiped { public class ModelDraconicArmor extends ModelBiped {
public ModelRenderOBJ head; public ModelRenderOBJ head;
@@ -182,14 +183,8 @@ public class ModelDraconicArmor extends ModelBiped {
this.bipedLeftLeg.render(1F / 16F); this.bipedLeftLeg.render(1F / 16F);
} }
public void setRotationAngles( public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
float p_78087_1_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
float p_78087_2_,
float p_78087_3_,
float p_78087_4_,
float p_78087_5_,
float p_78087_6_,
Entity p_78087_7_) {
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotationPointZ = 0.0F; this.bipedRightArm.rotationPointZ = 0.0F;
@@ -5,16 +5,16 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
/** /**
* Draconic Armor.tcn - TechneToTabulaImporter * Draconic Armor.tcn - TechneToTabulaImporter Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelDraconicArmorOld extends ModelBiped { // public class ModelDraconicArmorOld extends ModelBiped { //
// public ModelRenderer bipedHead; // public ModelRenderer bipedHead;
// public ModelRenderer bipedBody; // public ModelRenderer bipedBody;
// public ModelRenderer bipedRightArm; // public ModelRenderer bipedRightArm;
// public ModelRenderer bipedLeftArm; // public ModelRenderer bipedLeftArm;
// public ModelRenderer bipedRightLeg;/ // public ModelRenderer bipedRightLeg;/
// public ModelRenderer bipedLeftLeg; // public ModelRenderer bipedLeftLeg;
public ModelRenderer MainHelmPieceRight1; public ModelRenderer MainHelmPieceRight1;
public ModelRenderer MainHelmPieceRight2; public ModelRenderer MainHelmPieceRight2;
public ModelRenderer MainHelmPieceLeft1; public ModelRenderer MainHelmPieceLeft1;
@@ -108,8 +108,8 @@ public class ModelDraconicArmorOld extends ModelBiped { //
private boolean isDraconic; private boolean isDraconic;
public ModelDraconicArmorOld( public ModelDraconicArmorOld(float f, boolean isHelmet, boolean isChestPiece, boolean isLeggings, boolean isdBoots,
float f, boolean isHelmet, boolean isChestPiece, boolean isLeggings, boolean isdBoots, boolean isDraconic) { boolean isDraconic) {
super(f, 0.0f, 128, 128); super(f, 0.0f, 128, 128);
this.textureWidth = 256; this.textureWidth = 256;
this.textureHeight = 128; this.textureHeight = 128;
@@ -271,7 +271,10 @@ public class ModelDraconicArmorOld extends ModelBiped { //
this.DrChestDecorationPiece1.setRotationPoint(0.0F, -0.5F, -4.0F); this.DrChestDecorationPiece1.setRotationPoint(0.0F, -0.5F, -4.0F);
this.DrChestDecorationPiece1.addBox(0.0F, 0.0F, -0.5F, 5, 5, 1, 0.0F); this.DrChestDecorationPiece1.addBox(0.0F, 0.0F, -0.5F, 5, 5, 1, 0.0F);
this.setRotateAngle( this.setRotateAngle(
DrChestDecorationPiece1, 0.1426609064282019F, -0.13533507716461618F, 0.7946695004338321F); DrChestDecorationPiece1,
0.1426609064282019F,
-0.13533507716461618F,
0.7946695004338321F);
this.ChestDecorationPiece2 = new ModelRenderer(this, 229, 38); this.ChestDecorationPiece2 = new ModelRenderer(this, 229, 38);
this.ChestDecorationPiece2.setRotationPoint(-3.0F, 7.0F, -3.0F); this.ChestDecorationPiece2.setRotationPoint(-3.0F, 7.0F, -3.0F);
@@ -4,13 +4,14 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* ModelReactorPowerInjector - brandon3055 * ModelReactorPowerInjector - brandon3055 Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelReactorEnergyInjector extends ModelBase { public class ModelReactorEnergyInjector extends ModelBase {
public ModelRenderer BasePlate; public ModelRenderer BasePlate;
public ModelRenderer shape14; public ModelRenderer shape14;
public ModelRenderer coreSupports; public ModelRenderer coreSupports;
@@ -167,7 +168,9 @@ public class ModelReactorEnergyInjector extends ModelBase {
float colour = Math.min(2F, (brightness * 2F) + 0.5F); float colour = Math.min(2F, (brightness * 2F) + 0.5F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING); if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.setLightmapTextureCoords(
OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b)); OpenGlHelper.lightmapTexUnit,
Math.min(200F, lastBrightnessX + b),
Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour, colour, colour, 1F); GL11.glColor4f(colour, colour, colour, 1F);
this.element1.render(f5); this.element1.render(f5);
GL11.glColor4f(1F, 1F, 1F, 1F); GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -4,13 +4,14 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* ReactorStabilizerCore - brandon3055 * ReactorStabilizerCore - brandon3055 Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelReactorStabilizerCore extends ModelBase { public class ModelReactorStabilizerCore extends ModelBase {
public ModelRenderer hub1; public ModelRenderer hub1;
public ModelRenderer hub2; public ModelRenderer hub2;
public ModelRenderer rotor1R; public ModelRenderer rotor1R;
@@ -270,7 +271,9 @@ public class ModelReactorStabilizerCore extends ModelBase {
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING); if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.setLightmapTextureCoords(
OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b)); OpenGlHelper.lightmapTexUnit,
Math.min(200F, lastBrightnessX + b),
Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour, colour, colour, 1F); GL11.glColor4f(colour, colour, colour, 1F);
this.rotor2R.render(f5); this.rotor2R.render(f5);
GL11.glRotatef(rotation * 2F, 0F, 0F, 1F); GL11.glRotatef(rotation * 2F, 0F, 0F, 1F);
@@ -4,13 +4,14 @@ import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* EnergyStabilizer - brandon3055 * EnergyStabilizer - brandon3055 Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelReactorStabilizerRing extends ModelBase { public class ModelReactorStabilizerRing extends ModelBase {
public ModelRenderer ringElement1; public ModelRenderer ringElement1;
public ModelRenderer ringElement2; public ModelRenderer ringElement2;
public ModelRenderer ringElement3; public ModelRenderer ringElement3;
@@ -114,8 +115,8 @@ public class ModelReactorStabilizerRing extends ModelBase {
} }
@Override @Override
public void render( public void render(Entity entity, float embitterRotation, float brightness, float f2, float f3, float f4,
Entity entity, float embitterRotation, float brightness, float f2, float f3, float f4, float scale) { float scale) {
this.ringElement1.render(scale); this.ringElement1.render(scale);
this.ringElement2.render(scale); this.ringElement2.render(scale);
@@ -187,9 +188,9 @@ public class ModelReactorStabilizerRing extends ModelBase {
this.hing4.render(scale); this.hing4.render(scale);
GL11.glPopMatrix(); GL11.glPopMatrix();
// float lastBrightnessX = OpenGlHelper.lastBrightnessX; // float lastBrightnessX = OpenGlHelper.lastBrightnessX;
// float lastBrightnessY = OpenGlHelper.lastBrightnessY; // float lastBrightnessY = OpenGlHelper.lastBrightnessY;
// OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F); // OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
float lastBrightnessX = OpenGlHelper.lastBrightnessX; float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY; float lastBrightnessY = OpenGlHelper.lastBrightnessY;
@@ -197,7 +198,9 @@ public class ModelReactorStabilizerRing extends ModelBase {
float colour = Math.min(2F, (brightness * 2F) + 0.1F); float colour = Math.min(2F, (brightness * 2F) + 0.1F);
OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.setLightmapTextureCoords(
OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b)); OpenGlHelper.lightmapTexUnit,
Math.min(200F, lastBrightnessX + b),
Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour, colour, colour, 1F); GL11.glColor4f(colour, colour, colour, 1F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING); if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
@@ -1,18 +1,21 @@
package com.brandon3055.draconicevolution.client.model; package com.brandon3055.draconicevolution.client.model;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
/** /**
* Created by brandon3055 on 16/9/2015. * Created by brandon3055 on 16/9/2015.
*/ */
public class ModelRenderOBJ extends ModelRenderer { public class ModelRenderOBJ extends ModelRenderer {
private IModelCustom model; private IModelCustom model;
private ResourceLocation texture; private ResourceLocation texture;
private int displayList; private int displayList;
@@ -39,15 +42,21 @@ public class ModelRenderOBJ extends ModelRenderer {
GL11.glCallList(this.displayList); GL11.glCallList(this.displayList);
} else { } else {
GL11.glTranslatef( GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); this.rotationPointX * scale,
this.rotationPointY * scale,
this.rotationPointZ * scale);
GL11.glCallList(this.displayList); GL11.glCallList(this.displayList);
GL11.glTranslatef( GL11.glTranslatef(
-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale); -this.rotationPointX * scale,
-this.rotationPointY * scale,
-this.rotationPointZ * scale);
} }
} else { } else {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef( GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); this.rotationPointX * scale,
this.rotationPointY * scale,
this.rotationPointZ * scale);
if (this.rotateAngleZ != 0.0F) { if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
} }
@@ -115,18 +124,22 @@ public class ModelRenderOBJ extends ModelRenderer {
@Override @Override
public void postRender(float scale) { public void postRender(float scale) {
if (!this.isHidden && this.showModel) { if (!this.isHidden && this.showModel) {
// if(!this.compiled) { // if(!this.compiled) {
// this.compileDisplayList(scale); // this.compileDisplayList(scale);
// } // }
if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) {
GL11.glTranslatef( GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); this.rotationPointX * scale,
this.rotationPointY * scale,
this.rotationPointZ * scale);
} }
} else { } else {
GL11.glTranslatef( GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale); this.rotationPointX * scale,
this.rotationPointY * scale,
this.rotationPointZ * scale);
if (this.rotateAngleZ != 0.0F) { if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
} }
@@ -1,10 +1,11 @@
package com.brandon3055.draconicevolution.client.model; package com.brandon3055.draconicevolution.client.model;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.model.ModelBiped; import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
public class ModelWyvernArmor extends ModelBiped { public class ModelWyvernArmor extends ModelBiped {
public ModelRenderOBJ head; public ModelRenderOBJ head;
@@ -179,14 +180,8 @@ public class ModelWyvernArmor extends ModelBiped {
this.bipedLeftLeg.render(1F / 16F); this.bipedLeftLeg.render(1F / 16F);
} }
public void setRotationAngles( public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
float p_78087_1_, float p_78087_5_, float scale, Entity p_78087_7_) {
float p_78087_2_,
float p_78087_3_,
float p_78087_4_,
float p_78087_5_,
float scale,
Entity p_78087_7_) {
this.bipedRightArm.rotateAngleZ = 0.0F; this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F; this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotationPointZ = 0.0F; this.bipedRightArm.rotationPointZ = 0.0F;
@@ -1,16 +1,18 @@
package com.brandon3055.draconicevolution.client.model.special; package com.brandon3055.draconicevolution.client.model.special;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
/** /**
* DragonWings - brandon3055 * DragonWings - brandon3055 Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelContributorWings extends ModelBase { public class ModelContributorWings extends ModelBase {
public ModelRenderer rightBaseStem; public ModelRenderer rightBaseStem;
public ModelRenderer leftBaseStem; public ModelRenderer leftBaseStem;
public ModelRenderer rightOuterStem; public ModelRenderer rightOuterStem;
@@ -3,14 +3,15 @@ package com.brandon3055.draconicevolution.client.model.special;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
/** /**
* Staff of the Great One - brandon3055 * Staff of the Great One - brandon3055 Created using Tabula 5.0.0
* Created using Tabula 5.0.0
*/ */
public class ModelStaffOfTheGreatOne extends ModelBase { public class ModelStaffOfTheGreatOne extends ModelBase {
public double[] modelScale = new double[] {2.0D, 2.0D, 2.0D};
public double[] modelScale = new double[] { 2.0D, 2.0D, 2.0D };
public ModelRenderer staff; public ModelRenderer staff;
public ModelRenderer edge1; public ModelRenderer edge1;
public ModelRenderer edge1_1; public ModelRenderer edge1_1;
@@ -337,11 +338,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge1.offsetX, this.edge1.offsetY, this.edge1.offsetZ); GL11.glTranslated(this.edge1.offsetX, this.edge1.offsetY, this.edge1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge1.rotationPointX * f5, this.edge1.rotationPointY * f5, this.edge1.rotationPointZ * f5); this.edge1.rotationPointX * f5,
this.edge1.rotationPointY * f5,
this.edge1.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge1.offsetX, -this.edge1.offsetY, -this.edge1.offsetZ); GL11.glTranslated(-this.edge1.offsetX, -this.edge1.offsetY, -this.edge1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.edge1.rotationPointX * f5, -this.edge1.rotationPointY * f5, -this.edge1.rotationPointZ * f5); -this.edge1.rotationPointX * f5,
-this.edge1.rotationPointY * f5,
-this.edge1.rotationPointZ * f5);
this.edge1.render(f5); this.edge1.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -361,7 +366,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge2_1.offsetX, this.edge2_1.offsetY, this.edge2_1.offsetZ); GL11.glTranslated(this.edge2_1.offsetX, this.edge2_1.offsetY, this.edge2_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge2_1.rotationPointX * f5, this.edge2_1.rotationPointY * f5, this.edge2_1.rotationPointZ * f5); this.edge2_1.rotationPointX * f5,
this.edge2_1.rotationPointY * f5,
this.edge2_1.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge2_1.offsetX, -this.edge2_1.offsetY, -this.edge2_1.offsetZ); GL11.glTranslated(-this.edge2_1.offsetX, -this.edge2_1.offsetY, -this.edge2_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -401,21 +408,29 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.tope2.offsetX, this.tope2.offsetY, this.tope2.offsetZ); GL11.glTranslated(this.tope2.offsetX, this.tope2.offsetY, this.tope2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.tope2.rotationPointX * f5, this.tope2.rotationPointY * f5, this.tope2.rotationPointZ * f5); this.tope2.rotationPointX * f5,
this.tope2.rotationPointY * f5,
this.tope2.rotationPointZ * f5);
GL11.glScaled(0.9D, 0.5D, 0.9D); GL11.glScaled(0.9D, 0.5D, 0.9D);
GL11.glTranslated(-this.tope2.offsetX, -this.tope2.offsetY, -this.tope2.offsetZ); GL11.glTranslated(-this.tope2.offsetX, -this.tope2.offsetY, -this.tope2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.tope2.rotationPointX * f5, -this.tope2.rotationPointY * f5, -this.tope2.rotationPointZ * f5); -this.tope2.rotationPointX * f5,
-this.tope2.rotationPointY * f5,
-this.tope2.rotationPointZ * f5);
this.tope2.render(f5); this.tope2.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.tope1.offsetX, this.tope1.offsetY, this.tope1.offsetZ); GL11.glTranslated(this.tope1.offsetX, this.tope1.offsetY, this.tope1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.tope1.rotationPointX * f5, this.tope1.rotationPointY * f5, this.tope1.rotationPointZ * f5); this.tope1.rotationPointX * f5,
this.tope1.rotationPointY * f5,
this.tope1.rotationPointZ * f5);
GL11.glScaled(1.2D, 0.5D, 1.2D); GL11.glScaled(1.2D, 0.5D, 1.2D);
GL11.glTranslated(-this.tope1.offsetX, -this.tope1.offsetY, -this.tope1.offsetZ); GL11.glTranslated(-this.tope1.offsetX, -this.tope1.offsetY, -this.tope1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.tope1.rotationPointX * f5, -this.tope1.rotationPointY * f5, -this.tope1.rotationPointZ * f5); -this.tope1.rotationPointX * f5,
-this.tope1.rotationPointY * f5,
-this.tope1.rotationPointZ * f5);
this.tope1.render(f5); this.tope1.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -435,11 +450,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.shape4.offsetX, this.shape4.offsetY, this.shape4.offsetZ); GL11.glTranslated(this.shape4.offsetX, this.shape4.offsetY, this.shape4.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.shape4.rotationPointX * f5, this.shape4.rotationPointY * f5, this.shape4.rotationPointZ * f5); this.shape4.rotationPointX * f5,
this.shape4.rotationPointY * f5,
this.shape4.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.shape4.offsetX, -this.shape4.offsetY, -this.shape4.offsetZ); GL11.glTranslated(-this.shape4.offsetX, -this.shape4.offsetY, -this.shape4.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.shape4.rotationPointX * f5, -this.shape4.rotationPointY * f5, -this.shape4.rotationPointZ * f5); -this.shape4.rotationPointX * f5,
-this.shape4.rotationPointY * f5,
-this.shape4.rotationPointZ * f5);
this.shape4.render(f5); this.shape4.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -529,11 +548,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge3.offsetX, this.edge3.offsetY, this.edge3.offsetZ); GL11.glTranslated(this.edge3.offsetX, this.edge3.offsetY, this.edge3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge3.rotationPointX * f5, this.edge3.rotationPointY * f5, this.edge3.rotationPointZ * f5); this.edge3.rotationPointX * f5,
this.edge3.rotationPointY * f5,
this.edge3.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge3.offsetX, -this.edge3.offsetY, -this.edge3.offsetZ); GL11.glTranslated(-this.edge3.offsetX, -this.edge3.offsetY, -this.edge3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.edge3.rotationPointX * f5, -this.edge3.rotationPointY * f5, -this.edge3.rotationPointZ * f5); -this.edge3.rotationPointX * f5,
-this.edge3.rotationPointY * f5,
-this.edge3.rotationPointZ * f5);
this.edge3.render(f5); this.edge3.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -609,7 +632,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge5_2.offsetX, this.edge5_2.offsetY, this.edge5_2.offsetZ); GL11.glTranslated(this.edge5_2.offsetX, this.edge5_2.offsetY, this.edge5_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge5_2.rotationPointX * f5, this.edge5_2.rotationPointY * f5, this.edge5_2.rotationPointZ * f5); this.edge5_2.rotationPointX * f5,
this.edge5_2.rotationPointY * f5,
this.edge5_2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge5_2.offsetX, -this.edge5_2.offsetY, -this.edge5_2.offsetZ); GL11.glTranslated(-this.edge5_2.offsetX, -this.edge5_2.offsetY, -this.edge5_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -621,11 +646,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge5.offsetX, this.edge5.offsetY, this.edge5.offsetZ); GL11.glTranslated(this.edge5.offsetX, this.edge5.offsetY, this.edge5.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge5.rotationPointX * f5, this.edge5.rotationPointY * f5, this.edge5.rotationPointZ * f5); this.edge5.rotationPointX * f5,
this.edge5.rotationPointY * f5,
this.edge5.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge5.offsetX, -this.edge5.offsetY, -this.edge5.offsetZ); GL11.glTranslated(-this.edge5.offsetX, -this.edge5.offsetY, -this.edge5.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.edge5.rotationPointX * f5, -this.edge5.rotationPointY * f5, -this.edge5.rotationPointZ * f5); -this.edge5.rotationPointX * f5,
-this.edge5.rotationPointY * f5,
-this.edge5.rotationPointZ * f5);
this.edge5.render(f5); this.edge5.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -659,7 +688,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge1_1.offsetX, this.edge1_1.offsetY, this.edge1_1.offsetZ); GL11.glTranslated(this.edge1_1.offsetX, this.edge1_1.offsetY, this.edge1_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge1_1.rotationPointX * f5, this.edge1_1.rotationPointY * f5, this.edge1_1.rotationPointZ * f5); this.edge1_1.rotationPointX * f5,
this.edge1_1.rotationPointY * f5,
this.edge1_1.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge1_1.offsetX, -this.edge1_1.offsetY, -this.edge1_1.offsetZ); GL11.glTranslated(-this.edge1_1.offsetX, -this.edge1_1.offsetY, -this.edge1_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -727,7 +758,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge4_2.offsetX, this.edge4_2.offsetY, this.edge4_2.offsetZ); GL11.glTranslated(this.edge4_2.offsetX, this.edge4_2.offsetY, this.edge4_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge4_2.rotationPointX * f5, this.edge4_2.rotationPointY * f5, this.edge4_2.rotationPointZ * f5); this.edge4_2.rotationPointX * f5,
this.edge4_2.rotationPointY * f5,
this.edge4_2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge4_2.offsetX, -this.edge4_2.offsetY, -this.edge4_2.offsetZ); GL11.glTranslated(-this.edge4_2.offsetX, -this.edge4_2.offsetY, -this.edge4_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -753,7 +786,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge3_3.offsetX, this.edge3_3.offsetY, this.edge3_3.offsetZ); GL11.glTranslated(this.edge3_3.offsetX, this.edge3_3.offsetY, this.edge3_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge3_3.rotationPointX * f5, this.edge3_3.rotationPointY * f5, this.edge3_3.rotationPointZ * f5); this.edge3_3.rotationPointX * f5,
this.edge3_3.rotationPointY * f5,
this.edge3_3.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge3_3.offsetX, -this.edge3_3.offsetY, -this.edge3_3.offsetZ); GL11.glTranslated(-this.edge3_3.offsetX, -this.edge3_3.offsetY, -this.edge3_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -765,11 +800,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.shape3.offsetX, this.shape3.offsetY, this.shape3.offsetZ); GL11.glTranslated(this.shape3.offsetX, this.shape3.offsetY, this.shape3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.shape3.rotationPointX * f5, this.shape3.rotationPointY * f5, this.shape3.rotationPointZ * f5); this.shape3.rotationPointX * f5,
this.shape3.rotationPointY * f5,
this.shape3.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.shape3.offsetX, -this.shape3.offsetY, -this.shape3.offsetZ); GL11.glTranslated(-this.shape3.offsetX, -this.shape3.offsetY, -this.shape3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.shape3.rotationPointX * f5, -this.shape3.rotationPointY * f5, -this.shape3.rotationPointZ * f5); -this.shape3.rotationPointX * f5,
-this.shape3.rotationPointY * f5,
-this.shape3.rotationPointZ * f5);
this.shape3.render(f5); this.shape3.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -915,21 +954,29 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.tope3.offsetX, this.tope3.offsetY, this.tope3.offsetZ); GL11.glTranslated(this.tope3.offsetX, this.tope3.offsetY, this.tope3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.tope3.rotationPointX * f5, this.tope3.rotationPointY * f5, this.tope3.rotationPointZ * f5); this.tope3.rotationPointX * f5,
this.tope3.rotationPointY * f5,
this.tope3.rotationPointZ * f5);
GL11.glScaled(0.6D, 0.6D, 0.6D); GL11.glScaled(0.6D, 0.6D, 0.6D);
GL11.glTranslated(-this.tope3.offsetX, -this.tope3.offsetY, -this.tope3.offsetZ); GL11.glTranslated(-this.tope3.offsetX, -this.tope3.offsetY, -this.tope3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.tope3.rotationPointX * f5, -this.tope3.rotationPointY * f5, -this.tope3.rotationPointZ * f5); -this.tope3.rotationPointX * f5,
-this.tope3.rotationPointY * f5,
-this.tope3.rotationPointZ * f5);
this.tope3.render(f5); this.tope3.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.shape5.offsetX, this.shape5.offsetY, this.shape5.offsetZ); GL11.glTranslated(this.shape5.offsetX, this.shape5.offsetY, this.shape5.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.shape5.rotationPointX * f5, this.shape5.rotationPointY * f5, this.shape5.rotationPointZ * f5); this.shape5.rotationPointX * f5,
this.shape5.rotationPointY * f5,
this.shape5.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.shape5.offsetX, -this.shape5.offsetY, -this.shape5.offsetZ); GL11.glTranslated(-this.shape5.offsetX, -this.shape5.offsetY, -this.shape5.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.shape5.rotationPointX * f5, -this.shape5.rotationPointY * f5, -this.shape5.rotationPointZ * f5); -this.shape5.rotationPointX * f5,
-this.shape5.rotationPointY * f5,
-this.shape5.rotationPointZ * f5);
this.shape5.render(f5); this.shape5.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -963,7 +1010,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge5_3.offsetX, this.edge5_3.offsetY, this.edge5_3.offsetZ); GL11.glTranslated(this.edge5_3.offsetX, this.edge5_3.offsetY, this.edge5_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge5_3.rotationPointX * f5, this.edge5_3.rotationPointY * f5, this.edge5_3.rotationPointZ * f5); this.edge5_3.rotationPointX * f5,
this.edge5_3.rotationPointY * f5,
this.edge5_3.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge5_3.offsetX, -this.edge5_3.offsetY, -this.edge5_3.offsetZ); GL11.glTranslated(-this.edge5_3.offsetX, -this.edge5_3.offsetY, -this.edge5_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -975,7 +1024,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge3_1.offsetX, this.edge3_1.offsetY, this.edge3_1.offsetZ); GL11.glTranslated(this.edge3_1.offsetX, this.edge3_1.offsetY, this.edge3_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge3_1.rotationPointX * f5, this.edge3_1.rotationPointY * f5, this.edge3_1.rotationPointZ * f5); this.edge3_1.rotationPointX * f5,
this.edge3_1.rotationPointY * f5,
this.edge3_1.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge3_1.offsetX, -this.edge3_1.offsetY, -this.edge3_1.offsetZ); GL11.glTranslated(-this.edge3_1.offsetX, -this.edge3_1.offsetY, -this.edge3_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -987,11 +1038,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.shape7.offsetX, this.shape7.offsetY, this.shape7.offsetZ); GL11.glTranslated(this.shape7.offsetX, this.shape7.offsetY, this.shape7.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.shape7.rotationPointX * f5, this.shape7.rotationPointY * f5, this.shape7.rotationPointZ * f5); this.shape7.rotationPointX * f5,
this.shape7.rotationPointY * f5,
this.shape7.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.shape7.offsetX, -this.shape7.offsetY, -this.shape7.offsetZ); GL11.glTranslated(-this.shape7.offsetX, -this.shape7.offsetY, -this.shape7.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.shape7.rotationPointX * f5, -this.shape7.rotationPointY * f5, -this.shape7.rotationPointZ * f5); -this.shape7.rotationPointX * f5,
-this.shape7.rotationPointY * f5,
-this.shape7.rotationPointZ * f5);
this.shape7.render(f5); this.shape7.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1025,7 +1080,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge2_3.offsetX, this.edge2_3.offsetY, this.edge2_3.offsetZ); GL11.glTranslated(this.edge2_3.offsetX, this.edge2_3.offsetY, this.edge2_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge2_3.rotationPointX * f5, this.edge2_3.rotationPointY * f5, this.edge2_3.rotationPointZ * f5); this.edge2_3.rotationPointX * f5,
this.edge2_3.rotationPointY * f5,
this.edge2_3.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge2_3.offsetX, -this.edge2_3.offsetY, -this.edge2_3.offsetZ); GL11.glTranslated(-this.edge2_3.offsetX, -this.edge2_3.offsetY, -this.edge2_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1051,7 +1108,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge1_2.offsetX, this.edge1_2.offsetY, this.edge1_2.offsetZ); GL11.glTranslated(this.edge1_2.offsetX, this.edge1_2.offsetY, this.edge1_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge1_2.rotationPointX * f5, this.edge1_2.rotationPointY * f5, this.edge1_2.rotationPointZ * f5); this.edge1_2.rotationPointX * f5,
this.edge1_2.rotationPointY * f5,
this.edge1_2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge1_2.offsetX, -this.edge1_2.offsetY, -this.edge1_2.offsetZ); GL11.glTranslated(-this.edge1_2.offsetX, -this.edge1_2.offsetY, -this.edge1_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1063,7 +1122,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge2_2.offsetX, this.edge2_2.offsetY, this.edge2_2.offsetZ); GL11.glTranslated(this.edge2_2.offsetX, this.edge2_2.offsetY, this.edge2_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge2_2.rotationPointX * f5, this.edge2_2.rotationPointY * f5, this.edge2_2.rotationPointZ * f5); this.edge2_2.rotationPointX * f5,
this.edge2_2.rotationPointY * f5,
this.edge2_2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge2_2.offsetX, -this.edge2_2.offsetY, -this.edge2_2.offsetZ); GL11.glTranslated(-this.edge2_2.offsetX, -this.edge2_2.offsetY, -this.edge2_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1075,11 +1136,15 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge2.offsetX, this.edge2.offsetY, this.edge2.offsetZ); GL11.glTranslated(this.edge2.offsetX, this.edge2.offsetY, this.edge2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge2.rotationPointX * f5, this.edge2.rotationPointY * f5, this.edge2.rotationPointZ * f5); this.edge2.rotationPointX * f5,
this.edge2.rotationPointY * f5,
this.edge2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge2.offsetX, -this.edge2.offsetY, -this.edge2.offsetZ); GL11.glTranslated(-this.edge2.offsetX, -this.edge2.offsetY, -this.edge2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.edge2.rotationPointX * f5, -this.edge2.rotationPointY * f5, -this.edge2.rotationPointZ * f5); -this.edge2.rotationPointX * f5,
-this.edge2.rotationPointY * f5,
-this.edge2.rotationPointZ * f5);
this.edge2.render(f5); this.edge2.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1099,7 +1164,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge5_1.offsetX, this.edge5_1.offsetY, this.edge5_1.offsetZ); GL11.glTranslated(this.edge5_1.offsetX, this.edge5_1.offsetY, this.edge5_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge5_1.rotationPointX * f5, this.edge5_1.rotationPointY * f5, this.edge5_1.rotationPointZ * f5); this.edge5_1.rotationPointX * f5,
this.edge5_1.rotationPointY * f5,
this.edge5_1.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge5_1.offsetX, -this.edge5_1.offsetY, -this.edge5_1.offsetZ); GL11.glTranslated(-this.edge5_1.offsetX, -this.edge5_1.offsetY, -this.edge5_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1125,7 +1192,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge4_1.offsetX, this.edge4_1.offsetY, this.edge4_1.offsetZ); GL11.glTranslated(this.edge4_1.offsetX, this.edge4_1.offsetY, this.edge4_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge4_1.rotationPointX * f5, this.edge4_1.rotationPointY * f5, this.edge4_1.rotationPointZ * f5); this.edge4_1.rotationPointX * f5,
this.edge4_1.rotationPointY * f5,
this.edge4_1.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge4_1.offsetX, -this.edge4_1.offsetY, -this.edge4_1.offsetZ); GL11.glTranslated(-this.edge4_1.offsetX, -this.edge4_1.offsetY, -this.edge4_1.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1151,7 +1220,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge3_2.offsetX, this.edge3_2.offsetY, this.edge3_2.offsetZ); GL11.glTranslated(this.edge3_2.offsetX, this.edge3_2.offsetY, this.edge3_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge3_2.rotationPointX * f5, this.edge3_2.rotationPointY * f5, this.edge3_2.rotationPointZ * f5); this.edge3_2.rotationPointX * f5,
this.edge3_2.rotationPointY * f5,
this.edge3_2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge3_2.offsetX, -this.edge3_2.offsetY, -this.edge3_2.offsetZ); GL11.glTranslated(-this.edge3_2.offsetX, -this.edge3_2.offsetY, -this.edge3_2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1219,7 +1290,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge1_3.offsetX, this.edge1_3.offsetY, this.edge1_3.offsetZ); GL11.glTranslated(this.edge1_3.offsetX, this.edge1_3.offsetY, this.edge1_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge1_3.rotationPointX * f5, this.edge1_3.rotationPointY * f5, this.edge1_3.rotationPointZ * f5); this.edge1_3.rotationPointX * f5,
this.edge1_3.rotationPointY * f5,
this.edge1_3.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge1_3.offsetX, -this.edge1_3.offsetY, -this.edge1_3.offsetZ); GL11.glTranslated(-this.edge1_3.offsetX, -this.edge1_3.offsetY, -this.edge1_3.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1245,32 +1318,44 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.shape2.offsetX, this.shape2.offsetY, this.shape2.offsetZ); GL11.glTranslated(this.shape2.offsetX, this.shape2.offsetY, this.shape2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.shape2.rotationPointX * f5, this.shape2.rotationPointY * f5, this.shape2.rotationPointZ * f5); this.shape2.rotationPointX * f5,
this.shape2.rotationPointY * f5,
this.shape2.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.shape2.offsetX, -this.shape2.offsetY, -this.shape2.offsetZ); GL11.glTranslated(-this.shape2.offsetX, -this.shape2.offsetY, -this.shape2.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.shape2.rotationPointX * f5, -this.shape2.rotationPointY * f5, -this.shape2.rotationPointZ * f5); -this.shape2.rotationPointX * f5,
-this.shape2.rotationPointY * f5,
-this.shape2.rotationPointZ * f5);
this.shape2.render(f5); this.shape2.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
this.staff.render(f5); this.staff.render(f5);
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.shape6.offsetX, this.shape6.offsetY, this.shape6.offsetZ); GL11.glTranslated(this.shape6.offsetX, this.shape6.offsetY, this.shape6.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.shape6.rotationPointX * f5, this.shape6.rotationPointY * f5, this.shape6.rotationPointZ * f5); this.shape6.rotationPointX * f5,
this.shape6.rotationPointY * f5,
this.shape6.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.shape6.offsetX, -this.shape6.offsetY, -this.shape6.offsetZ); GL11.glTranslated(-this.shape6.offsetX, -this.shape6.offsetY, -this.shape6.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.shape6.rotationPointX * f5, -this.shape6.rotationPointY * f5, -this.shape6.rotationPointZ * f5); -this.shape6.rotationPointX * f5,
-this.shape6.rotationPointY * f5,
-this.shape6.rotationPointZ * f5);
this.shape6.render(f5); this.shape6.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge4.offsetX, this.edge4.offsetY, this.edge4.offsetZ); GL11.glTranslated(this.edge4.offsetX, this.edge4.offsetY, this.edge4.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge4.rotationPointX * f5, this.edge4.rotationPointY * f5, this.edge4.rotationPointZ * f5); this.edge4.rotationPointX * f5,
this.edge4.rotationPointY * f5,
this.edge4.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge4.offsetX, -this.edge4.offsetY, -this.edge4.offsetZ); GL11.glTranslated(-this.edge4.offsetX, -this.edge4.offsetY, -this.edge4.offsetZ);
GL11.glTranslated( GL11.glTranslated(
-this.edge4.rotationPointX * f5, -this.edge4.rotationPointY * f5, -this.edge4.rotationPointZ * f5); -this.edge4.rotationPointX * f5,
-this.edge4.rotationPointY * f5,
-this.edge4.rotationPointZ * f5);
this.edge4.render(f5); this.edge4.render(f5);
GL11.glPopMatrix(); GL11.glPopMatrix();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1304,7 +1389,9 @@ public class ModelStaffOfTheGreatOne extends ModelBase {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(this.edge5_4.offsetX, this.edge5_4.offsetY, this.edge5_4.offsetZ); GL11.glTranslated(this.edge5_4.offsetX, this.edge5_4.offsetY, this.edge5_4.offsetZ);
GL11.glTranslated( GL11.glTranslated(
this.edge5_4.rotationPointX * f5, this.edge5_4.rotationPointY * f5, this.edge5_4.rotationPointZ * f5); this.edge5_4.rotationPointX * f5,
this.edge5_4.rotationPointY * f5,
this.edge5_4.rotationPointZ * f5);
GL11.glScaled(0.7D, 0.7D, 0.7D); GL11.glScaled(0.7D, 0.7D, 0.7D);
GL11.glTranslated(-this.edge5_4.offsetX, -this.edge5_4.offsetY, -this.edge5_4.offsetZ); GL11.glTranslated(-this.edge5_4.offsetX, -this.edge5_4.offsetY, -this.edge5_4.offsetZ);
GL11.glTranslated( GL11.glTranslated(
@@ -1,14 +1,16 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
/** /**
* Created by Brandon on 16/02/2015. * Created by Brandon on 16/02/2015.
*/ */
@@ -55,14 +57,10 @@ public class RenderCrystal implements IItemRenderer {
} }
int meta = item.getItemDamage(); int meta = item.getItemDamage();
TileEntityRendererDispatcher.instance.renderTileEntityAt( TileEntityRendererDispatcher.instance.renderTileEntityAt(
meta == 0 meta == 0 ? relay1
? relay1 : meta == 1 ? relay2
: meta == 1 : meta == 2 ? transceiver1
? relay2 : meta == 3 ? transceiver2
: meta == 2
? transceiver1
: meta == 3
? transceiver2
: meta == 4 ? wirelessTransceiver1 : wirelessTransceiver2, : meta == 4 ? wirelessTransceiver1 : wirelessTransceiver2,
0.0D, 0.0D,
0.0D, 0.0D,
@@ -1,13 +1,15 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
import com.brandon3055.draconicevolution.common.utills.ICustomItemData;
import net.minecraft.client.model.ModelChest; import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
import com.brandon3055.draconicevolution.common.utills.ICustomItemData;
/** /**
* Created by Brandon on 16/11/2014. * Created by Brandon on 16/11/2014.
*/ */
@@ -1,10 +1,12 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.render.tile.RenderTileEarth; import com.brandon3055.draconicevolution.client.render.tile.RenderTileEarth;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 30/7/2015. * Created by brandon3055 on 30/7/2015.
@@ -1,12 +1,15 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
public class RenderEnergyInfuser implements IItemRenderer { public class RenderEnergyInfuser implements IItemRenderer {
private TileEnergyInfuser tile; private TileEnergyInfuser tile;
public RenderEnergyInfuser() { public RenderEnergyInfuser() {
@@ -1,14 +1,17 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
public class RenderParticleGen implements IItemRenderer { public class RenderParticleGen implements IItemRenderer {
private TileEntity tile; private TileEntity tile;
public RenderParticleGen() { public RenderParticleGen() {
@@ -1,8 +1,5 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.ModBlocks;
import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -10,16 +7,21 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import com.brandon3055.draconicevolution.common.ModBlocks;
import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
/** /**
* Created by Brandon on 25/5/2015. * Created by Brandon on 25/5/2015.
*/ */
public class RenderPortal implements ISimpleBlockRenderingHandler { public class RenderPortal implements ISimpleBlockRenderingHandler {
@Override @Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {} public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}
@Override @Override
public boolean renderWorldBlock( public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { RenderBlocks renderer) {
Tessellator tess = Tessellator.instance; Tessellator tess = Tessellator.instance;
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
@@ -1,10 +1,12 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorCore; import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorCore;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 30/7/2015. * Created by brandon3055 on 30/7/2015.
@@ -1,10 +1,12 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorEnergyInjector; import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorEnergyInjector;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 30/7/2015. * Created by brandon3055 on 30/7/2015.
@@ -1,10 +1,12 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorStabilizer; import com.brandon3055.draconicevolution.client.render.tile.RenderTileReactorStabilizer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 30/7/2015. * Created by brandon3055 on 30/7/2015.
@@ -1,14 +1,16 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess; import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
/** /**
* Created by Brandon on 25/10/2014. * Created by Brandon on 25/10/2014.
*/ */
@@ -23,8 +25,8 @@ public class RenderTeleporterStand implements ISimpleBlockRenderingHandler {
} }
@Override @Override
public boolean renderWorldBlock( public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { RenderBlocks renderer) {
return false; return false;
} }
@@ -1,12 +1,15 @@
package com.brandon3055.draconicevolution.client.render.block; package com.brandon3055.draconicevolution.client.render.block;
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.tileentities.TileUpgradeModifier;
public class RenderUpgradeModifier implements IItemRenderer { public class RenderUpgradeModifier implements IItemRenderer {
private TileUpgradeModifier tile; private TileUpgradeModifier tile;
public RenderUpgradeModifier() { public RenderUpgradeModifier() {
@@ -1,8 +1,5 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.model.ModelChaosCrystal;
import com.brandon3055.draconicevolution.common.entity.EntityChaosCrystal;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -11,12 +8,18 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityEnderCrystal; import net.minecraft.entity.item.EntityEnderCrystal;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.model.ModelChaosCrystal;
import com.brandon3055.draconicevolution.common.entity.EntityChaosCrystal;
/** /**
* Created by brandon3055 on 30/8/2015. * Created by brandon3055 on 30/8/2015.
*/ */
public class RenderChaosCrystal extends Render { public class RenderChaosCrystal extends Render {
private ModelBase model; private ModelBase model;
public RenderChaosCrystal() { public RenderChaosCrystal() {
@@ -100,12 +103,7 @@ public class RenderChaosCrystal extends Render {
return this.getEntityTexture((EntityChaosCrystal) p_110775_1_); return this.getEntityTexture((EntityChaosCrystal) p_110775_1_);
} }
public void doRender( public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
Entity p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) { float p_76986_9_) {
this.doRender((EntityChaosCrystal) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); this.doRender((EntityChaosCrystal) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
} }
@@ -1,11 +1,12 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** /**
* Created by Brandon on 14/09/2014. * Created by Brandon on 14/09/2014.
*/ */
@@ -1,10 +1,7 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;
import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random; import java.util.Random;
import net.minecraft.client.model.ModelDragon; import net.minecraft.client.model.ModelDragon;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
@@ -17,23 +14,31 @@ import net.minecraft.entity.boss.BossStatus;
import net.minecraft.entity.boss.EntityDragon; import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.entity.EntityChaosGuardian;
import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** /**
* Created by Brandon on 11/08/2014. * Created by Brandon on 11/08/2014.
*/ */
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderDragon extends RenderLiving { public class RenderDragon extends RenderLiving {
private static final ResourceLocation enderDragonExplodingTextures =
new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png"); private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation(
private static final ResourceLocation enderDragonCrystalBeamTextures = "textures/entity/enderdragon/dragon_exploding.png");
new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation(
private static final ResourceLocation enderDragonEyesTextures = "textures/entity/endercrystal/endercrystal_beam.png");
new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation(
private static final ResourceLocation enderDragonTextures = "textures/entity/enderdragon/dragon_eyes.png");
new ResourceLocation(References.RESOURCESPREFIX + "textures/entity/de_dragon.png"); private static final ResourceLocation enderDragonTextures = new ResourceLocation(
private static final ResourceLocation enderDragonTextures2 = References.RESOURCESPREFIX + "textures/entity/de_dragon.png");
new ResourceLocation(References.RESOURCESPREFIX + "textures/entity/de_chaos_dragon.png"); private static final ResourceLocation enderDragonTextures2 = new ResourceLocation(
References.RESOURCESPREFIX + "textures/entity/de_chaos_dragon.png");
/** /**
* An instance of the dragon model in RenderDragon * An instance of the dragon model in RenderDragon
*/ */
@@ -47,8 +52,8 @@ public class RenderDragon extends RenderLiving {
protected void rotateCorpse(EntityDragon p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) { protected void rotateCorpse(EntityDragon p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
float f3 = (float) p_77043_1_.getMovementOffsets(7, p_77043_4_)[0]; float f3 = (float) p_77043_1_.getMovementOffsets(7, p_77043_4_)[0];
float f4 = (float) float f4 = (float) (p_77043_1_.getMovementOffsets(5, p_77043_4_)[1]
(p_77043_1_.getMovementOffsets(5, p_77043_4_)[1] - p_77043_1_.getMovementOffsets(10, p_77043_4_)[1]); - p_77043_1_.getMovementOffsets(10, p_77043_4_)[1]);
GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(f4 * 10.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(f4 * 10.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, 0.0F, 1.0F);
@@ -68,14 +73,8 @@ public class RenderDragon extends RenderLiving {
/** /**
* Renders the model in RenderLiving * Renders the model in RenderLiving
*/ */
protected void renderModel( protected void renderModel(EntityDragon p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_,
EntityDragon p_77036_1_, float p_77036_5_, float p_77036_6_, float p_77036_7_) {
float p_77036_2_,
float p_77036_3_,
float p_77036_4_,
float p_77036_5_,
float p_77036_6_,
float p_77036_7_) {
if (p_77036_1_.deathTicks > 0) { if (p_77036_1_.deathTicks > 0) {
float f6 = (float) p_77036_1_.deathTicks / 200.0F; float f6 = (float) p_77036_1_.deathTicks / 200.0F;
GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glDepthFunc(GL11.GL_LEQUAL);
@@ -109,12 +108,7 @@ public class RenderDragon extends RenderLiving {
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/ */
public void doRender( public void doRender(EntityDragon dragon, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
EntityDragon dragon,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) { float p_76986_9_) {
BossStatus.setBossStatus(dragon, false); BossStatus.setBossStatus(dragon, false);
super.doRender((EntityLiving) dragon, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); super.doRender((EntityLiving) dragon, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
@@ -123,16 +117,13 @@ public class RenderDragon extends RenderLiving {
float f2 = (float) dragon.healingEnderCrystal.innerRotation + p_76986_9_; float f2 = (float) dragon.healingEnderCrystal.innerRotation + p_76986_9_;
float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F; float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
f3 = (f3 * f3 + f3) * 0.2F; f3 = (f3 * f3 + f3) * 0.2F;
float f4 = (float) (dragon.healingEnderCrystal.posX float f4 = (float) (dragon.healingEnderCrystal.posX - dragon.posX
- dragon.posX
- (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_)); - (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_));
float f5 = (float) ((double) f3 float f5 = (float) ((double) f3 + dragon.healingEnderCrystal.posY
+ dragon.healingEnderCrystal.posY
- 1.0D - 1.0D
- dragon.posY - dragon.posY
- (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_)); - (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_));
float f6 = (float) (dragon.healingEnderCrystal.posZ float f6 = (float) (dragon.healingEnderCrystal.posZ - dragon.posZ
- dragon.posZ
- (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_)); - (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_));
float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6); float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6); float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
@@ -165,7 +156,11 @@ public class RenderDragon extends RenderLiving {
float f13 = (float) (i % b0) * 1.0F / (float) b0; float f13 = (float) (i % b0) * 1.0F / (float) b0;
tessellator.setColorOpaque_I(0); tessellator.setColorOpaque_I(0);
tessellator.addVertexWithUV( tessellator.addVertexWithUV(
(double) (f11 * 0.2F), (double) (f12 * 0.2F), 0.0D, (double) f13, (double) f10); (double) (f11 * 0.2F),
(double) (f12 * 0.2F),
0.0D,
(double) f13,
(double) f10);
tessellator.setColorOpaque_I(16777215); tessellator.setColorOpaque_I(16777215);
tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9); tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9);
} }
@@ -182,18 +177,15 @@ public class RenderDragon extends RenderLiving {
: 0; : 0;
float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F; float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
f3 = (f3 * f3 + f3) * 0.2F; f3 = (f3 * f3 + f3) * 0.2F;
float f4 = (float) (((EntityChaosGuardian) dragon).crystalX float f4 = (float) (((EntityChaosGuardian) dragon).crystalX + 0.5
+ 0.5
- dragon.posX - dragon.posX
- (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_)); - (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_));
float f5 = (float) ((double) f3 float f5 = (float) ((double) f3 + ((EntityChaosGuardian) dragon).crystalY
+ ((EntityChaosGuardian) dragon).crystalY
+ 0.5 + 0.5
- 1.0D - 1.0D
- dragon.posY - dragon.posY
- (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_)); - (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_));
float f6 = (float) (((EntityChaosGuardian) dragon).crystalZ float f6 = (float) (((EntityChaosGuardian) dragon).crystalZ + 0.5
+ 0.5
- dragon.posZ - dragon.posZ
- (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_)); - (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_));
float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6); float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
@@ -227,7 +219,11 @@ public class RenderDragon extends RenderLiving {
float f13 = (float) (i % b0) * 1.0F / (float) b0; float f13 = (float) (i % b0) * 1.0F / (float) b0;
tessellator.setColorOpaque_I(0); tessellator.setColorOpaque_I(0);
tessellator.addVertexWithUV( tessellator.addVertexWithUV(
(double) (f11 * 0.2F), (double) (f12 * 0.2F), 0.0D, (double) f13, (double) f10); (double) (f11 * 0.2F),
(double) (f12 * 0.2F),
0.0D,
(double) f13,
(double) f10);
tessellator.setColorOpaque_I(0xFF0000); tessellator.setColorOpaque_I(0xFF0000);
tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9); tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9);
} }
@@ -238,55 +234,55 @@ public class RenderDragon extends RenderLiving {
RenderHelper.enableStandardItemLighting(); RenderHelper.enableStandardItemLighting();
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
// } else if (dragon instanceof EntityChaosGuardian && ((EntityChaosGuardian) dragon).healingChaosCrystal != // } else if (dragon instanceof EntityChaosGuardian && ((EntityChaosGuardian) dragon).healingChaosCrystal !=
// null){ // null){
// //
// //
// float f2 = (float)((EntityChaosGuardian) dragon).healingChaosCrystal.innerRotation + p_76986_9_; // float f2 = (float)((EntityChaosGuardian) dragon).healingChaosCrystal.innerRotation + p_76986_9_;
// float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F; // float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
// f3 = (f3 * f3 + f3) * 0.2F; // f3 = (f3 * f3 + f3) * 0.2F;
// float f4 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posX - dragon.posX - (dragon.prevPosX // float f4 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posX - dragon.posX - (dragon.prevPosX
// - dragon.posX) * (double)(1.0F - p_76986_9_)); // - dragon.posX) * (double)(1.0F - p_76986_9_));
// float f5 = (float)((double)f3 + ((EntityChaosGuardian) dragon).healingChaosCrystal.posY - 1.0D - // float f5 = (float)((double)f3 + ((EntityChaosGuardian) dragon).healingChaosCrystal.posY - 1.0D -
// dragon.posY - (dragon.prevPosY - dragon.posY) * (double)(1.0F - p_76986_9_)); // dragon.posY - (dragon.prevPosY - dragon.posY) * (double)(1.0F - p_76986_9_));
// float f6 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posZ - dragon.posZ - (dragon.prevPosZ // float f6 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posZ - dragon.posZ - (dragon.prevPosZ
// - dragon.posZ) * (double)(1.0F - p_76986_9_)); // - dragon.posZ) * (double)(1.0F - p_76986_9_));
// float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6); // float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
// float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6); // float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_ + 2.0F, (float)p_76986_6_); // GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_ + 2.0F, (float)p_76986_6_);
// GL11.glRotatef((float)(-Math.atan2((double)f6, (double)f4)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, // GL11.glRotatef((float)(-Math.atan2((double)f6, (double)f4)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F,
// 0.0F); // 0.0F);
// GL11.glRotatef((float)(-Math.atan2((double)f7, (double)f5)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, // GL11.glRotatef((float)(-Math.atan2((double)f7, (double)f5)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F,
// 0.0F); // 0.0F);
// Tessellator tessellator = Tessellator.instance; // Tessellator tessellator = Tessellator.instance;
// RenderHelper.disableStandardItemLighting(); // RenderHelper.disableStandardItemLighting();
// GL11.glDisable(GL11.GL_CULL_FACE); // GL11.glDisable(GL11.GL_CULL_FACE);
// this.bindTexture(enderDragonCrystalBeamTextures); // this.bindTexture(enderDragonCrystalBeamTextures);
// GL11.glShadeModel(GL11.GL_SMOOTH); // GL11.glShadeModel(GL11.GL_SMOOTH);
// float f9 = 0.0F - ((float)dragon.ticksExisted + p_76986_9_) * 0.01F; // float f9 = 0.0F - ((float)dragon.ticksExisted + p_76986_9_) * 0.01F;
// float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F - ((float)dragon.ticksExisted + // float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F - ((float)dragon.ticksExisted +
// p_76986_9_) * 0.01F; // p_76986_9_) * 0.01F;
// tessellator.startDrawing(5); // tessellator.startDrawing(5);
// byte b0 = 8; // byte b0 = 8;
// //
// for (int i = 0; i <= b0; ++i) // for (int i = 0; i <= b0; ++i)
// { // {
// float f11 = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.0F / (float)b0) * 0.75F; // float f11 = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.0F / (float)b0) * 0.75F;
// float f12 = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.0F / (float)b0) * 0.75F; // float f12 = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.0F / (float)b0) * 0.75F;
// float f13 = (float)(i % b0) * 1.0F / (float)b0; // float f13 = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorOpaque_I(0); // tessellator.setColorOpaque_I(0);
// tessellator.addVertexWithUV((double)(f11 * 0.2F), (double)(f12 * 0.2F), 0.0D, (double)f13, (double)f10); // tessellator.addVertexWithUV((double)(f11 * 0.2F), (double)(f12 * 0.2F), 0.0D, (double)f13, (double)f10);
// tessellator.setColorOpaque_I(0xFF0000); // tessellator.setColorOpaque_I(0xFF0000);
// tessellator.addVertexWithUV((double)f11, (double)f12, (double)f8, (double)f13, (double)f9); // tessellator.addVertexWithUV((double)f11, (double)f12, (double)f8, (double)f13, (double)f9);
// } // }
// //
// tessellator.draw(); // tessellator.draw();
// GL11.glEnable(GL11.GL_CULL_FACE); // GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_FLAT); // GL11.glShadeModel(GL11.GL_FLAT);
// RenderHelper.enableStandardItemLighting(); // RenderHelper.enableStandardItemLighting();
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// } // }
} }
/** /**
@@ -387,13 +383,8 @@ public class RenderDragon extends RenderLiving {
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/ */
public void doRender( public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
EntityLiving p_76986_1_, float p_76986_8_, float p_76986_9_) {
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) {
this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
} }
@@ -415,16 +406,16 @@ public class RenderDragon extends RenderLiving {
/** /**
* Renders the model in RenderLiving * Renders the model in RenderLiving
*/ */
protected void renderModel( protected void renderModel(EntityLivingBase p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_,
EntityLivingBase p_77036_1_, float p_77036_5_, float p_77036_6_, float p_77036_7_) {
float p_77036_2_,
float p_77036_3_,
float p_77036_4_,
float p_77036_5_,
float p_77036_6_,
float p_77036_7_) {
this.renderModel( this.renderModel(
(EntityDragon) p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_); (EntityDragon) p_77036_1_,
p_77036_2_,
p_77036_3_,
p_77036_4_,
p_77036_5_,
p_77036_6_,
p_77036_7_);
} }
/** /**
@@ -433,13 +424,8 @@ public class RenderDragon extends RenderLiving {
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/ */
public void doRender( public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
EntityLivingBase p_76986_1_, float p_76986_8_, float p_76986_9_) {
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) {
this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
} }
@@ -456,12 +442,7 @@ public class RenderDragon extends RenderLiving {
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/ */
public void doRender( public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
Entity p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) { float p_76986_9_) {
this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); this.doRender((EntityDragon) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
} }
@@ -1,9 +1,5 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
import com.brandon3055.draconicevolution.common.ModItems;
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
import com.brandon3055.draconicevolution.common.lib.References;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
@@ -13,21 +9,28 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
import com.brandon3055.draconicevolution.common.ModItems;
import com.brandon3055.draconicevolution.common.entity.EntityDragonHeart;
import com.brandon3055.draconicevolution.common.lib.References;
/** /**
* Created by Brandon on 21/11/2014. * Created by Brandon on 21/11/2014.
*/ */
public class RenderDragonHeart extends Render { public class RenderDragonHeart extends Render {
private static final ResourceLocation texture =
new ResourceLocation(References.RESOURCESPREFIX + "textures/items/dragonHeart.png"); private static final ResourceLocation texture = new ResourceLocation(
References.RESOURCESPREFIX + "textures/items/dragonHeart.png");
private void doRender(EntityDragonHeart entity, double x, double y, double z, float f) { private void doRender(EntityDragonHeart entity, double x, double y, double z, float f) {
float sine = (float) Math.abs(Math.cos(ClientEventHandler.elapsedTicks / 1000D)); float sine = (float) Math.abs(Math.cos(ClientEventHandler.elapsedTicks / 1000D));
{ // Draw Item { // Draw Item
// GL11.glRotatef((((float) ClientEventHandler.elapsedTicks) + f) * entity.rotationSpeed, 0f, 1f, 0f); // GL11.glRotatef((((float) ClientEventHandler.elapsedTicks) + f) * entity.rotationSpeed, 0f, 1f, 0f);
GL11.glRotatef(entity.rotation + f * entity.rotationInc, 0f, 1f, 0f); GL11.glRotatef(entity.rotation + f * entity.rotationInc, 0f, 1f, 0f);
EntityItem itemEntity = new EntityItem(entity.worldObj, 0, 0, 0, new ItemStack(ModItems.dragonHeart)); EntityItem itemEntity = new EntityItem(entity.worldObj, 0, 0, 0, new ItemStack(ModItems.dragonHeart));
itemEntity.hoverStart = 0.0F; itemEntity.hoverStart = 0.0F;
@@ -1,14 +1,16 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.entity.EntityDragonProjectile;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.entity.EntityDragonProjectile;
/** /**
* Created by brandon3055 on 24/8/2015. * Created by brandon3055 on 24/8/2015.
*/ */
@@ -53,8 +55,8 @@ public class RenderDragonProjectile extends Render {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F); GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
// GL11.glDepthMask(false); // GL11.glDepthMask(false);
// GL11.glEnable(GL11.GL_CULL_FACE); // GL11.glEnable(GL11.GL_CULL_FACE);
float f2 = entity.type == EntityDragonProjectile.MINI_CHAOS_CHASER ? entity.power / 10 : entity.power / 5; float f2 = entity.type == EntityDragonProjectile.MINI_CHAOS_CHASER ? entity.power / 10 : entity.power / 5;
GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F); GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
@@ -1,25 +1,28 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.entity.EntityChaosVortex;
import com.brandon3055.draconicevolution.common.lib.References;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.entity.EntityChaosVortex;
import com.brandon3055.draconicevolution.common.lib.References;
/** /**
* Created by brandon3055 on 3/10/2015. * Created by brandon3055 on 3/10/2015.
*/ */
public class RenderEntityChaosVortex extends Render { public class RenderEntityChaosVortex extends Render {
public static IModelCustom uvSphere; public static IModelCustom uvSphere;
public RenderEntityChaosVortex() { public RenderEntityChaosVortex() {
uvSphere = AdvancedModelLoader.loadModel( uvSphere = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
} }
public void doRender(EntityChaosVortex entity, double x, double y, double z, float f1, float tick) { public void doRender(EntityChaosVortex entity, double x, double y, double z, float f1, float tick) {
@@ -1,22 +1,25 @@
package com.brandon3055.draconicevolution.client.render.entity; package com.brandon3055.draconicevolution.client.render.entity;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.entity.EntityCustomArrow;
import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.entity.EntityCustomArrow;
/** /**
* Created by brandon3055 on 3/3/2016. * Created by brandon3055 on 3/3/2016.
*/ */
public class RenderEntityCustomArrow extends Render { public class RenderEntityCustomArrow extends Render {
private IModelCustom arrow =
AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/tools/ArrowCommon.obj")); private IModelCustom arrow = AdvancedModelLoader
.loadModel(ResourceHandler.getResource("models/tools/ArrowCommon.obj"));
public void doRender(EntityCustomArrow entityArrow, double x, double y, double z, float f1, float f2) { public void doRender(EntityCustomArrow entityArrow, double x, double y, double z, float f1, float f2) {
this.bindEntityTexture(entityArrow); this.bindEntityTexture(entityArrow);
@@ -71,8 +74,7 @@ public class RenderEntityCustomArrow extends Render {
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/ */
protected ResourceLocation getEntityTexture(EntityCustomArrow arrow) { protected ResourceLocation getEntityTexture(EntityCustomArrow arrow) {
return arrow.bowProperties.energyBolt return arrow.bowProperties.energyBolt ? ResourceHandler.getResource("textures/models/reactorCore.png")
? ResourceHandler.getResource("textures/models/reactorCore.png")
: ResourceHandler.getResource("textures/models/tools/ArrowCommon.png"); : ResourceHandler.getResource("textures/models/tools/ArrowCommon.png");
} }
@@ -89,12 +91,7 @@ public class RenderEntityCustomArrow extends Render {
* (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1, * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/ */
public void doRender( public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
Entity p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) { float p_76986_9_) {
this.doRender((EntityCustomArrow) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); this.doRender((EntityCustomArrow) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
} }
@@ -1,13 +1,15 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler; import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.lib.References; import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.LogHelper; import com.brandon3055.draconicevolution.common.utills.LogHelper;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 17/8/2015. * Created by brandon3055 on 17/8/2015.
@@ -40,15 +42,17 @@ public class RenderArmor implements IItemRenderer {
} }
GL11.glPushMatrix(); GL11.glPushMatrix();
ResourceHandler.bindResource( ResourceHandler
armor.getArmorTexture(stack, null, 0, null).replace(References.RESOURCESPREFIX, "")); .bindResource(armor.getArmorTexture(stack, null, 0, null).replace(References.RESOURCESPREFIX, ""));
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) { if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) {
GL11.glTranslated(0.5, 0.5, 0.5); GL11.glTranslated(0.5, 0.5, 0.5);
GL11.glRotated(180, 0, 1, 0); GL11.glRotated(180, 0, 1, 0);
} }
GL11.glTranslated( GL11.glTranslated(
0, armor.armorType == 0 ? -0.25 : armor.armorType == 1 ? 0.42 : armor.armorType == 2 ? 1.05 : 1.5, 0); 0,
armor.armorType == 0 ? -0.25 : armor.armorType == 1 ? 0.42 : armor.armorType == 2 ? 1.05 : 1.5,
0);
GL11.glRotated(180, -1, 0, 1); GL11.glRotated(180, -1, 0, 1);
armor.getArmorModel(null, stack, 0).render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f); armor.getArmorModel(null, stack, 0).render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f);
@@ -18,10 +18,12 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12; import org.lwjgl.opengl.GL12;
public class RenderBow implements IItemRenderer { public class RenderBow implements IItemRenderer {
private Minecraft mc; private Minecraft mc;
public RenderBow() { public RenderBow() {
@@ -89,85 +91,92 @@ public class RenderBow implements IItemRenderer {
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type); IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type);
if (customRenderer != null) { if (customRenderer != null) {
texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber())); texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber()));
ForgeHooksClient.renderEquippedItem( ForgeHooksClient
type, customRenderer, renderBlocksIr, par1EntityLivingBase, par2ItemStack); .renderEquippedItem(type, customRenderer, renderBlocksIr, par1EntityLivingBase, par2ItemStack);
} else if (par2ItemStack.getItemSpriteNumber() == 0 } else if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock
&& item instanceof ItemBlock
&& RenderBlocks.renderItemIn3d(block.getRenderType())) { && RenderBlocks.renderItemIn3d(block.getRenderType())) {
texturemanager.bindTexture(texturemanager.getResourceLocation(0)); texturemanager.bindTexture(texturemanager.getResourceLocation(0));
if (par2ItemStack != null && par2ItemStack.getItem() instanceof ItemCloth) { if (par2ItemStack != null && par2ItemStack.getItem() instanceof ItemCloth) {
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glDepthMask(false); GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0); OpenGlHelper.glBlendFunc(770, 771, 1, 0);
renderBlocksIr.renderBlockAsItem(block, par2ItemStack.getItemDamage(), 1.0F); renderBlocksIr.renderBlockAsItem(block, par2ItemStack.getItemDamage(), 1.0F);
GL11.glDepthMask(true); GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
} else { } else {
renderBlocksIr.renderBlockAsItem(block, par2ItemStack.getItemDamage(), 1.0F); renderBlocksIr.renderBlockAsItem(block, par2ItemStack.getItemDamage(), 1.0F);
} }
} else { } else {
IIcon iicon = par1EntityLivingBase.getItemIcon(par2ItemStack, par3); IIcon iicon = par1EntityLivingBase.getItemIcon(par2ItemStack, par3);
if (iicon == null) { if (iicon == null) {
GL11.glPopMatrix(); GL11.glPopMatrix();
return; return;
} }
texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber())); texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber()));
// TextureUtil.func_147950_a(false, false); // TextureUtil.func_147950_a(false, false);
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
float f = iicon.getMinU(); float f = iicon.getMinU();
float f1 = iicon.getMaxU(); float f1 = iicon.getMaxU();
float f2 = iicon.getMinV(); float f2 = iicon.getMinV();
float f3 = iicon.getMaxV(); float f3 = iicon.getMaxV();
float f4 = 0.0F; float f4 = 0.0F;
float f5 = 0.3F; float f5 = 0.3F;
GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glTranslatef(-f4, -f5, 0.0F); GL11.glTranslatef(-f4, -f5, 0.0F);
float f6 = 1.5F; float f6 = 1.5F;
GL11.glScalef(f6, f6, f6); GL11.glScalef(f6, f6, f6);
GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
ItemRenderer.renderItemIn2D( ItemRenderer.renderItemIn2D(
tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F); tessellator,
f1,
f2,
f,
f3,
iicon.getIconWidth(),
iicon.getIconHeight(),
0.0625F);
if (par2ItemStack.hasEffect(par3)) { if (par2ItemStack.hasEffect(par3)) {
ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); ResourceLocation RES_ITEM_GLINT = new ResourceLocation(
GL11.glDepthFunc(GL11.GL_EQUAL); "textures/misc/enchanted_item_glint.png");
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_EQUAL);
texturemanager.bindTexture(RES_ITEM_GLINT); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND); texturemanager.bindTexture(RES_ITEM_GLINT);
OpenGlHelper.glBlendFunc(768, 1, 1, 0); GL11.glEnable(GL11.GL_BLEND);
float f7 = 0.76F; OpenGlHelper.glBlendFunc(768, 1, 1, 0);
GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F); float f7 = 0.76F;
GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
GL11.glPushMatrix(); GL11.glMatrixMode(GL11.GL_TEXTURE);
float f8 = 0.125F; GL11.glPushMatrix();
GL11.glScalef(f8, f8, f8); float f8 = 0.125F;
float f9 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; GL11.glScalef(f8, f8, f8);
GL11.glTranslatef(f9, 0.0F, 0.0F); float f9 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(f9, 0.0F, 0.0F);
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
GL11.glPopMatrix(); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
GL11.glPushMatrix(); GL11.glPopMatrix();
GL11.glScalef(f8, f8, f8); GL11.glPushMatrix();
f9 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; GL11.glScalef(f8, f8, f8);
GL11.glTranslatef(-f9, 0.0F, 0.0F); f9 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(-f9, 0.0F, 0.0F);
ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
GL11.glPopMatrix(); ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F);
GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPopMatrix();
GL11.glDisable(GL11.GL_BLEND); GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_LIGHTING);
} GL11.glDepthFunc(GL11.GL_LEQUAL);
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glDisable(GL12.GL_RESCALE_NORMAL);
texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber())); texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber()));
TextureUtil.func_147945_b(); TextureUtil.func_147945_b();
} }
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@@ -1,18 +1,21 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.items.weapons.BowHandler;
/** /**
* Created by brandon3055 on 29/10/2015. * Created by brandon3055 on 29/10/2015.
*/ */
public class RenderBowModel implements IItemRenderer { public class RenderBowModel implements IItemRenderer {
private boolean draconic; private boolean draconic;
private IModelCustom[] wyvernModels = new IModelCustom[4]; private IModelCustom[] wyvernModels = new IModelCustom[4];
private IModelCustom[] draconicModels = new IModelCustom[4]; private IModelCustom[] draconicModels = new IModelCustom[4];
@@ -21,12 +24,10 @@ public class RenderBowModel implements IItemRenderer {
public RenderBowModel(boolean draconic) { public RenderBowModel(boolean draconic) {
this.draconic = draconic; this.draconic = draconic;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++) wyvernModels[i] = AdvancedModelLoader
wyvernModels[i] = .loadModel(ResourceHandler.getResource("models/tools/WyvernBow0" + i + ".obj"));
AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/tools/WyvernBow0" + i + ".obj")); for (int i = 0; i < 4; i++) draconicModels[i] = AdvancedModelLoader
for (int i = 0; i < 4; i++) .loadModel(ResourceHandler.getResource("models/tools/DraconicBow0" + i + ".obj"));
draconicModels[i] = AdvancedModelLoader.loadModel(
ResourceHandler.getResource("models/tools/DraconicBow0" + i + ".obj"));
this.arrow = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/tools/ArrowCommon.obj")); this.arrow = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/tools/ArrowCommon.obj"));
} }
@@ -80,8 +81,8 @@ public class RenderBowModel implements IItemRenderer {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void doRender( private void doRender(IModelCustom modelCustom, ItemRenderType type, int drawState,
IModelCustom modelCustom, ItemRenderType type, int drawState, BowHandler.BowProperties properties) { BowHandler.BowProperties properties) {
if (type == ItemRenderType.EQUIPPED) { if (type == ItemRenderType.EQUIPPED) {
GL11.glScaled(0.8, 0.8, 0.8); GL11.glScaled(0.8, 0.8, 0.8);
@@ -109,7 +110,9 @@ public class RenderBowModel implements IItemRenderer {
if (drawState != -1) { if (drawState != -1) {
GL11.glTranslated( GL11.glTranslated(
0.3, 0.151, -0.2 + (drawState == 1 ? 0 : drawState == 2 ? 0.55 : drawState == 3 ? 1 : -0.7)); 0.3,
0.151,
-0.2 + (drawState == 1 ? 0 : drawState == 2 ? 0.55 : drawState == 3 ? 1 : -0.7));
GL11.glRotatef(90, 0, 0, 1); GL11.glRotatef(90, 0, 0, 1);
if (properties != null && properties.energyBolt) { if (properties != null && properties.energyBolt) {
@@ -1,19 +1,22 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.model.special.ModelStaffOfTheGreatOne;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.model.special.ModelStaffOfTheGreatOne;
/** /**
* Created by brandon3055 on 1/10/2015. * Created by brandon3055 on 1/10/2015.
*/ */
public class RenderChaosFragment implements IItemRenderer { public class RenderChaosFragment implements IItemRenderer {
private static IModelCustom model =
AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/chaosCrystalShard.obj")); private static IModelCustom model = AdvancedModelLoader
.loadModel(ResourceHandler.getResource("models/chaosCrystalShard.obj"));
private static ModelStaffOfTheGreatOne staff = new ModelStaffOfTheGreatOne(); private static ModelStaffOfTheGreatOne staff = new ModelStaffOfTheGreatOne();
@@ -1,18 +1,21 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
/** /**
* Created by brandon3055 on 1/10/2015. * Created by brandon3055 on 1/10/2015.
*/ */
public class RenderChaosShard implements IItemRenderer { public class RenderChaosShard implements IItemRenderer {
private static IModelCustom model =
AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/chaosCrystalShard.obj")); private static IModelCustom model = AdvancedModelLoader
.loadModel(ResourceHandler.getResource("models/chaosCrystalShard.obj"));
@Override @Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) { public boolean handleRenderType(ItemStack item, ItemRenderType type) {
@@ -1,7 +1,5 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -9,32 +7,19 @@ import net.minecraft.entity.EntityList;
import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
public class RenderMobSoul implements IItemRenderer { public class RenderMobSoul implements IItemRenderer {
private Minecraft mc; private Minecraft mc;
private Entity randomEntity = null; private Entity randomEntity = null;
private String[] randomEntitys = new String[] { private String[] randomEntitys = new String[] { "Pig", "Sheep", "Enderman", "Zombie", "Creeper", "Cow", "Chicken",
"Pig", "Ozelot", "Witch", "Wolf", "MushroomCow", "Squid", "EntityHorse", "Spider", "Skeleton", "Blaze", "Bat",
"Sheep", "Villager", "Silverfish" };
"Enderman",
"Zombie",
"Creeper",
"Cow",
"Chicken",
"Ozelot",
"Witch",
"Wolf",
"MushroomCow",
"Squid",
"EntityHorse",
"Spider",
"Skeleton",
"Blaze",
"Bat",
"Villager",
"Silverfish"
};
public RenderMobSoul() { public RenderMobSoul() {
this.mc = Minecraft.getMinecraft(); this.mc = Minecraft.getMinecraft();
@@ -42,8 +27,7 @@ public class RenderMobSoul implements IItemRenderer {
@Override @Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) { public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type == ItemRenderType.EQUIPPED return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON
|| type == ItemRenderType.EQUIPPED_FIRST_PERSON
|| type == ItemRenderType.INVENTORY || type == ItemRenderType.INVENTORY
|| type == ItemRenderType.ENTITY; || type == ItemRenderType.ENTITY;
} }
@@ -56,8 +40,8 @@ public class RenderMobSoul implements IItemRenderer {
@Override @Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) { public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
Entity mob = EntityList.createEntityByName(ItemNBTHelper.getString(item, "Name", "Pig"), mc.theWorld); Entity mob = EntityList.createEntityByName(ItemNBTHelper.getString(item, "Name", "Pig"), mc.theWorld);
randomEntity = EntityList.createEntityByName( randomEntity = EntityList
randomEntitys[(int) ((Minecraft.getSystemTime() / 1000) % 18)], mc.theWorld); .createEntityByName(randomEntitys[(int) ((Minecraft.getSystemTime() / 1000) % 18)], mc.theWorld);
if (ItemNBTHelper.getString(item, "Name", "Pig").equals("Any")) mob = randomEntity; if (ItemNBTHelper.getString(item, "Name", "Pig").equals("Any")) mob = randomEntity;
if (mob instanceof EntitySkeleton) if (mob instanceof EntitySkeleton)
((EntitySkeleton) mob).setSkeletonType(ItemNBTHelper.getInteger(item, "SkeletonType", 0)); ((EntitySkeleton) mob).setSkeletonType(ItemNBTHelper.getInteger(item, "SkeletonType", 0));
@@ -1,11 +1,13 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.model.ModelReactorStabilizerCore; import com.brandon3055.draconicevolution.client.model.ModelReactorStabilizerCore;
import com.brandon3055.draconicevolution.client.model.ModelReactorStabilizerRing; import com.brandon3055.draconicevolution.client.model.ModelReactorStabilizerRing;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* Created by brandon3055 on 2/10/2015. * Created by brandon3055 on 2/10/2015.
@@ -39,8 +41,8 @@ public class RenderStabilizerPart implements IItemRenderer {
break; break;
case 1: // rotor inner case 1: // rotor inner
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png"); ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
// GL11.glScaled(2, 2, 2); // GL11.glScaled(2, 2, 2);
// GL11.glTranslated(-0.2, 0, 0); // GL11.glTranslated(-0.2, 0, 0);
modelBaseRotors.rotor1R.childModels.clear(); modelBaseRotors.rotor1R.childModels.clear();
modelBaseRotors.rotor1R.render(0.0625F); modelBaseRotors.rotor1R.render(0.0625F);
modelBaseRotors.rotor1R_1.render(0.0625F); modelBaseRotors.rotor1R_1.render(0.0625F);
@@ -50,8 +52,8 @@ public class RenderStabilizerPart implements IItemRenderer {
break; break;
case 2: // rotor outer case 2: // rotor outer
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png"); ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
// GL11.glScaled(2, 2, 2); // GL11.glScaled(2, 2, 2);
// GL11.glTranslated(-0.3, 0, 0); // GL11.glTranslated(-0.3, 0, 0);
modelBaseRotors.rotor2R.childModels.clear(); modelBaseRotors.rotor2R.childModels.clear();
modelBaseRotors.rotor2R.render(0.0625F); modelBaseRotors.rotor2R.render(0.0625F);
modelBaseRotors.rotor2R_1.render(0.0625F); modelBaseRotors.rotor2R_1.render(0.0625F);
@@ -61,8 +63,8 @@ public class RenderStabilizerPart implements IItemRenderer {
break; break;
case 3: // rotor assembly case 3: // rotor assembly
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png"); ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
// GL11.glScaled(1.5, 1.5, 1.5); // GL11.glScaled(1.5, 1.5, 1.5);
// GL11.glTranslated(-0.05, 0, 0); // GL11.glTranslated(-0.05, 0, 0);
GL11.glRotatef(30F, 0F, 0F, 1F); GL11.glRotatef(30F, 0F, 0F, 1F);
modelBase.rotor1R.render(0.0625F); modelBase.rotor1R.render(0.0625F);
modelBase.hub1.render(0.0625F); modelBase.hub1.render(0.0625F);
@@ -1,17 +1,20 @@
package com.brandon3055.draconicevolution.client.render.item; package com.brandon3055.draconicevolution.client.render.item;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.render.IRenderTweak;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.render.IRenderTweak;
/** /**
* Created by brandon3055 on 29/10/2015. * Created by brandon3055 on 29/10/2015.
*/ */
public class RenderTool implements IItemRenderer { public class RenderTool implements IItemRenderer {
private IModelCustom toolModel; private IModelCustom toolModel;
private String toolTexture; private String toolTexture;
private IRenderTweak tool; private IRenderTweak tool;
@@ -1,13 +1,16 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ParticleCustom extends EntityFX { public class ParticleCustom extends EntityFX {
public int red = 0; public int red = 0;
public int green = 0; public int green = 0;
public int blue = 0; public int blue = 0;
@@ -16,17 +19,8 @@ public class ParticleCustom extends EntityFX {
public int fadeLength = 0; public int fadeLength = 0;
public float gravity = 0F; public float gravity = 0F;
public ParticleCustom( public ParticleCustom(World world, double spawnX, double spawnY, double spawnZ, float spawnMotionX,
World world, float spawnMotionY, float spawnMotionZ, float scale, boolean canCollide, int index) {
double spawnX,
double spawnY,
double spawnZ,
float spawnMotionX,
float spawnMotionY,
float spawnMotionZ,
float scale,
boolean canCollide,
int index) {
super(world, spawnX, spawnY, spawnZ, 0.0D, 0.0D, 0.0D); super(world, spawnX, spawnY, spawnZ, 0.0D, 0.0D, 0.0D);
this.motionX = spawnMotionX; // initial motion value X this.motionX = spawnMotionX; // initial motion value X
this.motionY = spawnMotionY; // initial motion value Y this.motionY = spawnMotionY; // initial motion value Y
@@ -60,13 +54,7 @@ public class ParticleCustom extends EntityFX {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -1,31 +1,26 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ParticleDistortion extends EntityFX { public class ParticleDistortion extends EntityFX {
double originalX; double originalX;
double originalZ; double originalZ;
public ParticleDistortion( public ParticleDistortion(World par1World, double par2, double par4, double par6, float par8, float par9,
World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float scale) { float par10, float scale) {
this(par1World, par2, par4, par6, 1.0F, par8, par9, par10, scale); this(par1World, par2, par4, par6, 1.0F, par8, par9, par10, scale);
} }
public ParticleDistortion( public ParticleDistortion(World world, double par2, double par4, double par6, float par8, float par9, float par10,
World world, float par11, float scale) {
double par2,
double par4,
double par6,
float par8,
float par9,
float par10,
float par11,
float scale) {
super(world, par2, par4, par6, 0.0D, 0.0D, 0.0D); super(world, par2, par4, par6, 0.0D, 0.0D, 0.0D);
this.motionX = par9; // initial motion value X this.motionX = par9; // initial motion value X
this.motionY = par10; // initial motion value Y this.motionY = par10; // initial motion value Y
@@ -46,8 +41,8 @@ public class ParticleDistortion extends EntityFX {
// this.particleScale *= par8; // this.particleScale *= par8;
this.particleScale = scale; this.particleScale = scale;
this.particleMaxAge = this.particleMaxAge = 40 + world.rand.nextInt(40); // how soon the particle dies. You can use randomizer for
40 + world.rand.nextInt(40); // how soon the particle dies. You can use randomizer for this // this
this.noClip = true; // does your particle collide with blocks? this.noClip = true; // does your particle collide with blocks?
} }
@@ -69,13 +64,7 @@ public class ParticleDistortion extends EntityFX {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6,
Tessellator tessellator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tessellator.draw(); tessellator.draw();
@@ -1,11 +1,13 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World; import net.minecraft.world.World;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
public class ParticleEnergy extends EntityFX { public class ParticleEnergy extends EntityFX {
public double originalX; public double originalX;
public double originalY; public double originalY;
public double originalZ; public double originalZ;
@@ -15,8 +17,8 @@ public class ParticleEnergy extends EntityFX {
public int particle; public int particle;
public boolean expand = true; public boolean expand = true;
public ParticleEnergy( public ParticleEnergy(World world, double x, double y, double z, double tX, double tY, double tZ, int particle,
World world, double x, double y, double z, double tX, double tY, double tZ, int particle, boolean expand) { boolean expand) {
this(world, x, y, z, tX, tY, tZ, particle); this(world, x, y, z, tX, tY, tZ, particle);
this.expand = expand; this.expand = expand;
this.particleRed = 185F / 255F; this.particleRed = 185F / 255F;
@@ -78,8 +80,7 @@ public class ParticleEnergy extends EntityFX {
motionY = (targetY - posY) * ySpeedMultiplyer; motionY = (targetY - posY) * ySpeedMultiplyer;
motionZ = (targetZ - posZ) * speedMultiplyer; motionZ = (targetZ - posZ) * speedMultiplyer;
} }
if (expand if (expand && Math.abs(targetX - posX) < 0.01
&& Math.abs(targetX - posX) < 0.01
&& Math.abs(targetY - posY) < 0.01 && Math.abs(targetY - posY) < 0.01
&& Math.abs(targetZ - posZ) < 0.01) { && Math.abs(targetZ - posZ) < 0.01) {
motionX = 0; motionX = 0;
@@ -95,13 +96,7 @@ public class ParticleEnergy extends EntityFX {
@Override @Override
// @SideOnly(Side.CLIENT) // @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -1,9 +1,5 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
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 net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -11,12 +7,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.opengl.GL11; 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;
/** /**
* Created by Brandon on 8/02/2015. * Created by Brandon on 8/02/2015.
*/ */
public class ParticleEnergyBeam extends EntityFX { public class ParticleEnergyBeam extends EntityFX {
/** /**
* Power flow integer Ranges from 0 to 100 * Power flow integer Ranges from 0 to 100
*/ */
@@ -49,26 +52,18 @@ public class ParticleEnergyBeam extends EntityFX {
// todo make sure not dyrectly up or down on y axis, Set dead when player goes out of range, PaRTICLE eNGINE // todo make sure not dyrectly up or down on y axis, Set dead when player goes out of range, PaRTICLE eNGINE
private static ResourceLocation beamTextureBasic = private static ResourceLocation beamTextureBasic = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyBeamBlue.png"); References.MODID.toLowerCase(),
private static ResourceLocation beamTextureAdvanced = "textures/models/EnergyBeamBlue.png");
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyBeamRed.png"); private static ResourceLocation beamTextureAdvanced = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/models/EnergyBeamRed.png");
/** /**
* @param offsetMode 0 = no offset, 1 = offset target end, 2 = offset start end, 3 offset both ends * @param offsetMode 0 = no offset, 1 = offset target end, 2 = offset start end, 3 offset both ends
*/ */
public ParticleEnergyBeam( public ParticleEnergyBeam(World world, double x, double y, double z, double tX, double tY, double tZ, int maxAge,
World world, int flow, boolean advanced, int offsetMode) {
double x,
double y,
double z,
double tX,
double tY,
double tZ,
int maxAge,
int flow,
boolean advanced,
int offsetMode) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D); super(world, x, y, z, 0.0D, 0.0D, 0.0D);
this.particleRed = 1F; this.particleRed = 1F;
this.particleGreen = 1F; this.particleGreen = 1F;
@@ -116,8 +111,8 @@ public class ParticleEnergyBeam extends EntityFX {
@Override @Override
public void onUpdate() { public void onUpdate() {
// 1.570797f // 1.570797f
// double sin = Math.sin(-1f + (float)(particleAge % 360) / 180f * 1.570797f); // double sin = Math.sin(-1f + (float)(particleAge % 360) / 180f * 1.570797f);
// LogHelper.info(sin + " " + particleAge % 360); // LogHelper.info(sin + " " + particleAge % 360);
this.prevPosX = this.posX; this.prevPosX = this.posX;
this.prevPosY = this.posY; this.prevPosY = this.posY;
@@ -149,8 +144,8 @@ public class ParticleEnergyBeam extends EntityFX {
} }
@Override @Override
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { float rotYZ, float rotXY) {
if (!renderParticle) return; if (!renderParticle) return;
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -226,7 +221,7 @@ public class ParticleEnergyBeam extends EntityFX {
// GL11.glDepthMask(true); // GL11.glDepthMask(true);
GL11.glBlendFunc(770, 771); GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glPopAttrib(); // GL11.glPopAttrib();
GL11.glPopMatrix(); GL11.glPopMatrix();
ResourceHandler.bindDefaultParticles(); ResourceHandler.bindDefaultParticles();
@@ -1,16 +1,19 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
/** /**
* Created by Brandon on 9/02/2015. * Created by Brandon on 9/02/2015.
*/ */
public class ParticleEnergyField extends EntityFX { public class ParticleEnergyField extends EntityFX {
/** /**
* Particle Type 0 = Energy Ring, 1 = single particle * Particle Type 0 = Energy Ring, 1 = single particle
*/ */
@@ -51,8 +54,8 @@ public class ParticleEnergyField extends EntityFX {
} }
@Override @Override
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { float rotYZ, float rotXY) {
if (!renderParticle) return; if (!renderParticle) return;
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -157,7 +160,7 @@ public class ParticleEnergyField extends EntityFX {
tessellator.draw(); tessellator.draw();
} }
// GL11.glDepthMask(true); // GL11.glDepthMask(true);
// GL11.glPopAttrib(); // GL11.glPopAttrib();
GL11.glPopMatrix(); GL11.glPopMatrix();
@@ -1,24 +1,28 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler; import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.blocks.multiblock.IReactorPart; import com.brandon3055.draconicevolution.common.blocks.multiblock.IReactorPart;
import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper; import com.brandon3055.draconicevolution.common.blocks.multiblock.MultiblockHelper;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore; 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.TileReactorEnergyInjector;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer; import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorStabilizer;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
/** /**
* Created by Brandon on 17/7/2015. * Created by Brandon on 17/7/2015.
*/ */
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleReactorBeam extends EntityFX { public class ParticleReactorBeam extends EntityFX {
/** /**
* Particle Type 0 = Energy Ring, 1 = single particle * Particle Type 0 = Energy Ring, 1 = single particle
*/ */
@@ -59,8 +63,8 @@ public class ParticleReactorBeam extends EntityFX {
} }
@Override @Override
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { float rotYZ, float rotXY) {
if (!((IReactorPart) tile).isActive()) return; if (!((IReactorPart) tile).isActive()) return;
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -105,8 +109,8 @@ public class ParticleReactorBeam extends EntityFX {
// GL11.glPushMatrix(); // GL11.glPushMatrix();
GL11.glRotatef(((float) particleAge + partialTick) * 20F, 0, 0, 1); GL11.glRotatef(((float) particleAge + partialTick) * 20F, 0, 0, 1);
ResourceHandler.bindResource("textures/particle/reactorEnergyBeam.png"); ResourceHandler.bindResource("textures/particle/reactorEnergyBeam.png");
// float sizeOrigin = 0.5F; // float sizeOrigin = 0.5F;
// float sizeTarget = 0.2F; // float sizeTarget = 0.2F;
float sizeOrigin = 0.5F; float sizeOrigin = 0.5F;
int color = 0xFF2200; int color = 0xFF2200;
@@ -131,11 +135,14 @@ public class ParticleReactorBeam extends EntityFX {
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0); tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
tessellator.addVertexWithUV( tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), -0.55D, (double) texU, (double) (double) (verX * sizeOrigin),
texV1); (double) (verY * sizeOrigin),
-0.55D,
(double) texU,
(double) texV1);
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha); tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
tessellator.addVertexWithUV( tessellator
(double) verX, (double) verY, (double) length, (double) texU, (double) texV2); .addVertexWithUV((double) verX, (double) verY, (double) length, (double) texU, (double) texV2);
} }
length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ)
@@ -151,11 +158,14 @@ public class ParticleReactorBeam extends EntityFX {
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha); tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
tessellator.addVertexWithUV( tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) (double) (verX * sizeOrigin),
texV1); (double) (verY * sizeOrigin),
0.0D,
(double) texU,
(double) texV1);
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0); tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
tessellator.addVertexWithUV( tessellator
(double) verX, (double) verY, (double) length, (double) texU, (double) texV2); .addVertexWithUV((double) verX, (double) verY, (double) length, (double) texU, (double) texV2);
} }
tessellator.draw(); tessellator.draw();
@@ -178,11 +188,14 @@ public class ParticleReactorBeam extends EntityFX {
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha / 2); tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha / 2);
tessellator.addVertexWithUV( tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) (double) (verX * sizeOrigin),
texV1); (double) (verY * sizeOrigin),
0.0D,
(double) texU,
(double) texV1);
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0); tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
tessellator.addVertexWithUV( tessellator
(double) verX, (double) verY, (double) length, (double) texU, (double) texV2); .addVertexWithUV((double) verX, (double) verY, (double) length, (double) texU, (double) texV2);
} }
tessellator.draw(); tessellator.draw();
@@ -195,14 +208,8 @@ public class ParticleReactorBeam extends EntityFX {
tessellator.startDrawingQuads(); tessellator.startDrawingQuads();
} }
private void renderStabilizerEffect( private void renderStabilizerEffect(Tessellator tessellator, TileReactorCore reactor, float offsetX, float offsetY,
Tessellator tessellator, float offsetZ, float length, float partialTick) {
TileReactorCore reactor,
float offsetX,
float offsetY,
float offsetZ,
float length,
float partialTick) {
GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glShadeModel(GL11.GL_SMOOTH);
// Draw Beams // Draw Beams
@@ -287,23 +294,12 @@ public class ParticleReactorBeam extends EntityFX {
} }
/** /**
* Size Origin is the fraction of size start Target * Size Origin is the fraction of size start Target So if size target is 10 and size origin is 0.5 origin will
* So if size target is 10 and size origin is 0.5 origin will actually be 5 * actually be 5
*/ */
private void drawBeam( private void drawBeam(Tessellator tessellator, TileReactorCore reactor, float sizeOrigin, float sizeTarget,
Tessellator tessellator, float length, float offsetX, float offsetY, float offsetZ, int tick, float partialTick,
TileReactorCore reactor, boolean reverseTransparency, boolean reverseDirection, int color) {
float sizeOrigin,
float sizeTarget,
float length,
float offsetX,
float offsetY,
float offsetZ,
int tick,
float partialTick,
boolean reverseTransparency,
boolean reverseDirection,
int color) {
float speed = 3F; float speed = 3F;
float texV2 = -0.1F + ((float) tick + partialTick) * (reverseDirection ? -0.01F : 0.01F) * speed; float texV2 = -0.1F + ((float) tick + partialTick) * (reverseDirection ? -0.01F : 0.01F) * speed;
float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) / 32.0F float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) / 32.0F
@@ -323,7 +319,11 @@ public class ParticleReactorBeam extends EntityFX {
(color & 0xFF), (color & 0xFF),
reverseTransparency ? 0 : (int) (255D * reactor.renderSpeed)); reverseTransparency ? 0 : (int) (255D * reactor.renderSpeed));
tessellator.addVertexWithUV( tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) texV1); (double) (verX * sizeOrigin),
(double) (verY * sizeOrigin),
0.0D,
(double) texU,
(double) texV1);
tessellator.setColorRGBA( tessellator.setColorRGBA(
(color & 0xFF0000) >> 16, (color & 0xFF0000) >> 16,
(color & 0xFF00) >> 8, (color & 0xFF00) >> 8,
@@ -336,121 +336,121 @@ public class ParticleReactorBeam extends EntityFX {
} }
} }
// @Override // @Override
// public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float // public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float
// rotYZ, float rotXY) { // rotYZ, float rotXY) {
// if (!((IIsSlave)tile).isActive()) return; // if (!((IIsSlave)tile).isActive()) return;
// tessellator.draw(); // tessellator.draw();
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// GL11.glDisable(GL11.GL_CULL_FACE); // GL11.glDisable(GL11.GL_CULL_FACE);
// GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F); // GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
// //
// float xx = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTick - interpPosX); // float xx = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTick - interpPosX);
// float yy = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTick - interpPosY); // float yy = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTick - interpPosY);
// float zz = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTick - interpPosZ); // float zz = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTick - interpPosZ);
// GL11.glTranslated((double)xx, (double)yy, (double)zz); // GL11.glTranslated((double)xx, (double)yy, (double)zz);
// //
// //Common Fields // //Common Fields
// MultiblockHelper.TileLocation master = ((IIsSlave)tile).getMaster(); // MultiblockHelper.TileLocation master = ((IIsSlave)tile).getMaster();
// float offsetX = (float)(master.posX - tile.xCoord); // float offsetX = (float)(master.posX - tile.xCoord);
// float offsetY = (float)((double)master.posY - tile.yCoord); // float offsetY = (float)((double)master.posY - tile.yCoord);
// float offsetZ = (float)(master.posZ - tile.zCoord); // float offsetZ = (float)(master.posZ - tile.zCoord);
// float length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ); // float length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ);
// //
// //
// //Rotate beam to face target // //Rotate beam to face target
// float f7 = MathHelper.sqrt_float(offsetX * offsetX + offsetZ * offsetZ); // float f7 = MathHelper.sqrt_float(offsetX * offsetX + offsetZ * offsetZ);
// GL11.glRotatef((float) (-Math.atan2((double) offsetZ, (double) offsetX)) * 180.0F / (float) Math.PI - 90.0F, 0.0F, // GL11.glRotatef((float) (-Math.atan2((double) offsetZ, (double) offsetX)) * 180.0F / (float) Math.PI - 90.0F, 0.0F,
// 1.0F, 0.0F); // 1.0F, 0.0F);
// GL11.glRotatef((float)(-Math.atan2((double)f7, (double)offsetY)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, // GL11.glRotatef((float)(-Math.atan2((double)f7, (double)offsetY)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F,
// 0.0F); // 0.0F);
// //
// if (tile instanceof TileReactorStabilizer) renderStabilizerEffect(tessellator, offsetX, offsetY, offsetZ, length, // if (tile instanceof TileReactorStabilizer) renderStabilizerEffect(tessellator, offsetX, offsetY, offsetZ, length,
// partialTick); // partialTick);
// else { // else {
// GL11.glShadeModel(GL11.GL_SMOOTH); // GL11.glShadeModel(GL11.GL_SMOOTH);
// GL11.glTranslated(0, 0, 0.3); // GL11.glTranslated(0, 0, 0.3);
// //GL11.glPushMatrix(); // //GL11.glPushMatrix();
// GL11.glRotatef(((float)particleAge + partialTick)*20F, 0, 0, 1); // GL11.glRotatef(((float)particleAge + partialTick)*20F, 0, 0, 1);
// ResourceHandler.bindResource("textures/particle/reactorEnergyBeam.png"); // ResourceHandler.bindResource("textures/particle/reactorEnergyBeam.png");
//// float sizeOrigin = 0.5F; //// float sizeOrigin = 0.5F;
//// float sizeTarget = 0.2F; //// float sizeTarget = 0.2F;
// float sizeTarget = 0.2F; // float sizeTarget = 0.2F;
// float sizeOrigin = 0.5F; // float sizeOrigin = 0.5F;
// //
// int color = 0xFF2200; // int color = 0xFF2200;
// int alpha = 200; // int alpha = 200;
// length -= 1; // length -= 1;
// //
// float speed = 20F; // float speed = 20F;
// float texV2 = 0.0F + ((float)particleAge + partialTick) * 0.01F * speed; // float texV2 = 0.0F + ((float)particleAge + partialTick) * 0.01F * speed;
// float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) + // float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) +
// ((float)particleAge + partialTick) * 0.01F * speed; // ((float)particleAge + partialTick) * 0.01F * speed;
// //
// tessellator.startDrawing(5); // tessellator.startDrawing(5);
// tessellator.setBrightness(200); // tessellator.setBrightness(200);
// //
// byte b0 = 16; // byte b0 = 16;
// for (int i = 0; i <= b0; ++i) // for (int i = 0; i <= b0; ++i)
// { // {
// float verX = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget; // float verX = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget;
// float verY = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget; // float verY = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget;
// float texU = (float)(i % b0) * 1.0F / (float)b0; // float texU = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha); // tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
// //
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU, // tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU,
// (double)texV1); // (double)texV1);
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0); // tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
// tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2); // tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2);
// } // }
// //
// sizeTarget = 0.1F; // sizeTarget = 0.1F;
// //
// length = 0F; // length = 0F;
// for (int i = 0; i <= b0; ++i) // for (int i = 0; i <= b0; ++i)
// { // {
// float verX = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.3F / (float)b0) * sizeTarget; // float verX = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.3F / (float)b0) * sizeTarget;
// float verY = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.3F / (float)b0) * sizeTarget; // float verY = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.3F / (float)b0) * sizeTarget;
// float texU = (float)(i % b0) * 1.0F / (float)b0; // float texU = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0); // tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
// //
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), -0.55D, (double)texU, // tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), -0.55D, (double)texU,
// (double)texV1); // (double)texV1);
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha); // tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
// tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2); // tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2);
// } // }
// //
// tessellator.draw(); // tessellator.draw();
// //GL11.glPopMatrix(); // //GL11.glPopMatrix();
// GL11.glRotatef(((float)particleAge + partialTick)*-30F, 0, 0, 1); // GL11.glRotatef(((float)particleAge + partialTick)*-30F, 0, 0, 1);
// //
// tessellator.startDrawing(5); // tessellator.startDrawing(5);
// tessellator.setBrightness(200); // tessellator.setBrightness(200);
// color = 0xFF4400; // color = 0xFF4400;
// sizeOrigin = 0.15F; // sizeOrigin = 0.15F;
// sizeTarget = 0.6F; // sizeTarget = 0.6F;
// length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) - 1; // length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) - 1;
// GL11.glTranslated(0, 0, -0.1); // GL11.glTranslated(0, 0, -0.1);
// //
// for (int i = 0; i <= b0; ++i) // for (int i = 0; i <= b0; ++i)
// { // {
// float verX = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget; // float verX = MathHelper.sin((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget;
// float verY = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget; // float verY = MathHelper.cos((float)(i % b0) * (float)Math.PI * 2.13F / (float)b0) * sizeTarget;
// float texU = (float)(i % b0) * 1.0F / (float)b0; // float texU = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha/2); // tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha/2);
// //
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU, // tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU,
// (double)texV1); // (double)texV1);
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0); // tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
// tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2); // tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2);
// } // }
// //
// tessellator.draw(); // tessellator.draw();
// GL11.glShadeModel(GL11.GL_FLAT); // GL11.glShadeModel(GL11.GL_FLAT);
// } // }
// //
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// GL11.glEnable(GL11.GL_CULL_FACE); // GL11.glEnable(GL11.GL_CULL_FACE);
// ResourceHandler.bindDefaultParticles(); // ResourceHandler.bindDefaultParticles();
// tessellator.startDrawingQuads(); // tessellator.startDrawingQuads();
// } // }
@@ -1,11 +1,5 @@
package com.brandon3055.draconicevolution.client.render.particle; package com.brandon3055.draconicevolution.client.render.particle;
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 cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.particle.EntityFX; import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -14,8 +8,17 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; 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 cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/** /**
* Created by Brandon on 27/07/2014. * Created by Brandon on 27/07/2014.
*/ */
@@ -32,8 +35,8 @@ public class Particles {
private double[] trailY = new double[15]; private double[] trailY = new double[15];
private double[] trailZ = new double[15]; private double[] trailZ = new double[15];
public EnergyBeamParticle( public EnergyBeamParticle(World world, double x, double y, double z, double x1, double z1, int direction,
World world, double x, double y, double z, double x1, double z1, int direction, boolean mirror) { boolean mirror) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D); super(world, x, y, z, 0.0D, 0.0D, 0.0D);
float speed = 0.04F; float speed = 0.04F;
this.motionX = 0; this.motionX = 0;
@@ -123,13 +126,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -235,8 +232,8 @@ public class Particles {
private double targetZ; private double targetZ;
private boolean passive; private boolean passive;
public EnergyTransferParticle( public EnergyTransferParticle(World world, double x, double y, double z, double tX, double tY, double tZ,
World world, double x, double y, double z, double tX, double tY, double tZ, boolean passive) { boolean passive) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D); super(world, x, y, z, 0.0D, 0.0D, 0.0D);
this.passive = passive; this.passive = passive;
this.targetX = tX; this.targetX = tX;
@@ -273,13 +270,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -304,18 +295,16 @@ public class Particles {
float drawY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); float drawY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
if (passive) if (passive) tesselator.setColorRGBA_F(
tesselator.setColorRGBA_F( (float) this.getDistanceSq(targetX, targetY, targetZ) * 5F * this.particleRed,
(float) this.getDistanceSq(targetX, targetY, targetZ) * 5F * this.particleRed, (float) this.getDistanceSq(targetX, targetY, targetZ) * 5F * this.particleGreen,
(float) this.getDistanceSq(targetX, targetY, targetZ) * 5F * this.particleGreen, this.particleBlue,
this.particleBlue, this.particleAlpha);
this.particleAlpha); else tesselator.setColorRGBA_F(
else this.particleRed,
tesselator.setColorRGBA_F( this.particleGreen,
this.particleRed, this.particleBlue,
this.particleGreen, (float) this.getDistanceSq(targetX, targetY, targetZ) * 5F);
this.particleBlue,
(float) this.getDistanceSq(targetX, targetY, targetZ) * 5F);
// tesselator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F)); // tesselator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F));
@@ -359,8 +348,8 @@ public class Particles {
public int behaviour; public int behaviour;
public int timer = 0; public int timer = 0;
public AdvancedSeekerParticle( public AdvancedSeekerParticle(World world, double x, double y, double z, double tX, double tY, double tZ,
World world, double x, double y, double z, double tX, double tY, double tZ, int type, int maxAge) { int type, int maxAge) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D); super(world, x, y, z, 0.0D, 0.0D, 0.0D);
this.targetX = tX; this.targetX = tX;
this.targetY = tY; this.targetY = tY;
@@ -378,39 +367,16 @@ public class Particles {
this.particleMaxAge = maxAge; this.particleMaxAge = maxAge;
} }
public AdvancedSeekerParticle( public AdvancedSeekerParticle(World world, double x, double y, double z, double tX, double tY, double tZ,
World world, int type, float red, float green, float blue, int maxAge) {
double x,
double y,
double z,
double tX,
double tY,
double tZ,
int type,
float red,
float green,
float blue,
int maxAge) {
this(world, x, y, z, tX, tY, tZ, type, maxAge); this(world, x, y, z, tX, tY, tZ, type, maxAge);
this.particleRed = red; this.particleRed = red;
this.particleGreen = green; this.particleGreen = green;
this.particleBlue = blue; this.particleBlue = blue;
} }
public AdvancedSeekerParticle( public AdvancedSeekerParticle(World world, double x, double y, double z, double tX, double tY, double tZ,
World world, int type, float red, float green, float blue, int maxAge, int timer) {
double x,
double y,
double z,
double tX,
double tY,
double tZ,
int type,
float red,
float green,
float blue,
int maxAge,
int timer) {
this(world, x, y, z, tX, tY, tZ, type, maxAge); this(world, x, y, z, tX, tY, tZ, type, maxAge);
this.particleRed = red; this.particleRed = red;
this.particleGreen = green; this.particleGreen = green;
@@ -516,8 +482,7 @@ public class Particles {
motionY = (motionY * directMotT) + (targetY - posY) * directMotMod; motionY = (motionY * directMotT) + (targetY - posY) * directMotMod;
motionZ = (motionZ * directMotT) + (targetZ - posZ) * directMotMod; motionZ = (motionZ * directMotT) + (targetZ - posZ) * directMotMod;
if (particleMaxAge - particleAge < 40 if (particleMaxAge - particleAge < 40 && timer > 2300
&& timer > 2300
&& (particleRed == 1F || (particleGreen == 1f && particleBlue == 1f))) { && (particleRed == 1F || (particleGreen == 1f && particleBlue == 1f))) {
double yChange = (double) (timer - 2300); double yChange = (double) (timer - 2300);
// setPosition(posX, targetY + yChange, posZ); // setPosition(posX, targetY + yChange, posZ);
@@ -538,13 +503,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -560,10 +519,10 @@ public class Particles {
float minV = vIndex * 0.125F; float minV = vIndex * 0.125F;
float maxV = (vIndex + 1) * 0.125F; float maxV = (vIndex + 1) * 0.125F;
// float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F; // float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F;
// float maxU = 0.0F + 0.1245F;//minU + 0.124F; // float maxU = 0.0F + 0.1245F;//minU + 0.124F;
// float minV = 0F;//(float)this.particleTextureIndexY / 32.0F; // float minV = 0F;//(float)this.particleTextureIndexY / 32.0F;
// float maxV = 0.1245F;//minV + 0.124F; // float maxV = 0.1245F;//minV + 0.124F;
float drawScale = 0.1F * this.particleScale; float drawScale = 0.1F * this.particleScale;
if (this.particleIcon != null) { if (this.particleIcon != null) {
@@ -613,6 +572,7 @@ public class Particles {
} }
public static class TransceiverParticle extends EntityFX { public static class TransceiverParticle extends EntityFX {
public double targetX; public double targetX;
public double targetY; public double targetY;
public double targetZ; public double targetZ;
@@ -651,13 +611,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -722,6 +676,7 @@ public class Particles {
} }
public static class PortalParticle extends EntityFX { public static class PortalParticle extends EntityFX {
public double targetX; public double targetX;
public double targetY; public double targetY;
public double targetZ; public double targetZ;
@@ -768,13 +723,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -837,15 +786,15 @@ public class Particles {
} }
public static class ReactorExplosionParticle extends EntityFX { public static class ReactorExplosionParticle extends EntityFX {
public static IModelCustom uvSphere; public static IModelCustom uvSphere;
public double size = 0; public double size = 0;
public double maxSize; public double maxSize;
public ReactorExplosionParticle(World world, double x, double y, double z, double maxSize) { public ReactorExplosionParticle(World world, double x, double y, double z, double maxSize) {
super(world, x, y, z, 0D, 0D, 0D); super(world, x, y, z, 0D, 0D, 0D);
if (uvSphere == null) if (uvSphere == null) uvSphere = AdvancedModelLoader
uvSphere = AdvancedModelLoader.loadModel( .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
this.maxSize = maxSize; this.maxSize = maxSize;
} }
@@ -864,14 +813,8 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float par3, float par4, float par5,
Tessellator tessellator, float par6, float par7) { // Note U=X V=Y
float partialTick,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -973,15 +916,15 @@ public class Particles {
} }
public static class ChaosImplosionParticle extends EntityFX { public static class ChaosImplosionParticle extends EntityFX {
public static IModelCustom uvSphere; public static IModelCustom uvSphere;
public double size = 0; public double size = 0;
public double maxSize; public double maxSize;
public ChaosImplosionParticle(World world, double x, double y, double z, double maxSize) { public ChaosImplosionParticle(World world, double x, double y, double z, double maxSize) {
super(world, x, y, z, 0D, 0D, 0D); super(world, x, y, z, 0D, 0D, 0D);
if (uvSphere == null) if (uvSphere == null) uvSphere = AdvancedModelLoader
uvSphere = AdvancedModelLoader.loadModel( .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
this.maxSize = maxSize; this.maxSize = maxSize;
} }
@@ -1000,14 +943,8 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float par3, float par4, float par5,
Tessellator tessellator, float par6, float par7) { // Note U=X V=Y
float partialTick,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1033,13 +970,13 @@ public class Particles {
if (a > 0) uvSphere.renderAll(); if (a > 0) uvSphere.renderAll();
GL11.glPopMatrix(); GL11.glPopMatrix();
// //Disk // //Disk
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D)); // a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D));
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(2, 0.2, 2); // GL11.glScaled(2, 0.2, 2);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// Synced edge // Synced edge
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1109,6 +1046,7 @@ public class Particles {
} }
public static class DragonProjectileParticle extends EntityFX { public static class DragonProjectileParticle extends EntityFX {
private EntityDragonProjectile entity; private EntityDragonProjectile entity;
private int particleColour; private int particleColour;
@@ -1134,8 +1072,8 @@ public class Particles {
// super.onUpdate(); // super.onUpdate();
if (particleAge >= particleMaxAge) setDead(); if (particleAge >= particleMaxAge) setDead();
// //
// double d1 = Utills.getDistanceAtoB(startX, startY, startZ, targetX, targetY, targetZ); // double d1 = Utills.getDistanceAtoB(startX, startY, startZ, targetX, targetY, targetZ);
// double d2 = Utills.getDistanceAtoB(posX, posY, posZ, targetX, targetY, targetZ); // double d2 = Utills.getDistanceAtoB(posX, posY, posZ, targetX, targetY, targetZ);
// particleScale = ((float) (d2 / d1)) * baseScale; // particleScale = ((float) (d2 / d1)) * baseScale;
particleAlpha = (1F - (float) ((double) particleAge / particleMaxAge)); particleAlpha = (1F - (float) ((double) particleAge / particleMaxAge));
@@ -1150,13 +1088,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
ResourceHandler.bindParticles(); ResourceHandler.bindParticles();
@@ -1231,8 +1163,8 @@ public class Particles {
private int mode; private int mode;
public ChaosBoltParticle( public ChaosBoltParticle(World world, double x, double y, double z, double shardX, double shardY, double shardZ,
World world, double x, double y, double z, double shardX, double shardY, double shardZ, int mode) { int mode) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D); super(world, x, y, z, 0.0D, 0.0D, 0.0D);
this.focalX = x; this.focalX = x;
this.focalY = y; this.focalY = y;
@@ -1296,13 +1228,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
@@ -1366,6 +1292,7 @@ public class Particles {
} }
public static class ChaosExpansionParticle extends EntityFX { public static class ChaosExpansionParticle extends EntityFX {
public static IModelCustom uvSphere; public static IModelCustom uvSphere;
private final boolean shrink; private final boolean shrink;
public double size = 0; public double size = 0;
@@ -1374,9 +1301,8 @@ public class Particles {
public ChaosExpansionParticle(World world, double x, double y, double z, boolean shrink) { public ChaosExpansionParticle(World world, double x, double y, double z, boolean shrink) {
super(world, x, y, z, 0D, 0D, 0D); super(world, x, y, z, 0D, 0D, 0D);
this.shrink = shrink; this.shrink = shrink;
if (uvSphere == null) if (uvSphere == null) uvSphere = AdvancedModelLoader
uvSphere = AdvancedModelLoader.loadModel( .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
if (shrink) { if (shrink) {
size = 20; size = 20;
} }
@@ -1396,14 +1322,8 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float par3, float par4, float par5,
Tessellator tessellator, float par6, float par7) { // Note U=X V=Y
float partialTick,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1434,6 +1354,7 @@ public class Particles {
} }
public static class ArrowParticle extends EntityFX { public static class ArrowParticle extends EntityFX {
private int particleColour; private int particleColour;
private float setScale; private float setScale;
@@ -1463,13 +1384,7 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6,
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y float par7) { // Note U=X V=Y
tesselator.draw(); tesselator.draw();
ResourceHandler.bindParticles(); ResourceHandler.bindParticles();
@@ -1533,15 +1448,15 @@ public class Particles {
} }
public static class ArrowShockParticle extends EntityFX { public static class ArrowShockParticle extends EntityFX {
public static IModelCustom uvSphere; public static IModelCustom uvSphere;
public double size = 0; public double size = 0;
public double maxSize; public double maxSize;
public ArrowShockParticle(World world, double x, double y, double z, int maxSize) { public ArrowShockParticle(World world, double x, double y, double z, int maxSize) {
super(world, x, y, z, 0D, 0D, 0D); super(world, x, y, z, 0D, 0D, 0D);
if (uvSphere == null) if (uvSphere == null) uvSphere = AdvancedModelLoader
uvSphere = AdvancedModelLoader.loadModel( .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
this.maxSize = maxSize / 100D; this.maxSize = maxSize / 100D;
} }
@@ -1560,14 +1475,8 @@ public class Particles {
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticle( public void renderParticle(Tessellator tessellator, float partialTick, float par3, float par4, float par5,
Tessellator tessellator, float par6, float par7) { // Note U=X V=Y
float partialTick,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tessellator.draw(); tessellator.draw();
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1592,13 +1501,13 @@ public class Particles {
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
GL11.glPopMatrix(); GL11.glPopMatrix();
// //Disk // //Disk
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D)); // a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D));
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(2, 0.2, 2); // GL11.glScaled(2, 0.2, 2);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// Synced edge // Synced edge
GL11.glPushMatrix(); GL11.glPushMatrix();
@@ -1607,59 +1516,59 @@ public class Particles {
if (a > 0) uvSphere.renderAll(); if (a > 0) uvSphere.renderAll();
GL11.glPopMatrix(); GL11.glPopMatrix();
// GL11.glScalef(1.5F, 1.5F, 1.5F); // GL11.glScalef(1.5F, 1.5F, 1.5F);
// //
// //Inner edges // //Inner edges
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D)); // a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D));
//// GL11.glColor4f(1F, 0.3F, 0F, a); //// GL11.glColor4f(1F, 0.3F, 0F, a);
// GL11.glScaled(0.8, 0.8, 0.8); // GL11.glScaled(0.8, 0.8, 0.8);
//// if (a > 0)uvSphere.renderAll(); //// if (a > 0)uvSphere.renderAll();
// //
//// GL11.glColor4f(1F, 0.3F, 0F, a); //// GL11.glColor4f(1F, 0.3F, 0F, a);
// GL11.glScaled(0.8, 0.8, 0.8); // GL11.glScaled(0.8, 0.8, 0.8);
//// if (a > 0)uvSphere.renderAll(); //// if (a > 0)uvSphere.renderAll();
// //
//// GL11.glColor4f(1F, 0.3F, 0F, a); //// GL11.glColor4f(1F, 0.3F, 0F, a);
// GL11.glScaled(0.7, 0.7, 0.7); // GL11.glScaled(0.7, 0.7, 0.7);
//// if (a > 0)uvSphere.renderAll(); //// if (a > 0)uvSphere.renderAll();
// //
//// GL11.glColor4f(1F, 0.3F, 0F, a); //// GL11.glColor4f(1F, 0.3F, 0F, a);
// GL11.glScaled(0.6, 0.6, 0.6); // GL11.glScaled(0.6, 0.6, 0.6);
//// if (a > 0)uvSphere.renderAll(); //// if (a > 0)uvSphere.renderAll();
// //
//// GL11.glColor4f(1F, 0.3F, 0F, a); //// GL11.glColor4f(1F, 0.3F, 0F, a);
// GL11.glScaled(0.5, 0.5, 0.5); // GL11.glScaled(0.5, 0.5, 0.5);
//// if (a > 0)uvSphere.renderAll(); //// if (a > 0)uvSphere.renderAll();
// //
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// for (int i = 0; i < 10; i++) // for (int i = 0; i < 10; i++)
// { // {
// GL11.glScalef(0.95F, 0.95F, 0.95F); // GL11.glScalef(0.95F, 0.95F, 0.95F);
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D)); // a = (float)Math.max(0D, 0.5D - ((size / (maxSize)) * 0.5D));
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(0.8, 0.6, 0.8); // GL11.glScaled(0.8, 0.6, 0.8);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// //
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(0.8, 0.7, 0.8); // GL11.glScaled(0.8, 0.7, 0.8);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// //
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(0.7, 0.9, 0.7); // GL11.glScaled(0.7, 0.9, 0.7);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// //
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(0.6, 0.9, 0.6); // GL11.glScaled(0.6, 0.9, 0.6);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// //
// GL11.glColor4f(1F, 1F, 1F, a); // GL11.glColor4f(1F, 1F, 1F, a);
// GL11.glScaled(0.5, 0.9, 0.5); // GL11.glScaled(0.5, 0.9, 0.5);
// if (a > 0)uvSphere.renderAll(); // if (a > 0)uvSphere.renderAll();
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// } // }
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix(); GL11.glPopMatrix();
@@ -1,7 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -9,14 +7,19 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.tileentities.TileChaosShard;
/** /**
* Created by brandon3055 on 24/9/2015. * Created by brandon3055 on 24/9/2015.
*/ */
public class RenderTileChaosShard extends TileEntitySpecialRenderer { public class RenderTileChaosShard extends TileEntitySpecialRenderer {
public static IModelCustom model =
AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/chaosCrystal.obj")); public static IModelCustom model = AdvancedModelLoader
.loadModel(ResourceHandler.getResource("models/chaosCrystal.obj"));
@Override @Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float tick) { public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float tick) {
@@ -1,11 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
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 net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -13,32 +7,45 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ClientEventHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyRelay;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileEnergyTransceiver;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileRemoteEnergyBase;
import com.brandon3055.draconicevolution.common.tileentities.energynet.TileWirelessEnergyTransceiver;
/** /**
* Created by Brandon on 31/01/2015. * Created by Brandon on 31/01/2015.
*/ */
public class RenderTileCrystal extends TileEntitySpecialRenderer { public class RenderTileCrystal extends TileEntitySpecialRenderer {
private static ResourceLocation texrure = private static ResourceLocation texrure = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalPurpleTransparent.png"); References.MODID.toLowerCase(),
private static ResourceLocation crystalBlue = "textures/models/CrystalPurpleTransparent.png");
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalBlue.png"); private static ResourceLocation crystalBlue = new ResourceLocation(
private static ResourceLocation crystalBlueAlpha = References.MODID.toLowerCase(),
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalBlueAlpha.png"); "textures/models/CrystalBlue.png");
private static ResourceLocation crystalRed = private static ResourceLocation crystalBlueAlpha = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalRed.png"); References.MODID.toLowerCase(),
private static ResourceLocation crystalRedAlpha = "textures/models/CrystalBlueAlpha.png");
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalRedAlpha.png"); private static ResourceLocation crystalRed = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/models/CrystalRed.png");
private static ResourceLocation crystalRedAlpha = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/models/CrystalRedAlpha.png");
private IModelCustom modelCrystal; private IModelCustom modelCrystal;
private IModelCustom modelCrystalTransceiver; private IModelCustom modelCrystalTransceiver;
public RenderTileCrystal() { public RenderTileCrystal() {
modelCrystal = AdvancedModelLoader.loadModel( modelCrystal = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/CCrystal.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/CCrystal.obj"));
modelCrystalTransceiver = AdvancedModelLoader.loadModel( modelCrystalTransceiver = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/CrystalTransceiver.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/CrystalTransceiver.obj"));
} }
@Override @Override
@@ -77,7 +84,7 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
modelCrystal.renderAll(); modelCrystal.renderAll();
GL11.glAlphaFunc(GL11.GL_GREATER, 0f); GL11.glAlphaFunc(GL11.GL_GREATER, 0f);
// GL11.glDisable(GL11.GL_ALPHA_TEST); // GL11.glDisable(GL11.GL_ALPHA_TEST);
// --- Render Overlay ---// // --- Render Overlay ---//
bindTexture(texrure); bindTexture(texrure);
@@ -121,7 +128,7 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
GL11.glTranslated(0, -1, 0); GL11.glTranslated(0, -1, 0);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
// RenderHelper.disableStandardItemLighting(); // RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
float innerLight = 100f; float innerLight = 100f;
float outerLight = 140f + ClientEventHandler.energyCrystalAlphaValue * 40F; float outerLight = 140f + ClientEventHandler.energyCrystalAlphaValue * 40F;
@@ -152,7 +159,7 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
// --- Post Render ---// // --- Post Render ---//
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
// RenderHelper.enableStandardItemLighting(); // RenderHelper.enableStandardItemLighting();
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
@@ -3,20 +3,24 @@ package com.brandon3055.draconicevolution.client.render.tile;
/** /**
* Created by Brandon on 5/07/2014. * Created by Brandon on 5/07/2014.
*/ */
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.tileentities.CustomSpawnerBaseLogic;
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.tileentities.CustomSpawnerBaseLogic;
import com.brandon3055.draconicevolution.common.tileentities.TileCustomSpawner;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderTileCustomSpawner extends TileEntitySpecialRenderer { public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
public void renderTileEntityAt(TileCustomSpawner tile, double x, double y, double z, float p_147518_8_) { public void renderTileEntityAt(TileCustomSpawner tile, double x, double y, double z, float p_147518_8_) {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y, (float) z + 0.5F); GL11.glTranslatef((float) x + 0.5F, (float) y, (float) z + 0.5F);
@@ -24,8 +28,8 @@ public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
public void renderTile( public void renderTile(CustomSpawnerBaseLogic customSpawnerBaseLogic, double x, double y, double z,
CustomSpawnerBaseLogic customSpawnerBaseLogic, double x, double y, double z, float partialTick) { float partialTick) {
Tessellator tessellator = Tessellator.instance; Tessellator tessellator = Tessellator.instance;
Entity entity = customSpawnerBaseLogic.getEntityForRenderer(); Entity entity = customSpawnerBaseLogic.getEntityForRenderer();
@@ -38,8 +42,8 @@ public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
GL11.glTranslatef(0.0F, 0.4F, 0.0F); GL11.glTranslatef(0.0F, 0.4F, 0.0F);
GL11.glRotatef( GL11.glRotatef(
(float) (customSpawnerBaseLogic.renderRotation1 (float) (customSpawnerBaseLogic.renderRotation1
+ (customSpawnerBaseLogic.renderRotation0 - customSpawnerBaseLogic.renderRotation1) + (customSpawnerBaseLogic.renderRotation0 - customSpawnerBaseLogic.renderRotation1)
* (double) partialTick) * (double) partialTick)
* 10.0F, * 10.0F,
0.0F, 0.0F,
1.0F, 1.0F,
@@ -93,8 +97,8 @@ public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
} }
@Override @Override
public void renderTileEntityAt( public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_,
TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { float p_147500_8_) {
this.renderTileEntityAt((TileCustomSpawner) p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_); this.renderTileEntityAt((TileCustomSpawner) p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_);
} }
} }
@@ -1,6 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
@@ -12,8 +11,11 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.tileentities.TileDissEnchanter;
public class RenderTileDissEnchanter extends TileEntitySpecialRenderer { public class RenderTileDissEnchanter extends TileEntitySpecialRenderer {
// private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), // private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(),
@@ -2,23 +2,27 @@ package com.brandon3055.draconicevolution.client.render.tile;
import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.GL11.*;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
import java.util.Random; import java.util.Random;
import net.minecraft.client.model.ModelChest; import net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileDraconiumChest;
/** /**
* Created by Brandon on 25/10/2014. * Created by Brandon on 25/10/2014.
*/ */
public class RenderTileDraconiumChest extends TileEntitySpecialRenderer { public class RenderTileDraconiumChest extends TileEntitySpecialRenderer {
ModelChest model; ModelChest model;
private final ResourceLocation texture = private final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/DraconiumChest.png"); References.MODID.toLowerCase(),
"textures/models/DraconiumChest.png");
private Random random; private Random random;
public RenderTileDraconiumChest() { public RenderTileDraconiumChest() {
@@ -1,8 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEarth;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -10,20 +7,26 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEarth;
import cpw.mods.fml.client.FMLClientHandler;
/** /**
* Created by Brandon on 27/07/2014. * Created by Brandon on 27/07/2014.
*/ */
public class RenderTileEarth extends TileEntitySpecialRenderer { public class RenderTileEarth extends TileEntitySpecialRenderer {
private static final ResourceLocation iner_model_texture = private static final ResourceLocation iner_model_texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/Earth.png"); References.MODID.toLowerCase(),
"textures/models/Earth.png");
public static IModelCustom modelCustom; public static IModelCustom modelCustom;
public RenderTileEarth() { public RenderTileEarth() {
modelCustom = modelCustom = AdvancedModelLoader
AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/Earth.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/Earth.obj"));
} }
@Override @Override
@@ -1,7 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
@@ -11,12 +9,17 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileEnergyInfuser;
public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer { public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
private final ResourceLocation texture = private final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyInfuserTextureSheet.png"); References.MODID.toLowerCase(),
"textures/models/EnergyInfuserTextureSheet.png");
private static float pxl = 1F / 256F; private static float pxl = 1F / 256F;
@@ -149,8 +152,8 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
public static void render2DWithThicness( public static void render2DWithThicness(Tessellator tess, float maxU, float minV, float minU, float maxV, int width,
Tessellator tess, float maxU, float minV, float minU, float maxV, int width, int height, float thickness) { int height, float thickness) {
double pix = 1D / 64D; double pix = 1D / 64D;
tess.startDrawingQuads(); tess.startDrawingQuads();
tess.setNormal(0.0F, 0.0F, 1.0F); tess.setNormal(0.0F, 0.0F, 1.0F);
@@ -1,27 +1,30 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyPylon;
/** /**
* Created by Brandon on 27/07/2014. * Created by Brandon on 27/07/2014.
*/ */
public class RenderTileEnergyPylon extends TileEntitySpecialRenderer { public class RenderTileEnergyPylon extends TileEntitySpecialRenderer {
private static final ResourceLocation model_texture = private static final ResourceLocation model_texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/pylon_sphere_texture.png"); References.MODID.toLowerCase(),
"textures/models/pylon_sphere_texture.png");
private IModelCustom model; private IModelCustom model;
public RenderTileEnergyPylon() { public RenderTileEnergyPylon() {
model = AdvancedModelLoader.loadModel( model = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/pylon_sphere.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/pylon_sphere.obj"));
} }
@Override @Override
@@ -97,5 +100,5 @@ public class RenderTileEnergyPylon extends TileEntitySpecialRenderer {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
// private void renderSphere() // private void renderSphere()
} }
@@ -1,8 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -10,22 +7,29 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
import cpw.mods.fml.client.FMLClientHandler;
/** /**
* Created by Brandon on 27/07/2014. * Created by Brandon on 27/07/2014.
*/ */
public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer { public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
private static final ResourceLocation iner_model_texture = private static final ResourceLocation iner_model_texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png"); References.MODID.toLowerCase(),
private static final ResourceLocation outer_model_texture = "textures/models/power_sphere_layer_1.png");
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.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 iner_model;
public RenderTileEnergyStorageCore() { public RenderTileEnergyStorageCore() {
iner_model = AdvancedModelLoader.loadModel( iner_model = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
} }
@Override @Override
@@ -81,19 +85,19 @@ public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
iner_model.renderAll(); iner_model.renderAll();
GL11.glPopMatrix(); GL11.glPopMatrix();
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// GL11.glScalef(0.8F, 0.8F, 0.8F); // GL11.glScalef(0.8F, 0.8F, 0.8F);
// GL11.glColor4d(1F, 1f, 0.2f, 1F); // GL11.glColor4d(1F, 1f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F); // GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll(); // //iner_model.renderAll();
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// //
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// GL11.glScalef(0.9F, 0.9F, 0.9F); // GL11.glScalef(0.9F, 0.9F, 0.9F);
// GL11.glColor4d(1F, 0f, 0.2f, 1F); // GL11.glColor4d(1F, 0f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F); // GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll(); // //iner_model.renderAll();
// GL11.glPopMatrix(); // GL11.glPopMatrix();
GL11.glScalef(1.1F, 1.1F, 1.1F); GL11.glScalef(1.1F, 1.1F, 1.1F);
GL11.glDepthMask(false); GL11.glDepthMask(false);
@@ -1,11 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
@@ -14,24 +8,36 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileParticleGenerator;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.TileEnergyStorageCore;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderTileParticleGen extends TileEntitySpecialRenderer { public class RenderTileParticleGen extends TileEntitySpecialRenderer {
private final ResourceLocation texture = private final ResourceLocation texture = new ResourceLocation(
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/ParticleGenTextureSheet.png"); References.MODID.toLowerCase(),
private final ResourceLocation beamTexture = "textures/models/ParticleGenTextureSheet.png");
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_beam.png"); private final ResourceLocation beamTexture = new ResourceLocation(
private static final ResourceLocation modelTexture = References.MODID.toLowerCase(),
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_sphere.png"); "textures/models/stabilizer_beam.png");
private static final ResourceLocation modelTexture = new ResourceLocation(
References.MODID.toLowerCase(),
"textures/models/stabilizer_sphere.png");
private IModelCustom stabilizerSphereModel; private IModelCustom stabilizerSphereModel;
private float pxl = 1F / 64; private float pxl = 1F / 64;
public RenderTileParticleGen() { public RenderTileParticleGen() {
stabilizerSphereModel = AdvancedModelLoader.loadModel( stabilizerSphereModel = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/stabilizer_sphere.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/stabilizer_sphere.obj"));
} }
@Override @Override
@@ -325,8 +331,8 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
private void drawCornerCube( private void drawCornerCube(Tessellator tess, float x, float y, float z, float FP, boolean inverted,
Tessellator tess, float x, float y, float z, float FP, boolean inverted, boolean stabalizerMode) { boolean stabalizerMode) {
float srcXMin = inverted ? 38F * pxl : 32F * pxl; float srcXMin = inverted ? 38F * pxl : 32F * pxl;
float srcYMin = 0F; float srcYMin = 0F;
float srcXMax = inverted ? 44F * pxl : 38F * pxl; float srcXMax = inverted ? 44F * pxl : 38F * pxl;
@@ -654,8 +660,8 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(true); GL11.glDepthMask(true);
// //
// GL11.glEnable(GL11.GL_LIGHTING); // GL11.glEnable(GL11.GL_LIGHTING);
// GL11.glEnable(GL11.GL_TEXTURE_2D); // GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
@@ -1,7 +1,5 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.common.items.MobSoul;
import com.brandon3055.draconicevolution.common.tileentities.TilePlacedItem;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
@@ -13,8 +11,12 @@ import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.common.items.MobSoul;
import com.brandon3055.draconicevolution.common.tileentities.TilePlacedItem;
/** /**
* Created by Brandon on 27/07/2014. * Created by Brandon on 27/07/2014.
*/ */
@@ -1,47 +1,50 @@
package com.brandon3055.draconicevolution.client.render.tile; package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.reactor.TileReactorCore;
/** /**
* Created by Brandon on 16/6/2015. * Created by Brandon on 16/6/2015.
*/ */
public class RenderTileReactorCore extends TileEntitySpecialRenderer { public class RenderTileReactorCore extends TileEntitySpecialRenderer {
public static IModelCustom reactorModel; public static IModelCustom reactorModel;
public RenderTileReactorCore() { public RenderTileReactorCore() {
reactorModel = AdvancedModelLoader.loadModel( reactorModel = AdvancedModelLoader
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj")); .loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
} }
@Override @Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) { public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) {
TileReactorCore tile = (TileReactorCore) tileEntity; TileReactorCore tile = (TileReactorCore) tileEntity;
// tile.renderList.clear(); // tile.renderList.clear();
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
renderReactorCore(tile, partialTick); renderReactorCore(tile, partialTick);
// for (MultiblockHelper.TileOffset offset : tile.stabilizerLocations){ // for (MultiblockHelper.TileOffset offset : tile.stabilizerLocations){
// if (!(offset.getTileEntity(tileEntity) instanceof TileReactorStabilizer)) continue; // if (!(offset.getTileEntity(tileEntity) instanceof TileReactorStabilizer)) continue;
// GL11.glPushMatrix(); // GL11.glPushMatrix();
// //
// TileReactorStabilizer stabilizer = (TileReactorStabilizer)offset.getTileEntity(tileEntity); // TileReactorStabilizer stabilizer = (TileReactorStabilizer)offset.getTileEntity(tileEntity);
// GL11.glTranslated(-offset.offsetX, -offset.offsetY, -offset.offsetZ); // GL11.glTranslated(-offset.offsetX, -offset.offsetY, -offset.offsetZ);
// //RenderTileReactorStabilizer.renderCore(stabilizer, partialTick); // //RenderTileReactorStabilizer.renderCore(stabilizer, partialTick);
// //RenderTileReactorStabilizer.renderEffects(stabilizer, partialTick); // //RenderTileReactorStabilizer.renderEffects(stabilizer, partialTick);
// //
// GL11.glPopMatrix(); // GL11.glPopMatrix();
// } // }
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
Loaded 100 of 348 files, more files were not shown because too many files have changed in this diff. Show more