Allow the Grinder to attack Ender Dragons (#26)

* Update buildscript

* Allow the Grander to kill Ender Dragons

* Apply spotless
This commit is contained in:
glowredman authored and GitHub committed 2022-08-09 01:25:35 +04:00
1 parent 8c9161dc83
commit 5b110be984
326 files changed
+14641 -7821

No files matched your search

@@ -15,11 +15,15 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
@Mod(modid = References.MODID, name = References.MODNAME, version = References.VERSION, canBeDeactivated = false, guiFactory = References.GUIFACTORY,
dependencies = "after:NotEnoughItems;" +
"after:ThermalExpansion;" +
"after:ThermalFoundation;" +
"required-after:BrandonsCore@[1.0.0.11,);")
@Mod(
modid = References.MODID,
name = References.MODNAME,
version = References.VERSION,
canBeDeactivated = false,
guiFactory = References.GUIFACTORY,
dependencies = "after:NotEnoughItems;" + "after:ThermalExpansion;"
+ "after:ThermalFoundation;"
+ "required-after:BrandonsCore@[1.0.0.11,);")
public class DraconicEvolution {
@Mod.Instance(References.MODID)
@@ -28,13 +32,15 @@ public class DraconicEvolution {
@SidedProxy(clientSide = References.CLIENTPROXYLOCATION, serverSide = References.SERVERPROXYLOCATION)
public static CommonProxy proxy;
public static CreativeTabs tabToolsWeapons = new DETab(CreativeTabs.getNextID(), References.MODID, "toolsAndWeapons", 0);
public static CreativeTabs tabBlocksItems = new DETab(CreativeTabs.getNextID(), References.MODID, "blocksAndItems", 1);
public static CreativeTabs tabToolsWeapons =
new DETab(CreativeTabs.getNextID(), References.MODID, "toolsAndWeapons", 0);
public static CreativeTabs tabBlocksItems =
new DETab(CreativeTabs.getNextID(), References.MODID, "blocksAndItems", 1);
public static final String networkChannelName = "DEvolutionNC";
public static SimpleNetworkWrapper network;
public static boolean debug = false;//todo
public static boolean debug = false; // todo
public static Enchantment reaperEnchant;
@@ -46,16 +52,15 @@ public class DraconicEvolution {
public static void preInit(final FMLPreInitializationEvent event) {
if (debug) LogHelper.info("Initialization");
// event.getModMetadata().autogenerated = false;
// event.getModMetadata().credits = "";
// event.getModMetadata().description = "This is a mod originally made for the Tolkiencraft mod pack";
// event.getModMetadata().authorList = Arrays.asList("brandon3055");
// event.getModMetadata().logoFile = "banner.png";
// event.getModMetadata().url = "http://www.brandon3055.com/";
// event.getModMetadata().version = References.VERSION + "-MC1.7.10";
// event.getModMetadata().autogenerated = false;
// event.getModMetadata().credits = "";
// event.getModMetadata().description = "This is a mod originally made for the Tolkiencraft mod pack";
// event.getModMetadata().authorList = Arrays.asList("brandon3055");
// event.getModMetadata().logoFile = "banner.png";
// event.getModMetadata().url = "http://www.brandon3055.com/";
// event.getModMetadata().version = References.VERSION + "-MC1.7.10";
proxy.preInit(event);
}
@Mod.EventHandler
@@ -75,7 +80,7 @@ public class DraconicEvolution {
proxy.postInit(event);
}
//FMLInterModComms.sendMessage("DraconicEvolution", "addChestRecipe:item.coal", new ItemStack(Items.diamond, 2));
// FMLInterModComms.sendMessage("DraconicEvolution", "addChestRecipe:item.coal", new ItemStack(Items.diamond, 2));
@Mod.EventHandler
public void processMessage(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage m : event.getMessages()) {
@@ -87,4 +92,4 @@ public class DraconicEvolution {
}
}
}
}
}
@@ -5,9 +5,8 @@ import com.brandon3055.draconicevolution.common.world.ChaosWorldGenHandler;
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
import com.brandon3055.draconicevolution.common.world.WorldGenEnderComet;
import com.brandon3055.draconicevolution.common.world.WorldGenEnderIsland;
import net.minecraft.world.World;
import java.util.Random;
import net.minecraft.world.World;
/**
* Created by Brandon on 11/7/2015.
@@ -40,8 +39,10 @@ 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 random a random
*/
public static void generateChaosChunk(World world, int chunkX, int chunkZ, int centerX, int centerZ, Random random) {
ChaosWorldGenHandler.generateChunk(world, chunkX, chunkZ, new DataUtills.XZPair<Integer, Integer>(centerX, centerZ), random);
public static void generateChaosChunk(
World world, int chunkX, int chunkZ, int centerX, int centerZ, Random random) {
ChaosWorldGenHandler.generateChunk(
world, chunkX, chunkZ, new DataUtills.XZPair<Integer, Integer>(centerX, centerZ), random);
}
/**
@@ -1,6 +1,7 @@
/**
* Created by Brandon on 19/03/2015.
*/
@API(apiVersion = "1.2", owner = "DraconicEvolution", provides = "DraconicEvolution|API") package com.brandon3055.draconicevolution.api;
@API(apiVersion = "1.2", owner = "DraconicEvolution", provides = "DraconicEvolution|API")
package com.brandon3055.draconicevolution.api;
import cpw.mods.fml.common.API;
import cpw.mods.fml.common.API;
@@ -49,7 +49,7 @@ import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
public class ClientProxy extends CommonProxy {
private final static boolean debug = DraconicEvolution.debug;
private static final boolean debug = DraconicEvolution.debug;
public static String downloadLocation;
@Override
@@ -59,52 +59,52 @@ public class ClientProxy extends CommonProxy {
ResourceHandler.init(event);
// downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + "/mods/derspack";
// downloadLocation = downloadLocation.replaceAll("\\\\", "/");
//
// File rescourcePack = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/derspack");
//
//
// //File file = new File(downloadLocation);
// if (!rescourcePack.exists()) rescourcePack.mkdir();
//
// LogHelper.info("Downloading Images");
//
// try {
// URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg");
// String fileName = url.getFile();
// //String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/"));
// File dll = new File(rescourcePack, fileName.substring(fileName.lastIndexOf("/")));
//
// InputStream is = url.openStream();
// OutputStream os = new FileOutputStream(dll);
//
// ByteStreams.copy(is, os);
//
// is.close();
// os.close();
// }catch (IOException e){
// LogHelper.info(e);
// }
//
//
// List defaultResourcePacks = Lists.newArrayList();
// Field f = ReflectionHelper.findField(Minecraft.class, "defaultResourcePacks", "field_110449_ao");
// f.setAccessible(true);
// try {
// defaultResourcePacks = (List)f.get(Minecraft.getMinecraft());
// defaultResourcePacks.add(new FolderResourcePack(rescourcePack));
// for (Object o : defaultResourcePacks){
// if (o instanceof FolderResourcePack) LogHelper.info(((FolderResourcePack) o).getPackName());
// if (o instanceof FileResourcePack) LogHelper.info(((FileResourcePack)o).getPackName());
// }
//
// f.set(Minecraft.getMinecraft(), defaultResourcePacks);
// }
// catch (IllegalAccessException e) {
// e.printStackTrace();
// }
// downloadLocation = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() +
// "/mods/derspack";
// downloadLocation = downloadLocation.replaceAll("\\\\", "/");
//
// File rescourcePack = new File(event.getModConfigurationDirectory().getParentFile(), "/mods/derspack");
//
//
// //File file = new File(downloadLocation);
// if (!rescourcePack.exists()) rescourcePack.mkdir();
//
// LogHelper.info("Downloading Images");
//
// try {
// URL url = new URL("http://i.imgur.com/oHRx1yQ.jpg");
// String fileName = url.getFile();
// //String destName = downloadLocation + fileName.substring(fileName.lastIndexOf("/"));
// File dll = new File(rescourcePack, fileName.substring(fileName.lastIndexOf("/")));
//
// InputStream is = url.openStream();
// OutputStream os = new FileOutputStream(dll);
//
// ByteStreams.copy(is, os);
//
// is.close();
// os.close();
// }catch (IOException e){
// LogHelper.info(e);
// }
//
//
// List defaultResourcePacks = Lists.newArrayList();
// Field f = ReflectionHelper.findField(Minecraft.class, "defaultResourcePacks", "field_110449_ao");
// f.setAccessible(true);
// try {
// defaultResourcePacks = (List)f.get(Minecraft.getMinecraft());
// defaultResourcePacks.add(new FolderResourcePack(rescourcePack));
// for (Object o : defaultResourcePacks){
// if (o instanceof FolderResourcePack) LogHelper.info(((FolderResourcePack) o).getPackName());
// if (o instanceof FileResourcePack) LogHelper.info(((FileResourcePack)o).getPackName());
// }
//
// f.set(Minecraft.getMinecraft(), defaultResourcePacks);
// }
// catch (IllegalAccessException e) {
// e.printStackTrace();
// }
}
@@ -113,7 +113,8 @@ public class ClientProxy extends CommonProxy {
super.init(event);
FMLCommonHandler.instance().bus().register(new KeyInputHandler());
FMLCommonHandler.instance().bus().register(new ClientEventHandler());
if (ConfigHandler.enableVersionChecker) FMLCommonHandler.instance().bus().register(new UpdateChecker());
if (ConfigHandler.enableVersionChecker)
FMLCommonHandler.instance().bus().register(new UpdateChecker());
MinecraftForge.EVENT_BUS.register(new HudHandler());
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
KeyBindings.init();
@@ -129,7 +130,7 @@ public class ClientProxy extends CommonProxy {
}
public void registerRendering() {
//Item Renderers
// Item Renderers
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBow());
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBow());
MinecraftForgeClient.registerItemRenderer(ModItems.mobSoul, new RenderMobSoul());
@@ -149,38 +150,83 @@ public class ClientProxy extends CommonProxy {
}
if (!ConfigHandler.useOldD2DToolTextures) {
MinecraftForgeClient.registerItemRenderer(ModItems.draconicSword, new RenderTool("models/tools/DraconicSword.obj", "textures/models/tools/DraconicSword.png", (IRenderTweak) ModItems.draconicSword));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernPickaxe, new RenderTool("models/tools/Pickaxe.obj", "textures/models/tools/Pickaxe.png", (IRenderTweak) ModItems.wyvernPickaxe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicPickaxe, new RenderTool("models/tools/DraconicPickaxe.obj", "textures/models/tools/DraconicPickaxe.png", (IRenderTweak) ModItems.draconicPickaxe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicAxe, new RenderTool("models/tools/DraconicLumberAxe.obj", "textures/models/tools/DraconicLumberAxe.png", (IRenderTweak) ModItems.draconicAxe));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernShovel, new RenderTool("models/tools/Shovel.obj", "textures/models/tools/Shovel.png", (IRenderTweak) ModItems.wyvernShovel));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicShovel, new RenderTool("models/tools/DraconicShovel.obj", "textures/models/tools/DraconicShovel.png", (IRenderTweak) ModItems.draconicShovel));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernSword, new RenderTool("models/tools/Sword.obj", "textures/models/tools/Sword.png", (IRenderTweak) ModItems.wyvernSword));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicDestructionStaff, new RenderTool("models/tools/DraconicStaffOfPower.obj", "textures/models/tools/DraconicStaffOfPower.png", (IRenderTweak) ModItems.draconicDestructionStaff));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHoe, new RenderTool("models/tools/DraconicHoe.obj", "textures/models/tools/DraconicHoe.png", (IRenderTweak) ModItems.draconicHoe));
MinecraftForgeClient.registerItemRenderer(
ModItems.draconicSword,
new RenderTool(
"models/tools/DraconicSword.obj", "textures/models/tools/DraconicSword.png", (IRenderTweak)
ModItems.draconicSword));
MinecraftForgeClient.registerItemRenderer(
ModItems.wyvernPickaxe,
new RenderTool("models/tools/Pickaxe.obj", "textures/models/tools/Pickaxe.png", (IRenderTweak)
ModItems.wyvernPickaxe));
MinecraftForgeClient.registerItemRenderer(
ModItems.draconicPickaxe,
new RenderTool(
"models/tools/DraconicPickaxe.obj",
"textures/models/tools/DraconicPickaxe.png",
(IRenderTweak) ModItems.draconicPickaxe));
MinecraftForgeClient.registerItemRenderer(
ModItems.draconicAxe,
new RenderTool(
"models/tools/DraconicLumberAxe.obj",
"textures/models/tools/DraconicLumberAxe.png",
(IRenderTweak) ModItems.draconicAxe));
MinecraftForgeClient.registerItemRenderer(
ModItems.wyvernShovel,
new RenderTool("models/tools/Shovel.obj", "textures/models/tools/Shovel.png", (IRenderTweak)
ModItems.wyvernShovel));
MinecraftForgeClient.registerItemRenderer(
ModItems.draconicShovel,
new RenderTool(
"models/tools/DraconicShovel.obj",
"textures/models/tools/DraconicShovel.png",
(IRenderTweak) ModItems.draconicShovel));
MinecraftForgeClient.registerItemRenderer(
ModItems.wyvernSword,
new RenderTool("models/tools/Sword.obj", "textures/models/tools/Sword.png", (IRenderTweak)
ModItems.wyvernSword));
MinecraftForgeClient.registerItemRenderer(
ModItems.draconicDestructionStaff,
new RenderTool(
"models/tools/DraconicStaffOfPower.obj",
"textures/models/tools/DraconicStaffOfPower.png",
(IRenderTweak) ModItems.draconicDestructionStaff));
MinecraftForgeClient.registerItemRenderer(
ModItems.draconicHoe,
new RenderTool(
"models/tools/DraconicHoe.obj", "textures/models/tools/DraconicHoe.png", (IRenderTweak)
ModItems.draconicHoe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBowModel(true));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBowModel(false));
}
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyCrystal), new RenderCrystal());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
MinecraftForgeClient.registerItemRenderer(
Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
//ISimpleBlockRendering
// ISimpleBlockRendering
RenderingRegistry.registerBlockHandler(new RenderTeleporterStand());
RenderingRegistry.registerBlockHandler(new RenderPortal());
//TileEntitySpecialRenderers
// TileEntitySpecialRenderers
ClientRegistry.bindTileEntitySpecialRenderer(TileParticleGenerator.class, new RenderTileParticleGen());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyInfuser.class, new RenderTileEnergyInfiser());
ClientRegistry.bindTileEntitySpecialRenderer(TileCustomSpawner.class, new RenderTileCustomSpawner());
//ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
// ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyStorageCore.class, new RenderTileEnergyStorageCore());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyPylon.class, new RenderTileEnergyPylon());
ClientRegistry.bindTileEntitySpecialRenderer(TilePlacedItem.class, new RenderTilePlacedItem());
@@ -192,11 +238,12 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileWirelessEnergyTransceiver.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorCore.class, new RenderTileReactorCore());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorStabilizer.class, new RenderTileReactorStabilizer());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
ClientRegistry.bindTileEntitySpecialRenderer(
TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard());
ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier());
//Entitys
// Entitys
RenderingRegistry.registerEntityRenderingHandler(EntityCustomDragon.class, new RenderDragon());
RenderingRegistry.registerEntityRenderingHandler(EntityChaosGuardian.class, new RenderDragon());
RenderingRegistry.registerEntityRenderingHandler(EntityDragonHeart.class, new RenderDragonHeart());
@@ -212,7 +259,19 @@ public class ClientProxy extends CommonProxy {
}
@Override
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
public ParticleEnergyBeam energyBeam(
World worldObj,
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;
ParticleEnergyBeam beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50);
@@ -233,7 +292,15 @@ public class ClientProxy extends CommonProxy {
}
@Override
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced, ParticleEnergyField oldBeam, boolean render) {
public ParticleEnergyField energyField(
World worldObj,
double x,
double y,
double z,
int type,
boolean advanced,
ParticleEnergyField oldBeam,
boolean render) {
if (!worldObj.isRemote) return null;
ParticleEnergyField beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50);
@@ -274,7 +341,6 @@ public class ClientProxy extends CommonProxy {
return beam;
}
public boolean isOp(String paramString) {
return Minecraft.getMinecraft().theWorld.getWorldInfo().getGameType().isCreative();
}
@@ -36,16 +36,24 @@ public class ReactorSound extends PositionedSound implements ITickableSound {
if (tile.reactionTemperature > 8000) {
volume += (float) ((tile.reactionTemperature - 8000D) / 1000D);
}
if (tile.reactionTemperature > 2000 && tile.maxFieldCharge > 0 && tile.fieldCharge < (tile.maxFieldCharge * 0.2D)) {
if (tile.reactionTemperature > 2000
&& tile.maxFieldCharge > 0
&& tile.fieldCharge < (tile.maxFieldCharge * 0.2D)) {
volume += 2D - ((tile.fieldCharge / tile.maxFieldCharge) * 10D);
}
if (tile.reactionTemperature > 2000 && tile.reactorFuel + tile.convertedFuel > 0 && tile.reactorFuel < (double) (tile.reactorFuel + tile.convertedFuel) * 0.2D) {
if (tile.reactionTemperature > 2000
&& tile.reactorFuel + tile.convertedFuel > 0
&& tile.reactorFuel < (double) (tile.reactorFuel + tile.convertedFuel) * 0.2D) {
volume += 2D - ((tile.reactorFuel / (tile.reactorFuel + tile.convertedFuel)) * 10D);
}
field_147663_c = 0.5F + volume / 2F;
if (tile.isInvalid() || !tile.getWorldObj().getChunkFromBlockCoords(tile.xCoord, tile.zCoord).isChunkLoaded) {// || player == null || tile.getDistanceFrom(player.posX, player.posY, player.posZ) > 512){
if (tile.isInvalid()
|| !tile.getWorldObj()
.getChunkFromBlockCoords(tile.xCoord, tile.zCoord)
.isChunkLoaded) { // || player == null || tile.getDistanceFrom(player.posX, player.posY,
// player.posZ) > 512){
donePlaying = true;
repeat = false;
}
@@ -1,7 +1,7 @@
package com.brandon3055.draconicevolution.client.creativetab;
import com.brandon3055.draconicevolution.common.ModBlocks;
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;
@@ -18,7 +18,8 @@ public class DETab extends CreativeTabs {
public static void initialize() {
if (ModItems.isEnabled(ModItems.draconicDestructionStaff))
iconStackStaff = ItemNBTHelper.setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 30000000);
iconStackStaff =
ItemNBTHelper.setInteger(new ItemStack(ModItems.draconicDestructionStaff), "Energy", 30000000);
else iconStackStaff = new ItemStack(Items.stick);
}
@@ -12,10 +12,15 @@ import net.minecraftforge.common.config.Configuration;
*/
public class ConfigGUI extends GuiConfig {
public ConfigGUI(GuiScreen parent) {
super(parent, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), References.MODID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
super(
parent,
new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(),
References.MODID,
false,
false,
GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
configElements.addAll(new ConfigElement(ConfigHandler.config.getCategory("spawner")).getChildElements());
configElements.addAll(new ConfigElement(ConfigHandler.config.getCategory("long range dislocator")).getChildElements());
configElements.addAll(
new ConfigElement(ConfigHandler.config.getCategory("long range dislocator")).getChildElements());
}
}
@@ -1,11 +1,10 @@
package com.brandon3055.draconicevolution.client.gui;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11;
public class CustomGuiButton extends GuiButton {
@@ -18,13 +17,22 @@ public class CustomGuiButton extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height;
this.field_146123_n = p_146112_2_ >= this.xPosition
&& p_146112_3_ >= this.yPosition
&& p_146112_2_ < this.xPosition + this.width
&& p_146112_3_ < this.yPosition + this.height;
int k = this.getHoverState(this.field_146123_n);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(
this.xPosition + this.width / 2,
this.yPosition,
200 - this.width / 2,
46 + k * 20,
this.width / 2,
this.height);
this.mouseDragged(minecraft, p_146112_2_, p_146112_3_);
int l = 14737632;
@@ -36,8 +44,12 @@ public class CustomGuiButton extends GuiButton {
l = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
this.drawCenteredString(
fontrenderer,
this.displayString,
this.xPosition + this.width / 2,
this.yPosition + (this.height - 8) / 2,
l);
}
}
}
@@ -1,19 +1,16 @@
package com.brandon3055.draconicevolution.client.gui;
import cpw.mods.fml.client.IModGuiFactory;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import java.util.Set;
/**
* Created by Brandon on 6/08/2014.
*/
public class DEGUIFactory implements IModGuiFactory {
@Override
public void initialize(Minecraft minecraftInstance) {
}
public void initialize(Minecraft minecraftInstance) {}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
@@ -29,42 +29,37 @@ public class GUIContainerTemplate extends GuiContainer {
this.player = invPlayer.player;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
//bindTexture(texture);
// bindTexture(texture);
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
}
@Override
public void initGui() {
super.initGui();
}
@Override
protected void actionPerformed(GuiButton button) {
}
protected void actionPerformed(GuiButton button) {}
@Override
public void updateScreen() {
super.updateScreen();
}
}
@@ -34,19 +34,24 @@ public class GUIDissEnchanter extends GuiContainer {
this.player = invPlayer.player;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DissEnchanter.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DissEnchanter.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("tile.draconicevolution:dissEnchanter.name"), 88, 4, 0x00FFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("tile.draconicevolution:dissEnchanter.name"),
88,
4,
0x00FFFF);
fontRendererObj.drawString("Item", 5, 40, 0x0000ff);
fontRendererObj.drawString("Damage: " + (40 - tile.bookPower) + "%", 5, 49, 0x0000ff);
@@ -13,6 +13,9 @@ 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.Collections;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -25,17 +28,15 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@SideOnly(Side.CLIENT)
@Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems")
public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
public EntityPlayer player;
private TileDraconiumChest tile;
private static final ResourceLocation textureLeft = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestLeft.png");
private static final ResourceLocation textureRight = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestRight.png");
private static final ResourceLocation textureLeft =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestLeft.png");
private static final ResourceLocation textureRight =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/DraconicChestRight.png");
private int lastAutoFeed = -1;
public GUIDraconiumChest(InventoryPlayer invPlayer, TileDraconiumChest tile) {
@@ -67,24 +68,29 @@ public class GUIDraconiumChest extends GuiContainer implements INEIGuiHandler {
}
int arrowHight = (int) (((float) tile.smeltingProgressTime / (float) tile.smeltingCompleateTime) * 22f);
drawTexturedModalRect(guiLeft + 140, guiTop + 192 + 22 - arrowHight, 140, 216 + 22 - arrowHight, 16, arrowHight);
drawTexturedModalRect(
guiLeft + 140, guiTop + 192 + 22 - arrowHight, 140, 216 + 22 - arrowHight, 16, arrowHight);
Minecraft.getMinecraft().getTextureManager().bindTexture(textureRight);
int energyWidth = (int) (((float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)) * 90f);
int energyWidth = (int) (((float) tile.getEnergyStored(ForgeDirection.DOWN)
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN))
* 90f);
drawTexturedModalRect(guiLeft + 44, guiTop + 235, 131, 236, energyWidth, 16);
int flameHight = (int) (((float) tile.smeltingBurnSpeed / (float) tile.smeltingMaxBurnSpeed) * 13f);
//flameHight = tile.smeltingProgressTime <= 0 ? 0 : Math.min(flameHight, 13);
// flameHight = tile.smeltingProgressTime <= 0 ? 0 : Math.min(flameHight, 13);
drawTexturedModalRect(guiLeft + 45, guiTop + 217 + 13 - flameHight, 132, 180 + 13 - flameHight, 88, flameHight);
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
fontRendererObj.drawString(tile.getInventoryName(), 4, 4, 0x222222);
//fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("button.de.chestAutoFeed.txt"), 4, 180, 0x00FFFF);
// fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("button.de.chestAutoFeed.txt"), 4, 180,
// 0x00FFFF);
ArrayList<String> list = new ArrayList<String>();
list.add(String.valueOf(tile.getEnergyStored(ForgeDirection.DOWN)) + "/" + String.valueOf(tile.getMaxEnergyStored(ForgeDirection.DOWN)) + "RF");
list.add(String.valueOf(tile.getEnergyStored(ForgeDirection.DOWN)) + "/"
+ String.valueOf(tile.getMaxEnergyStored(ForgeDirection.DOWN)) + "RF");
if (GuiHelper.isInRect(44, 235, 90, 16, x - guiLeft, y - guiTop))
drawHoveringText(list, x - guiLeft, y - guiTop, fontRendererObj);
list.clear();
@@ -7,6 +7,8 @@ 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.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -17,9 +19,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.Random;
@SideOnly(Side.CLIENT)
public class GUIEnergyInfuser extends GuiContainer {
@@ -37,7 +36,8 @@ public class GUIEnergyInfuser extends GuiContainer {
this.player = invPlayer.player;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/EnergyInfuser.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/EnergyInfuser.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -45,16 +45,33 @@ public class GUIEnergyInfuser extends GuiContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (tile.getStackInSlot(0) == null)
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel box
float power = (float) tile.energy.getEnergyStored() / (float) tile.energy.getMaxEnergyStored() * -1F + 1F;
drawTexturedModalRect(guiLeft + 49, guiTop + 7 + (int) (power * 45), xSize, (int) (power * 45), 8, 45 - (int) (power * 45));//Power bar
drawTexturedModalRect(
guiLeft + 49,
guiTop + 7 + (int) (power * 45),
xSize,
(int) (power * 45),
8,
45 - (int) (power * 45)); // Power bar
if (tile.running && tile.getStackInSlot(0) != null && tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
IEnergyContainerItem item = (IEnergyContainerItem) tile.getStackInSlot(0).getItem();
float charge = (float) item.getEnergyStored(tile.getStackInSlot(0)) / (float) item.getMaxEnergyStored(tile.getStackInSlot(0)) * -1F + 1F;
drawTexturedModalRect(guiLeft + 119, guiTop + 7 + (int) (charge * 45), xSize, (int) (charge * 45), 8, 45 - (int) (charge * 45));//Item Power bar
if (tile.running
&& tile.getStackInSlot(0) != null
&& tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
IEnergyContainerItem item =
(IEnergyContainerItem) tile.getStackInSlot(0).getItem();
float charge = (float) item.getEnergyStored(tile.getStackInSlot(0))
/ (float) item.getMaxEnergyStored(tile.getStackInSlot(0))
* -1F
+ 1F;
drawTexturedModalRect(
guiLeft + 119,
guiTop + 7 + (int) (charge * 45),
xSize,
(int) (charge * 45),
8,
45 - (int) (charge * 45)); // Item Power bar
}
drawAnimatedParts();
@@ -64,12 +81,11 @@ public class GUIEnergyInfuser extends GuiContainer {
protected void drawGuiContainerForegroundLayer(int x, int y) {
fontRendererObj.drawStringWithShadow("Energy Infuser", 49, -9, 0x00FFFF);
// bindTexture(texture);
//bindTexture(texture);
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
}
@@ -83,37 +99,39 @@ public class GUIEnergyInfuser extends GuiContainer {
public void initGui() {
super.initGui();
//ID
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
// ID
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
}
@Override
protected void actionPerformed(GuiButton button) {
}
protected void actionPerformed(GuiButton button) {}
@Override
public void updateScreen() {
super.updateScreen();
}
private void drawEnergyBarHoverText(int x, int y) {
if (GuiHelper.isInRect(48, 6, 9, 46, x, y)) {
ArrayList<String> internal = new ArrayList<String>();
internal.add(StatCollector.translateToLocal("gui.de.internalStorage.txt"));
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.energy.getEnergyStored() + "/" + tile.energy.getMaxEnergyStored());
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.energy.getEnergyStored() + "/"
+ tile.energy.getMaxEnergyStored());
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
GL11.glPopAttrib();
}
if (GuiHelper.isInRect(118, 6, 10, 46, x, y) && tile.running && tile.getStackInSlot(0) != null && tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
IEnergyContainerItem item = (IEnergyContainerItem) tile.getStackInSlot(0).getItem();
if (GuiHelper.isInRect(118, 6, 10, 46, x, y)
&& tile.running
&& tile.getStackInSlot(0) != null
&& tile.getStackInSlot(0).getItem() instanceof IEnergyContainerItem) {
IEnergyContainerItem item =
(IEnergyContainerItem) tile.getStackInSlot(0).getItem();
ArrayList<String> internal = new ArrayList<String>();
internal.add(StatCollector.translateToLocal("gui.de.itemStorage.txt"));
internal.add("" + EnumChatFormatting.DARK_BLUE + item.getEnergyStored(tile.getStackInSlot(0)) + "/" + item.getMaxEnergyStored(tile.getStackInSlot(0)));
internal.add("" + EnumChatFormatting.DARK_BLUE + item.getEnergyStored(tile.getStackInSlot(0)) + "/"
+ item.getMaxEnergyStored(tile.getStackInSlot(0)));
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
GL11.glPopAttrib();
@@ -126,7 +144,7 @@ public class GUIEnergyInfuser extends GuiContainer {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glTranslatef(guiLeft + 62, guiTop + 4, 0);
{//Draw Ring
{ // Draw Ring
GL11.glTranslatef(26, 26, 0);
GL11.glRotatef(rotation, 0, 0, 1);
GL11.glTranslatef(-26, -26, 0);
@@ -169,12 +187,9 @@ public class GUIEnergyInfuser extends GuiContainer {
drawTexturedModalRect(0, 0, 0, 173, 26, 8);
}
}
}
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
@@ -4,15 +4,14 @@ import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.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;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Brandon on 30/6/2015.
*/
@@ -46,24 +45,60 @@ public class GUIFlowGate extends GuiScreen {
drawDefaultBackground();
ResourceHandler.bindResource("textures/gui/ToolConfig.png");
drawTexturedModalRect(guiLeft, guiTop, 0, 0, 197, 88);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.flowGate.name"), guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGate.name")) / 2), guiTop + 5, 0x2c2c2c);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.flowGate.name"),
guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGate.name")) / 2),
guiTop + 5,
0x2c2c2c);
if (!tile.flowOverridden) {
String flowRSLow = tile.getFlowSetting(0);
String flowRSHeigh = tile.getFlowSetting(1);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"), guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSHigh.name")) / 2), guiTop + 20, 0xff0000);
fontRendererObj.drawString(flowRSHeigh, guiCrt - (fontRendererObj.getStringWidth(flowRSHeigh) / 2), guiTop + 31, 0x2c2c2c);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.flowGateRSLow.name"), guiCrt - (fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.flowGateRSLow.name")) / 2), guiTop + 50, 0x660000);
fontRendererObj.drawString(flowRSLow, guiCrt - (fontRendererObj.getStringWidth(flowRSLow) / 2), guiTop + 61, 0x2c2c2c);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"),
guiCrt
- (fontRendererObj.getStringWidth(
StatCollector.translateToLocal("gui.de.flowGateRSHigh.name"))
/ 2),
guiTop + 20,
0xff0000);
fontRendererObj.drawString(
flowRSHeigh, guiCrt - (fontRendererObj.getStringWidth(flowRSHeigh) / 2), guiTop + 31, 0x2c2c2c);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.flowGateRSLow.name"),
guiCrt
- (fontRendererObj.getStringWidth(
StatCollector.translateToLocal("gui.de.flowGateRSLow.name"))
/ 2),
guiTop + 50,
0x660000);
fontRendererObj.drawString(
flowRSLow, guiCrt - (fontRendererObj.getStringWidth(flowRSLow) / 2), guiTop + 61, 0x2c2c2c);
} else
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.flowGateOverridden.txt"), width / 2, height / 2 - 30, 0x00FF00);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("gui.de.flowGateOverridden.txt"),
width / 2,
height / 2 - 30,
0x00FF00);
String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": " + Utills.addCommas(tile.getActualFlow());
String flow = StatCollector.translateToLocal("gui.de.flowGateCurrentFlow.name") + ": "
+ Utills.addCommas(tile.getActualFlow());
fontRendererObj.drawString(flow, guiCrt - (fontRendererObj.getStringWidth(flow) / 2), guiTop + 76, 0x2c2c2c);
if (!tile.flowOverridden) {
fontRendererObj.drawSplitString(StatCollector.translateToLocal("gui.de.flowGatePartialSignal.name"), guiLeft + 5, guiTop + 90, 197, 0xFFFFFF);
fontRendererObj.drawSplitString(StatCollector.translateToLocal("gui.de.ctrlAndShift.name"), guiLeft + 200, guiTop + 5, 100, 0xFFFFFF);
fontRendererObj.drawSplitString(
StatCollector.translateToLocal("gui.de.flowGatePartialSignal.name"),
guiLeft + 5,
guiTop + 90,
197,
0xFFFFFF);
fontRendererObj.drawSplitString(
StatCollector.translateToLocal("gui.de.ctrlAndShift.name"),
guiLeft + 200,
guiTop + 5,
100,
0xFFFFFF);
ResourceHandler.bindResource("textures/gui/Widgets.png");
super.drawScreen(x, y, pt);
@@ -73,22 +108,36 @@ public class GUIFlowGate extends GuiScreen {
boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
if (GuiHelper.isInRect(guiLeft + 20, guiTop + 20, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " " + tile.getToolTip(1, shift, ctrl));
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " "
+ tile.getToolTip(1, shift, ctrl));
}
if (GuiHelper.isInRect(guiLeft + 159, guiTop + 20, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " " + tile.getToolTip(1, shift, ctrl));
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " "
+ tile.getToolTip(1, shift, ctrl));
}
if (GuiHelper.isInRect(guiLeft + 20, guiTop + 50, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " " + tile.getToolTip(0, shift, ctrl));
hoverText.add(StatCollector.translateToLocal("gui.de.decrement.name") + " "
+ tile.getToolTip(0, shift, ctrl));
}
if (GuiHelper.isInRect(guiLeft + 159, guiTop + 50, 18, 18, x, y)) {
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " " + tile.getToolTip(0, shift, ctrl));
hoverText.add(StatCollector.translateToLocal("gui.de.increment.name") + " "
+ tile.getToolTip(0, shift, ctrl));
}
if (!hoverText.isEmpty()) {
hoverText.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("gui.de.pressOrScroll.name"));
drawHoveringText(hoverText, x - (x < width / 2 ? fontRendererObj.getStringWidth(StatCollector.translateToLocal("gui.de.decrement.name") + " " + tile.getToolTip(1, shift, ctrl)) + 25 : 0), y, fontRendererObj);
drawHoveringText(
hoverText,
x
- (x < width / 2
? fontRendererObj.getStringWidth(
StatCollector.translateToLocal("gui.de.decrement.name") + " "
+ tile.getToolTip(1, shift, ctrl))
+ 25
: 0),
y,
fontRendererObj);
}
}
}
@@ -155,5 +204,4 @@ public class GUIFlowGate extends GuiScreen {
this.mc.setIngameFocus();
}
}
}
@@ -1,11 +1,12 @@
package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.common.container.ContainerGenerator;
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 net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -16,8 +17,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
@SideOnly(Side.CLIENT)
public class GUIGenerator extends GuiContainer {
@@ -35,7 +34,8 @@ public class GUIGenerator extends GuiContainer {
this.player = invPlayer.player;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) {
@@ -43,16 +43,31 @@ public class GUIGenerator extends GuiContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18); // fuel box
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18); // flame box
if (tile.getStackInSlot(0) == null)
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel box
float power = (float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) * -1 + 1;
float power = (float) tile.getEnergyStored(ForgeDirection.DOWN)
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)
* -1
+ 1;
float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1;
drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int) (power * 40), xSize, 0 + (int) (power * 40), 12, 40 - (int) (power * 40));//Power bar
drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int) (fuel * 13), xSize, 40 + (int) (fuel * 13), 18, 18 - (int) (fuel * 13));//Power bar
drawTexturedModalRect(
guiLeft + 83,
guiTop + 11 + (int) (power * 40),
xSize,
0 + (int) (power * 40),
12,
40 - (int) (power * 40)); // Power bar
drawTexturedModalRect(
guiLeft + 100,
guiTop + 37 + (int) (fuel * 13),
xSize,
40 + (int) (fuel * 13),
18,
18 - (int) (fuel * 13)); // Power bar
fontRendererObj.drawStringWithShadow("Generator", guiLeft + 64, guiTop + 0, 0x00FFFF);
@@ -61,7 +76,8 @@ public class GUIGenerator extends GuiContainer {
if (GuiHelper.isInRect(83, 10, 12, 40, x, y)) {
ArrayList<String> internal = new ArrayList<String>();
internal.add("Internal Storage");
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/"
+ tile.getMaxEnergyStored(ForgeDirection.UP));
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
}
}
@@ -71,28 +87,25 @@ public class GUIGenerator extends GuiContainer {
int x = X - guiLeft;
int y = Y - guiTop;
/* if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) {
ArrayList<String> internal = new ArrayList<String>();
internal.add("Internal Storage");
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
drawHoveringText(internal, x, y, fontRendererObj);
}
*/
/* if (GuiHelper.isInRect(83, 10, 95, 50, x, y)) {
ArrayList<String> internal = new ArrayList<String>();
internal.add("Internal Storage");
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
drawHoveringText(internal, x, y, fontRendererObj);
}
*/
}
@Override
public void initGui() {
super.initGui();
//ID
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
// ID
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
}
@Override
protected void actionPerformed(GuiButton button) {
}
protected void actionPerformed(GuiButton button) {}
@Override
public void updateScreen() {
@@ -102,9 +115,8 @@ public class GUIGenerator extends GuiContainer {
guiUpdateTick = 0;
}
super.updateScreen();
}
// ####Draw at############ read from size
//drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
// drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
}
@@ -1,11 +1,12 @@
package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.common.container.ContainerGrinder;
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 net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
@@ -16,8 +17,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
@SideOnly(Side.CLIENT)
public class GUIGrinder extends GuiContainer {
@@ -35,7 +34,8 @@ public class GUIGrinder extends GuiContainer {
this.player = invPlayer.player;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/GGrinder.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y) {
@@ -43,21 +43,39 @@ public class GUIGrinder extends GuiContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (!tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box
if (!tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18); // fuel box
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18); // flame box
if (tile.getStackInSlot(0) == null && !tile.isExternallyPowered())
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18); // fuel box
float power;
if (tile.isExternallyPowered()) {
power = (float) tile.getEnergyStored(ForgeDirection.DOWN) / (float) tile.getMaxEnergyStored(ForgeDirection.DOWN) * -1 + 1;
power = (float) tile.getEnergyStored(ForgeDirection.DOWN)
/ (float) tile.getMaxEnergyStored(ForgeDirection.DOWN)
* -1
+ 1;
} else {
power = (float) tile.getInternalBuffer().getEnergyStored() / (float) tile.getInternalBuffer().getMaxEnergyStored() * -1 + 1;
power = (float) tile.getInternalBuffer().getEnergyStored()
/ (float) tile.getInternalBuffer().getMaxEnergyStored()
* -1
+ 1;
}
float fuel = tile.burnTimeRemaining / ((float) tile.burnTime) * -1 + 1;
drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int) (power * 40), xSize, 0 + (int) (power * 40), 12, 40 - (int) (power * 40));//Power bar
drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int) (fuel * 13), xSize, 40 + (int) (fuel * 13), 18, 18 - (int) (fuel * 13));//Power bar
drawTexturedModalRect(
guiLeft + 83,
guiTop + 11 + (int) (power * 40),
xSize,
0 + (int) (power * 40),
12,
40 - (int) (power * 40)); // Power bar
drawTexturedModalRect(
guiLeft + 100,
guiTop + 37 + (int) (fuel * 13),
xSize,
40 + (int) (fuel * 13),
18,
18 - (int) (fuel * 13)); // Power bar
if (tile.isExternallyPowered()) drawTexturedModalRect(guiLeft + 100, guiTop + 37, xSize, 66, 13, 13);
fontRendererObj.drawStringWithShadow("Grinder", guiLeft + 71, guiTop + 0, 0x00FFFF);
@@ -68,9 +86,12 @@ public class GUIGrinder extends GuiContainer {
ArrayList<String> internal = new ArrayList<String>();
internal.add("Energy Buffer");
if (tile.isExternallyPowered()) {
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/" + tile.getMaxEnergyStored(ForgeDirection.UP));
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getEnergyStored(ForgeDirection.UP) + "/"
+ tile.getMaxEnergyStored(ForgeDirection.UP));
} else {
internal.add("" + EnumChatFormatting.DARK_BLUE + tile.getInternalBuffer().getEnergyStored() + "/" + tile.getInternalBuffer().getMaxEnergyStored());
internal.add("" + EnumChatFormatting.DARK_BLUE
+ tile.getInternalBuffer().getEnergyStored() + "/"
+ tile.getInternalBuffer().getMaxEnergyStored());
}
drawHoveringText(internal, x + guiLeft, y + guiTop, fontRendererObj);
}
@@ -78,9 +99,9 @@ public class GUIGrinder extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
}
@@ -88,15 +109,12 @@ public class GUIGrinder extends GuiContainer {
public void initGui() {
super.initGui();
//ID
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
// ID
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
}
@Override
protected void actionPerformed(GuiButton button) {
}
protected void actionPerformed(GuiButton button) {}
@Override
public void updateScreen() {
@@ -106,9 +124,8 @@ public class GUIGrinder extends GuiContainer {
guiUpdateTick = 0;
}
super.updateScreen();
}
// ####Draw at############ read from size
//drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
// drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
}
@@ -16,12 +16,13 @@ import org.lwjgl.opengl.GL11;
public class GUIParticleGenerator extends GuiScreen {
private final int xSize = 212;
private final int ySize = 198;
private ResourceLocation guiTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/ParticleGenerator.png");
private ResourceLocation guiTexture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/ParticleGenerator.png");
private int page = 1;
private int infoPage = 0;
private boolean hasInitialized = false;
//Particle variables
// Particle variables
private boolean particles_enabled = true;
private int red = 0;
@@ -53,7 +54,7 @@ public class GUIParticleGenerator extends GuiScreen {
private int selected_max = 3;
private float gravity = 0F;
//Beam variables
// Beam variables
private boolean beam_enabled = false;
private boolean render_core = false;
@@ -66,11 +67,10 @@ public class GUIParticleGenerator extends GuiScreen {
private float beam_length = 0F;
private float beam_rotation = 0F;
// Buttons
//Buttons
//Info Page
//particle selection
// Info Page
// particle selection
private TileParticleGenerator tile;
@@ -80,9 +80,34 @@ public class GUIParticleGenerator extends GuiScreen {
syncWithServer();
}
String[] InfoText = {"" + "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. " + "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 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 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 \"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 \"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 \"Gravity\" field sets how the particle is affected by gravity. " + "-\"Block Collision\" Toggles weather or not the particle will collide with blocks " + "-\"Particle Selected\" Switches between the different particles available.", EnumChatFormatting.DARK_RED + " Redstone Control" + EnumChatFormatting.BLACK + "\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." + "\nThe redstone mode is indicated by the 8 cubes at the corners of the block.", EnumChatFormatting.DARK_RED + " Computer Control" + EnumChatFormatting.BLACK + "\nThe Generator can be controlled via a computer" + "\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."};
String[] InfoText = {
""
+ "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. "
+ "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 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 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 \"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 \"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 \"Gravity\" field sets how the particle is affected by gravity. "
+ "-\"Block Collision\" Toggles weather or not the particle will collide with blocks "
+ "-\"Particle Selected\" Switches between the different particles available.",
EnumChatFormatting.DARK_RED + " Redstone Control" + EnumChatFormatting.BLACK
+ "\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."
+ "\nThe redstone mode is indicated by the 8 cubes at the corners of the block.",
EnumChatFormatting.DARK_RED + " Computer Control" + EnumChatFormatting.BLACK
+ "\nThe Generator can be controlled via a computer" + "\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
public void drawScreen(int x, int y, float f) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -109,7 +134,7 @@ public class GUIParticleGenerator extends GuiScreen {
super.drawScreen(x, y, f);
}
//@formatter:on
// @formatter:on
@Override
protected void mouseClicked(int x, int y, int button) {
@@ -137,8 +162,6 @@ public class GUIParticleGenerator extends GuiScreen {
if (page < 10) buttonList.add(new GuiButton(54, posX - 21, posY + 3, 20, 20, "i"));
else buttonList.add(new GuiButton(55, posX - 31, posY + 23, 30, 20, "Back"));
}
@Override
@@ -159,251 +182,252 @@ public class GUIParticleGenerator extends GuiScreen {
value_F = (value) / 1000F;
switch (button.id) {
case 0://Red +
case 0: // Red +
red = (red + value) > 255 ? 255 : red + value;
packetValue = (short) red;
break;
case 1://Green +
case 1: // Green +
green = (green + value) > 255 ? 255 : green + value;
packetValue = (short) green;
break;
case 2://Blue +
case 2: // Blue +
blue = (blue + value) > 255 ? 255 : blue + value;
packetValue = (short) blue;
break;
case 3://MX +
case 3: // MX +
motion_x = (motion_x + value_F) > 5F ? 5F : motion_x + value_F;
packetValue = (short) (motion_x * 1000F);
break;
case 4://MY +
case 4: // MY +
motion_y = (motion_y + value_F) > 5F ? 5F : motion_y + value_F;
packetValue = (short) (motion_y * 1000F);
break;
case 5://MZ +
case 5: // MZ +
motion_z = (motion_z + value_F) > 5F ? 5F : motion_z + value_F;
packetValue = (short) (motion_z * 1000F);
break;
case 6://Red -
case 6: // Red -
red = (red - value) < 0 ? 0 : red - value;
packetValue = (short) red;
break;
case 7://Green -
case 7: // Green -
green = (green - value) < 0 ? 0 : green - value;
packetValue = (short) green;
break;
case 8://Blue -
case 8: // Blue -
blue = (blue - value) < 0 ? 0 : blue - value;
packetValue = (short) blue;
break;
case 9://MX -
case 9: // MX -
motion_x = (motion_x - value_F) < -5F ? -5F : motion_x - value_F;
packetValue = (short) (motion_x * 1000F);
break;
case 10://MY -
case 10: // MY -
motion_y = (motion_y - value_F) < -5F ? -5F : motion_y - value_F;
packetValue = (short) (motion_y * 1000F);
break;
case 11://MZ -
case 11: // MZ -
motion_z = (motion_z - value_F) < -5F ? -5F : motion_z - value_F;
packetValue = (short) (motion_z * 1000F);
break;
case 12://RRed +
case 12: // RRed +
random_red = (random_red + value) > 255 ? 255 : random_red + value;
packetValue = (short) random_red;
break;
case 13://RGreen +
case 13: // RGreen +
random_green = (random_green + value) > 255 ? 255 : random_green + value;
packetValue = (short) random_green;
break;
case 14://RBlue +
case 14: // RBlue +
random_blue = (random_blue + value) > 255 ? 255 : random_blue + value;
packetValue = (short) random_blue;
break;
case 15://RMX +
case 15: // RMX +
random_motion_x = (random_motion_x + value_F) > 5F ? 5F : random_motion_x + value_F;
packetValue = (short) (random_motion_x * 1000F);
break;
case 16://RMY +
case 16: // RMY +
random_motion_y = (random_motion_y + value_F) > 5F ? 5F : random_motion_y + value_F;
packetValue = (short) (random_motion_y * 1000F);
break;
case 17://RMZ +
case 17: // RMZ +
random_motion_z = (random_motion_z + value_F) > 5F ? 5F : random_motion_z + value_F;
packetValue = (short) (random_motion_z * 1000F);
break;
case 18://RRed -
case 18: // RRed -
random_red = (random_red - value) < 0 ? 0 : random_red - value;
packetValue = (short) random_red;
break;
case 19://RGreen -
case 19: // RGreen -
random_green = (random_green - value) < 0 ? 0 : random_green - value;
packetValue = (short) random_green;
break;
case 20://RBlue -
case 20: // RBlue -
random_blue = (random_blue - value) < 0 ? 0 : random_blue - value;
packetValue = (short) random_blue;
break;
case 21://RMX -
case 21: // RMX -
random_motion_x = (random_motion_x - value_F) < -5F ? -5F : random_motion_x - value_F;
packetValue = (short) (random_motion_x * 1000F);
break;
case 22://RMY -
case 22: // RMY -
random_motion_y = (random_motion_y - value_F) < -5F ? -5F : random_motion_y - value_F;
packetValue = (short) (random_motion_y * 1000F);
break;
case 23://RMZ -
case 23: // RMZ -
random_motion_z = (random_motion_z - value_F) < -5F ? -5F : random_motion_z - value_F;
packetValue = (short) (random_motion_z * 1000F);
break;
case 24://Life +
case 24: // Life +
life = (life + value) > 1000 ? 1000 : life + value;
packetValue = (short) life;
break;
case 25://Life -
case 25: // Life -
life = (life - value) < 0 ? 0 : life - value;
packetValue = (short) life;
break;
case 26://RLife +
case 26: // RLife +
random_life = (random_life + value) > 1000 ? 1000 : random_life + value;
packetValue = (short) random_life;
break;
case 27://RLife -
case 27: // RLife -
random_life = (random_life - value) < 0 ? 0 : random_life - value;
packetValue = (short) random_life;
break;
case 28://Size +
case 28: // Size +
scale = (scale + value_F * 10F) > 50F ? 50F : scale + value_F * 10F;
packetValue = (short) (scale * 100F);
break;
case 29://Size -
case 29: // Size -
scale = (scale - value_F * 10F) < 0.01F ? 0.01F : scale - value_F * 10F;
packetValue = (short) (scale * 100F);
break;
case 30://RSize +
case 30: // RSize +
random_scale = (random_scale + value_F * 10F) > 50F ? 50F : random_scale + value_F * 10F;
packetValue = (short) (random_scale * 100F);
break;
case 31://RSize -
case 31: // RSize -
random_scale = (random_scale - value_F * 10F) < 0.0F ? 0.0F : random_scale - value_F * 10F;
packetValue = (short) (random_scale * 100F);
break;
case 32://Page 2
case 32: // Page 2
if (page > 1) page--;
packetValue = (short) page;
initGui();
break;
case 33://Page 1
case 33: // Page 1
if (page < 3) page++;
initGui();
packetValue = (short) page;
break;
case 34://SX +
case 34: // SX +
spawn_x = (spawn_x + value_F * 100F) > 50F ? 50F : spawn_x + value_F * 100F;
packetValue = (short) (spawn_x * 100F);
break;
case 35://SX -
case 35: // SX -
spawn_x = (spawn_x - value_F * 100F) < -50F ? -50F : spawn_x - value_F * 100F;
packetValue = (short) (spawn_x * 100F);
break;
case 36://RSX +
case 36: // RSX +
random_spawn_x = (random_spawn_x + value_F * 100F) > 50F ? 50F : random_spawn_x + value_F * 100F;
packetValue = (short) (random_spawn_x * 100F);
break;
case 37://RSX -
case 37: // RSX -
random_spawn_x = (random_spawn_x - value_F * 100F) < -50F ? -50F : random_spawn_x - value_F * 100F;
packetValue = (short) (random_spawn_x * 100F);
break;
case 38://SY +
case 38: // SY +
spawn_y = (spawn_y + value_F * 100F) > 50F ? 50F : spawn_y + value_F * 100F;
packetValue = (short) (spawn_y * 100F);
break;
case 39://SY -
case 39: // SY -
spawn_y = (spawn_y - value_F * 100F) < -50F ? -50F : spawn_y - value_F * 100F;
packetValue = (short) (spawn_y * 100F);
break;
case 40://RSY +
case 40: // RSY +
random_spawn_y = (random_spawn_y + value_F * 100F) > 50F ? 50F : random_spawn_y + value_F * 100F;
packetValue = (short) (random_spawn_y * 100F);
break;
case 41://RSY -
case 41: // RSY -
random_spawn_y = (random_spawn_y - value_F * 100F) < -50F ? -50F : random_spawn_y - value_F * 100F;
packetValue = (short) (random_spawn_y * 100F);
break;
case 42://SZ +
case 42: // SZ +
spawn_z = (spawn_z + value_F * 100F) > 50F ? 50F : spawn_z + value_F * 100F;
packetValue = (short) (spawn_z * 100F);
break;
case 43://SZ -
case 43: // SZ -
spawn_z = (spawn_z - value_F * 100F) < -50F ? -50F : spawn_z - value_F * 100F;
packetValue = (short) (spawn_z * 100F);
break;
case 44://RSZ +
case 44: // RSZ +
random_spawn_z = (random_spawn_z + value_F * 100F) > 50F ? 50F : random_spawn_z + value_F * 100F;
packetValue = (short) (random_spawn_z * 100F);
break;
case 45://RSZ -
case 45: // RSZ -
random_spawn_z = (random_spawn_z - value_F * 100F) < -50F ? -50F : random_spawn_z - value_F * 100F;
packetValue = (short) (random_spawn_z * 100F);
break;
case 46://Delay +
case 46: // Delay +
spawn_rate = (spawn_rate + value) > 200 ? 200 : spawn_rate + value;
packetValue = (short) spawn_rate;
break;
case 47://Delay -
case 47: // Delay -
spawn_rate = (spawn_rate - value) < 1 ? 1 : spawn_rate - value;
packetValue = (short) spawn_rate;
break;
case 48://Fade +
case 48: // Fade +
fade = (fade + value) > 100 ? 100 : fade + value;
packetValue = (short) fade;
break;
case 49://Fade -
case 49: // Fade -
fade = (fade - value) < 0 ? 0 : fade - value;
packetValue = (short) fade;
break;
case 50://Toggle Collision
case 50: // Toggle Collision
collide = !collide;
packetValue = (short) (collide ? 1 : 0);
initGui();
break;
case 51://cycle particle selection
case 51: // cycle particle selection
selected_particle = selected_particle < selected_max ? selected_particle + 1 : 1;
packetValue = (short) selected_particle;
initGui();
break;
case 52://RSZ +
case 52: // RSZ +
gravity = (gravity + value_F) > 5F ? 5F : gravity + value_F;
packetValue = (short) (gravity * 1000F);
break;
case 53://RSZ -
case 53: // RSZ -
gravity = (gravity - value_F) < -5F ? -5F : gravity - value_F;
packetValue = (short) (gravity * 1000F);
break;
case 54://Info Page
case 54: // Info Page
page = 10;
initGui();
packetValue = (short) page;
break;
case 55://Back Page
case 55: // Back Page
page = 1;
initGui();
packetValue = (short) page;
break;
case 56://Info Next Page
case 56: // Info Next Page
if (infoPage < 5) infoPage++;
else initGui();
break;
case 57://Info Previous Page
case 57: // Info Previous Page
if (infoPage > 0) infoPage--;
else initGui();
break;
case 58://particles Enabled
case 58: // particles Enabled
particles_enabled = !particles_enabled;
packetValue = particles_enabled ? (byte) 1 : (byte) 0;
initGui();
break;
}
DraconicEvolution.network.sendToServer(new ParticleGenPacket((byte) button.id, packetValue, tile.xCoord, tile.yCoord, tile.zCoord));
DraconicEvolution.network.sendToServer(
new ParticleGenPacket((byte) button.id, packetValue, tile.xCoord, tile.yCoord, tile.zCoord));
}
@Override
@@ -415,8 +439,7 @@ public class GUIParticleGenerator extends GuiScreen {
}
@Override
public void updateScreen() {
}
public void updateScreen() {}
@Override
public boolean doesGuiPauseGame() {
@@ -466,7 +489,7 @@ public class GUIParticleGenerator extends GuiScreen {
beam_rotation = tile.beam_rotation;
}
//@formatter:off
// @formatter:off
private void page1Txt() {
int posX = (this.width - xSize) / 2;
int posY = (this.height - ySize) / 2;
@@ -567,8 +590,6 @@ public class GUIParticleGenerator extends GuiScreen {
buttonList.add(new GuiButton(23, posX + DX4, posY + y1 + 5 * 22, 20, 20, "-"));
buttonList.add(new GuiButton(27, posX + DX4, posY + y1 + 6 * 22, 20, 20, "-"));
buttonList.add(new GuiButton(31, posX + DX4, posY + y1 + 7 * 22, 20, 20, "-"));
}
private void page2Txt() {
@@ -611,7 +632,6 @@ public class GUIParticleGenerator extends GuiScreen {
fontRendererObj.drawString("" + fade, col1, posY + ln2 + 4 * 22, 0x000000, false);
fontRendererObj.drawString("Gravity:", col1, posY + ln1 + 5 * 22, 0x000000, false);
fontRendererObj.drawString(Gravity, col1, posY + ln2 + 5 * 22, 0x000000, false);
}
private void page2Buttons() {
@@ -645,10 +665,13 @@ public class GUIParticleGenerator extends GuiScreen {
buttonList.add(new GuiButton(41, posX + DX4, posY + y1 + 1 * 22, 20, 20, "-"));
buttonList.add(new GuiButton(45, posX + DX4, posY + y1 + 2 * 22, 20, 20, "-"));
buttonList.add(new GuiButton(50, posX + DX3 - 11, posY + y1 + 3 * 22, 102, 20, "Block Collision: " + (collide ? "on" : "off")));
buttonList.add(new GuiButton(51, posX + DX3 - 11, posY + y1 + 4 * 22, 102, 20, "Particle Selected: " + selected_particle));
buttonList.add(new GuiButton(
50, posX + DX3 - 11, posY + y1 + 3 * 22, 102, 20, "Block Collision: " + (collide ? "on" : "off")));
buttonList.add(new GuiButton(
51, posX + DX3 - 11, posY + y1 + 4 * 22, 102, 20, "Particle Selected: " + selected_particle));
buttonList.add(new GuiButton(58, posX + DX3 - 11, posY + y1 + 5 * 22, 102, 20, "Enabled: " + (particles_enabled ? "on" : "off")));
buttonList.add(new GuiButton(
58, posX + DX3 - 11, posY + y1 + 5 * 22, 102, 20, "Enabled: " + (particles_enabled ? "on" : "off")));
}
private void page3Txt() {
@@ -683,13 +706,12 @@ public class GUIParticleGenerator extends GuiScreen {
fontRendererObj.drawString(rotation, col1, posY + ln2 + 6 * 22, 0x000000, false);
fontRendererObj.drawString("Scale:", col1, posY + ln1 + 7 * 22, 0x000000, false);
fontRendererObj.drawString(scale, col1, posY + ln2 + 7 * 22, 0x000000, false);
}
private void page3Buttons() {
int posX = (this.width - xSize) / 2;
int posY = (this.height - ySize) / 2;
int DX1 = 5;//x pos for row 1,2,3,4
int DX1 = 5; // x pos for row 1,2,3,4
int DX2 = DX1 + 71;
int DX3 = DX2 + 40;
int DX4 = DX3 + 71;
@@ -713,9 +735,10 @@ public class GUIParticleGenerator extends GuiScreen {
buttonList.add(new GuiButton(114, posX + DX2, posY + y1 + 6 * 22, 20, 20, "-"));
buttonList.add(new GuiButton(115, posX + DX2, posY + y1 + 7 * 22, 20, 20, "-"));
buttonList.add(new GuiButton(116, posX + DX3 - 11, posY + y1 + 0 * 22, 102, 20, "Enabled: " + (beam_enabled ? "on" : "off")));
buttonList.add(new GuiButton(117, posX + DX3 - 11, posY + y1 + 1 * 22, 102, 20, "Render Core: " + (render_core ? "on" : "off")));
buttonList.add(new GuiButton(
116, posX + DX3 - 11, posY + y1 + 0 * 22, 102, 20, "Enabled: " + (beam_enabled ? "on" : "off")));
buttonList.add(new GuiButton(
117, posX + DX3 - 11, posY + y1 + 1 * 22, 102, 20, "Render Core: " + (render_core ? "on" : "off")));
buttonList.add(new GuiButton(127, posX + DX3 - 11, posY + y1 + 7 * 22, 102, 20, "Take note of values"));
}
@@ -732,84 +755,84 @@ public class GUIParticleGenerator extends GuiScreen {
value_F = (value) / 100F;
switch (button.id) {
case 100: //beam red +
case 100: // beam red +
beam_red = (beam_red + value) > 255 ? 255 : beam_red + value;
packetValue = (short) beam_red;
break;
case 101: //beam green +
case 101: // beam green +
beam_green = (beam_green + value) > 255 ? 255 : beam_green + value;
packetValue = (short) beam_green;
break;
case 102: //beam blue +
case 102: // beam blue +
beam_blue = (beam_blue + value) > 255 ? 255 : beam_blue + value;
packetValue = (short) beam_blue;
break;
case 103: //beam pitch +
case 103: // beam pitch +
beam_pitch = (beam_pitch + value_F) > 180F ? 180F : beam_pitch + value_F;
packetValue = (short) (beam_pitch * 100F);
break;
case 104: //beam yaw +
case 104: // beam yaw +
beam_yaw = (beam_yaw + value_F) > 180F ? 180F : beam_yaw + value_F;
packetValue = (short) (beam_yaw * 100F);
break;
case 105: //beam length +
case 105: // beam length +
beam_length = (beam_length + value_F) > 320F ? 320F : beam_length + value_F;
packetValue = (short) (beam_length * 100F);
break;
case 106: //beam rotation +
case 106: // beam rotation +
beam_rotation = (beam_rotation + value_F) > 1F ? 1F : beam_rotation + value_F;
packetValue = (short) (beam_rotation * 100F);
break;
case 107: //beam scale +
case 107: // beam scale +
beam_scale = (beam_scale + value_F) > 5F ? 5F : beam_scale + value_F;
packetValue = (short) (beam_scale * 100F);
break;
case 108: //beam red -
case 108: // beam red -
beam_red = (beam_red - value) < 0 ? 0 : beam_red - value;
packetValue = (short) beam_red;
break;
case 109: //beam green -
case 109: // beam green -
beam_green = (beam_green - value) < 0 ? 0 : beam_green - value;
packetValue = (short) beam_green;
break;
case 110: //beam blue -
case 110: // beam blue -
beam_blue = (beam_blue - value) < 0 ? 0 : beam_blue - value;
packetValue = (short) beam_blue;
break;
case 111: //beam pitch -
case 111: // beam pitch -
beam_pitch = (beam_pitch - value_F) < -180F ? -180F : beam_pitch - value_F;
packetValue = (short) (beam_pitch * 100F);
break;
case 112: //beam yaw -
case 112: // beam yaw -
beam_yaw = (beam_yaw - value_F) < -180F ? -180F : beam_yaw - value_F;
packetValue = (short) (beam_yaw * 100F);
break;
case 113: //beam length -
case 113: // beam length -
beam_length = (beam_length - value_F) < -0F ? -0F : beam_length - value_F;
packetValue = (short) (beam_length * 100F);
break;
case 114: //beam rotation -
case 114: // beam rotation -
beam_rotation = (beam_rotation - value_F) < -1F ? -1F : beam_rotation - value_F;
packetValue = (short) (beam_rotation * 100F);
break;
case 115: //beam scale -
case 115: // beam scale -
beam_scale = (beam_scale - value_F) < -0F ? -0F : beam_scale - value_F;
packetValue = (short) (beam_scale * 100F);
break;
case 116: //beam enabled
case 116: // beam enabled
beam_enabled = !beam_enabled;
packetValue = beam_enabled ? (byte) 1 : (byte) 0;
initGui();
break;
case 117: //beam enabled
case 117: // beam enabled
render_core = !render_core;
packetValue = render_core ? (byte) 1 : (byte) 0;
initGui();
break;
}
DraconicEvolution.network.sendToServer(new ParticleGenPacket((byte) button.id, packetValue, tile.xCoord, tile.yCoord, tile.zCoord));
DraconicEvolution.network.sendToServer(
new ParticleGenPacket((byte) button.id, packetValue, tile.xCoord, tile.yCoord, tile.zCoord));
}
//@formatter:on
// @formatter:on
}
@@ -2,12 +2,13 @@ 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.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TilePlayerDetectorAdvanced;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
@@ -17,8 +18,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
@SideOnly(Side.CLIENT)
public class GUIPlayerDetector extends GuiContainer {
@@ -40,8 +39,7 @@ public class GUIPlayerDetector extends GuiContainer {
super(detector.getGuiContainer(invPlayer));
this.inventorySlots = new ContainerPlayerDetector(invPlayer, detector, this);
for (int i = 0; i < names.length; i++)
names[i] = "";
for (int i = 0; i < names.length; i++) names[i] = "";
xSize = 176;
ySize = 198;
@@ -51,7 +49,8 @@ public class GUIPlayerDetector extends GuiContainer {
syncWithServer();
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/PlayerDetector.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/PlayerDetector.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -65,14 +64,11 @@ public class GUIPlayerDetector extends GuiContainer {
}
if (showInvSlots) drawTexturedModalRect(guiLeft + 142, guiTop + 19, xSize, 0, 23, 41);
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
drawGuiText(x, y);
}
@Override
@@ -107,42 +103,42 @@ public class GUIPlayerDetector extends GuiContainer {
selectedNameText.setMaxStringLength(40);
selectedNameText.setVisible(editMode);
//ID
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, "sgASGgs"));
// ID
// buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, "sgASGgs"));
//syncWithServer();
// syncWithServer();
}
@Override
protected void actionPerformed(GuiButton button) {
switch (button.id) {
case 0: //Range +
case 0: // Range +
range = (range < maxRange) ? range + 1 : maxRange;
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 0, (byte) range));
break;
case 1: //Range -
case 1: // Range -
range = (range > 1) ? range - 1 : 1;
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 0, (byte) range));
break;
case 3: //White List -
case 3: // White List -
initScedualed = true;
editMode = true;
showInvSlots = false;
((ContainerPlayerDetector) this.inventorySlots).updateContainerSlots();
break;
case 4: //Toggle White List -
case 4: // Toggle White List -
whitelist = !whitelist;
initScedualed = true;
byte val = (byte) (whitelist ? 1 : 0);
DraconicEvolution.network.sendToServer(new PlayerDetectorButtonPacket((byte) 1, val));
break;
case 5: //Back -
case 5: // Back -
editMode = false;
showInvSlots = true;
((ContainerPlayerDetector) this.inventorySlots).updateContainerSlots();
initScedualed = true;
break;
case 6: //Back -
case 6: // Back -
outputInverted = !outputInverted;
initScedualed = true;
byte val2 = (byte) (outputInverted ? 1 : 0);
@@ -150,7 +146,7 @@ public class GUIPlayerDetector extends GuiContainer {
break;
}
//DraconicEvolution.channelHandler.sendToServer(new ButtonPacket((byte) 0, true));
// DraconicEvolution.channelHandler.sendToServer(new ButtonPacket((byte) 0, true));
}
@@ -162,7 +158,8 @@ public class GUIPlayerDetector extends GuiContainer {
names[selected] = selectedNameText.getText();
selectedNameText.setText("");
selectedNameText.setFocused(false);
DraconicEvolution.network.sendToServer(new PlayerDetectorStringPacket((byte) selected, names[selected]));
DraconicEvolution.network.sendToServer(
new PlayerDetectorStringPacket((byte) selected, names[selected]));
selected = -1;
}
} else super.keyTyped(par1, par2);
@@ -185,7 +182,7 @@ public class GUIPlayerDetector extends GuiContainer {
if (editMode) selectName(x - guiLeft, y - guiTop);
//this.selectedNameText.mouseClicked(x - guiLeft, y - guiTop, par3);
// this.selectedNameText.mouseClicked(x - guiLeft, y - guiTop, par3);
}
private void drawGuiText(int rawX, int rawY) {
@@ -223,7 +220,8 @@ public class GUIPlayerDetector extends GuiContainer {
for (int i = 0; i < 21; i++) {
for (int j = 0; j < 2; j++) {
if ((x > 4 + j * 84 && x < (xSize / 2) - 1 + j * 82) && (y > 4 + i * 9 && y < 13 + i * 9) || i + j * 21 == selected)
if ((x > 4 + j * 84 && x < (xSize / 2) - 1 + j * 82) && (y > 4 + i * 9 && y < 13 + i * 9)
|| i + j * 21 == selected)
drawTexturedModalRect(guiLeft + 5 + j * 84, guiTop + 5 + i * 9, 0, ySize + 10, 82, 8);
}
}
@@ -1,21 +1,19 @@
package com.brandon3055.draconicevolution.client.gui;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerSunDial;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
import com.brandon3055.draconicevolution.common.tileentities.TileSunDial;
import cpw.mods.fml.relauncher.Side;
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;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerSunDial;
import com.brandon3055.draconicevolution.common.network.TeleporterPacket;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileSunDial;
@SideOnly(Side.CLIENT)
public class GUISunDial extends GuiContainer {
@@ -26,7 +24,6 @@ public class GUISunDial extends GuiContainer {
xSize = 176;
ySize = 90;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID, "textures/gui/SunDial.png");
@@ -37,21 +34,20 @@ public class GUISunDial extends GuiContainer {
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
// fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
}
@Override
public void initGui() {
super.initGui();
//ID
// ID
buttonList.add(new GuiButton(0, guiLeft + 10, guiTop + 10, 85, 20, ""));
}
@@ -60,7 +56,6 @@ public class GUISunDial extends GuiContainer {
if (button.id == 0) {
DraconicEvolution.network.sendToServer(new TeleporterPacket());
}
}
@Override
@@ -72,6 +67,4 @@ public class GUISunDial extends GuiContainer {
}
super.updateScreen();
}
}
@@ -10,6 +10,8 @@ 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.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -26,14 +28,12 @@ import net.minecraft.util.StatCollector;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.List;
@SideOnly(Side.CLIENT)
public class GUITeleporter extends GuiScreen {
private final int xSize = 182;
private final int ySize = 141;
private ResourceLocation guiTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/TeleporterMKII.png");
private ResourceLocation guiTexture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/TeleporterMKII.png");
private ItemStack teleporterItem;
protected List<TeleportLocation> locations = new ArrayList<TeleportLocation>(0);
@@ -52,7 +52,8 @@ public class GUITeleporter extends GuiScreen {
public GUITeleporter(EntityPlayer player) {
super();
this.player = player;
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII))) {
if (player.getCurrentEquippedItem() != null
&& player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII))) {
this.teleporterItem = player.getCurrentEquippedItem();
readDataFromItem(teleporterItem);
}
@@ -82,7 +83,11 @@ public class GUITeleporter extends GuiScreen {
String colour = EnumChatFormatting.GREEN + "";
if (fuel < 10) colour = EnumChatFormatting.YELLOW + "";
if (fuel == 0) colour = EnumChatFormatting.DARK_RED + "";
fontRendererObj.drawString(colour + StatCollector.translateToLocal("info.teleporterInfFuel.txt") + " " + fuel, posX + 115, posY + 87, 0x000000);
fontRendererObj.drawString(
colour + StatCollector.translateToLocal("info.teleporterInfFuel.txt") + " " + fuel,
posX + 115,
posY + 87,
0x000000);
super.drawScreen(x, y, f);
@@ -162,10 +167,30 @@ public class GUITeleporter extends GuiScreen {
int posX = (this.width - xSize) / 2;
int posY = (this.height - ySize) / 2;
if (locations.size() <= 0) return;
fontRendererObj.drawString(EnumChatFormatting.GOLD + "X: " + (int) getLocationSafely(selected + selectionOffset).getXCoord(), posX + 114, posY + 7, 0x000000);
fontRendererObj.drawString(EnumChatFormatting.GOLD + "Y: " + (int) getLocationSafely(selected + selectionOffset).getYCoord(), posX + 114, posY + 16, 0x000000);
fontRendererObj.drawString(EnumChatFormatting.GOLD + "Z: " + (int) getLocationSafely(selected + selectionOffset).getZCoord(), posX + 114, posY + 25, 0x000000);
fontRendererObj.drawString(EnumChatFormatting.GOLD + "" + getLocationSafely(selected + selectionOffset).getDimensionName(), posX + 114, posY + 34, 0x000000);
fontRendererObj.drawString(
EnumChatFormatting.GOLD + "X: "
+ (int) getLocationSafely(selected + selectionOffset).getXCoord(),
posX + 114,
posY + 7,
0x000000);
fontRendererObj.drawString(
EnumChatFormatting.GOLD + "Y: "
+ (int) getLocationSafely(selected + selectionOffset).getYCoord(),
posX + 114,
posY + 16,
0x000000);
fontRendererObj.drawString(
EnumChatFormatting.GOLD + "Z: "
+ (int) getLocationSafely(selected + selectionOffset).getZCoord(),
posX + 114,
posY + 25,
0x000000);
fontRendererObj.drawString(
EnumChatFormatting.GOLD + ""
+ getLocationSafely(selected + selectionOffset).getDimensionName(),
posX + 114,
posY + 34,
0x000000);
}
@Override
@@ -178,7 +203,7 @@ public class GUITeleporter extends GuiScreen {
if (textBeingEdited.getVisible()) textBeingEdited.mouseClicked(x, y, button);
//Check for arrow click
// Check for arrow click
if (selectionOffset > 0 && GuiHelper.isInRect(3, 5, 13, 15, x - posX, y - posY)) {
selectionOffset--;
offsetChanged = true;
@@ -196,7 +221,7 @@ public class GUITeleporter extends GuiScreen {
}
}
//Check for location or lock clicked
// Check for location or lock clicked
for (int i = 0; i < Math.min(12, locations.size()); i++) {
if (GuiHelper.isInRect(17, 6 + i * 11, 80, 10, x - posX, y - posY)) {
if (!(getLocationSafely(i + selectionOffset).getWriteProtected() && editingExisting) && button == 0) {
@@ -212,22 +237,29 @@ public class GUITeleporter extends GuiScreen {
if (player.capabilities.isCreativeMode || fuel > 0) {
if (!player.capabilities.isCreativeMode) fuel--;
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.TELEPORT, i + selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.TELEPORT, i + selectionOffset, false));
}
}
}
if (GuiHelper.isInRect(99, 8 + i * 11, 8, 7, x - posX, y - posY)) {
getLocationSafely(i + selectionOffset).setWriteProtected(!getLocationSafely(i + selectionOffset).getWriteProtected());
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATELOCK, i + selectionOffset, getLocationSafely(i + selectionOffset).getWriteProtected()));
getLocationSafely(i + selectionOffset)
.setWriteProtected(
!getLocationSafely(i + selectionOffset).getWriteProtected());
DraconicEvolution.network.sendToServer(new TeleporterPacket(
TeleporterPacket.UPDATELOCK,
i + selectionOffset,
getLocationSafely(i + selectionOffset).getWriteProtected()));
}
}
if (selectionChanged)
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
if (offsetChanged)
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
updateButtons();
super.mouseClicked(x, y, button);
@@ -263,9 +295,11 @@ public class GUITeleporter extends GuiScreen {
}
if (selectionChanged)
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
if (offsetChanged)
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
super.handleMouseInput();
}
@@ -278,10 +312,13 @@ public class GUITeleporter extends GuiScreen {
if ((selected + selectionOffset) + 1 > locations.size()) {
selected = 0;
selectionOffset = 0;
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.CHANGESELECTION, selected, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.UPDATEOFFSET, selectionOffset, false));
}
if (locations.size() == 0 || getLocationSafely(selected + selectionOffset).getWriteProtected()) {
if (locations.size() == 0
|| getLocationSafely(selected + selectionOffset).getWriteProtected()) {
((GuiButton) buttonList.get(0)).enabled = false;
((GuiButton) buttonList.get(1)).enabled = false;
((GuiButton) buttonList.get(2)).enabled = false;
@@ -308,19 +345,27 @@ public class GUITeleporter extends GuiScreen {
int posX = (this.width - xSize) / 2;
int posY = (this.height - ySize) / 2;
//updateTeleporter();
// updateTeleporter();
buttonList.add(new GuiButtonAHeight(0, posX + 112, posY + 45, 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(
0, posX + 112, posY + 45, 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(3, posX + 112, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.UP.txt")));
buttonList.add(new GuiButtonAHeight(
3, posX + 112, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.UP.txt")));
buttonList.add(new GuiButtonAHeight(4, posX + 112, posY + 112, 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(
4, posX + 112, posY + 112, 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(7, posX + 112 + 34, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.DOWN.txt")));
buttonList.add(new GuiButtonAHeight(
7, posX + 112 + 34, posY + 99, 33, 12, StatCollector.translateToLocal("button.de.DOWN.txt")));
((GuiButton) buttonList.get(6)).visible = false;
textBeingEdited = new GuiTextField(fontRendererObj, posX + 3, posY - 14, xSize - 67, 12);
@@ -347,7 +392,8 @@ public class GUITeleporter extends GuiScreen {
if (!editingExisting) {
editingExisting = true;
textBeingEdited.setVisible(true);
textBeingEdited.setText(getLocationSafely(selected + selectionOffset).getName());
textBeingEdited.setText(
getLocationSafely(selected + selectionOffset).getName());
textBeingEdited.setSelectionPos(0);
textBeingEdited.setFocused(true);
((GuiButton) buttonList.get(6)).visible = true;
@@ -356,8 +402,10 @@ public class GUITeleporter extends GuiScreen {
getLocationSafely(selected + selectionOffset).setName(textBeingEdited.getText());
TeleportLocation location = new TeleportLocation();
location.setName(textBeingEdited.getText());
DraconicEvolution.network.sendToServer(new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset));
((GuiButton) buttonList.get(0)).displayString = StatCollector.translateToLocal("button.de.rename.txt");
DraconicEvolution.network.sendToServer(
new TeleporterPacket(location, TeleporterPacket.UPDATENAME, selected + selectionOffset));
((GuiButton) buttonList.get(0)).displayString =
StatCollector.translateToLocal("button.de.rename.txt");
editingExisting = false;
textBeingEdited.setVisible(false);
((GuiButton) buttonList.get(6)).visible = false;
@@ -366,13 +414,22 @@ public class GUITeleporter extends GuiScreen {
}
if (button.id == 1) {
TeleportLocation location = new TeleportLocation(player.posX, player.posY - 1.62, player.posZ, player.dimension, player.rotationPitch, player.rotationYaw, getLocationSafely(selected + selectionOffset).getName());
DraconicEvolution.network.sendToServer(new TeleporterPacket(location, TeleporterPacket.UPDATEDESTINATION, selected + selectionOffset));
TeleportLocation location = new TeleportLocation(
player.posX,
player.posY - 1.62,
player.posZ,
player.dimension,
player.rotationPitch,
player.rotationYaw,
getLocationSafely(selected + selectionOffset).getName());
DraconicEvolution.network.sendToServer(
new TeleporterPacket(location, TeleporterPacket.UPDATEDESTINATION, selected + selectionOffset));
locations.set(selected + selectionOffset, location);
}
if (button.id == 2) {
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.REMOVEDESTINATION, selected + selectionOffset, false));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.REMOVEDESTINATION, selected + selectionOffset, false));
locations.remove(selected + selectionOffset);
if (selectionOffset > 0) selectionOffset--;
if (selected >= locations.size()) selected--;
@@ -395,7 +452,8 @@ public class GUITeleporter extends GuiScreen {
}
}
DraconicEvolution.network.sendToServer(new TeleporterPacket(TeleporterPacket.MOVELOCATION, selected + selectionOffset, button.id == 3));
DraconicEvolution.network.sendToServer(
new TeleporterPacket(TeleporterPacket.MOVELOCATION, selected + selectionOffset, button.id == 3));
}
if (button.id == 4 || button.id == 6 && !editingExisting) {
@@ -417,7 +475,8 @@ public class GUITeleporter extends GuiScreen {
} else {
if (!textBeingEdited.getText().isEmpty()) {
addCurrentLocationToList(textBeingEdited.getText());
((GuiButton) buttonList.get(4)).displayString = StatCollector.translateToLocal("button.de.addNew.txt");
((GuiButton) buttonList.get(4)).displayString =
StatCollector.translateToLocal("button.de.addNew.txt");
editingNew = false;
textBeingEdited.setVisible(false);
((GuiButton) buttonList.get(6)).visible = false;
@@ -455,11 +514,13 @@ public class GUITeleporter extends GuiScreen {
public void keyTyped(char key, int keyN) {
if (this.textBeingEdited.textboxKeyTyped(key, keyN)) {
if (editingNew) {
((GuiButton) buttonList.get(4)).enabled = !textBeingEdited.getText().isEmpty();
((GuiButton) buttonList.get(4)).enabled =
!textBeingEdited.getText().isEmpty();
((GuiButton) buttonList.get(4)).displayString = StatCollector.translateToLocal("button.de.commit.txt");
}
if (editingExisting) {
((GuiButton) buttonList.get(0)).enabled = !textBeingEdited.getText().isEmpty();
((GuiButton) buttonList.get(0)).enabled =
!textBeingEdited.getText().isEmpty();
((GuiButton) buttonList.get(0)).displayString = StatCollector.translateToLocal("button.de.commit.txt");
}
return;
@@ -476,13 +537,20 @@ public class GUITeleporter extends GuiScreen {
@Override
public void updateScreen() {
if (player.getCurrentEquippedItem() == null || !player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII)) || player.isDead) {
if (player.getCurrentEquippedItem() == null
|| !player.getCurrentEquippedItem().isItemEqual(new ItemStack(ModItems.teleporterMKII))
|| player.isDead) {
this.mc.displayGuiScreen(null);
this.mc.setIngameFocus();
}
if (tick % 5 == 0 && locations.size() > 0 && getLocationSafely(selected + selectionOffset).getDimensionName().equals("") && player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.teleporterMKII)
readDataFromItem(player.getHeldItem());
if (tick % 5 == 0
&& locations.size() > 0
&& getLocationSafely(selected + selectionOffset)
.getDimensionName()
.equals("")
&& player.getHeldItem() != null
&& player.getHeldItem().getItem() == ModItems.teleporterMKII) readDataFromItem(player.getHeldItem());
tick++;
if (tick >= 10) {
@@ -510,7 +578,9 @@ public class GUITeleporter extends GuiScreen {
for (int i = 0; i < list.tagCount(); i++) {
NBTTagCompound tagLocation = list.getCompoundTagAt(i);
//TeleportLocation location = new TeleportLocation(tagLocation.getDouble("X"), tagLocation.getDouble("Y"), tagLocation.getDouble("Z"), tagLocation.getInteger("Dimension"), tagLocation.getFloat("Pitch"), tagLocation.getFloat("Yaw"), tagLocation.getString("Name"));
// TeleportLocation location = new TeleportLocation(tagLocation.getDouble("X"), tagLocation.getDouble("Y"),
// tagLocation.getDouble("Z"), tagLocation.getInteger("Dimension"), tagLocation.getFloat("Pitch"),
// tagLocation.getFloat("Yaw"), tagLocation.getString("Name"));
TeleportLocation location = new TeleportLocation();
location.readFromNBT(tagLocation);
location.setWriteProtected(tagLocation.getBoolean("WP"));
@@ -519,7 +589,14 @@ public class GUITeleporter extends GuiScreen {
}
private void addCurrentLocationToList(String name) {
TeleportLocation currentLocation = new TeleportLocation(player.posX, player.posY - 1.62, player.posZ, player.dimension, player.rotationPitch, player.rotationYaw, name);
TeleportLocation currentLocation = new TeleportLocation(
player.posX,
player.posY - 1.62,
player.posZ,
player.dimension,
player.rotationPitch,
player.rotationYaw,
name);
DraconicEvolution.network.sendToServer(new TeleporterPacket(currentLocation, TeleporterPacket.ADDDESTINATION));
locations.add(currentLocation);
}
@@ -1,8 +1,5 @@
package com.brandon3055.draconicevolution.client.gui;
import java.util.ArrayList;
import java.util.List;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.ModItems;
@@ -12,6 +9,8 @@ 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.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiButton;
@@ -35,11 +34,11 @@ public class GUIUpgradeModifier extends GuiContainer {
private List<EnumUpgrade> itemUpgrades = new ArrayList<EnumUpgrade>();
private ContainerUpgradeModifier containerEM;
public GUIUpgradeModifier(InventoryPlayer invPlayer, TileUpgradeModifier tile, ContainerUpgradeModifier containerEM) {
public GUIUpgradeModifier(
InventoryPlayer invPlayer, TileUpgradeModifier tile, ContainerUpgradeModifier containerEM) {
super(containerEM);
this.containerEM = containerEM;
xSize = 176;
ySize = 190;
@@ -47,7 +46,6 @@ public class GUIUpgradeModifier extends GuiContainer {
this.player = invPlayer.player;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -90,14 +88,10 @@ public class GUIUpgradeModifier extends GuiContainer {
@Override
public void initGui() {
super.initGui();
}
@Override
protected void actionPerformed(GuiButton button) {
}
protected void actionPerformed(GuiButton button) {}
private int coreSlots = 0;
private int coreTier = 0;
@@ -159,24 +153,32 @@ public class GUIUpgradeModifier extends GuiContainer {
int[] appliedCores = upgrade.getCoresApplied(tile.getStackInSlot(0));
for (int i = 0; i <= coreTier; i++) {
//Check + buttons
if (coreInInventory[i] && coreSlots > usedSlots && GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y) && upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
// Check + buttons
if (coreInInventory[i]
&& coreSlots > usedSlots
&& GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y)
&& upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
containerEM.sendObjectToServer(null, upgrade.index, i * 2);
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
Minecraft.getMinecraft()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(
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)) {
containerEM.sendObjectToServer(null, upgrade.index, 1 + i * 2);
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
Minecraft.getMinecraft()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(
ResourceHandler.getResourceWOP("gui.button.press"), 1.0F));
}
}
}
}
private void renderUpgrades(int x, int y) {
//First Draw
// First Draw
for (EnumUpgrade upgrade : itemUpgrades) {
int xIndex = itemUpgrades.indexOf(upgrade);
int spacing = (xSize - 6) / itemUpgrades.size();
@@ -202,32 +204,43 @@ public class GUIUpgradeModifier extends GuiContainer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glDisable(GL11.GL_BLEND);
//Draw + buttons
if (coreSlots > usedSlots && upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
// Draw + buttons
if (coreSlots > usedSlots
&& upgrade.getUpgradePoints(stack) < upgradableItem.getMaxUpgradePoints(upgrade.index, stack)) {
boolean hovering = GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y);
if (!coreInInventory[i]) drawTexturedModalRect(xPos, yPos + 33 + i * 18, 24, 208, 8, 8);
else drawTexturedModalRect(xPos, yPos + 33 + i * 18, 32 + (hovering ? 8 : 0), 208, 8, 8);
}
//Draw - buttons
// Draw - buttons
if (appliedCores[i] > 0) {
boolean hovering = GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y);
drawTexturedModalRect(xPos + 16, yPos + 33 + i * 18, 56 + (hovering ? 8 : 0), 208, 8, 8);
}
}
for (int i = 0; i <= coreTier; i++)
fontRendererObj.drawString(String.valueOf(appliedCores[i]), xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(appliedCores[i])) / 2, yPos + 29 + i * 18, 0xFFFFFF);
fontRendererObj.drawString(String.valueOf(upgrade.getUpgradePoints(stack)), xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(upgrade.getUpgradePoints(stack))) / 2, yPos - 8, 0xFFFFFF);
fontRendererObj.drawString(
String.valueOf(appliedCores[i]),
xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(appliedCores[i])) / 2,
yPos + 29 + i * 18,
0xFFFFFF);
fontRendererObj.drawString(
String.valueOf(upgrade.getUpgradePoints(stack)),
xPos + 12 - fontRendererObj.getStringWidth(String.valueOf(upgrade.getUpgradePoints(stack))) / 2,
yPos - 8,
0xFFFFFF);
}
fontRendererObj.drawStringWithShadow(StatCollector.translateToLocal("gui.de.cores.txt"), guiLeft + 4, guiTop + 4, 0x00ff00);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.cap.txt"), guiLeft + 4, guiTop + 16, 0x000000);
fontRendererObj.drawStringWithShadow(
StatCollector.translateToLocal("gui.de.cores.txt"), guiLeft + 4, 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(StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.installed.txt"), guiLeft + 4, guiTop + 37, 0x000000);
fontRendererObj.drawString(">" + usedSlots, guiLeft + 4, guiTop + 46, 0x000000);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.free.txt"), guiLeft + 4, guiTop + 58, 0x000000);
fontRendererObj.drawString(">" + (coreSlots - usedSlots), guiLeft + 4, guiTop + 67, 0x000000);
}
@@ -236,7 +249,7 @@ public class GUIUpgradeModifier extends GuiContainer {
super.drawScreen(x, y, f);
if (!inUse) return;
//Second Draw
// Second Draw
for (EnumUpgrade upgrade : itemUpgrades) {
int xIndex = itemUpgrades.indexOf(upgrade);
int spacing = (xSize - 6) / itemUpgrades.size();
@@ -252,8 +265,10 @@ public class GUIUpgradeModifier extends GuiContainer {
if (GuiHelper.isInRect(xPos + 3, yPos - 9, 18, 8, x, y)) {
List list = new ArrayList();
list.add(StatCollector.translateToLocal("gui.de.basePoints.txt") + ": " + upgradableItem.getBaseUpgradePoints(upgrade.index));
list.add(StatCollector.translateToLocal("gui.de.maxPoints.txt") + ": " + upgradableItem.getMaxUpgradePoints(upgrade.index, stack));
list.add(StatCollector.translateToLocal("gui.de.basePoints.txt") + ": "
+ upgradableItem.getBaseUpgradePoints(upgrade.index));
list.add(StatCollector.translateToLocal("gui.de.maxPoints.txt") + ": "
+ upgradableItem.getMaxUpgradePoints(upgrade.index, stack));
list.add(StatCollector.translateToLocal("gui.de.pointCost.txt") + ": " + upgrade.pointConversion);
drawHoveringText(list, x, y, fontRendererObj);
}
@@ -262,12 +277,15 @@ public class GUIUpgradeModifier extends GuiContainer {
if (GuiHelper.isInRect(xPos + 9, yPos + 25 + i * 18, 6, 15, x, y)) {
List list = new ArrayList();
double value = Math.pow(2, i) / upgrade.pointConversion;
String string = StatCollector.translateToLocal("gui.de.value.txt") + ": " + value + " " + (value == 1 ? StatCollector.translateToLocal("gui.de.point.txt") : StatCollector.translateToLocal("gui.de.points.txt"));
String string = StatCollector.translateToLocal("gui.de.value.txt") + ": " + value + " "
+ (value == 1
? StatCollector.translateToLocal("gui.de.point.txt")
: StatCollector.translateToLocal("gui.de.points.txt"));
list.add(string.replace(".0", ""));
drawHoveringText(list, x, y, fontRendererObj);
}
//Draw Button Text (add)
// Draw Button Text (add)
if (coreSlots > usedSlots && GuiHelper.isInRect(xPos, yPos + 33 + i * 18, 8, 8, x, y)) {
List list = new ArrayList<String>();
if (coreInInventory[i]) list.add(StatCollector.translateToLocal("gui.de.addCore.txt"));
@@ -275,7 +293,7 @@ public class GUIUpgradeModifier extends GuiContainer {
drawHoveringText(list, x, y, fontRendererObj);
}
//Draw Button Text (remove)
// Draw Button Text (remove)
if (appliedCores[i] > 0 && GuiHelper.isInRect(xPos + 16, yPos + 33 + i * 18, 8, 8, x, y)) {
List list = new ArrayList<String>();
if (coreInInventory[i]) list.add(StatCollector.translateToLocal("gui.de.removeCore.txt"));
@@ -283,7 +301,6 @@ public class GUIUpgradeModifier extends GuiContainer {
}
}
}
}
public void drawFlippedTexturedModalRect(int xPos, int yPos, int texXPos, int texYPos, int xSize, int ySize) {
@@ -291,10 +308,30 @@ public class GUIUpgradeModifier extends GuiContainer {
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double) (xPos), (double) (yPos + ySize), (double) this.zLevel, (double) ((float) (texXPos + xSize) * f), (double) ((float) (texYPos + ySize) * f1));
tessellator.addVertexWithUV((double) (xPos + xSize), (double) (yPos + ySize), (double) this.zLevel, (double) ((float) (texXPos) * f), (double) ((float) (texYPos + ySize) * f1));
tessellator.addVertexWithUV((double) (xPos + xSize), (double) (yPos), (double) this.zLevel, (double) ((float) (texXPos) * f), (double) ((float) (texYPos) * f1));
tessellator.addVertexWithUV((double) (xPos), (double) (yPos), (double) this.zLevel, (double) ((float) (texXPos + xSize) * f), (double) ((float) (texYPos) * f1));
tessellator.addVertexWithUV(
(double) (xPos),
(double) (yPos + ySize),
(double) this.zLevel,
(double) ((float) (texXPos + xSize) * f),
(double) ((float) (texYPos + ySize) * f1));
tessellator.addVertexWithUV(
(double) (xPos + xSize),
(double) (yPos + ySize),
(double) this.zLevel,
(double) ((float) (texXPos) * f),
(double) ((float) (texYPos + ySize) * f1));
tessellator.addVertexWithUV(
(double) (xPos + xSize),
(double) (yPos),
(double) this.zLevel,
(double) ((float) (texXPos) * f),
(double) ((float) (texYPos) * f1));
tessellator.addVertexWithUV(
(double) (xPos),
(double) (yPos),
(double) this.zLevel,
(double) ((float) (texXPos + xSize) * f),
(double) ((float) (texYPos) * f1));
tessellator.draw();
}
}
@@ -1,22 +1,20 @@
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.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import com.brandon3055.draconicevolution.DraconicEvolution;
import com.brandon3055.draconicevolution.common.container.ContainerWeatherController;
import com.brandon3055.draconicevolution.common.network.ButtonPacket;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileWeatherController;
@SideOnly(Side.CLIENT)
public class GUIWeatherController extends GuiContainer {
@@ -36,7 +34,8 @@ public class GUIWeatherController extends GuiContainer {
this.player = invPlayer.player;
}
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/WeatherController.png");
private static final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/WeatherController.png");
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
@@ -51,9 +50,8 @@ public class GUIWeatherController extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
// drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
drawCenteredString(fontRendererObj, "Weather Controller", xSize / 2, -15, 0x2a4ed0);
}
public static final String RAIN_ON_TEXT = "Turn rain on";
@@ -68,7 +66,7 @@ public class GUIWeatherController extends GuiContainer {
if (tileWC.mode == 0) text = RAIN_OFF_TEXT;
else if (tileWC.mode == 1) text = RAIN_ON_TEXT;
else text = STORM_TEXT;
//ID
// ID
buttonList.add(new GuiButton(0, guiLeft + 85, guiTop, 85, 20, text));
}
@@ -80,7 +78,6 @@ public class GUIWeatherController extends GuiContainer {
else if (button.displayString.equals(RAIN_OFF_TEXT)) button.displayString = RAIN_ON_TEXT;
else button.displayString = STORM_TEXT;
}
}
@Override
@@ -93,6 +90,4 @@ public class GUIWeatherController extends GuiContainer {
super.updateScreen();
this.charges = tileWC.charges;
}
}
@@ -21,17 +21,39 @@ public class GuiButtonAHeight extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
this.field_146123_n = mouseX >= this.xPosition
&& mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
int k = this.getHoverState(this.field_146123_n);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, width % 2 + this.width / 2, this.height);
this.drawTexturedModalRect(width % 2 + this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height);
this.drawTexturedModalRect(
this.xPosition, this.yPosition, 0, 46 + k * 20, width % 2 + this.width / 2, this.height);
this.drawTexturedModalRect(
width % 2 + this.xPosition + this.width / 2,
this.yPosition,
200 - this.width / 2,
46 + k * 20,
this.width / 2,
this.height);
if (this.height < 20) {
this.drawTexturedModalRect(xPosition, yPosition + 3, 0, (46 + k * 20) + 20 - height + 3, width % 2 + width / 2, height - 3);
this.drawTexturedModalRect(width % 2 + xPosition + width / 2, yPosition + 3, 200 - width / 2, (46 + k * 20) + 20 - height + 3, width / 2, height - 3);
this.drawTexturedModalRect(
xPosition,
yPosition + 3,
0,
(46 + k * 20) + 20 - height + 3,
width % 2 + width / 2,
height - 3);
this.drawTexturedModalRect(
width % 2 + xPosition + width / 2,
yPosition + 3,
200 - width / 2,
(46 + k * 20) + 20 - height + 3,
width / 2,
height - 3);
}
this.mouseDragged(minecraft, mouseX, mouseY);
int l = 14737632;
@@ -43,7 +65,12 @@ public class GuiButtonAHeight extends GuiButton {
} else if (this.field_146123_n) {
l = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
this.drawCenteredString(
fontrenderer,
this.displayString,
this.xPosition + this.width / 2,
this.yPosition + (this.height - 8) / 2,
l);
}
}
}
@@ -14,7 +14,8 @@ public class GuiButtonTextOnly extends GuiButton {
public String LINKED_PAGE;
public int textColour;
public GuiButtonTextOnly(int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, int colour) {
public GuiButtonTextOnly(
int id, int xPos, int yPos, int width, int hight, String displayString, String linkedPage, int colour) {
super(id, xPos, yPos, width, hight, displayString);
this.LINKED_PAGE = linkedPage;
this.textColour = colour;
@@ -26,7 +27,10 @@ public class GuiButtonTextOnly extends GuiButton {
FontRenderer fontrenderer = minecraft.fontRenderer;
minecraft.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
this.field_146123_n = mouseX >= this.xPosition
&& mouseY >= this.yPosition
&& mouseX < this.xPosition + this.width
&& mouseY < this.yPosition + this.height;
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -48,12 +52,22 @@ public class GuiButtonTextOnly extends GuiButton {
trimmedDisplayString = EnumChatFormatting.BOLD + "" + EnumChatFormatting.ITALIC + trimmedDisplayString;
GL11.glPushMatrix();
GL11.glColor4f(0f, 0f, 0f, 1f);
drawTexturedModalRect(xPosition + (int) (xPosition * 0.01), yPosition + (int) (yPosition * 0.01), 0, 46, (int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2, 8);
drawTexturedModalRect(
xPosition + (int) (xPosition * 0.01),
yPosition + (int) (yPosition * 0.01),
0,
46,
(int) (fontrenderer.getStringWidth(trimmedDisplayString) * 0.72) + 2,
8);
GL11.glPopMatrix();
}
GL11.glPushMatrix();
GL11.glScalef(0.7F, 0.7F, 1);
fontrenderer.drawString(trimmedDisplayString, (int) (xPosition * 1.45), (int) ((yPosition + (height - 8) / 2) * 1.45), textColour);
fontrenderer.drawString(
trimmedDisplayString,
(int) (xPosition * 1.45),
(int) ((yPosition + (height - 8) / 2) * 1.45),
textColour);
GL11.glPopMatrix();
}
}
@@ -104,13 +104,12 @@ public class GuiHandler implements IGuiHandler {
}
break;
// case GUIID_CONTAINER_TEMPLATE:
// TileEntity containerTemp = world.getTileEntity(x, y, z);
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
// return new ContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
// }
// break;
// case GUIID_CONTAINER_TEMPLATE:
// TileEntity containerTemp = world.getTileEntity(x, y, z);
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
// return new ContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
// }
// break;
}
return null;
@@ -141,7 +140,9 @@ public class GuiHandler implements IGuiHandler {
break;
case GUIID_PARTICLEGEN:
TileEntity gen = world.getTileEntity(x, y, z);
return (gen != null && gen instanceof TileParticleGenerator) ? new GUIParticleGenerator((TileParticleGenerator) gen, player) : null;
return (gen != null && gen instanceof TileParticleGenerator)
? new GUIParticleGenerator((TileParticleGenerator) gen, player)
: null;
case GUIID_PLAYERDETECTOR:
TileEntity detector = world.getTileEntity(x, y, z);
if (detector != null && detector instanceof TilePlayerDetectorAdvanced) {
@@ -177,29 +178,35 @@ public class GuiHandler implements IGuiHandler {
case GUIID_REACTOR:
TileEntity reactor = world.getTileEntity(x, y, z);
if (reactor != null && reactor instanceof TileReactorCore) {
return new GUIReactor(player, (TileReactorCore) reactor, new ContainerReactor(player, (TileReactorCore) reactor));
return new GUIReactor(
player, (TileReactorCore) reactor, new ContainerReactor(player, (TileReactorCore) reactor));
}
break;
case GUIID_TOOL_CONFIG:
return new GUIToolConfig(player, new ContainerAdvTool(player.inventory, new InventoryTool(player, null)));
return new GUIToolConfig(
player, new ContainerAdvTool(player.inventory, new InventoryTool(player, null)));
case GUIID_FLOW_GATE:
return world.getTileEntity(x, y, z) instanceof TileGate ? new GUIFlowGate((TileGate) world.getTileEntity(x, y, z)) : null;
return world.getTileEntity(x, y, z) instanceof TileGate
? new GUIFlowGate((TileGate) world.getTileEntity(x, y, z))
: null;
case GUIID_UPGRADE_MODIFIER:
TileEntity containerTemp = world.getTileEntity(x, y, z);
if (containerTemp != null && containerTemp instanceof TileUpgradeModifier) {
return new GUIUpgradeModifier(player.inventory, (TileUpgradeModifier) containerTemp, new ContainerUpgradeModifier(player.inventory, (TileUpgradeModifier) containerTemp));
return new GUIUpgradeModifier(
player.inventory,
(TileUpgradeModifier) containerTemp,
new ContainerUpgradeModifier(player.inventory, (TileUpgradeModifier) containerTemp));
}
break;
// case GUIID_CONTAINER_TEMPLATE:
// TileEntity containerTemp = world.getTileEntity(x, y, z);
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
// return new GUIContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
// }
// break;
// case GUIID_CONTAINER_TEMPLATE:
// TileEntity containerTemp = world.getTileEntity(x, y, z);
// if (containerTemp != null && containerTemp instanceof TileContainerTemplate) {
// return new GUIContainerTemplate(player.inventory, (TileContainerTemplate) containerTemp);
// }
// break;
}
return null;
}
}
@@ -3,6 +3,7 @@ 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 net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -11,8 +12,6 @@ import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import java.util.ArrayList;
/**
* Created by brandon3055 on 11/2/2016.
*/
@@ -40,24 +39,36 @@ public class GuiHudConfig extends GuiScreen {
buttonList.add(new GuiButtonAHeight(0, x - 35, y + 95, 70, 15, StatCollector.translateToLocal("gui.back")));
buttonList.add(new GuiButtonAHeight(1, 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(new GuiButtonAHeight(
1, 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(new GuiButtonAHeight(9, x - 81, y - 3, 163, 15, StatCollector.translateToLocal("button.de.toggleHidden.txt")));
buttonList.add(new GuiButtonAHeight(
9, x - 81, y - 3, 163, 15, StatCollector.translateToLocal("button.de.toggleHidden.txt")));
buttonList.add(new GuiButtonAHeight(4, 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(new GuiButtonAHeight(
4, 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(buttonArmorNumeric = new GuiButtonAHeight(7, x + 2, y + 59, 80, 15, ""));
buttonList.add(new GuiButtonAHeight(8, 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")));
buttonList.add(new GuiButtonAHeight(
8, 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
public void updateScreen() {
buttonHudFade.displayString = StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[6] + ".txt");
buttonArmorFade.displayString = StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[7] + ".txt");
buttonArmorNumeric.displayString = StatCollector.translateToLocal("button.de.numeric.txt") + " " + (ConfigHandler.hudSettings[9] == 0 ? StatCollector.translateToLocal("gui.de.off.txt") : StatCollector.translateToLocal("gui.de.on.txt"));
buttonHudFade.displayString =
StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[6] + ".txt");
buttonArmorFade.displayString =
StatCollector.translateToLocal("button.de.fadeMode" + ConfigHandler.hudSettings[7] + ".txt");
buttonArmorNumeric.displayString = StatCollector.translateToLocal("button.de.numeric.txt") + " "
+ (ConfigHandler.hudSettings[9] == 0
? StatCollector.translateToLocal("gui.de.off.txt")
: StatCollector.translateToLocal("gui.de.on.txt"));
}
@Override
@@ -93,7 +104,17 @@ public class GuiHudConfig extends GuiScreen {
else ConfigHandler.hudSettings[11] = 0;
}
ConfigHandler.config.get("Gui Stuff", "HUD Settings", 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", Integer.MIN_VALUE, Integer.MAX_VALUE, true, 12).set(ConfigHandler.hudSettings);
ConfigHandler.config
.get(
"Gui Stuff",
"HUD Settings",
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",
Integer.MIN_VALUE,
Integer.MAX_VALUE,
true,
12)
.set(ConfigHandler.hudSettings);
ConfigHandler.config.save();
}
@@ -105,13 +126,35 @@ public class GuiHudConfig extends GuiScreen {
int armorX = (int) ((pos[2] / 1000D) * width);
int armorY = (int) ((pos[3] / 1000D) * height);
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.configureGuiElements.txt"), width / 2, height / 2 - 90, 0x00FFFF);
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.hudDisplaySettings.txt"), width / 2, height / 2 - 77, 0xFFFFFF);
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.shieldDisplaySettings.txt"), width / 2, height / 2 - 15, 0xFFFFFF);
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.clickAndDragPurpleBoxes.txt"), width / 2, height / 2 + 85, 0xFFFFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("gui.de.configureGuiElements.txt"),
width / 2,
height / 2 - 90,
0x00FFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("gui.de.hudDisplaySettings.txt"),
width / 2,
height / 2 - 77,
0xFFFFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("gui.de.shieldDisplaySettings.txt"),
width / 2,
height / 2 - 15,
0xFFFFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("gui.de.clickAndDragPurpleBoxes.txt"),
width / 2,
height / 2 + 85,
0xFFFFFF);
drawCenteredString(fontRendererObj, ConfigHandler.hudSettings[4] + "%", width / 2 + 97, height / 2 - 63, 0xFFFFFF);
drawCenteredString(fontRendererObj, ConfigHandler.hudSettings[5] + "%", width / 2 + 97, height / 2 - 1, 0xFFFFFF);
drawCenteredString(
fontRendererObj, ConfigHandler.hudSettings[4] + "%", width / 2 + 97, height / 2 - 63, 0xFFFFFF);
drawCenteredString(
fontRendererObj, ConfigHandler.hudSettings[5] + "%", width / 2 + 97, height / 2 - 1, 0xFFFFFF);
super.drawScreen(x, y, partial);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
@@ -140,12 +183,18 @@ public class GuiHudConfig extends GuiScreen {
RenderHelper.enableStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
if (GuiHelper.isInRect(armorX - 19, armorY - 19, 39, 39, x, y) || GuiHelper.isInRect(hudX - 19, hudY - 19, 39, 39, x, y)) {
drawHoveringText(new ArrayList<String>() {{
add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt2.txt"));
}}, x, y, fontRendererObj);
if (GuiHelper.isInRect(armorX - 19, armorY - 19, 39, 39, x, y)
|| GuiHelper.isInRect(hudX - 19, hudY - 19, 39, 39, x, y)) {
drawHoveringText(
new ArrayList<String>() {
{
add(StatCollector.translateToLocal("info.de.hudDisplayConfigTxt2.txt"));
}
},
x,
y,
fontRendererObj);
}
}
@Override
@@ -175,7 +224,17 @@ public class GuiHudConfig extends GuiScreen {
protected void mouseMovedOrUp(int x, int y, int action) {
super.mouseMovedOrUp(x, y, action);
draggingHud = draggingArmor = false;
ConfigHandler.config.get("Gui Stuff", "HUD Settings", 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", Integer.MIN_VALUE, Integer.MAX_VALUE, true, 12).set(ConfigHandler.hudSettings);
ConfigHandler.config
.get(
"Gui Stuff",
"HUD Settings",
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",
Integer.MIN_VALUE,
Integer.MAX_VALUE,
true,
12)
.set(ConfigHandler.hudSettings);
ConfigHandler.config.save();
}
@@ -13,7 +13,8 @@ public class GuiTextureButton extends GuiButton {
public int textureXPos;
public int textureYPos;
public GuiTextureButton(int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise, String text) {
public GuiTextureButton(
int id, int xPos, int yPos, int textureXPos, int textureYPos, int xSise, int ySise, String text) {
super(id, xPos, yPos, xSise, ySise, text);
this.textureXPos = textureXPos;
this.textureYPos = textureYPos;
@@ -24,12 +25,16 @@ public class GuiTextureButton extends GuiButton {
if (this.visible) {
FontRenderer fontrenderer = mc.fontRenderer;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = x >= this.xPosition && y >= this.yPosition && x < this.xPosition + this.width && y < this.yPosition + this.height;
this.field_146123_n = x >= this.xPosition
&& y >= this.yPosition
&& x < this.xPosition + this.width
&& y < this.yPosition + this.height;
int k = this.getHoverState(this.field_146123_n);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.drawTexturedModalRect(this.xPosition, this.yPosition, textureXPos, textureYPos + k * height, this.width, this.height);
this.drawTexturedModalRect(
this.xPosition, this.yPosition, textureXPos, textureYPos + k * height, this.width, this.height);
this.mouseDragged(mc, x, y);
int l = 14737632;
@@ -42,9 +47,12 @@ public class GuiTextureButton extends GuiButton {
l = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
this.drawCenteredString(
fontrenderer,
this.displayString,
this.xPosition + this.width / 2,
this.yPosition + (this.height - 8) / 2,
l);
}
}
}
@@ -13,6 +13,9 @@ import com.brandon3055.draconicevolution.common.handler.ContributorHandler;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
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;
@@ -26,10 +29,6 @@ import org.apache.commons.io.IOUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Brandon on 6/03/2015.
*/
@@ -42,17 +41,21 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
private int worldUpdateIn = -1;
private static String lang;
public GUIManual() {
super(new DummyContainer(), 255, 325);
if (currentPage != null) {
collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE);
collection.addComponent(new ComponentButton(102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt"))).setGroup(GR_PAGE);
collection
.addComponent(new ComponentManualPage(0, 0, this, currentPage))
.setGroup(GR_PAGE);
collection
.addComponent(new ComponentButton(
102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt")))
.setGroup(GR_PAGE);
collection.setOnlyGroupEnabled(GR_BACKGROUND);
collection.setGroupEnabled(GR_PAGE, true);
}
//mc.gameSettings.guiScale
// mc.gameSettings.guiScale
}
@Override
@@ -61,8 +64,11 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
loadPages();
if (previousScale == -1) adjustGuiScale();
if (!Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode().equals(lang))
loadPages();
if (!Minecraft.getMinecraft()
.getLanguageManager()
.getCurrentLanguage()
.getLanguageCode()
.equals(lang)) loadPages();
LogHelper.info(ContributorHandler.contributors);
}
@@ -119,19 +125,69 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
protected ComponentCollection assembleComponents() {
collection = new ComponentCollection(0, 0, xSize, ySize, this);
collection.addComponent(new ComponentTexturedRect(0, 0, 255, 255, ResourceHandler.getResource("textures/gui/manualTop.png"))).setGroup(GR_BACKGROUND);
collection.addComponent(new ComponentTexturedRect(0, 255, 255, 69, ResourceHandler.getResource("textures/gui/manualBottom.png"))).setGroup(GR_BACKGROUND);
collection
.addComponent(new ComponentTexturedRect(
0, 0, 255, 255, ResourceHandler.getResource("textures/gui/manualTop.png")))
.setGroup(GR_BACKGROUND);
collection
.addComponent(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 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, this, StatCollector.translateToLocal("info.de.manual.indexButton.txt"), StatCollector.translateToLocal("info.de.manual.indexButtonTip.txt"))).setGroup(GR_INTRO);
collection.addComponent(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");
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);
collection
.addComponent(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");
collection.addComponent(new ComponentTextureButton(140, 290, 0, 0, 100, 30, 10, this, "", "", ResourceHandler.getResource("textures/gui/patreon.png")).forceFullRender()).setGroup(GR_CONTRIBUTORS);
collection
.addComponent(new ComponentTextureButton(
140,
290,
0,
0,
100,
30,
10,
this,
"",
"",
ResourceHandler.getResource("textures/gui/patreon.png"))
.forceFullRender())
.setGroup(GR_CONTRIBUTORS);
for (int i = 0; i < pageList.size(); i++) {
collection.addComponent(new ComponentIndexButton(20, 20 + i * 20, this, pageList.get(i))).setGroup(GR_INDEX).setName("INDEX_BUTTON_" + i);
collection
.addComponent(new ComponentIndexButton(20, 20 + i * 20, this, pageList.get(i)))
.setGroup(GR_INDEX)
.setName("INDEX_BUTTON_" + i);
pageLength += 20;
}
@@ -144,7 +200,8 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
@Override
public void handleScrollInput(int direction) {
if (collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
if (collection.getComponent("INDEX_BUTTON_0") != null
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
if (currentPage != null) return;
scrollOffset += direction * (InfoHelper.isShiftKeyDown() ? 30 : 10);
@@ -153,15 +210,15 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
if (pageLength + 40 <= ySize) scrollOffset = 0;
barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D);
} else if (collection.getComponent("CONTRIBUTORS") != null && collection.getComponent("CONTRIBUTORS").isEnabled()) {
} else if (collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS").isEnabled()) {
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS");
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
} else if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
} else if (collection.getComponent("OPEN_PAGE") != null
&& collection.getComponent("OPEN_PAGE").isEnabled()) {
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
}
}
@Override
@@ -169,10 +226,17 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
super.drawScreen(mouseX, mouseY, par3);
int posX = (this.width - xSize) / 2;
int posY = (this.height - ySize) / 2;
if (collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled())
fontRendererObj.drawSplitString(StatCollector.translateToLocal("info.de.manual.introTxt.txt"), posX + 20, posY + 190, 150, 0x000000);
if (collection.getComponent("BANNER") != null
&& collection.getComponent("BANNER").isEnabled())
fontRendererObj.drawSplitString(
StatCollector.translateToLocal("info.de.manual.introTxt.txt"),
posX + 20,
posY + 190,
150,
0x000000);
if (collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled()) return;
if (collection.getComponent("BANNER") != null
&& collection.getComponent("BANNER").isEnabled()) return;
ResourceHandler.bindResource("textures/gui/Widgets.png");
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(guiLeft, guiTop, 118, 20, 17, 17);
@@ -191,14 +255,21 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
public void updateScreen() {
super.updateScreen();
disableScrollBar = collection.getComponent("BANNER") != null && collection.getComponent("BANNER").isEnabled();
disableScrollBar = collection.getComponent("BANNER") != null
&& collection.getComponent("BANNER").isEnabled();
if (!scrollPressed && collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
if (!scrollPressed
&& collection.getComponent("INDEX_BUTTON_0") != null
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) {
barPosition = (int) (((double) scrollOffset / scrollLimit) * 247D);
} else if (!scrollPressed && collection.getComponent("CONTRIBUTORS") != null && collection.getComponent("CONTRIBUTORS").isEnabled()) {
} else if (!scrollPressed
&& collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS").isEnabled()) {
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS");
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
} else if (!scrollPressed && collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
} else if (!scrollPressed
&& collection.getComponent("OPEN_PAGE") != null
&& collection.getComponent("OPEN_PAGE").isEnabled()) {
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
barPosition = (int) (((double) page.scrollOffset / page.scrollLimit) * 247D);
}
@@ -229,7 +300,6 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
if (disableScrollBar) return;
ResourceHandler.bindResource("textures/gui/manualBottom.png");
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(guiLeft - 16, guiTop + 10, 0, 146, 15, 100);
@@ -278,15 +348,18 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
}
public static void loadPages() {
lang = Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
lang = Minecraft.getMinecraft()
.getLanguageManager()
.getCurrentLanguage()
.getLanguageCode();
ResourceLocation rsLocation = new ResourceLocation(References.RESOURCESPREFIX + "manual/manual-" + lang + ".json");
ResourceLocation rsLocation =
new ResourceLocation(References.RESOURCESPREFIX + "manual/manual-" + lang + ".json");
IResource resource = null;
try {
resource = Minecraft.getMinecraft().getResourceManager().getResource(rsLocation);
}
catch (IOException e) {
} catch (IOException e) {
LogHelper.warn("##################################################################################");
LogHelper.warn("");
LogHelper.warn("Info Tablet language localisation is not available for the selected language: " + lang);
@@ -297,8 +370,7 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
rsLocation = new ResourceLocation(References.RESOURCESPREFIX + "manual/manual-en_US.json");
try {
resource = Minecraft.getMinecraft().getResourceManager().getResource(rsLocation);
}
catch (IOException e1) {
} catch (IOException e1) {
LogHelper.error("Well that didn't work... ");
e1.printStackTrace();
}
@@ -309,7 +381,6 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
return;
}
try {
File manualJSON = new File(ResourceHandler.getConfigFolder(), "manual.json");
@@ -319,14 +390,14 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
is.close();
os.close();
JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(manualJSON),"utf-8"));
JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(manualJSON), "utf-8"));
List<String> images;
List<String> content;
reader.beginArray();
//Read next page
// Read next page
while (reader.hasNext()) {
String name;
String nameL = null;
@@ -335,18 +406,18 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
content = new ArrayList<String>();
reader.beginObject();
//Read page name
// Read page name
String s = reader.nextName();
if (s.equals("name")) {
name = reader.nextString();
} else {
reader.close();
throw new IOException("Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
reader.close();
throw new IOException(
"Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
}
//Read page images
// Read page images
s = reader.nextName();
if (s.equals("nameL")) {
nameL = reader.nextString();
@@ -365,11 +436,12 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
if (!imageURLs.contains(url)) imageURLs.add(url);
}
reader.endArray();
} else{
reader.close();
throw new IOException("Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
}
//Read page content
} else {
reader.close();
throw new IOException(
"Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
}
// Read page content
s = reader.nextName();
if (s.equals("content")) {
reader.beginArray();
@@ -377,25 +449,28 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
content.add(reader.nextString());
}
reader.endArray();
} else{
reader.close();
throw new IOException("Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
}
} else {
reader.close();
throw new IOException(
"Error reading manual.json (invalid name in place of \"name\" [Found:\"" + s + "\"])");
}
reader.endObject();
if (isValidPage(name))
pageList.add(new ManualPage(name, images.toArray(new String[images.size()]), content.toArray(new String[content.size()]), nameL, meta));
pageList.add(new ManualPage(
name,
images.toArray(new String[images.size()]),
content.toArray(new String[content.size()]),
nameL,
meta));
}
reader.endArray();
reader.close();
}
catch (FileNotFoundException e) {
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
}
@Override
@@ -404,11 +479,22 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
if (buttonPressed) return;
for (ComponentBase c : collection.getComponents()) {
if (c instanceof ComponentIndexButton && c.isEnabled() && ((ComponentIndexButton) c).isOnScreen() && c.isMouseOver(x - guiLeft, y - guiTop)) {
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
if (c instanceof ComponentIndexButton
&& c.isEnabled()
&& ((ComponentIndexButton) c).isOnScreen()
&& c.isMouseOver(x - guiLeft, y - guiTop)) {
Minecraft.getMinecraft()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
currentPage = ((ComponentIndexButton) c).getPage();
collection.addComponent(new ComponentManualPage(0, 0, this, currentPage)).setGroup(GR_PAGE).setName("OPEN_PAGE");
collection.addComponent(new ComponentButton(102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt"))).setGroup(GR_PAGE);
collection
.addComponent(new ComponentManualPage(0, 0, this, currentPage))
.setGroup(GR_PAGE)
.setName("OPEN_PAGE");
collection
.addComponent(new ComponentButton(
102, 314, 50, 12, 1, this, StatCollector.translateToLocal("button.de.back.txt")))
.setGroup(GR_PAGE);
collection.setOnlyGroupEnabled(GR_BACKGROUND);
collection.setGroupEnabled(GR_PAGE, true);
break;
@@ -418,13 +504,15 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
@Override
public void barMoved(double position) {
if (collection.getComponent("INDEX_BUTTON_0") != null && collection.getComponent("INDEX_BUTTON_0").isEnabled())
scrollOffset = (int) (position * scrollLimit);
else if (collection.getComponent("CONTRIBUTORS") != null && collection.getComponent("CONTRIBUTORS").isEnabled()) {
if (collection.getComponent("INDEX_BUTTON_0") != null
&& collection.getComponent("INDEX_BUTTON_0").isEnabled()) scrollOffset = (int) (position * scrollLimit);
else if (collection.getComponent("CONTRIBUTORS") != null
&& collection.getComponent("CONTRIBUTORS").isEnabled()) {
ComponentContributorsPage page = (ComponentContributorsPage) collection.getComponent("CONTRIBUTORS");
if (page.scrollLimit < 0) return;
page.scrollOffset = (int) (position * page.scrollLimit);
} else if (collection.getComponent("OPEN_PAGE") != null && collection.getComponent("OPEN_PAGE").isEnabled()) {
} else if (collection.getComponent("OPEN_PAGE") != null
&& collection.getComponent("OPEN_PAGE").isEnabled()) {
ComponentManualPage page = (ComponentManualPage) collection.getComponent("OPEN_PAGE");
if (page.scrollLimit < 0) return;
page.scrollOffset = (int) (position * page.scrollLimit);
@@ -443,4 +531,3 @@ public class GUIManual extends GUIScrollingBase implements GuiYesNoCallback {
mc.displayGuiScreen(this);
}
}
@@ -6,6 +6,8 @@ import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.common.container.ContainerReactor;
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;
@@ -13,9 +15,6 @@ import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.List;
/**
* Created by brandon3055 on 30/7/2015.
*/
@@ -33,28 +32,82 @@ public class GUIReactor extends GUIBase {
@Override
protected ComponentCollection assembleComponents() {
collection = new ComponentCollection(0, 0, 248, 222, this);
collection.addComponent(new ComponentTexturedRect(0, 0, xSize, ySize, ResourceHandler.getResource("textures/gui/Reactor.png")));
collection.addComponent(new ComponentTextureButton(14, 190, 18, 162, 18, 18, 0, this, "", StatCollector.translateToLocal("button.de.reactorCharge.txt"), ResourceHandler.getResource("textures/gui/Widgets.png"))).setName("CHARGE");
collection.addComponent(new ComponentTextureButton(14, 190, 18, 54, 18, 18, 1, this, "", StatCollector.translateToLocal("button.de.reactorStart.txt"), ResourceHandler.getResource("textures/gui/Widgets.png"))).setName("ACTIVATE");
collection.addComponent(new ComponentTextureButton(216, 190, 18, 108, 18, 18, 2, this, "", StatCollector.translateToLocal("button.de.reactorStop.txt"), ResourceHandler.getResource("textures/gui/Widgets.png"))).setName("DEACTIVATE");
collection.addComponent(new ComponentButton(9, 120, 43, 15, 3, this, StatCollector.translateToLocal("button.de.stats.txt"), StatCollector.translateToLocal("button.de.statsShow.txt"))).setName("STATS");
collection.addComponent(
new ComponentTexturedRect(0, 0, xSize, ySize, ResourceHandler.getResource("textures/gui/Reactor.png")));
collection
.addComponent(new ComponentTextureButton(
14,
190,
18,
162,
18,
18,
0,
this,
"",
StatCollector.translateToLocal("button.de.reactorCharge.txt"),
ResourceHandler.getResource("textures/gui/Widgets.png")))
.setName("CHARGE");
collection
.addComponent(new ComponentTextureButton(
14,
190,
18,
54,
18,
18,
1,
this,
"",
StatCollector.translateToLocal("button.de.reactorStart.txt"),
ResourceHandler.getResource("textures/gui/Widgets.png")))
.setName("ACTIVATE");
collection
.addComponent(new ComponentTextureButton(
216,
190,
18,
108,
18,
18,
2,
this,
"",
StatCollector.translateToLocal("button.de.reactorStop.txt"),
ResourceHandler.getResource("textures/gui/Widgets.png")))
.setName("DEACTIVATE");
collection
.addComponent(new ComponentButton(
9,
120,
43,
15,
3,
this,
StatCollector.translateToLocal("button.de.stats.txt"),
StatCollector.translateToLocal("button.de.statsShow.txt")))
.setName("STATS");
return collection;
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
//Draw I/O Slots
// Draw I/O Slots
if (reactor.reactorState == TileReactorCore.STATE_OFFLINE) {
RenderHelper.enableGUIStandardItemLighting();
drawTexturedModalRect(guiLeft + 14, guiTop + 139, 14, ySize, 18, 18);
drawTexturedModalRect(guiLeft + 216, guiTop + 139, 32, ySize, 18, 18);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.insert.txt"), guiLeft + 8, guiTop + 159, 0);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 13, guiTop + 168, 0);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.insert.txt"), guiLeft + 8, guiTop + 159, 0);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 13, guiTop + 168, 0);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.extract.txt"), guiLeft + 206, guiTop + 159, 0);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 215, guiTop + 168, 0);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.extract.txt"), guiLeft + 206, guiTop + 159, 0);
fontRendererObj.drawString(
StatCollector.translateToLocal("gui.de.fuel.txt"), guiLeft + 215, guiTop + 168, 0);
}
drawCenteredString(fontRendererObj, "Draconic Reactor", guiLeft + xSize / 2, guiTop + 4, 0x00FFFF);
}
@@ -65,7 +118,7 @@ public class GUIReactor extends GUIBase {
ResourceHandler.bindResource("textures/gui/Reactor.png");
GL11.glColor4f(1f, 1f, 1f, 1f);
//Draw Indicators
// Draw Indicators
double value = Math.min(reactor.reactionTemperature, reactor.maxReactTemperature) / reactor.maxReactTemperature;
int pixOffset = (int) (value * 108);
drawTexturedModalRect(11, 112 - pixOffset, 0, 222, 14, 5);
@@ -103,9 +156,16 @@ public class GUIReactor extends GUIBase {
drawStats();
}
String status = StatCollector.translateToLocal("gui.de.status.txt") + ": " + (reactor.reactorState == 0 ? EnumChatFormatting.DARK_GRAY : reactor.reactorState == 1 ? EnumChatFormatting.RED : reactor.reactorState == 2 ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.RED) + StatCollector.translateToLocal("gui.de.status" + reactor.reactorState + ".txt");
String status = StatCollector.translateToLocal("gui.de.status.txt") + ": "
+ (reactor.reactorState == 0
? EnumChatFormatting.DARK_GRAY
: reactor.reactorState == 1
? EnumChatFormatting.RED
: reactor.reactorState == 2 ? EnumChatFormatting.DARK_GREEN : EnumChatFormatting.RED)
+ StatCollector.translateToLocal("gui.de.status" + reactor.reactorState + ".txt");
if (reactor.reactorState == 1 && reactor.canStart())
status = StatCollector.translateToLocal("gui.de.status.txt") + ": " + EnumChatFormatting.DARK_GREEN + StatCollector.translateToLocal("gui.de.status1_5.txt");
status = StatCollector.translateToLocal("gui.de.status.txt") + ": " + EnumChatFormatting.DARK_GREEN
+ StatCollector.translateToLocal("gui.de.status1_5.txt");
if (!showStats) fontRendererObj.drawString(status, xSize - 5 - fontRendererObj.getStringWidth(status), 125, 0);
}
@@ -121,37 +181,52 @@ public class GUIReactor extends GUIBase {
text.add(StatCollector.translateToLocal("gui.de.fieldStrength.txt"));
if (reactor.maxFieldCharge > 0)
text.add(Utills.round(reactor.fieldCharge / reactor.maxFieldCharge * 100D, 100D) + "%");
text.add(Utills.addCommas((int) reactor.fieldCharge) + " / " + Utills.addCommas((int) reactor.maxFieldCharge)); //todo refine or remove
text.add(Utills.addCommas((int) reactor.fieldCharge) + " / "
+ Utills.addCommas((int) reactor.maxFieldCharge)); // todo refine or remove
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(197, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
text.add(StatCollector.translateToLocal("gui.de.energySaturation.txt"));
if (reactor.maxEnergySaturation > 0)
text.add(Utills.round((double) reactor.energySaturation / (double) reactor.maxEnergySaturation * 100D, 100D) + "%");
text.add(Utills.addCommas(reactor.energySaturation) + " / " + Utills.addCommas(reactor.maxEnergySaturation)); //todo refine or remove
text.add(Utills.round(
(double) reactor.energySaturation / (double) reactor.maxEnergySaturation * 100D, 100D)
+ "%");
text.add(Utills.addCommas(reactor.energySaturation) + " / "
+ Utills.addCommas(reactor.maxEnergySaturation)); // todo refine or remove
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(221, 4, 18, 114, mouseX - guiLeft, mouseY - guiTop)) {
text.add(StatCollector.translateToLocal("gui.de.fuelConversion.txt"));
if (reactor.reactorFuel + reactor.convertedFuel > 0)
text.add(Utills.round(((double) reactor.convertedFuel + reactor.conversionUnit) / ((double) reactor.convertedFuel + (double) reactor.reactorFuel) * 100D, 100D) + "%");
text.add(reactor.convertedFuel + " / " + (reactor.convertedFuel + reactor.reactorFuel)); //todo refine or remove
text.add(Utills.round(
((double) reactor.convertedFuel + reactor.conversionUnit)
/ ((double) reactor.convertedFuel + (double) reactor.reactorFuel)
* 100D,
100D)
+ "%");
text.add(reactor.convertedFuel + " / "
+ (reactor.convertedFuel + reactor.reactorFuel)); // todo refine or remove
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
}
if (showStats) {
if (GuiHelper.isInRect(53, 15, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacTempLoadFactor.txt"), 200));
text.addAll(fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacTempLoadFactor.txt"), 200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 40, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacCoreMass.txt"), 200));
text.addAll(fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacCoreMass.txt"), 200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 65, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacGenRate.txt"), 200));
text.addAll(fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacGenRate.txt"), 200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 88, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacInputRate.txt"), 200));
text.addAll(fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacInputRate.txt"), 200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
} else if (GuiHelper.isInRect(53, 113, 140, 18, mouseX - guiLeft, mouseY - guiTop)) {
text.addAll(fontRendererObj.listFormattedStringToWidth(StatCollector.translateToLocal("gui.de.reacConversionRate.txt"), 200));
text.addAll(fontRendererObj.listFormattedStringToWidth(
StatCollector.translateToLocal("gui.de.reacConversionRate.txt"), 200));
drawHoveringText(text, mouseX, mouseY, fontRendererObj);
}
}
@@ -163,26 +238,34 @@ public class GUIReactor extends GUIBase {
fontRendererObj.drawString(StatCollector.translateToLocal("gui.de.tempLoad.name"), 55, 16, 0x0000FF);
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(Utills.round((reactor.reactorFuel + reactor.convertedFuel) / 1296D, 100) + "m^3", 60, 2 + 2 * 24, 0);
fontRendererObj.drawString(
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(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(Utills.addCommas((int) Math.round(reactor.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 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(
Utills.addCommas((int) Math.round(reactor.fuelUseRate * 1000000D)) + "nb/t", 60, 2 + 5 * 24, 0);
}
@Override
public void updateScreen() {
if (reactor.reactorState == TileReactorCore.STATE_INVALID || reactor.reactorState == TileReactorCore.STATE_OFFLINE || reactor.reactorState == TileReactorCore.STATE_STOP)
if (reactor.reactorState == TileReactorCore.STATE_INVALID
|| reactor.reactorState == TileReactorCore.STATE_OFFLINE
|| reactor.reactorState == TileReactorCore.STATE_STOP)
collection.getComponent("DEACTIVATE").setEnabled(false);
else collection.getComponent("DEACTIVATE").setEnabled(true);
if ((reactor.reactorState == TileReactorCore.STATE_OFFLINE || (reactor.reactorState == TileReactorCore.STATE_STOP && !reactor.canStart())) && reactor.canCharge())
collection.getComponent("CHARGE").setEnabled(true);
if ((reactor.reactorState == TileReactorCore.STATE_OFFLINE
|| (reactor.reactorState == TileReactorCore.STATE_STOP && !reactor.canStart()))
&& reactor.canCharge()) collection.getComponent("CHARGE").setEnabled(true);
else collection.getComponent("CHARGE").setEnabled(false);
if ((reactor.reactorState == TileReactorCore.STATE_START || reactor.reactorState == TileReactorCore.STATE_STOP) && reactor.canStart())
collection.getComponent("ACTIVATE").setEnabled(true);
if ((reactor.reactorState == TileReactorCore.STATE_START || reactor.reactorState == TileReactorCore.STATE_STOP)
&& reactor.canStart()) collection.getComponent("ACTIVATE").setEnabled(true);
else collection.getComponent("ACTIVATE").setEnabled(false);
super.updateScreen();
}
@@ -193,8 +276,9 @@ public class GUIReactor extends GUIBase {
if (id < 3) container.sendObjectToServer(null, 20, id);
else if (id == 3) {
showStats = !showStats;
((ComponentButton) collection.getComponent("STATS")).hoverText = showStats ? StatCollector.translateToLocal("button.de.statsHide.txt") : StatCollector.translateToLocal("button.de.statsShow.txt");
((ComponentButton) collection.getComponent("STATS")).hoverText = showStats
? StatCollector.translateToLocal("button.de.statsHide.txt")
: StatCollector.translateToLocal("button.de.statsShow.txt");
}
}
}
@@ -17,6 +17,8 @@ import com.brandon3055.draconicevolution.common.network.ItemConfigPacket;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
import com.brandon3055.draconicevolution.common.utills.IInventoryTool;
import com.brandon3055.draconicevolution.common.utills.ItemConfigField;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
@@ -25,16 +27,14 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.util.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Brandon on 26/12/2014.
*/
public class GUIToolConfig extends GUIBase {
public EntityPlayer player;
private static final ResourceLocation inventoryTexture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
private static final ResourceLocation inventoryTexture =
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
private int screenLevel = 0;
private ItemStack editingItem;
private ContainerAdvTool container;
@@ -52,15 +52,28 @@ public class GUIToolConfig extends GUIBase {
public void initGui() {
super.initGui();
if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) {
ContributorHandler.Contributor contributor = ContributorHandler.contributors.get(player.getCommandSenderName());
ContributorHandler.Contributor contributor =
ContributorHandler.contributors.get(player.getCommandSenderName());
if (!contributor.isUserValid(player)) return;
buttonList.clear();
if (contributor.contributionLevel >= 1)
buttonList.add(new GuiButton(0, guiLeft - 150, guiTop, 150, 20, "Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled")));
buttonList.add(new GuiButton(
0,
guiLeft - 150,
guiTop,
150,
20,
"Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled")));
if (contributor.contribution.toLowerCase().contains("patreon"))
buttonList.add(new GuiButton(1, guiLeft - 150, guiTop + 22, 150, 20, "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled")));
buttonList.add(new GuiButton(
1,
guiLeft - 150,
guiTop + 22,
150,
20,
"Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled")));
}
}
@@ -68,51 +81,76 @@ public class GUIToolConfig extends GUIBase {
protected void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if (ContributorHandler.contributors.containsKey(player.getCommandSenderName())) {
ContributorHandler.Contributor contributor = ContributorHandler.contributors.get(player.getCommandSenderName());
ContributorHandler.Contributor contributor =
ContributorHandler.contributors.get(player.getCommandSenderName());
if (!contributor.isUserValid(player)) return;
if (button.id == 0) {
contributor.contributorWingsEnabled = !contributor.contributorWingsEnabled;
button.displayString = "Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled");
button.displayString =
"Contributor Wings: " + (contributor.contributorWingsEnabled ? "Enabled" : "Disabled");
} else if (button.id == 1) {
contributor.patreonBadgeEnabled = !contributor.patreonBadgeEnabled;
button.displayString = "Patreon Badge: " + (contributor.patreonBadgeEnabled ? "Enabled" : "Disabled");
}
DraconicEvolution.network.sendToServer(new ContributorPacket(player.getCommandSenderName(), contributor.contributorWingsEnabled, contributor.patreonBadgeEnabled));
DraconicEvolution.network.sendToServer(new ContributorPacket(
player.getCommandSenderName(),
contributor.contributorWingsEnabled,
contributor.patreonBadgeEnabled));
}
}
@Override
protected ComponentCollection assembleComponents() {
ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this).setOpenBoarders();
c.addComponent(new ComponentTexturedRect(0, -15, 198, 20, inventoryTexture)).setGroup("TEXT_TAB");
c.addComponent(new ComponentTexturedRect(0, 0, 198, 89, inventoryTexture)).setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 13, 0, 9, 198, 80, inventoryTexture, false)).setGroup("BACKGROUND_EXTENSION");
c.addComponent(new ComponentButton(3, 26, 20, 12, 0, this, "<=", StatCollector.translateToLocal("gui.back"))).setGroup("BUTTONS").setName("BACK_BUTTON");
c.addComponent(new ComponentButton(3, 39, 20, 12, 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");
c.addComponent(new ComponentButton(0, ySize, xSize, 14, 2, this, StatCollector.translateToLocal("gui.de.configureGuiElements.txt")).setGroup("INV_SCREEN"));
c.addComponent(new ComponentTexturedRect(0, -15, 198, 20, inventoryTexture))
.setGroup("TEXT_TAB");
c.addComponent(new ComponentTexturedRect(0, 0, 198, 89, inventoryTexture))
.setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 13, 0, 9, 198, 80, inventoryTexture, false))
.setGroup("BACKGROUND_EXTENSION");
c.addComponent(new ComponentButton(3, 26, 20, 12, 0, this, "<=", StatCollector.translateToLocal("gui.back")))
.setGroup("BUTTONS")
.setName("BACK_BUTTON");
c.addComponent(new ComponentButton(
3, 39, 20, 12, 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");
c.addComponent(new ComponentButton(
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).setLabel(StatCollector.translateToLocal("gui.de.profile.txt") + ":", 0xE0E0E0).setGroup("TEXT_TAB").setName("PROFILE_TEXT_FIELD");
ComponentTextField textField = (ComponentTextField) new ComponentTextField(this, 3, -12, 191, 12)
.setLabel(StatCollector.translateToLocal("gui.de.profile.txt") + ":", 0xE0E0E0)
.setGroup("TEXT_TAB")
.setName("PROFILE_TEXT_FIELD");
c.addComponent(textField);
return c;
}
protected void addDependentComponents() {
for (int x = 0; x < 9; x++) {
collection.addComponent(new ComponentConfigItemButton(29 + 18 * x, 64, x, player)).setGroup("INV_SCREEN");
collection
.addComponent(new ComponentConfigItemButton(29 + 18 * x, 64, x, player))
.setGroup("INV_SCREEN");
}
for (int y = 0; y < 3; y++) {
for (int x = 0; x < 9; x++) {
collection.addComponent(new ComponentConfigItemButton(29 + 18 * x, 7 + y * 18, x + y * 9 + 9, player)).setGroup("INV_SCREEN");
collection
.addComponent(new ComponentConfigItemButton(29 + 18 * x, 7 + y * 18, x + y * 9 + 9, player))
.setGroup("INV_SCREEN");
}
}
for (int y = 0; y < 4; y++) {
collection.addComponent(new ComponentConfigItemButton(6, 7 + y * 19, 39 - y, player)).setGroup("INV_SCREEN");
collection
.addComponent(new ComponentConfigItemButton(6, 7 + y * 19, 39 - y, player))
.setGroup("INV_SCREEN");
}
setLevel(0);
@@ -136,7 +174,10 @@ public class GUIToolConfig extends GUIBase {
int fieldOffsetY = 5;
for (ComponentBase component : collection.getComponents()) {
if (component.isEnabled() && component instanceof ComponentConfigItemButton && component.isMouseOver(x - this.guiLeft, y - this.guiTop) && ((ComponentConfigItemButton) component).hasValidItem) {
if (component.isEnabled()
&& component instanceof ComponentConfigItemButton
&& component.isMouseOver(x - this.guiLeft, y - this.guiTop)
&& ((ComponentConfigItemButton) component).hasValidItem) {
ItemStack stack = player.inventory.getStackInSlot(((ComponentConfigItemButton) component).slot);
if (stack == null || !(stack.getItem() instanceof IConfigurableItem)) return;
buttonPressed = true;
@@ -145,7 +186,9 @@ public class GUIToolConfig extends GUIBase {
setEditingItem(stack, ((ComponentConfigItemButton) component).slot);
setLevel(1);
for (ItemConfigField field : item.getFields(stack, ((ComponentConfigItemButton) component).slot)) {
collection.addComponent(new ComponentFieldButton(fieldOffsetX, fieldOffsetY, player, field, this)).setGroup("LIST_SCREEN");
collection
.addComponent(new ComponentFieldButton(fieldOffsetX, fieldOffsetY, player, field, this))
.setGroup("LIST_SCREEN");
fieldOffsetY += 12;
}
@@ -160,7 +203,8 @@ public class GUIToolConfig extends GUIBase {
}
}
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField && !collection.getComponent("PROFILE_TEXT_FIELD").isMouseOver(x - guiLeft, y - guiTop)) {
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField
&& !collection.getComponent("PROFILE_TEXT_FIELD").isMouseOver(x - guiLeft, y - guiTop)) {
((ComponentTextField) collection.getComponent("PROFILE_TEXT_FIELD")).textField.setFocused(false);
}
}
@@ -169,13 +213,13 @@ public class GUIToolConfig extends GUIBase {
public void buttonClicked(int id, int button) {
super.buttonClicked(id, button);
if (id == 0 && screenLevel > 0) {//button back
if (id == 0 && screenLevel > 0) { // button back
setLevel(screenLevel - 1);
} else if (id == 1 && editingItem != null) {//inventory button
} else if (id == 1 && editingItem != null) { // inventory button
setLevel(3);
Minecraft.getMinecraft().displayGuiScreen(new GUIToolInventory(player, container, this));
// LogHelper.info("Pre send container " + Minecraft.getMinecraft().thePlayer.openContainer);
// DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLINVENTORY, false));
// LogHelper.info("Pre send container " + Minecraft.getMinecraft().thePlayer.openContainer);
// DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLINVENTORY, false));
} else if (id == 2) {
Minecraft.getMinecraft().displayGuiScreen(new GuiHudConfig(this));
}
@@ -184,29 +228,33 @@ public class GUIToolConfig extends GUIBase {
public void setLevel(int level) {
this.screenLevel = level;
if (level == 0) {//inv screen
if (level == 0) { // inv screen
collection.schedulRemoval("LIST_SCREEN");
collection.setOnlyGroupEnabled("INV_SCREEN");
collection.setGroupEnabled("BACKGROUND", true);
collection.setComponentEnabled("BACK_BUTTON", false);
slot = -1;
} else if (level == 1) {//list screen
} else if (level == 1) { // list screen
collection.setOnlyGroupEnabled("LIST_SCREEN");
collection.setGroupEnabled("BACKGROUND", true);
collection.setGroupEnabled("BACKGROUND_EXTENSION", true);
if (editingItem != null && editingItem.getItem() instanceof IConfigurableItem && ((IConfigurableItem) editingItem.getItem()).hasProfiles())
if (editingItem != null
&& editingItem.getItem() instanceof IConfigurableItem
&& ((IConfigurableItem) editingItem.getItem()).hasProfiles())
collection.setGroupEnabled("TEXT_TAB", true);
collection.setComponentEnabled("BACK_BUTTON", true);
if (editingItem != null && editingItem.getItem() instanceof IInventoryTool)
collection.setComponentEnabled("INVENTORY_BUTTON", true);
if (collection.getComponent("BACK_BUTTON") != null) collection.getComponent("BACK_BUTTON").setY(26);
} else if (level == 2) {//field screen
if (collection.getComponent("BACK_BUTTON") != null)
collection.getComponent("BACK_BUTTON").setY(26);
} else if (level == 2) { // field screen
collection.setOnlyGroupEnabled("FIELD_BUTTONS");
collection.setGroupEnabled("BACKGROUND", true);
collection.setComponentEnabled("BACK_BUTTON", true);
if (collection.getComponent("BACK_BUTTON") != null) collection.getComponent("BACK_BUTTON").setY(3);
// slot = -1;
} else if (level == 3) {//inventory screen
if (collection.getComponent("BACK_BUTTON") != null)
collection.getComponent("BACK_BUTTON").setY(3);
// slot = -1;
} else if (level == 3) { // inventory screen
}
}
@@ -229,7 +277,9 @@ public class GUIToolConfig extends GUIBase {
@Override
protected void keyTyped(char par1, int par2) {
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField && ((ComponentTextField) collection.getComponent("PROFILE_TEXT_FIELD")).isFocused() && par2 != 1) {
if (collection.getComponent("PROFILE_TEXT_FIELD") instanceof ComponentTextField
&& ((ComponentTextField) collection.getComponent("PROFILE_TEXT_FIELD")).isFocused()
&& par2 != 1) {
collection.keyTyped(par1, par2);
return;
}
@@ -251,16 +301,23 @@ public class GUIToolConfig extends GUIBase {
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
if (slot > -1) editingItem = player.inventory.getStackInSlot(slot);
if (slot > -1 && editingItem != null && editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
if (slot > -1
&& editingItem != null
&& editingItem.getUnlocalizedName().toLowerCase().contains("bow")) {
BowHandler.BowProperties properties = new BowHandler.BowProperties(editingItem, player);
if (!properties.canFire() && properties.cantFireMessage != null && !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
fontRendererObj.drawSplitString(StatCollector.translateToLocal(properties.cantFireMessage), 0, ySize + 5, xSize, 0xFF0000);
if (!properties.canFire()
&& properties.cantFireMessage != null
&& !properties.cantFireMessage.equals("msg.de.outOfArrows.name")) {
fontRendererObj.drawSplitString(
StatCollector.translateToLocal(properties.cantFireMessage), 0, ySize + 5, xSize, 0xFF0000);
}
List<String> list = new ArrayList<String>();
list.add(StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": " + Utills.addCommas(properties.calculateEnergyCost()));
list.add(StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": " + properties.arrowDamage * (properties.arrowSpeed * 3));
list.add(StatCollector.translateToLocal("gui.de.rfPerShot.txt") + ": "
+ Utills.addCommas(properties.calculateEnergyCost()));
list.add(StatCollector.translateToLocal("gui.de.maxDamage.txt") + ": "
+ properties.arrowDamage * (properties.arrowSpeed * 3));
drawHoveringText(list, xSize - 8, 0, fontRendererObj);
}
}
@@ -13,7 +13,8 @@ import org.lwjgl.opengl.GL11;
*/
public class GUIToolInventory extends GUIBase {
private static final ResourceLocation inventoryTexture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
private static final ResourceLocation inventoryTexture =
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/ToolConfig.png");
private ContainerAdvTool container;
private String inventoryName;
@@ -37,13 +38,16 @@ public class GUIToolInventory extends GUIBase {
@Override
protected ComponentCollection assembleComponents() {
ComponentCollection c = new ComponentCollection(0, 0, xSize, ySize, this);
c.addComponent(new ComponentTexturedRect(0, 130 - 89, 198, 89, inventoryTexture)).setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 0, 198, 80, inventoryTexture)).setGroup("BACKGROUND");
c.addComponent(new ComponentTexturedRect(0, 130 - 89, 198, 89, 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"));
for (int i = 0; i < 5; i++) {
c.addComponent(new ComponentSlotBackground(172, 18 + i * 21)).setGroup("INVENTORY");
c.addComponent(new ComponentTexturedRect(173, 20 + i * 21, 0, 89, 16, 14, inventoryTexture, true)).setGroup("INVENTORY");
c.addComponent(new ComponentTexturedRect(173, 20 + i * 21, 0, 89, 16, 14, inventoryTexture, true))
.setGroup("INVENTORY");
}
return c;
}
@@ -64,7 +68,9 @@ public class GUIToolInventory extends GUIBase {
collection.addComponent(new ComponentSlotBackground(7 + x * 18, 18)).setGroup("INVENTORY");
ComponentSlotBackground.addInventorySlots(collection, 7, 44, container.inventoryItemSlot);
if (container.inventoryItemSlot > 35)
collection.addComponent(new ComponentItemRenderer(6, 18, container.inventoryTool.inventoryItem)).setGroup("INVENTORY");
collection
.addComponent(new ComponentItemRenderer(6, 18, container.inventoryTool.inventoryItem))
.setGroup("INVENTORY");
}
@Override
@@ -29,24 +29,24 @@ public class ManualPage {
}
public String getImageResourceName(String url) {
// try
// {
// try
// {
LogHelper.info(url);
return FilenameUtils.getName(url);
//String fileName = new URL(url).getFile();
//return fileName.substring(fileName.indexOf("/") + 1);
// }
// catch (MalformedURLException e)
// {
// e.printStackTrace();
// return "";
// }
// String fileName = new URL(url).getFile();
// return fileName.substring(fileName.indexOf("/") + 1);
// }
// catch (MalformedURLException e)
// {
// e.printStackTrace();
// return "";
// }
}
public String getLocalizedName() {
if (nameL != null) return nameL;
return (name.contains("item.") || name.contains("tile.")) ? StatCollector.translateToLocal(name + ".name") : name.contains("info.") ? name.substring(name.indexOf("info.") + 5) : "Invalid Name Data";
return (name.contains("item.") || name.contains("tile."))
? StatCollector.translateToLocal(name + ".name")
: name.contains("info.") ? name.substring(name.indexOf("info.") + 5) : "Invalid Name Data";
}
}
@@ -5,21 +5,21 @@ 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.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Brandon on 29/12/2014.
*/
public class ComponentConfigItemButton extends ComponentBase {
private static final ResourceLocation texture = new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png");
private static final ResourceLocation texture =
new ResourceLocation(References.RESOURCESPREFIX + "textures/gui/Widgets.png");
public int slot;
private InventoryPlayer inventory;
public boolean hasValidItem = false;
@@ -32,7 +32,13 @@ public class ComponentConfigItemButton extends ComponentBase {
}
public void refreshState() {
hasValidItem = (inventory.getStackInSlot(slot) != null && ((inventory.getStackInSlot(slot).getItem() instanceof IConfigurableItem && !((IConfigurableItem) inventory.getStackInSlot(slot).getItem()).getFields(inventory.getStackInSlot(slot), slot).isEmpty()) || inventory.getStackInSlot(slot).getItem() instanceof IInventoryTool));
hasValidItem = (inventory.getStackInSlot(slot) != null
&& ((inventory.getStackInSlot(slot).getItem() instanceof IConfigurableItem
&& !((IConfigurableItem)
inventory.getStackInSlot(slot).getItem())
.getFields(inventory.getStackInSlot(slot), slot)
.isEmpty())
|| inventory.getStackInSlot(slot).getItem() instanceof IInventoryTool));
}
@Override
@@ -58,18 +64,17 @@ public class ComponentConfigItemButton extends ComponentBase {
}
@Override
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
}
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
@Override
public void renderFinal(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
if (isMouseOver(mouseX, mouseY) && hasValidItem) {
List<String> list = new ArrayList<String>();
List<ItemConfigField> fields = ((IConfigurableItem) inventory.getStackInSlot(slot).getItem()).getFields(inventory.getStackInSlot(slot), slot);
List<ItemConfigField> fields = ((IConfigurableItem)
inventory.getStackInSlot(slot).getItem())
.getFields(inventory.getStackInSlot(slot), slot);
for (ItemConfigField field : fields) {
list.add(field.getLocalizedName() + ": " + field.getFormattedValue());
}
drawHoveringText(list, mouseX + offsetX, mouseY + offsetY + 10, fontRendererObj);
}
@@ -78,7 +83,9 @@ public class ComponentConfigItemButton extends ComponentBase {
@Override
public void mouseClicked(int x, int y, int button) {
if (hasValidItem) {
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
Minecraft.getMinecraft()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
}
}
}
@@ -4,9 +4,13 @@ import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentScrollingB
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 com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.gui.GuiConfirmOpenLink;
@@ -18,11 +22,6 @@ import net.minecraft.util.StatCollector;
import net.minecraft.util.StringUtils;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by brandon3055 on 5/11/2015.
*/
@@ -46,7 +45,6 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (scrollOffset < 0) scrollOffset = 0;
if (scrollOffset > pageLength - getHeight()) scrollOffset = pageLength - getHeight();
if (pageLength <= getHeight()) scrollOffset = 0;
}
@Override
@@ -66,7 +64,12 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
yOffset += 20;
if (yOffset > 0) {
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("info.de.manual.contributors.txt"), getWidth() / 2, yOffset, 0x00FFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("info.de.manual.contributors.txt"),
getWidth() / 2,
yOffset,
0x00FFFF);
}
yOffset += 10;
@@ -79,7 +82,11 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!(yOffset > 25 && yOffset < 324)) continue;
if (mouseX > 15 && mouseX < 245 && mouseY < yOffset + 5 && mouseY > yOffset - 25 && !patreonButtonHighlighted) {
if (mouseX > 15
&& mouseX < 245
&& mouseY < yOffset + 5
&& mouseY > yOffset - 25
&& !patreonButtonHighlighted) {
ResourceHandler.bindResource("textures/gui/manualTop.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glColor4f(0F, 0F, 0F, 0.4F);
@@ -94,8 +101,10 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
renderPlayer(contributor.ign);
GL11.glPopMatrix();
fontRendererObj.drawStringWithShadow(EnumChatFormatting.GOLD + contributor.name, 50, yOffset - 20, 0x000000);
fontRendererObj.drawString(EnumChatFormatting.DARK_BLUE + contributor.contribution, 50, yOffset - 10, 0x000000);
fontRendererObj.drawStringWithShadow(
EnumChatFormatting.GOLD + contributor.name, 50, yOffset - 20, 0x000000);
fontRendererObj.drawString(
EnumChatFormatting.DARK_BLUE + contributor.contribution, 50, yOffset - 10, 0x000000);
}
}
@@ -111,7 +120,11 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!(yOffset > 20 && yOffset < 330)) continue;
if (mouseX > 15 && mouseX < 245 && mouseY < yOffset + 5 && mouseY > yOffset - 25 && !patreonButtonHighlighted) {
if (mouseX > 15
&& mouseX < 245
&& mouseY < yOffset + 5
&& mouseY > yOffset - 25
&& !patreonButtonHighlighted) {
List<String> list = new ArrayList<String>();
list.add(EnumChatFormatting.GOLD + contributor.contribution);
@@ -129,7 +142,8 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!StringUtils.isNullOrEmpty(contributor.website)) {
list.add("");
list.add("Website: " + EnumChatFormatting.BLUE + contributor.website);
list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("info.de.manual.clickToGoToSite.txt"));
list.add(EnumChatFormatting.GRAY
+ StatCollector.translateToLocal("info.de.manual.clickToGoToSite.txt"));
}
drawHoveringText(list, offsetX - 7, offsetY + yOffset + 20, fontRendererObj);
@@ -137,13 +151,12 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
}
if (!ContributorHandler.successfulLoad)
fontRendererObj.drawString("[Error] Failed to download contributors list", offsetX + 20, offsetY + 40, 0xFF0000);
fontRendererObj.drawString(
"[Error] Failed to download contributors list", offsetX + 20, offsetY + 40, 0xFF0000);
}
@Override
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
}
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
private String lastClickURL = "";
@@ -161,7 +174,11 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!(yOffset > 20 && yOffset < 330) || patreonButtonHighlighted) continue;
if (x > 15 && x < 245 && y < yOffset + 5 && y > yOffset - 25 && !StringUtils.isNullOrEmpty(contributor.website)) {
if (x > 15
&& x < 245
&& y < yOffset + 5
&& y > yOffset - 25
&& !StringUtils.isNullOrEmpty(contributor.website)) {
lastClickURL = contributor.website;
mc.displayGuiScreen(new GuiConfirmOpenLink(this, contributor.website, 0, true));
}
@@ -200,5 +217,4 @@ public class ComponentContributorsPage extends ComponentScrollingBase implements
if (!skinCache.containsKey(username)) return AbstractClientPlayer.locationStevePng;
return skinCache.get(username);
}
}
@@ -17,7 +17,8 @@ import net.minecraft.util.StatCollector;
* Created by Brandon on 1/01/2015.
*/
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");
public ItemConfigField field;
@@ -45,15 +46,50 @@ public class ComponentFieldAdjuster extends ComponentBase {
minecraft.getTextureManager().bindTexture(buttonTextures);
if (isBoolean()) {
renderButton((getWidth() / 2) - 30, 0, 60, 20, GuiHelper.isInRect(x + (getWidth() / 2) - 30, y, 60, 20, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) - 30,
0,
60,
20,
GuiHelper.isInRect(x + (getWidth() / 2) - 30, y, 60, 20, mouseX - offsetX, mouseY - offsetY));
} else if (isDecimal() || isNonDecimal()) {
renderButton((getWidth() / 2) - 43, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) - 43, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton((getWidth() / 2) - 69, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) - 69, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton((getWidth() / 2) - 95, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) - 95, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) - 43,
3,
24,
14,
GuiHelper.isInRect(x + (getWidth() / 2) - 43, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) - 69,
3,
24,
14,
GuiHelper.isInRect(x + (getWidth() / 2) - 69, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) - 95,
3,
24,
14,
GuiHelper.isInRect(x + (getWidth() / 2) - 95, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton((getWidth() / 2) + 19, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) + 19, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton((getWidth() / 2) + 45, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) + 45, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton((getWidth() / 2) + 71, 3, 24, 14, GuiHelper.isInRect(x + (getWidth() / 2) + 71, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) + 19,
3,
24,
14,
GuiHelper.isInRect(x + (getWidth() / 2) + 19, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) + 45,
3,
24,
14,
GuiHelper.isInRect(x + (getWidth() / 2) + 45, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
renderButton(
(getWidth() / 2) + 71,
3,
24,
14,
GuiHelper.isInRect(x + (getWidth() / 2) + 71, y + 3, 24, 14, mouseX - offsetX, mouseY - offsetY));
}
}
@@ -66,16 +102,21 @@ public class ComponentFieldAdjuster extends ComponentBase {
double d = (Double) field.value;
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;
// fieldValue = String.valueOf((double)Math.round((double)(d*100f)) / 100D);
//}
// }
int centre = fontRendererObj.getStringWidth(fieldName) / 2;
fontRendererObj.drawString(fieldName, x + getWidth() / 2 - centre, y - 12, 0x00000);
drawCenteredString(fontRendererObj, fieldValue, x + getWidth() / 2, y + 6, 0xffffff);
if (field.modifier == null || field.modifier.equals("AOE"))
drawCenteredString(fontRendererObj, StatCollector.translateToLocal("gui.de.max.txt") + " " + field.getMaxFormattedValue(), x + getWidth() / 2, y + 20, 0xFFFFFF);
drawCenteredString(
fontRendererObj,
StatCollector.translateToLocal("gui.de.max.txt") + " " + field.getMaxFormattedValue(),
x + getWidth() / 2,
y + 20,
0xFFFFFF);
if (isDecimal() || isNonDecimal()) {
fontRendererObj.drawString("---", 7, y + 6, 0x000000);
@@ -84,7 +125,6 @@ public class ComponentFieldAdjuster extends ComponentBase {
fontRendererObj.drawString("+", 127, y + 6, 0x000000);
fontRendererObj.drawString("++", 151, y + 6, 0x000000);
fontRendererObj.drawString("+++", 174, y + 6, 0x000000);
}
}
@@ -98,17 +138,17 @@ public class ComponentFieldAdjuster extends ComponentBase {
if (field == null) return;
if (!isBoolean()) {
if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 43, this.y + 3, 26, 14, x, y)) {//-
if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 43, this.y + 3, 26, 14, x, y)) { // -
incroment(-1);
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 69, this.y + 3, 26, 14, x, y)) {//--
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 69, this.y + 3, 26, 14, x, y)) { // --
incroment(-10);
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 95, this.y + 3, 26, 14, x, y)) {//---
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 95, this.y + 3, 26, 14, x, y)) { // ---
incroment(-100);
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 19, this.y + 3, 26, 14, x, y)) {//+
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 19, this.y + 3, 26, 14, x, y)) { // +
incroment(1);
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 45, this.y + 3, 26, 14, x, y)) {//++
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 45, this.y + 3, 26, 14, x, y)) { // ++
incroment(10);
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 71, this.y + 3, 26, 14, x, y)) {//+++
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) + 71, this.y + 3, 26, 14, x, y)) { // +++
incroment(100);
}
} else if (GuiHelper.isInRect(this.x + (getWidth() / 2) - 30, this.y, 60, 20, x, y)) {
@@ -167,10 +207,13 @@ public class ComponentFieldAdjuster extends ComponentBase {
field.value = !(Boolean) field.value;
break;
}
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
Minecraft.getMinecraft()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
if (stack != null && stack.getItem() instanceof IConfigurableItem) {
DataUtills.writeObjectToCompound(IConfigurableItem.ProfileHelper.getProfileCompound(stack), field.value, field.datatype, field.name);
DataUtills.writeObjectToCompound(
IConfigurableItem.ProfileHelper.getProfileCompound(stack), field.value, field.datatype, field.name);
}
field.sendChanges();
}
@@ -181,11 +224,13 @@ public class ComponentFieldAdjuster extends ComponentBase {
int y = this.y + offsetY;
this.drawTexturedModalRect(x, y, 0, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize));
this.drawTexturedModalRect(x + xSize / 2, y, 200 - xSize / 2, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize));
this.drawTexturedModalRect(
x + xSize / 2, y, 200 - xSize / 2, 46 + k * 20, xSize / 2, 20 - Math.max(0, 20 - ySize));
if (ySize < 20) {
this.drawTexturedModalRect(x, y + 3, 0, (46 + k * 20) + 20 - ySize + 3, xSize - 1, ySize - 3);
this.drawTexturedModalRect(x + xSize / 2, y + 3, 200 - xSize / 2, (46 + k * 20) + 20 - ySize + 3, xSize / 2, ySize - 3);
this.drawTexturedModalRect(
x + xSize / 2, y + 3, 200 - xSize / 2, (46 + k * 20) + 20 - ySize + 3, xSize / 2, ySize - 3);
}
}
@@ -194,7 +239,9 @@ public class ComponentFieldAdjuster extends ComponentBase {
}
private boolean isNonDecimal() {
return field.datatype == References.INT_ID || field.datatype == References.SHORT_ID || field.datatype == References.BYTE_ID;
return field.datatype == References.INT_ID
|| field.datatype == References.SHORT_ID
|| field.datatype == References.BYTE_ID;
}
private boolean isDecimal() {
@@ -1,26 +1,26 @@
package com.brandon3055.draconicevolution.client.gui.guicomponents;
import com.brandon3055.brandonscore.client.gui.guicomponents.ComponentBase;
import com.brandon3055.brandonscore.common.utills.DataUtills;
import com.brandon3055.draconicevolution.client.gui.componentguis.GUIToolConfig;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.brandonscore.common.utills.DataUtills;
import com.brandon3055.draconicevolution.common.utills.IConfigurableItem;
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;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Brandon on 31/12/2014.
*/
public class ComponentFieldButton 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");
public EntityPlayer player;
public int slot;
@@ -68,7 +68,12 @@ public class ComponentFieldButton extends ComponentBase {
@Override
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
drawString(fontRendererObj, field.getLocalizedName(), x + offsetX + 2, y + offsetY + (getHeight() / 2) - (fontRendererObj.FONT_HEIGHT / 2), 0xffffff);
drawString(
fontRendererObj,
field.getLocalizedName(),
x + offsetX + 2,
y + offsetY + (getHeight() / 2) - (fontRendererObj.FONT_HEIGHT / 2),
0xffffff);
}
@Override
@@ -82,13 +87,19 @@ public class ComponentFieldButton extends ComponentBase {
@Override
public void mouseClicked(int x, int y, int button) {
Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
Minecraft.getMinecraft()
.getSoundHandler()
.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
if (field.datatype == References.BOOLEAN_ID) {
field.value = !(Boolean) field.value;
field.sendChanges();
ItemStack stack = gui.player.inventory.getStackInSlot(field.slot);
if (stack != null && stack.getItem() instanceof IConfigurableItem) {
DataUtills.writeObjectToCompound(IConfigurableItem.ProfileHelper.getProfileCompound(stack), field.value, field.datatype, field.name);
DataUtills.writeObjectToCompound(
IConfigurableItem.ProfileHelper.getProfileCompound(stack),
field.value,
field.datatype,
field.name);
}
return;
}
@@ -2,9 +2,9 @@ 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.common.utills.Utills;
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.brandonscore.common.utills.Utills;
import net.minecraft.client.Minecraft;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@@ -26,7 +26,7 @@ public class ComponentIndexButton extends ComponentScrollingBase {
@Override
public void handleScrollInput(int direction) {
//this.y += direction * 10;
// this.y += direction * 10;
}
@Override
@@ -48,7 +48,6 @@ public class ComponentIndexButton extends ComponentScrollingBase {
fontRendererObj.drawString(page.getLocalizedName(), x + 19, sy, mouseOver ? 0xdd00ff : 0x000000);
ResourceHandler.bindResource("textures/gui/Widgets.png");
GL11.glColor4f(1f, 1f, 1f, 1f);
if (mouseOver) {
GL11.glColor4f(0f, 1f, 1f, 1f);
@@ -57,7 +56,6 @@ public class ComponentIndexButton extends ComponentScrollingBase {
if (stack != null && stack.getItem() != null) drawItemStack(stack, x, sy, "");
else drawItemStack(new ItemStack(Items.writable_book), x, sy, "");
}
}
@@ -67,8 +65,7 @@ public class ComponentIndexButton extends ComponentScrollingBase {
}
@Override
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
}
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
public ManualPage getPage() {
return page;
@@ -8,6 +8,11 @@ import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.gui.componentguis.ManualPage;
import com.brandon3055.draconicevolution.client.handler.ResourceHandler;
import com.brandon3055.draconicevolution.client.utill.CustomResourceLocation;
import 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;
@@ -18,12 +23,6 @@ import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.apache.commons.io.FilenameUtils;
import org.lwjgl.opengl.GL11;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* Created by Brandon on 19/03/2015.
*/
@@ -83,13 +82,10 @@ public class ComponentManualPage extends ComponentScrollingBase {
}
@Override
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) {}
@Override
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
}
public void renderForground(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {}
@Override
public void updateScreen() {
@@ -104,6 +100,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
* 0 = text, 1 = image, 2 = crafting
*/
private int type;
public int yPos;
private ComponentManualPage page;
private String[] textLines;
@@ -157,7 +154,8 @@ public class ComponentManualPage extends ComponentScrollingBase {
if (stack != null) {
for (IRecipe recipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
for (IRecipe recipe :
(List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
if (recipe == null) continue;
ItemStack result = recipe.getRecipeOutput();
@@ -169,7 +167,10 @@ public class ComponentManualPage extends ComponentScrollingBase {
recipes.add(recipe);
}
Iterator iterator = FurnaceRecipes.smelting().getSmeltingList().entrySet().iterator();
Iterator iterator = FurnaceRecipes.smelting()
.getSmeltingList()
.entrySet()
.iterator();
Map.Entry entry;
while (iterator.hasNext()) {
@@ -183,14 +184,20 @@ public class ComponentManualPage extends ComponentScrollingBase {
}
public int getHeight() {
if (type == 1 && (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content)) || (slide && ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))))) {
CustomResourceLocation texture = slide ? ResourceHandler.downloadedImages.get(FilenameUtils.getName(content)) : ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
if (type == 1
&& (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))
|| (slide
&& ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))))) {
CustomResourceLocation texture = slide
? ResourceHandler.downloadedImages.get(FilenameUtils.getName(content))
: ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
return (int) ((double) texture.getHeight() / (double) texture.getWidth() * 220D) + 5;
} else if (type == 2) {
return (recipes.size() + smeltingRecipes.size()) * 57;
}
return ((textLines != null ? textLines.length * 10 : 10) + 5) + ((isTitle && (page.page.name.contains("tile.") || page.page.name.contains("item."))) ? 18 : 0);
return ((textLines != null ? textLines.length * 10 : 10) + 5)
+ ((isTitle && (page.page.name.contains("tile.") || page.page.name.contains("item."))) ? 18 : 0);
}
public void render(int mouseX, int mouseY) {
@@ -203,7 +210,8 @@ public class ComponentManualPage extends ComponentScrollingBase {
} else if (isTitle) {
int y = yPos - page.scrollOffset;
if (y > 310 || y < 5) return;
page.drawCenteredString(page.fontRendererObj, content.substring(content.indexOf("title.") + 6), 128, y, 0x00ffff);
page.drawCenteredString(
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) {
ResourceHandler.bindResource("textures/gui/Widgets.png");
@@ -221,17 +229,20 @@ public class ComponentManualPage extends ComponentScrollingBase {
}
private void renderImage() {
CustomResourceLocation image = null;//slide ? ResourceHandler.downloadedImages.get(slides.get(page.slideTick % slides.size() - 1)) : ResourceHandler.downloadedImages.get(content);
CustomResourceLocation image =
null; // slide ? ResourceHandler.downloadedImages.get(slides.get(page.slideTick % slides.size() -
// 1)) : ResourceHandler.downloadedImages.get(content);
if (slide) {
int index = (page.slideTick / 20) % (slides.size());
image = (slides.size() > index) ? ResourceHandler.downloadedImages.get(FilenameUtils.getName(slides.get(index))) : null;
image = (slides.size() > index)
? ResourceHandler.downloadedImages.get(FilenameUtils.getName(slides.get(index)))
: null;
} else if (ResourceHandler.downloadedImages.containsKey(FilenameUtils.getName(content))) {
image = ResourceHandler.downloadedImages.get(FilenameUtils.getName(content));
}
if (image != null) {
//CustomResourceLocation image = ResourceHandler.downloadedImages.get(content);
// CustomResourceLocation image = ResourceHandler.downloadedImages.get(content);
image.bind();
Tessellator tess = Tessellator.instance;
@@ -286,7 +297,13 @@ public class ComponentManualPage extends ComponentScrollingBase {
if (y + yDown + posY < 0 || y + yDown + posY > 305) continue;
page.drawTexturedModalRect(x + posX, y + yDown + posY, 138, 0, 18, 18);
ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack ? getRecipeInput(recipe)[i] : getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ArrayList ? ((ArrayList) getRecipeInput(recipe)[i]).get(0) : null);
ItemStack stack = (ItemStack)
(getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack
? getRecipeInput(recipe)[i]
: getRecipeInput(recipe).length > i
&& getRecipeInput(recipe)[i] instanceof ArrayList
? ((ArrayList) getRecipeInput(recipe)[i]).get(0)
: null);
if (stack != null) {
if (stack.getItemDamage() == OreDictionary.WILDCARD_VALUE) stack.setItemDamage(0);
@@ -301,7 +318,6 @@ public class ComponentManualPage extends ComponentScrollingBase {
if (recipe.getRecipeOutput() != null)
page.drawItemStack(recipe.getRecipeOutput(), 5 + 90 + posX, 5 + 14 + yDown + posY, "");
}
}
for (IRecipe recipe : recipes) {
@@ -325,7 +341,13 @@ public class ComponentManualPage extends ComponentScrollingBase {
int y = i / 3 * 18;
if (y + yDown + posY < 0 || y + yDown + posY > 305) continue;
ItemStack stack = (ItemStack) (getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack ? getRecipeInput(recipe)[i] : getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ArrayList ? ((ArrayList) getRecipeInput(recipe)[i]).get(0) : null);
ItemStack stack = (ItemStack)
(getRecipeInput(recipe).length > i && getRecipeInput(recipe)[i] instanceof ItemStack
? getRecipeInput(recipe)[i]
: getRecipeInput(recipe).length > i
&& getRecipeInput(recipe)[i] instanceof ArrayList
? ((ArrayList) getRecipeInput(recipe)[i]).get(0)
: null);
if (stack != null) {
if (GuiHelper.isInRect(1 + x + posX, 1 + y + yDown + posY, 18, 18, mouseX, mouseY)) {
@@ -381,7 +403,8 @@ public class ComponentManualPage extends ComponentScrollingBase {
}
private Object[] getRecipeInput(IRecipe recipe) {
if (recipe instanceof ShapelessOreRecipe) return ((ShapelessOreRecipe) recipe).getInput().toArray();
if (recipe instanceof ShapelessOreRecipe)
return ((ShapelessOreRecipe) recipe).getInput().toArray();
else if (recipe instanceof ShapedOreRecipe) return getShapedOreRecipe((ShapedOreRecipe) recipe);
else if (recipe instanceof ShapedRecipes) return ((ShapedRecipes) recipe).recipeItems;
else if (recipe instanceof ShapelessRecipes)
@@ -409,8 +432,7 @@ public class ComponentManualPage extends ComponentScrollingBase {
}
return grid;
}
}
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
}
return null;
@@ -18,34 +18,30 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
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.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
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.minecraft.item.ItemStack;
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 org.lwjgl.opengl.GL12;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Random;
/**
* Created by Brandon on 28/10/2014.
*/
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;
private static float previousFOB = 0f;
@@ -72,12 +68,13 @@ public class ClientEventHandler {
if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT)
return;
for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = playerShieldStatus.entrySet().iterator(); i.hasNext(); ) {
for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i =
playerShieldStatus.entrySet().iterator();
i.hasNext(); ) {
Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next();
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
}
if (mc == null) mc = Minecraft.getMinecraft();
else if (mc.theWorld != null) {
elapsedTicks++;
@@ -99,7 +96,8 @@ public class ClientEventHandler {
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f)
energyCrystalAlphaTarget = rand.nextFloat();
playerHoldingWrench = mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() == ModItems.wrench;
playerHoldingWrench = mc.thePlayer.getHeldItem() != null
&& mc.thePlayer.getHeldItem().getItem() == ModItems.wrench;
searchForPlayerMount();
}
@@ -109,7 +107,7 @@ public class ClientEventHandler {
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void renderGameOverlayEvent (final RenderGameOverlayEvent.Post event) {
public void renderGameOverlayEvent(final RenderGameOverlayEvent.Post event) {
if (event.type == RenderGameOverlayEvent.ElementType.ALL) {
statusDisplayManager.drawItemStack();
}
@@ -118,36 +116,42 @@ public class ClientEventHandler {
@SubscribeEvent(priority = EventPriority.LOW)
public void fovUpdate(FOVUpdateEvent event) {
//region Bow FOV Update
if (event.entity.getHeldItem() != null && (event.entity.getHeldItem().getItem() instanceof WyvernBow || event.entity.getHeldItem().getItem() instanceof DraconicBow) && Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
// region Bow FOV Update
if (event.entity.getHeldItem() != null
&& (event.entity.getHeldItem().getItem() instanceof WyvernBow
|| event.entity.getHeldItem().getItem() instanceof DraconicBow)
&& Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
BowHandler.BowProperties properties = new BowHandler.BowProperties(event.entity.getHeldItem(), event.entity);
BowHandler.BowProperties properties =
new BowHandler.BowProperties(event.entity.getHeldItem(), event.entity);
event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov;
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
// bowZoom = true;
// tickSet = elapsedTicks;
// }
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
// bowZoom = true;
// tickSet = elapsedTicks;
// }
}
//endregion
// endregion
//region Armor move speed FOV effect cancellation
// region Armor move speed FOV effect cancellation
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity);
if (summery != null && summery.speedModifier > 0) {
IAttributeInstance iattributeinstance = event.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
float f = (float) ((iattributeinstance.getAttributeValue() / (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
IAttributeInstance iattributeinstance =
event.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
float f = (float)
((iattributeinstance.getAttributeValue() / (double) event.entity.capabilities.getWalkSpeed() + 1.0D)
/ 2.0D);
event.newfov /= f;
}
//endregion
// endregion
}
private void searchForPlayerMount() {
if (remountTicksRemaining > 0) {
Entity e = Minecraft.getMinecraft().theWorld.getEntityByID(remountEntityID);
@@ -180,7 +184,8 @@ public class ClientEventHandler {
@SubscribeEvent
public void renderArmorEvent(RenderPlayerEvent.SetArmorModel event) {
if (ConfigHandler.useOriginal3DArmorModel || ConfigHandler.useOldArmorModel || event.isCanceled()) return;
if (event.stack != null && (event.stack.getItem() instanceof DraconicArmor || event.stack.getItem() instanceof WyvernArmor)) {
if (event.stack != null
&& (event.stack.getItem() instanceof DraconicArmor || event.stack.getItem() instanceof WyvernArmor)) {
ItemArmor itemarmor = (ItemArmor) event.stack.getItem();
ModelBiped modelbiped = itemarmor.getArmorModel(event.entityPlayer, event.stack, event.slot);
event.renderer.setRenderPassModel(modelbiped);
@@ -206,7 +211,8 @@ public class ClientEventHandler {
EntityPlayer viewingPlayer = Minecraft.getMinecraft().thePlayer;
int i = 5 - (elapsedTicks - playerShieldStatus.get(event.entityPlayer).getValue());
int i = 5
- (elapsedTicks - playerShieldStatus.get(event.entityPlayer).getValue());
GL11.glColor4f(1F - p, 0F, p, i / 5F);
@@ -215,9 +221,12 @@ public class ClientEventHandler {
double translationYLT = event.entityPlayer.prevPosY - viewingPlayer.prevPosY;
double translationZLT = event.entityPlayer.prevPosZ - viewingPlayer.prevPosZ;
double translationX = translationXLT + (((event.entityPlayer.posX - viewingPlayer.posX) - translationXLT) * event.partialRenderTick);
double translationY = translationYLT + (((event.entityPlayer.posY - viewingPlayer.posY) - translationYLT) * event.partialRenderTick);
double translationZ = translationZLT + (((event.entityPlayer.posZ - viewingPlayer.posZ) - translationZLT) * event.partialRenderTick);
double translationX = translationXLT
+ (((event.entityPlayer.posX - viewingPlayer.posX) - translationXLT) * event.partialRenderTick);
double translationY = translationYLT
+ (((event.entityPlayer.posY - viewingPlayer.posY) - translationYLT) * event.partialRenderTick);
double translationZ = translationZLT
+ (((event.entityPlayer.posZ - viewingPlayer.posZ) - translationZLT) * event.partialRenderTick);
GL11.glTranslated(translationX, translationY + 1.1, translationZ);
} else {
@@ -1,8 +1,5 @@
package com.brandon3055.draconicevolution.client.handler;
import java.util.ArrayList;
import java.util.List;
import com.brandon3055.brandonscore.client.utills.GuiHelper;
import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.gui.GuiHudConfig;
@@ -13,6 +10,8 @@ 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.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiChat;
@@ -47,8 +46,9 @@ public class HudHandler {
@SideOnly(Side.CLIENT)
public void drawHUD(RenderGameOverlayEvent.Post event) {
Minecraft mc = Minecraft.getMinecraft();
if (event.type != RenderGameOverlayEvent.ElementType.ALL || mc.gameSettings.showDebugInfo || mc.currentScreen instanceof GuiChat)
return;
if (event.type != RenderGameOverlayEvent.ElementType.ALL
|| mc.gameSettings.showDebugInfo
|| mc.currentScreen instanceof GuiChat) return;
ScaledResolution resolution = event.resolution;
width = resolution.getScaledWidth();
@@ -60,7 +60,15 @@ public class HudHandler {
int y = (int) (((float) ConfigHandler.hudSettings[1] / 1000F) * (float) height);
GL11.glPushMatrix();
GuiHelper.drawHoveringText(hudList, x, y, fontRenderer, toolTipFadeOut > 1 ? 1 : toolTipFadeOut, ConfigHandler.hudSettings[4] / 100D, width, height);
GuiHelper.drawHoveringText(
hudList,
x,
y,
fontRenderer,
toolTipFadeOut > 1 ? 1 : toolTipFadeOut,
ConfigHandler.hudSettings[4] / 100D,
width,
height);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
@@ -73,14 +81,15 @@ public class HudHandler {
}
}
//x, y, x, y, scale, scale, fademode, fademode, rotateArmor, armorText
// x, y, x, y, scale, scale, fademode, fademode, rotateArmor, armorText
@SideOnly(Side.CLIENT)
public static void clientTick() {
if (ConfigHandler.hudSettings[6] > 0 && toolTipFadeOut > 1F - ((float) ConfigHandler.hudSettings[6] * 0.25F)) {
toolTipFadeOut -= 0.1F;
}
if (hudList != null && (ltHudList == null || !hudList.equals(ltHudList))) toolTipFadeOut = 5F;
if (ConfigHandler.hudSettings[7] > 0 && armorStatsFadeOut > 1F - ((float) ConfigHandler.hudSettings[7] * 0.25F)) {
if (ConfigHandler.hudSettings[7] > 0
&& armorStatsFadeOut > 1F - ((float) ConfigHandler.hudSettings[7] * 0.25F)) {
armorStatsFadeOut -= 0.1F;
if (armorStatsFadeOut < 0) armorStatsFadeOut = 0;
}
@@ -103,13 +112,18 @@ public class HudHandler {
toolTipFadeOut = 1F;
armorStatsFadeOut = 1F;
}
} else if (mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() instanceof IHudDisplayItem) {
hudList = ((IHudDisplayItem) mc.thePlayer.getHeldItem().getItem()).getDisplayData(mc.thePlayer.getHeldItem());
} else if (mc.thePlayer.getHeldItem() != null
&& mc.thePlayer.getHeldItem().getItem() instanceof IHudDisplayItem) {
hudList =
((IHudDisplayItem) mc.thePlayer.getHeldItem().getItem()).getDisplayData(mc.thePlayer.getHeldItem());
}
MovingObjectPosition mop = mc.thePlayer.rayTrace(5, 0);
if (mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ) instanceof IHudDisplayBlock) {
hudList = ((IHudDisplayBlock) mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ)).getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ);
if (mop != null
&& mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ) instanceof IHudDisplayBlock) {
hudList = ((IHudDisplayBlock) mc.theWorld.getBlock(mop.blockX, mop.blockY, mop.blockZ))
.getDisplayData(mc.theWorld, mop.blockX, mop.blockY, mop.blockZ);
}
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(mc.thePlayer);
@@ -120,18 +134,20 @@ public class HudHandler {
}
showShieldHud = armorStatsFadeOut > 0F;
if (maxShieldPoints != summery.maxProtectionPoints || shieldPoints != summery.protectionPoints || shieldEntropy != summery.entropy || rfTotal != summery.totalEnergyStored)
armorStatsFadeOut = 5F;
if (maxShieldPoints != summery.maxProtectionPoints
|| shieldPoints != summery.protectionPoints
|| shieldEntropy != summery.entropy
|| rfTotal != summery.totalEnergyStored) armorStatsFadeOut = 5F;
maxShieldPoints = summery.maxProtectionPoints;
shieldPoints = summery.protectionPoints;
shieldPercentCharge = (int) (summery.protectionPoints / summery.maxProtectionPoints * 100D);
shieldEntropy = summery.entropy;
rfCharge = (int) ((double) summery.totalEnergyStored / Math.max((double) summery.maxTotalEnergyStorage, 1D) * 100D);
rfCharge = (int)
((double) summery.totalEnergyStored / Math.max((double) summery.maxTotalEnergyStorage, 1D) * 100D);
rfTotal = summery.totalEnergyStored;
}
private void drawArmorHUD(int x, int y, boolean rotated, double scale) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -153,10 +169,30 @@ public class HudHandler {
} else GuiHelper.drawTexturedRect(x + 1, y + 105, 15, 17, 2, 0, 13, 15, 0, GuiHelper.PXL128);
GuiHelper.drawTexturedRect(x, y, 17, 104, 0, 15, 17, 104, 0, GuiHelper.PXL128);
GuiHelper.drawTexturedRect(x + 2, y + 2 + (100 - shieldPercentCharge), 7, shieldPercentCharge, 17, 100 - shieldPercentCharge, 7, shieldPercentCharge, 0, GuiHelper.PXL128);
GuiHelper.drawTexturedRect(x + 10, y + 2 + 100 - (int) shieldEntropy, 2, (int) shieldEntropy, 25, 100 - (int) shieldEntropy, 2, (int) shieldEntropy, 0, GuiHelper.PXL128);
GuiHelper.drawTexturedRect(x + 13, y + 2 + 100 - rfCharge, 2, rfCharge, 28, 100 - rfCharge, 2, rfCharge, 0, GuiHelper.PXL128);
GuiHelper.drawTexturedRect(
x + 2,
y + 2 + (100 - shieldPercentCharge),
7,
shieldPercentCharge,
17,
100 - shieldPercentCharge,
7,
shieldPercentCharge,
0,
GuiHelper.PXL128);
GuiHelper.drawTexturedRect(
x + 10,
y + 2 + 100 - (int) shieldEntropy,
2,
(int) shieldEntropy,
25,
100 - (int) shieldEntropy,
2,
(int) shieldEntropy,
0,
GuiHelper.PXL128);
GuiHelper.drawTexturedRect(
x + 13, y + 2 + 100 - rfCharge, 2, rfCharge, 28, 100 - rfCharge, 2, rfCharge, 0, GuiHelper.PXL128);
if (ConfigHandler.hudSettings[9] == 1) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
@@ -168,13 +204,25 @@ public class HudHandler {
String energy = "RF: " + Utills.formatNumber(rfTotal);
float fade = Math.min(armorStatsFadeOut, 1F);
if (!rotated) {
fontRenderer.drawStringWithShadow(shield, x + 18, y + 74, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(energy, x + 18, y + 84, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(entropy, x + 18, y + 94, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(
shield, x + 18, y + 74, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(
energy, x + 18, y + 84, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(
entropy, x + 18, y + 94, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
} else {
fontRenderer.drawString(shield, x - 52 - fontRenderer.getStringWidth(shield) / 2, y + 2, ((int) (fade * 240F) + 0x10 << 24) | 0x000000FF);
fontRenderer.drawStringWithShadow(entropy, x - fontRenderer.getStringWidth(entropy), y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(energy, x - 102, y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawString(
shield,
x - 52 - fontRenderer.getStringWidth(shield) / 2,
y + 2,
((int) (fade * 240F) + 0x10 << 24) | 0x000000FF);
fontRenderer.drawStringWithShadow(
entropy,
x - fontRenderer.getStringWidth(entropy),
y + 18,
((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
fontRenderer.drawStringWithShadow(
energy, x - 102, y + 18, ((int) (fade * 240F) + 0x10 << 24) | 0x00FFFFFF);
}
}
@@ -186,23 +234,26 @@ public class HudHandler {
}
}
//GL11.glPushMatrix();
// GL11.glPushMatrix();
// GL11.glEnable(GL11.GL_ALPHA_TEST);
// ResourceHandler.bindResource("textures/gui/HUD.png");
//
// if (rotated){
// GuiHelper.drawTexturedRect(x-(12*scale), y+scale, (int)(11*scale), (int)(13*scale), 2, 0, 11, 13, 0, GuiHelper.PXL128);
// GuiHelper.drawTexturedRect(x-(12*scale), y+scale, (int)(11*scale), (int)(13*scale), 2, 0, 11, 13, 0,
// GuiHelper.PXL128);
// x+=(104*scale);
// GL11.glTranslated(x, y, 0);
// GL11.glRotated(-90, 0, 0, -1);
// 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, GuiHelper.PXL128);
// else GuiHelper.drawTexturedRect(x+(1*scale), y+(104*scale)+1, (int)(13*scale), (int)(15*scale), 2, 0, 11, 13, 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 *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 * scale, 25, 100-(int)shieldEntropy, 2, (int)shieldEntropy, 0, GuiHelper.PXL128);
// GuiHelper.drawTexturedRect(x+(2*scale), y+(2*scale)+(100-shieldPercentCharge), (int)(7*scale), shieldPercentCharge
// *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
// * scale, 25, 100-(int)shieldEntropy, 2, (int)shieldEntropy, 0, GuiHelper.PXL128);
//
// if (ConfigHandler.hudSettings[9] == 1) {
// FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
@@ -215,7 +266,8 @@ public class HudHandler {
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x + 16, y + 94, 0xFFFFFF);
// }else {
// fontRenderer.drawStringWithShadow(Math.round(shieldPoints) + "/" + (int)maxShieldPoints, x - 102, y + 16, 0xFFFFFF);
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x - fontRenderer.getStringWidth((int)shieldEntropy + "%"), y + 16, 0xFFFFFF);
// fontRenderer.drawStringWithShadow((int)shieldEntropy + "%", x - fontRenderer.getStringWidth((int)shieldEntropy +
// "%"), y + 16, 0xFFFFFF);
// }
// }
//
@@ -17,7 +17,8 @@ public final class ItemDisplayManager {
private int ticksCounter;
private static final RenderItem renderItem = new RenderItem();
private static final FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
private static final TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
private static final TextureManager textureManager =
Minecraft.getMinecraft().getTextureManager();
public ItemDisplayManager(int ticks) {
this.ticks = ticks;
@@ -57,4 +58,4 @@ public final class ItemDisplayManager {
GL11.glDisable(GL11.GL_BLEND);
}
}
}
}
@@ -12,7 +12,15 @@ public class ParticleHandler {
private static Minecraft mc = Minecraft.getMinecraft();
private static World theWorld = mc.theWorld;
public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
public static EntityFX spawnParticle(
String particleName,
double x,
double y,
double z,
double motionX,
double motionY,
double motionZ,
float scale) {
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
int var14 = mc.gameSettings.particleSetting;
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
@@ -29,7 +37,8 @@ public class ParticleHandler {
return null;
} else {
if (particleName.equals("distortionParticle")) {
var21 = new ParticleDistortion(theWorld, x, y, z, (float) motionX, (float) motionY, (float) motionZ, scale);
var21 = new ParticleDistortion(
theWorld, x, y, z, (float) motionX, (float) motionY, (float) motionZ, scale);
}
mc.effectRenderer.addEffect(var21);
@@ -72,4 +81,4 @@ public class ParticleHandler {
}
return true;
}
}
}
@@ -11,19 +11,18 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
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 javax.imageio.ImageIO;
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.
@@ -31,19 +30,18 @@ import java.util.*;
public class ResourceHandler {
public static ResourceHandler instance = new ResourceHandler();
private static ResourceLocation defaultParticles;
private static ResourceLocation particles = new ResourceLocation(References.RESOURCESPREFIX + "textures/particle/particles.png");
private static ResourceLocation particles =
new ResourceLocation(References.RESOURCESPREFIX + "textures/particle/particles.png");
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
public static Map<String, CustomResourceLocation> downloadedImages = new HashMap<String, CustomResourceLocation>();
private static String savePath;
private static File saveFolder;
private static File imagesFolder;
private static DownloadThread downloadThread;
public static int downloadStatus = 0;
//-------------------- File Handling -----------------------//
// -------------------- File Handling -----------------------//
@SubscribeEvent
public void tick(TickEvent.ClientTickEvent event) {
@@ -60,14 +58,14 @@ public class ResourceHandler {
FMLCommonHandler.instance().bus().register(instance);
if (event != null)
savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath() + "/config/draconicevolution";
savePath = event.getModConfigurationDirectory().getParentFile().getAbsolutePath()
+ "/config/draconicevolution";
GUIManual.loadPages();
downloadThread = new DownloadThread(GUIManual.imageURLs);
downloadThread.start();
}
public static class DownloadThread extends Thread {
private List<String> imageURLs;
private boolean isFinished = false;
@@ -89,13 +87,14 @@ public class ResourceHandler {
String fileName = url.getFile();
BufferedImage bi = ImageIO.read(new File(getImagesFolder(), FilenameUtils.getName(fileName)));
downloadedImages.put(FilenameUtils.getName(fileName), new CustomResourceLocation(FilenameUtils.getName(fileName), bi.getWidth(), bi.getHeight()));
}
catch (MalformedURLException e) {
downloadedImages.put(
FilenameUtils.getName(fileName),
new CustomResourceLocation(
FilenameUtils.getName(fileName), bi.getWidth(), bi.getHeight()));
} catch (MalformedURLException e) {
LogHelper.error("Image Read Failed");
e.printStackTrace();
}
catch (IOException e) {
} catch (IOException e) {
LogHelper.error("Image Read Failed");
e.printStackTrace();
}
@@ -122,8 +121,7 @@ public class ResourceHandler {
is.close();
os.close();
}
catch (IOException e) {
} catch (IOException e) {
LogHelper.error("Download Failed");
e.printStackTrace();
return false;
@@ -136,8 +134,7 @@ public class ResourceHandler {
URL url = new URL(urlS);
String fileName = url.getFile();
return Arrays.asList(getImagesFolder().list()).contains(FilenameUtils.getName(fileName));
}
catch (MalformedURLException e) {
} catch (MalformedURLException e) {
LogHelper.error("Unable to check files existence. Invalid URL: " + urlS);
e.printStackTrace();
return false;
@@ -157,7 +154,6 @@ public class ResourceHandler {
}
}
private static void addRSPack(boolean refreash) {
File rspack = new File(getConfigFolder(), "/resources");
if (!rspack.exists()) return;
@@ -173,8 +169,7 @@ public class ResourceHandler {
writer.endObject();
writer.endObject();
writer.close();
}
catch (IOException e) {
} catch (IOException e) {
LogHelper.error("Error creating pack.mcmeta");
e.printStackTrace();
}
@@ -189,8 +184,7 @@ public class ResourceHandler {
f.set(Minecraft.getMinecraft(), defaultResourcePacks);
LogHelper.info("RS Added");
if (refreash) Minecraft.getMinecraft().refreshResources();
}
catch (IllegalAccessException e) {
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
@@ -213,8 +207,7 @@ public class ResourceHandler {
return imagesFolder;
}
//----------------------------------------------------------//
// ----------------------------------------------------------//
public static void bindTexture(ResourceLocation texture) {
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
@@ -226,9 +219,9 @@ public class ResourceHandler {
public static void bindDefaultParticles() {
if (defaultParticles == null) {
try {
defaultParticles = (ResourceLocation) ReflectionHelper.getPrivateValue(EffectRenderer.class, null, "particleTextures", "field_110737_b");
}
catch (Exception e) {
defaultParticles = (ResourceLocation) ReflectionHelper.getPrivateValue(
EffectRenderer.class, null, "particleTextures", "field_110737_b");
} catch (Exception e) {
}
}
if (defaultParticles != null) bindTexture(defaultParticles);
@@ -252,6 +245,4 @@ public class ResourceHandler {
public static void bindResource(String rs) {
bindTexture(ResourceHandler.getResource(rs));
}
}
@@ -32,11 +32,15 @@ public class KeyInputHandler {
if (KeyBindings.placeItem.isPressed()) handlePlaceItemKey();
else if (KeyBindings.toolConfig.isPressed()) {
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOLCONFIG, false));
} else if (KeyBindings.toolProfileChange.isPressed() && Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().thePlayer.getItemInUse() == null) {
} else if (KeyBindings.toolProfileChange.isPressed()
&& Minecraft.getMinecraft().thePlayer != null
&& Minecraft.getMinecraft().thePlayer.getItemInUse() == null) {
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
if (stack != null && stack.getItem() instanceof IConfigurableItem && ((IConfigurableItem) stack.getItem()).hasProfiles()) {
if (stack != null
&& stack.getItem() instanceof IConfigurableItem
&& ((IConfigurableItem) stack.getItem()).hasProfiles()) {
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
if (++preset >= 5) preset = 0;
ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
@@ -65,13 +69,13 @@ public class KeyInputHandler {
}
}
private void handlePlaceItemKey() {
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
WorldClient world = Minecraft.getMinecraft().theWorld;
MovingObjectPosition mop = ToolHandler.raytraceFromEntity(world, player, 4.5D);
if (mop != null)
DraconicEvolution.network.sendToServer(new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ));
DraconicEvolution.network.sendToServer(
new PlacedItemPacket((byte) mop.sideHit, mop.blockX, mop.blockY, mop.blockZ));
}
@SideOnly(Side.CLIENT)
@@ -84,7 +88,9 @@ public class KeyInputHandler {
DraconicEvolution.network.sendToServer(new ButtonPacket(ButtonPacket.ID_TOOL_PROFILE_CHANGE, false));
ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem();
if (stack != null && stack.getItem() instanceof IConfigurableItem && ((IConfigurableItem) stack.getItem()).hasProfiles()) {
if (stack != null
&& stack.getItem() instanceof IConfigurableItem
&& ((IConfigurableItem) stack.getItem()).hasProfiles()) {
int preset = ItemNBTHelper.getInteger(stack, "ConfigProfile", 0);
if (++preset >= 5) preset = 0;
ItemNBTHelper.setInteger(stack, "ConfigProfile", preset);
@@ -5,7 +5,6 @@ import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelDraconicArmor extends ModelBiped {
public ModelRenderOBJ head;
@@ -45,16 +44,42 @@ public class ModelDraconicArmor extends ModelBiped {
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
this.head = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicHelmet.obj"), ResourceHandler.getResource("textures/models/armor/DraconicHelmet.png"));
this.body = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicBody.obj"), ResourceHandler.getResource("textures/models/armor/DraconicBody.png"));
this.rightArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicRightArm.obj"), ResourceHandler.getResource("textures/models/armor/DraconicRightArm.png"));
this.leftArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicLeftArm.obj"), ResourceHandler.getResource("textures/models/armor/DraconicLeftArm.png"));
this.belt = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicBelt.obj"), ResourceHandler.getResource("textures/models/armor/DraconicBelt.png"));
this.rightLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicRightLeg.obj"), ResourceHandler.getResource("textures/models/armor/DraconicRightLeg.png"));
this.leftLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicLeftLeg.obj"), ResourceHandler.getResource("textures/models/armor/DraconicLeftLeg.png"));
this.rightBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicRightBoot.obj"), ResourceHandler.getResource("textures/models/armor/DraconicRightBoot.png"));
this.leftBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/DraconicLeftBoot.obj"), ResourceHandler.getResource("textures/models/armor/DraconicLeftBoot.png"));
this.head = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicHelmet.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicHelmet.png"));
this.body = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicBody.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicBody.png"));
this.rightArm = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicRightArm.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicRightArm.png"));
this.leftArm = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicLeftArm.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicLeftArm.png"));
this.belt = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicBelt.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicBelt.png"));
this.rightLeg = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicRightLeg.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicRightLeg.png"));
this.leftLeg = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicLeftLeg.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicLeftLeg.png"));
this.rightBoot = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicRightBoot.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicRightBoot.png"));
this.leftBoot = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/DraconicLeftBoot.obj"),
ResourceHandler.getResource("textures/models/armor/DraconicLeftBoot.png"));
this.bipedHead.cubeList.clear();
this.bipedHeadwear.cubeList.clear();
@@ -113,7 +138,6 @@ public class ModelDraconicArmor extends ModelBiped {
this.bipedLeftLeg.addChild(leftBoot);
this.bipedRightLeg.addChild(rightBoot);
}
}
@Override
@@ -158,7 +182,14 @@ public class ModelDraconicArmor extends ModelBiped {
this.bipedLeftLeg.render(1F / 16F);
}
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
public void setRotationAngles(
float p_78087_1_,
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.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotationPointZ = 0.0F;
@@ -8,13 +8,13 @@ import net.minecraft.entity.Entity;
* Draconic Armor.tcn - TechneToTabulaImporter
* Created using Tabula 5.0.0
*/
public class ModelDraconicArmorOld extends ModelBiped {//
public class ModelDraconicArmorOld extends ModelBiped { //
// public ModelRenderer bipedHead;
// public ModelRenderer bipedBody;
// public ModelRenderer bipedRightArm;
// public ModelRenderer bipedLeftArm;
// public ModelRenderer bipedRightLeg;/
// public ModelRenderer bipedLeftLeg;
// public ModelRenderer bipedBody;
// public ModelRenderer bipedRightArm;
// public ModelRenderer bipedLeftArm;
// public ModelRenderer bipedRightLeg;/
// public ModelRenderer bipedLeftLeg;
public ModelRenderer MainHelmPieceRight1;
public ModelRenderer MainHelmPieceRight2;
public ModelRenderer MainHelmPieceLeft1;
@@ -84,7 +84,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
public ModelRenderer BootPieceRight4;
public ModelRenderer LeggsTop;
//Draconic Specific
// Draconic Specific
public ModelRenderer DrMainChestPieceTop;
public ModelRenderer DrMainChestPieceMid;
public ModelRenderer DrChestDecorationPiece1;
@@ -94,7 +94,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
public ModelRenderer BeltLeft;
public ModelRenderer BeltRight;
public ModelRenderer BeltBuckle;
//Wyvern Specific
// Wyvern Specific
public ModelRenderer WyHelmPieceTop1;
public ModelRenderer WyHelmPieceTop2;
public ModelRenderer WyHelmPieceTop3;
@@ -108,13 +108,14 @@ public class ModelDraconicArmorOld extends ModelBiped {//
private boolean isDraconic;
public ModelDraconicArmorOld(float f, boolean isHelmet, boolean isChestPiece, boolean isLeggings, boolean isdBoots, boolean isDraconic) {
public ModelDraconicArmorOld(
float f, boolean isHelmet, boolean isChestPiece, boolean isLeggings, boolean isdBoots, boolean isDraconic) {
super(f, 0.0f, 128, 128);
this.textureWidth = 256;
this.textureHeight = 128;
this.isDraconic = isDraconic;
/* Helm */
/* Helm */
{
this.bipedHead = new ModelRenderer(this, 0, 0);
this.bipedHead.setRotationPoint(0.0F, 0.0F, 0.0F);
@@ -178,7 +179,6 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.MainHelmPieceFrontTop.setRotationPoint(-4.0F, -8.0F, -5.0F);
this.MainHelmPieceFrontTop.addBox(0.0F, 0.0F, 0.0F, 8, 2, 1, 0.0F);
this.HornPieceLeft1 = new ModelRenderer(this, 182, 40);
this.HornPieceLeft1.setRotationPoint(4.0F, -7.5F, -1.0F);
this.HornPieceLeft1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 4, 0.0F);
@@ -238,7 +238,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.setRotateAngle(WyHelmPieceTop4, -0.20943951023931953F, -0.0F, 0.0F);
}
/* Chest */
/* Chest */
{
this.bipedBody = new ModelRenderer(this, 16, 16);
this.bipedBody.setRotationPoint(0.0F, 0.0F, 0.0F);
@@ -270,7 +270,8 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.DrChestDecorationPiece1 = new ModelRenderer(this, 244, 38);
this.DrChestDecorationPiece1.setRotationPoint(0.0F, -0.5F, -4.0F);
this.DrChestDecorationPiece1.addBox(0.0F, 0.0F, -0.5F, 5, 5, 1, 0.0F);
this.setRotateAngle(DrChestDecorationPiece1, 0.1426609064282019F, -0.13533507716461618F, 0.7946695004338321F);
this.setRotateAngle(
DrChestDecorationPiece1, 0.1426609064282019F, -0.13533507716461618F, 0.7946695004338321F);
this.ChestDecorationPiece2 = new ModelRenderer(this, 229, 38);
this.ChestDecorationPiece2.setRotationPoint(-3.0F, 7.0F, -3.0F);
@@ -325,7 +326,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.BeltLeft.setRotationPoint(3.7F, 10.01F, -2.2F);
this.BeltLeft.addBox(0.0F, 0.0F, -0.3F, 1, 2, 5, 0.0F);
//Left
// Left
this.bipedLeftArm = new ModelRenderer(this, 40, 16);
this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F);
this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, 0.0F);
@@ -382,8 +383,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.ArmStrapLeftBottom.setRotationPoint(-1.5F, 7.0F, -2.5F);
this.ArmStrapLeftBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 5, 0.0F);
//Right
// Right
this.MainArmGuardRight = new ModelRenderer(this, 240, 72);
this.MainArmGuardRight.setRotationPoint(-3.5F, 3.0F, -2.5F);
this.MainArmGuardRight.addBox(0.0F, 0.0F, 0.0F, 3, 5, 5, 0.0F);
@@ -440,12 +440,12 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.ArmStrapRightBottom.addBox(0.0F, 0.0F, 0.0F, 2, 1, 5, 0.0F);
}
/* Leggs */
/* Leggs */
{
this.LeggsTop = new ModelRenderer(this, 121, 15);
this.LeggsTop.setRotationPoint(0.5F, 8.0F, -2.4F);
this.LeggsTop.addBox(-5.0F, 0.0F, 0.0F, 9, 4, 5, 0.0F);
//Left
// Left
this.bipedLeftLeg = new ModelRenderer(this, 0, 16);
this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F);
this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
@@ -471,7 +471,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.KneePieceLeft1.setRotationPoint(-0.5F, 2.0F, -2.7F);
this.KneePieceLeft1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 1, 0.0F);
//Right
// Right
this.bipedRightLeg = new ModelRenderer(this, 0, 16);
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
@@ -496,12 +496,11 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.KneePieceRight1 = new ModelRenderer(this, 156, 15);
this.KneePieceRight1.setRotationPoint(-0.5F, 2.0F, -2.7F);
this.KneePieceRight1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 1, 0.0F);
}
/* Boots */
/* Boots */
{
//Left
// Left
this.MainBootPieceLeft = new ModelRenderer(this, 119, 0);
this.MainBootPieceLeft.setRotationPoint(-2.0F, 9.1F, -2.5F);
this.MainBootPieceLeft.addBox(0.0F, 0.0F, 0.0F, 4, 3, 5, 0.0F);
@@ -523,7 +522,7 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.BootPieceLeft4.setRotationPoint(-2.5F, 9.05F, -2.0F);
this.BootPieceLeft4.addBox(0.0F, 0.0F, 0.0F, 1, 3, 4, 0.0F);
//Right
// Right
this.MainBootPieceRight = new ModelRenderer(this, 119, 0);
this.MainBootPieceRight.setRotationPoint(-2.0F, 9.1F, -2.5F);
this.MainBootPieceRight.addBox(0.0F, 0.0F, 0.0F, 4, 3, 5, 0.0F);
@@ -546,7 +545,6 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.BootPieceRight4.addBox(0.0F, 0.0F, 0.0F, 1, 3, 4, 0.0F);
}
this.bipedHead.cubeList.clear();
this.bipedHeadwear.cubeList.clear();
if (isHelmet) {
@@ -659,7 +657,6 @@ public class ModelDraconicArmorOld extends ModelBiped {//
}
}
if (isdBoots) {
this.bipedLeftLeg.addChild(this.MainBootPieceLeft);
this.bipedLeftLeg.addChild(this.BootPieceLeft2);
@@ -673,14 +670,13 @@ public class ModelDraconicArmorOld extends ModelBiped {//
this.bipedRightLeg.addChild(this.BootPieceRight3);
this.bipedRightLeg.addChild(this.BootPieceRight4);
}
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.bipedRightLeg.render(f5);
this.bipedBody.render(f5 * 1.05F);// * 1.1F);
this.bipedBody.render(f5 * 1.05F); // * 1.1F);
this.bipedLeftArm.render(f5);
this.bipedRightArm.render(f5);
this.bipedLeftLeg.render(f5);
@@ -158,7 +158,7 @@ public class ModelReactorEnergyInjector extends ModelBase {
public void render(Entity entity, float brightness, float f1, float f2, float f3, float f4, float f5) {
this.support1.render(f5);
this.BasePlate.render(f5);
//this.coreSupports.render(f5);
// this.coreSupports.render(f5);
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
@@ -166,7 +166,8 @@ public class ModelReactorEnergyInjector extends ModelBase {
float b = brightness * 200F;
float colour = Math.min(2F, (brightness * 2F) + 0.5F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
OpenGlHelper.setLightmapTextureCoords(
OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour, colour, colour, 1F);
this.element1.render(f5);
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -269,7 +269,8 @@ public class ModelReactorStabilizerCore extends ModelBase {
float colour = Math.min(2F, (brightness * 2F) + 0.1F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
OpenGlHelper.setLightmapTextureCoords(
OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour, colour, colour, 1F);
this.rotor2R.render(f5);
GL11.glRotatef(rotation * 2F, 0F, 0F, 1F);
@@ -114,7 +114,8 @@ public class ModelReactorStabilizerRing extends ModelBase {
}
@Override
public void render(Entity entity, float embitterRotation, float brightness, float f2, float f3, float f4, float scale) {
public void render(
Entity entity, float embitterRotation, float brightness, float f2, float f3, float f4, float scale) {
this.ringElement1.render(scale);
this.ringElement2.render(scale);
@@ -131,84 +132,133 @@ public class ModelReactorStabilizerRing extends ModelBase {
GL11.glPushMatrix();
GL11.glTranslated(this.hing1.offsetX, this.hing1.offsetY, this.hing1.offsetZ);
GL11.glTranslated(this.hing1.rotationPointX * scale, this.hing1.rotationPointY * scale, this.hing1.rotationPointZ * scale);
GL11.glTranslated(
this.hing1.rotationPointX * scale,
this.hing1.rotationPointY * scale,
this.hing1.rotationPointZ * scale);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.hing1.offsetX, -this.hing1.offsetY, -this.hing1.offsetZ);
GL11.glTranslated(-this.hing1.rotationPointX * scale, -this.hing1.rotationPointY * scale, -this.hing1.rotationPointZ * scale);
GL11.glTranslated(
-this.hing1.rotationPointX * scale,
-this.hing1.rotationPointY * scale,
-this.hing1.rotationPointZ * scale);
this.hing1.render(scale);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(this.hing2.offsetX, this.hing2.offsetY, this.hing2.offsetZ);
GL11.glTranslated(this.hing2.rotationPointX * scale, this.hing2.rotationPointY * scale, this.hing2.rotationPointZ * scale);
GL11.glTranslated(
this.hing2.rotationPointX * scale,
this.hing2.rotationPointY * scale,
this.hing2.rotationPointZ * scale);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.hing2.offsetX, -this.hing2.offsetY, -this.hing2.offsetZ);
GL11.glTranslated(-this.hing2.rotationPointX * scale, -this.hing2.rotationPointY * scale, -this.hing2.rotationPointZ * scale);
GL11.glTranslated(
-this.hing2.rotationPointX * scale,
-this.hing2.rotationPointY * scale,
-this.hing2.rotationPointZ * scale);
this.hing2.render(scale);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(this.hing3.offsetX, this.hing3.offsetY, this.hing3.offsetZ);
GL11.glTranslated(this.hing3.rotationPointX * scale, this.hing3.rotationPointY * scale, this.hing3.rotationPointZ * scale);
GL11.glTranslated(
this.hing3.rotationPointX * scale,
this.hing3.rotationPointY * scale,
this.hing3.rotationPointZ * scale);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.hing3.offsetX, -this.hing3.offsetY, -this.hing3.offsetZ);
GL11.glTranslated(-this.hing3.rotationPointX * scale, -this.hing3.rotationPointY * scale, -this.hing3.rotationPointZ * scale);
GL11.glTranslated(
-this.hing3.rotationPointX * scale,
-this.hing3.rotationPointY * scale,
-this.hing3.rotationPointZ * scale);
this.hing3.render(scale);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(this.hing4.offsetX, this.hing4.offsetY, this.hing4.offsetZ);
GL11.glTranslated(this.hing4.rotationPointX * scale, this.hing4.rotationPointY * scale, this.hing4.rotationPointZ * scale);
GL11.glTranslated(
this.hing4.rotationPointX * scale,
this.hing4.rotationPointY * scale,
this.hing4.rotationPointZ * scale);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.hing4.offsetX, -this.hing4.offsetY, -this.hing4.offsetZ);
GL11.glTranslated(-this.hing4.rotationPointX * scale, -this.hing4.rotationPointY * scale, -this.hing4.rotationPointZ * scale);
GL11.glTranslated(
-this.hing4.rotationPointX * scale,
-this.hing4.rotationPointY * scale,
-this.hing4.rotationPointZ * scale);
this.hing4.render(scale);
GL11.glPopMatrix();
// float lastBrightnessX = OpenGlHelper.lastBrightnessX;
// float lastBrightnessY = OpenGlHelper.lastBrightnessY;
// OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
// float lastBrightnessX = OpenGlHelper.lastBrightnessX;
// float lastBrightnessY = OpenGlHelper.lastBrightnessY;
// OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
float b = brightness * 200F;
float colour = Math.min(2F, (brightness * 2F) + 0.1F);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
OpenGlHelper.setLightmapTextureCoords(
OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour, colour, colour, 1F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
GL11.glPushMatrix();
GL11.glTranslated(this.emitter1.offsetX, this.emitter1.offsetY, this.emitter1.offsetZ);
GL11.glTranslated(this.emitter1.rotationPointX * scale, this.emitter1.rotationPointY * scale, this.emitter1.rotationPointZ * scale);
GL11.glTranslated(
this.emitter1.rotationPointX * scale,
this.emitter1.rotationPointY * scale,
this.emitter1.rotationPointZ * scale);
GL11.glRotatef(embitterRotation, 0, 0, 1);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.emitter1.offsetX, -this.emitter1.offsetY, -this.emitter1.offsetZ);
GL11.glTranslated(-this.emitter1.rotationPointX * scale, -this.emitter1.rotationPointY * scale, -this.emitter1.rotationPointZ * scale);
GL11.glTranslated(
-this.emitter1.rotationPointX * scale,
-this.emitter1.rotationPointY * scale,
-this.emitter1.rotationPointZ * scale);
this.emitter1.render(scale);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(this.emitter2.offsetX, this.emitter2.offsetY, this.emitter2.offsetZ);
GL11.glTranslated(this.emitter2.rotationPointX * scale, this.emitter2.rotationPointY * scale, this.emitter2.rotationPointZ * scale);
GL11.glTranslated(
this.emitter2.rotationPointX * scale,
this.emitter2.rotationPointY * scale,
this.emitter2.rotationPointZ * scale);
GL11.glRotatef(embitterRotation, 0, 0, -1);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.emitter2.offsetX, -this.emitter2.offsetY, -this.emitter2.offsetZ);
GL11.glTranslated(-this.emitter2.rotationPointX * scale, -this.emitter2.rotationPointY * scale, -this.emitter2.rotationPointZ * scale);
GL11.glTranslated(
-this.emitter2.rotationPointX * scale,
-this.emitter2.rotationPointY * scale,
-this.emitter2.rotationPointZ * scale);
this.emitter2.render(scale);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(this.emitter3.offsetX, this.emitter3.offsetY, this.emitter3.offsetZ);
GL11.glTranslated(this.emitter3.rotationPointX * scale, this.emitter3.rotationPointY * scale, this.emitter3.rotationPointZ * scale);
GL11.glTranslated(
this.emitter3.rotationPointX * scale,
this.emitter3.rotationPointY * scale,
this.emitter3.rotationPointZ * scale);
GL11.glRotatef(embitterRotation, 1, 0, 0);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.emitter3.offsetX, -this.emitter3.offsetY, -this.emitter3.offsetZ);
GL11.glTranslated(-this.emitter3.rotationPointX * scale, -this.emitter3.rotationPointY * scale, -this.emitter3.rotationPointZ * scale);
GL11.glTranslated(
-this.emitter3.rotationPointX * scale,
-this.emitter3.rotationPointY * scale,
-this.emitter3.rotationPointZ * scale);
this.emitter3.render(scale);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(this.emitter4.offsetX, this.emitter4.offsetY, this.emitter4.offsetZ);
GL11.glTranslated(this.emitter4.rotationPointX * scale, this.emitter4.rotationPointY * scale, this.emitter4.rotationPointZ * scale);
GL11.glTranslated(
this.emitter4.rotationPointX * scale,
this.emitter4.rotationPointY * scale,
this.emitter4.rotationPointZ * scale);
GL11.glRotatef(embitterRotation, -1, 0, 0);
GL11.glScaled(0.5D, 0.5D, 0.5D);
GL11.glTranslated(-this.emitter4.offsetX, -this.emitter4.offsetY, -this.emitter4.offsetZ);
GL11.glTranslated(-this.emitter4.rotationPointX * scale, -this.emitter4.rotationPointY * scale, -this.emitter4.rotationPointZ * scale);
GL11.glTranslated(
-this.emitter4.rotationPointX * scale,
-this.emitter4.rotationPointY * scale,
-this.emitter4.rotationPointZ * scale);
this.emitter4.render(scale);
GL11.glPopMatrix();
@@ -226,6 +276,4 @@ public class ModelReactorStabilizerRing extends ModelBase {
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
@@ -38,13 +38,16 @@ public class ModelRenderOBJ extends ModelRenderer {
if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
GL11.glCallList(this.displayList);
} else {
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
GL11.glCallList(this.displayList);
GL11.glTranslatef(-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale);
GL11.glTranslatef(
-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale);
}
} else {
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
@@ -63,7 +66,6 @@ public class ModelRenderOBJ extends ModelRenderer {
GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);
}
}
private void compileDisplayList(float scale) {
@@ -74,7 +76,7 @@ public class ModelRenderOBJ extends ModelRenderer {
GL11.glPushMatrix();
ResourceHandler.bindTexture(texture);
//scale = 1F/15F;
// scale = 1F/15F;
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(180, -1, 0, 1);
model.renderAll();
@@ -108,22 +110,23 @@ public class ModelRenderOBJ extends ModelRenderer {
GL11.glCallList(this.displayList);
GL11.glPopMatrix();
}
}
@Override
public void postRender(float scale) {
if (!this.isHidden && this.showModel) {
// if(!this.compiled) {
// this.compileDisplayList(scale);
// }
// if(!this.compiled) {
// this.compileDisplayList(scale);
// }
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) {
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
}
} else {
GL11.glTranslatef(this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
GL11.glTranslatef(
this.rotationPointX * scale, this.rotationPointY * scale, this.rotationPointZ * scale);
if (this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * 57.295776F, 0.0F, 0.0F, 1.0F);
}
@@ -137,6 +140,5 @@ public class ModelRenderOBJ extends ModelRenderer {
}
}
}
}
}
@@ -55,7 +55,6 @@ public class ModelTeleporterStand extends ModelBase {
baseBottom.setRotationPoint(-5F, 7F, -5F);
baseBottom.setTextureSize(64, 64);
setRotationDegree(baseBottom, 0, 0, 0);
}
public void render() {
@@ -5,7 +5,6 @@ import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelWyvernArmor extends ModelBiped {
public ModelRenderOBJ head;
@@ -45,16 +44,42 @@ public class ModelWyvernArmor extends ModelBiped {
this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F);
this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, 0.0F);
this.head = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernHelmet.obj"), ResourceHandler.getResource("textures/models/armor/WyvernHelmet.png"));
this.body = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernBody.obj"), ResourceHandler.getResource("textures/models/armor/WyvernBody.png"));
this.rightArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernRightArm.obj"), ResourceHandler.getResource("textures/models/armor/WyvernRightArm.png"));
this.leftArm = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernLeftArm.obj"), ResourceHandler.getResource("textures/models/armor/WyvernLeftArm.png"));
this.belt = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernBelt.obj"), ResourceHandler.getResource("textures/models/armor/WyvernBelt.png"));
this.rightLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernRightLeg.obj"), ResourceHandler.getResource("textures/models/armor/WyvernRightLeg.png"));
this.leftLeg = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernLeftLeg.obj"), ResourceHandler.getResource("textures/models/armor/WyvernLeftLeg.png"));
this.rightBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernRightBoot.obj"), ResourceHandler.getResource("textures/models/armor/WyvernRightBoot.png"));
this.leftBoot = new ModelRenderOBJ(this, ResourceHandler.getResource("models/armor/WyvernLeftBoot.obj"), ResourceHandler.getResource("textures/models/armor/WyvernLeftBoot.png"));
this.head = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernHelmet.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernHelmet.png"));
this.body = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernBody.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernBody.png"));
this.rightArm = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernRightArm.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernRightArm.png"));
this.leftArm = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernLeftArm.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernLeftArm.png"));
this.belt = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernBelt.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernBelt.png"));
this.rightLeg = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernRightLeg.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernRightLeg.png"));
this.leftLeg = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernLeftLeg.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernLeftLeg.png"));
this.rightBoot = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernRightBoot.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernRightBoot.png"));
this.leftBoot = new ModelRenderOBJ(
this,
ResourceHandler.getResource("models/armor/WyvernLeftBoot.obj"),
ResourceHandler.getResource("textures/models/armor/WyvernLeftBoot.png"));
this.bipedHead.cubeList.clear();
this.bipedHeadwear.cubeList.clear();
@@ -110,7 +135,6 @@ public class ModelWyvernArmor extends ModelBiped {
this.bipedLeftLeg.addChild(leftBoot);
this.bipedRightLeg.addChild(rightBoot);
}
}
@Override
@@ -155,7 +179,14 @@ public class ModelWyvernArmor extends ModelBiped {
this.bipedLeftLeg.render(1F / 16F);
}
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float scale, Entity p_78087_7_) {
public void setRotationAngles(
float p_78087_1_,
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.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightArm.rotationPointZ = 0.0F;
@@ -32,7 +32,6 @@ public class RenderCrystal implements IItemRenderer {
transceiver2.facing = 1;
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
@@ -55,7 +54,20 @@ public class RenderCrystal implements IItemRenderer {
else GL11.glTranslatef(0.0F, -0.6F, 0.0F);
}
int meta = item.getItemDamage();
TileEntityRendererDispatcher.instance.renderTileEntityAt(meta == 0 ? relay1 : meta == 1 ? relay2 : meta == 2 ? transceiver1 : meta == 3 ? transceiver2 : meta == 4 ? wirelessTransceiver1 : wirelessTransceiver2, 0.0D, 0.0D, 0.0D, 0.0F);
TileEntityRendererDispatcher.instance.renderTileEntityAt(
meta == 0
? relay1
: meta == 1
? relay2
: meta == 2
? transceiver1
: meta == 3
? transceiver2
: meta == 4 ? wirelessTransceiver1 : wirelessTransceiver2,
0.0D,
0.0D,
0.0D,
0.0F);
GL11.glPopMatrix();
RenderHelper.enableStandardItemLighting();
}
@@ -35,6 +35,4 @@ public class RenderParticleGen implements IItemRenderer {
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
@@ -15,12 +15,11 @@ import net.minecraft.world.IBlockAccess;
*/
public class RenderPortal implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
}
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tess = Tessellator.instance;
int meta = world.getBlockMetadata(x, y, z);
@@ -23,7 +23,8 @@ public class RenderTeleporterStand implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return false;
}
@@ -36,5 +37,4 @@ public class RenderTeleporterStand implements ISimpleBlockRenderingHandler {
public int getRenderId() {
return References.idTeleporterStand;
}
}
@@ -96,12 +96,17 @@ public class RenderChaosCrystal extends Render {
return ResourceHandler.getResource("textures/entity/chaosCrystal.png");
}
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return this.getEntityTexture((EntityChaosCrystal) p_110775_1_);
}
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(
Entity p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
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_);
}
}
@@ -13,9 +13,7 @@ import net.minecraft.util.ResourceLocation;
public class RenderChaosDrill extends Render {
@Override
public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {
}
public void doRender(Entity entity, double x, double y, double z, float p_76986_8_, float p_76986_9_) {}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
@@ -4,6 +4,7 @@ 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 net.minecraft.client.model.ModelDragon;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
@@ -18,18 +19,21 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import java.util.Random;
/**
* Created by Brandon on 11/08/2014.
*/
@SideOnly(Side.CLIENT)
public class RenderDragon extends RenderLiving {
private static final ResourceLocation enderDragonExplodingTextures = new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png");
private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png");
private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png");
private static final ResourceLocation enderDragonTextures = new ResourceLocation(References.RESOURCESPREFIX + "textures/entity/de_dragon.png");
private static final ResourceLocation enderDragonTextures2 = new ResourceLocation(References.RESOURCESPREFIX + "textures/entity/de_chaos_dragon.png");
private static final ResourceLocation enderDragonExplodingTextures =
new ResourceLocation("textures/entity/enderdragon/dragon_exploding.png");
private static final ResourceLocation enderDragonCrystalBeamTextures =
new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png");
private static final ResourceLocation enderDragonEyesTextures =
new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png");
private static final ResourceLocation enderDragonTextures =
new ResourceLocation(References.RESOURCESPREFIX + "textures/entity/de_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
*/
@@ -43,7 +47,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_) {
float f3 = (float) p_77043_1_.getMovementOffsets(7, p_77043_4_)[0];
float f4 = (float) (p_77043_1_.getMovementOffsets(5, p_77043_4_)[1] - p_77043_1_.getMovementOffsets(10, p_77043_4_)[1]);
float f4 = (float)
(p_77043_1_.getMovementOffsets(5, p_77043_4_)[1] - p_77043_1_.getMovementOffsets(10, p_77043_4_)[1]);
GL11.glRotatef(-f3, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(f4 * 10.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, 0.0F, 1.0F);
@@ -63,7 +68,14 @@ public class RenderDragon extends RenderLiving {
/**
* Renders the model in RenderLiving
*/
protected void renderModel(EntityDragon p_77036_1_, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_) {
protected void renderModel(
EntityDragon p_77036_1_,
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) {
float f6 = (float) p_77036_1_.deathTicks / 200.0F;
GL11.glDepthFunc(GL11.GL_LEQUAL);
@@ -97,7 +109,13 @@ 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,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityDragon dragon, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(
EntityDragon dragon,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
float p_76986_9_) {
BossStatus.setBossStatus(dragon, false);
super.doRender((EntityLiving) dragon, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
@@ -105,22 +123,39 @@ public class RenderDragon extends RenderLiving {
float f2 = (float) dragon.healingEnderCrystal.innerRotation + p_76986_9_;
float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
f3 = (f3 * f3 + f3) * 0.2F;
float f4 = (float) (dragon.healingEnderCrystal.posX - dragon.posX - (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_));
float f5 = (float) ((double) f3 + dragon.healingEnderCrystal.posY - 1.0D - dragon.posY - (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_));
float f6 = (float) (dragon.healingEnderCrystal.posZ - dragon.posZ - (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_));
float f4 = (float) (dragon.healingEnderCrystal.posX
- dragon.posX
- (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_));
float f5 = (float) ((double) f3
+ dragon.healingEnderCrystal.posY
- 1.0D
- dragon.posY
- (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_));
float f6 = (float) (dragon.healingEnderCrystal.posZ
- dragon.posZ
- (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_));
float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
GL11.glPushMatrix();
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, 0.0F);
GL11.glRotatef((float) (-Math.atan2((double) f7, (double) f5)) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(
(float) (-Math.atan2((double) f6, (double) f4)) * 180.0F / (float) Math.PI - 90.0F,
0.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);
Tessellator tessellator = Tessellator.instance;
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_CULL_FACE);
this.bindTexture(enderDragonCrystalBeamTextures);
GL11.glShadeModel(GL11.GL_SMOOTH);
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 + p_76986_9_) * 0.01F;
float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F
- ((float) dragon.ticksExisted + p_76986_9_) * 0.01F;
tessellator.startDrawing(5);
byte b0 = 8;
@@ -129,7 +164,8 @@ public class RenderDragon extends RenderLiving {
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;
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(16777215);
tessellator.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9);
}
@@ -141,25 +177,47 @@ public class RenderDragon extends RenderLiving {
GL11.glPopMatrix();
} else if (dragon instanceof EntityChaosGuardian && ((EntityChaosGuardian) dragon).crystalY > 0) {
float f2 = ((EntityChaosGuardian) dragon).healingChaosCrystal != null ? (float) ((EntityChaosGuardian) dragon).healingChaosCrystal.innerRotation + p_76986_9_ : 0;
float f2 = ((EntityChaosGuardian) dragon).healingChaosCrystal != null
? (float) ((EntityChaosGuardian) dragon).healingChaosCrystal.innerRotation + p_76986_9_
: 0;
float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
f3 = (f3 * f3 + f3) * 0.2F;
float f4 = (float) (((EntityChaosGuardian) dragon).crystalX + 0.5 - dragon.posX - (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_));
float f5 = (float) ((double) f3 + ((EntityChaosGuardian) dragon).crystalY + 0.5 - 1.0D - dragon.posY - (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_));
float f6 = (float) (((EntityChaosGuardian) dragon).crystalZ + 0.5 - dragon.posZ - (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_));
float f4 = (float) (((EntityChaosGuardian) dragon).crystalX
+ 0.5
- dragon.posX
- (dragon.prevPosX - dragon.posX) * (double) (1.0F - p_76986_9_));
float f5 = (float) ((double) f3
+ ((EntityChaosGuardian) dragon).crystalY
+ 0.5
- 1.0D
- dragon.posY
- (dragon.prevPosY - dragon.posY) * (double) (1.0F - p_76986_9_));
float f6 = (float) (((EntityChaosGuardian) dragon).crystalZ
+ 0.5
- dragon.posZ
- (dragon.prevPosZ - dragon.posZ) * (double) (1.0F - p_76986_9_));
float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
GL11.glPushMatrix();
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, 0.0F);
GL11.glRotatef((float) (-Math.atan2((double) f7, (double) f5)) * 180.0F / (float) Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(
(float) (-Math.atan2((double) f6, (double) f4)) * 180.0F / (float) Math.PI - 90.0F,
0.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);
Tessellator tessellator = Tessellator.instance;
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_CULL_FACE);
this.bindTexture(enderDragonCrystalBeamTextures);
GL11.glShadeModel(GL11.GL_SMOOTH);
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 + p_76986_9_) * 0.01F;
float f10 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6) / 32.0F
- ((float) dragon.ticksExisted + p_76986_9_) * 0.01F;
tessellator.startDrawing(5);
byte b0 = 8;
@@ -168,7 +226,8 @@ public class RenderDragon extends RenderLiving {
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;
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.addVertexWithUV((double) f11, (double) f12, (double) f8, (double) f13, (double) f9);
}
@@ -179,48 +238,55 @@ public class RenderDragon extends RenderLiving {
RenderHelper.enableStandardItemLighting();
GL11.glPopMatrix();
}
// } else if (dragon instanceof EntityChaosGuardian && ((EntityChaosGuardian) dragon).healingChaosCrystal != null){
//
//
// float f2 = (float)((EntityChaosGuardian) dragon).healingChaosCrystal.innerRotation + p_76986_9_;
// float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
// f3 = (f3 * f3 + f3) * 0.2F;
// float f4 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posX - dragon.posX - (dragon.prevPosX - dragon.posX) * (double)(1.0F - p_76986_9_));
// float f5 = (float)((double)f3 + ((EntityChaosGuardian) dragon).healingChaosCrystal.posY - 1.0D - dragon.posY - (dragon.prevPosY - dragon.posY) * (double)(1.0F - p_76986_9_));
// float f6 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posZ - dragon.posZ - (dragon.prevPosZ - dragon.posZ) * (double)(1.0F - p_76986_9_));
// float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
// float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
// GL11.glPushMatrix();
// 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, 0.0F);
// GL11.glRotatef((float)(-Math.atan2((double)f7, (double)f5)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F);
// Tessellator tessellator = Tessellator.instance;
// RenderHelper.disableStandardItemLighting();
// GL11.glDisable(GL11.GL_CULL_FACE);
// this.bindTexture(enderDragonCrystalBeamTextures);
// GL11.glShadeModel(GL11.GL_SMOOTH);
// 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 + p_76986_9_) * 0.01F;
// tessellator.startDrawing(5);
// byte b0 = 8;
//
// for (int i = 0; i <= b0; ++i)
// {
// 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 f13 = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorOpaque_I(0);
// tessellator.addVertexWithUV((double)(f11 * 0.2F), (double)(f12 * 0.2F), 0.0D, (double)f13, (double)f10);
// tessellator.setColorOpaque_I(0xFF0000);
// tessellator.addVertexWithUV((double)f11, (double)f12, (double)f8, (double)f13, (double)f9);
// }
//
// tessellator.draw();
// GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_FLAT);
// RenderHelper.enableStandardItemLighting();
// GL11.glPopMatrix();
// }
// } else if (dragon instanceof EntityChaosGuardian && ((EntityChaosGuardian) dragon).healingChaosCrystal !=
// null){
//
//
// float f2 = (float)((EntityChaosGuardian) dragon).healingChaosCrystal.innerRotation + p_76986_9_;
// float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
// f3 = (f3 * f3 + f3) * 0.2F;
// float f4 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posX - dragon.posX - (dragon.prevPosX
// - dragon.posX) * (double)(1.0F - p_76986_9_));
// float f5 = (float)((double)f3 + ((EntityChaosGuardian) dragon).healingChaosCrystal.posY - 1.0D -
// dragon.posY - (dragon.prevPosY - dragon.posY) * (double)(1.0F - p_76986_9_));
// float f6 = (float)(((EntityChaosGuardian) dragon).healingChaosCrystal.posZ - dragon.posZ - (dragon.prevPosZ
// - dragon.posZ) * (double)(1.0F - p_76986_9_));
// float f7 = MathHelper.sqrt_float(f4 * f4 + f6 * f6);
// float f8 = MathHelper.sqrt_float(f4 * f4 + f5 * f5 + f6 * f6);
// GL11.glPushMatrix();
// 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,
// 0.0F);
// GL11.glRotatef((float)(-Math.atan2((double)f7, (double)f5)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F,
// 0.0F);
// Tessellator tessellator = Tessellator.instance;
// RenderHelper.disableStandardItemLighting();
// GL11.glDisable(GL11.GL_CULL_FACE);
// this.bindTexture(enderDragonCrystalBeamTextures);
// GL11.glShadeModel(GL11.GL_SMOOTH);
// 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 +
// p_76986_9_) * 0.01F;
// tessellator.startDrawing(5);
// byte b0 = 8;
//
// for (int i = 0; i <= b0; ++i)
// {
// 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 f13 = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorOpaque_I(0);
// tessellator.addVertexWithUV((double)(f11 * 0.2F), (double)(f12 * 0.2F), 0.0D, (double)f13, (double)f10);
// tessellator.setColorOpaque_I(0xFF0000);
// tessellator.addVertexWithUV((double)f11, (double)f12, (double)f8, (double)f13, (double)f9);
// }
//
// tessellator.draw();
// GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_FLAT);
// RenderHelper.enableStandardItemLighting();
// GL11.glPopMatrix();
// }
}
/**
@@ -321,7 +387,13 @@ 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,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(
EntityLiving p_76986_1_,
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_);
}
@@ -343,8 +415,16 @@ public class RenderDragon extends RenderLiving {
/**
* Renders the model in RenderLiving
*/
protected void renderModel(EntityLivingBase p_77036_1_, 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((EntityDragon) p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
protected void renderModel(
EntityLivingBase p_77036_1_,
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(
(EntityDragon) p_77036_1_, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
}
/**
@@ -353,7 +433,13 @@ 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,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(
EntityLivingBase p_76986_1_,
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_);
}
@@ -370,8 +456,13 @@ 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,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(
Entity p_76986_1_,
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_);
}
}
@@ -19,14 +19,15 @@ import org.lwjgl.opengl.GL11;
* Created by Brandon on 21/11/2014.
*/
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) {
float sine = (float) Math.abs(Math.cos(ClientEventHandler.elapsedTicks / 1000D));
{ //Draw Item
//GL11.glRotatef((((float) ClientEventHandler.elapsedTicks) + f) * entity.rotationSpeed, 0f, 1f, 0f);
{ // Draw Item
// GL11.glRotatef((((float) ClientEventHandler.elapsedTicks) + f) * entity.rotationSpeed, 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));
itemEntity.hoverStart = 0.0F;
@@ -37,8 +38,7 @@ public class RenderDragonHeart extends Render {
RenderItem.renderInFrame = false;
}
{ //Draw Outer Layers
{ // Draw Outer Layers
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200f, 200f);
Tessellator tess = Tessellator.instance;
bindTexture(texture);
@@ -53,8 +53,8 @@ public class RenderDragonProjectile extends Render {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glDisable(GL11.GL_LIGHTING);
// GL11.glDepthMask(false);
// GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glDepthMask(false);
// GL11.glEnable(GL11.GL_CULL_FACE);
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);
Tessellator tessellator = Tessellator.instance;
@@ -90,7 +90,7 @@ public class RenderDragonProjectile extends Render {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glDisable(GL11.GL_BLEND);
//GL11.glDepthMask(true);
// GL11.glDepthMask(true);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
@@ -100,5 +100,4 @@ public class RenderDragonProjectile extends Render {
protected ResourceLocation getEntityTexture(Entity entity) {
return null;
}
}
@@ -18,7 +18,8 @@ public class RenderEntityChaosVortex extends Render {
public static IModelCustom uvSphere;
public RenderEntityChaosVortex() {
uvSphere = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
uvSphere = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
}
public void doRender(EntityChaosVortex entity, double x, double y, double z, float f1, float tick) {
@@ -15,14 +15,23 @@ import org.lwjgl.opengl.GL12;
* Created by brandon3055 on 3/3/2016.
*/
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) {
this.bindEntityTexture(entityArrow);
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glRotatef(entityArrow.prevRotationYaw + (entityArrow.rotationYaw - entityArrow.prevRotationYaw) * f2 - 90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(entityArrow.prevRotationPitch + (entityArrow.rotationPitch - entityArrow.prevRotationPitch) * f2, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(
entityArrow.prevRotationYaw + (entityArrow.rotationYaw - entityArrow.prevRotationYaw) * f2 - 90.0F,
0.0F,
1.0F,
0.0F);
GL11.glRotatef(
entityArrow.prevRotationPitch + (entityArrow.rotationPitch - entityArrow.prevRotationPitch) * f2,
0.0F,
0.0F,
1.0F);
float f10 = 0.3F;
float f11 = (float) entityArrow.arrowShake - f2;
@@ -38,8 +47,7 @@ public class RenderEntityCustomArrow extends Render {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
//arrow.renderAll();
// arrow.renderAll();
if (entityArrow.bowProperties != null && entityArrow.bowProperties.energyBolt) {
arrow.renderAll();
@@ -57,15 +65,15 @@ public class RenderEntityCustomArrow extends Render {
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityCustomArrow arrow) {
return arrow.bowProperties.energyBolt ? ResourceHandler.getResource("textures/models/reactorCore.png") : ResourceHandler.getResource("textures/models/tools/ArrowCommon.png");
return arrow.bowProperties.energyBolt
? ResourceHandler.getResource("textures/models/reactorCore.png")
: ResourceHandler.getResource("textures/models/tools/ArrowCommon.png");
}
/**
@@ -81,7 +89,13 @@ 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,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
public void doRender(
Entity p_76986_1_,
double p_76986_2_,
double p_76986_4_,
double p_76986_6_,
float p_76986_8_,
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_);
}
}
@@ -16,9 +16,7 @@ public class RenderArmor implements IItemRenderer {
private ItemArmor armor;
public RenderArmor() {
}
public RenderArmor() {}
public RenderArmor(ItemArmor armor) {
this.armor = armor;
@@ -42,13 +40,15 @@ public class RenderArmor implements IItemRenderer {
}
GL11.glPushMatrix();
ResourceHandler.bindResource(armor.getArmorTexture(stack, null, 0, null).replace(References.RESOURCESPREFIX, ""));
ResourceHandler.bindResource(
armor.getArmorTexture(stack, null, 0, null).replace(References.RESOURCESPREFIX, ""));
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.EQUIPPED) {
GL11.glTranslated(0.5, 0.5, 0.5);
GL11.glRotated(180, 0, 1, 0);
}
GL11.glTranslated(0, armor.armorType == 0 ? -0.25 : armor.armorType == 1 ? 0.42 : armor.armorType == 2 ? 1.05 : 1.5, 0);
GL11.glTranslated(
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);
armor.getArmorModel(null, stack, 0).render(null, 0f, 0f, 0f, 0f, 0f, 0.0625f);
@@ -25,16 +25,17 @@ public class RenderBow implements IItemRenderer {
private Minecraft mc;
public RenderBow() {
//this.renderManager = RenderManager.instance;
// this.renderManager = RenderManager.instance;
this.mc = Minecraft.getMinecraft();
//this.texturemanager = this.mc.getTextureManager();
// this.texturemanager = this.mc.getTextureManager();
}
@Override
//HandleRenderType lets forge know if it will renderBackground the item in the requested view.
// HandleRenderType lets forge know if it will renderBackground the item in the requested view.
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
//You can remove everything after "EQUIPPED" if you only want this class to renderBackground the third person item.
return type == ItemRenderType.EQUIPPED;// || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
// You can remove everything after "EQUIPPED" if you only want this class to renderBackground the third person
// item.
return type == ItemRenderType.EQUIPPED; // || type == ItemRenderType.EQUIPPED_FIRST_PERSON;
}
@Override
@@ -45,23 +46,23 @@ public class RenderBow implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
EntityLivingBase entity = (EntityLivingBase) data[1];
//ItemRenderer irInstance = this.mc.entityRenderer.itemRenderer;
// ItemRenderer irInstance = this.mc.entityRenderer.itemRenderer;
GL11.glPushMatrix(); // prevents Forge from pre-translating the item
if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
this.renderItem(entity, item, 0);
} else {
GL11.glPushMatrix();
// contra-translate the item from it's standard translation
// also apply some more scale or else the bow is tiny
// contra-translate the item from it's standard translation
// also apply some more scale or else the bow is tiny
float f2 = 3F - (1F / 1.3F);
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); //Roll left-right
GL11.glRotatef(110.0F, 1.0F, 0.0F, 0.0F);//aim up-down
GL11.glRotatef(-10.0F, 0.0F, 0.0F, 1.0F);//aim left-right
GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); // Roll left-right
GL11.glRotatef(110.0F, 1.0F, 0.0F, 0.0F); // aim up-down
GL11.glRotatef(-10.0F, 0.0F, 0.0F, 1.0F); // aim left-right
GL11.glScalef(f2, f2, f2);
GL11.glTranslatef(0.15F, -0.1875F, 0.1875F);
// renderBackground the item as 'real' bow
//This is pulled from RenderBiped
// renderBackground the item as 'real' bow
// This is pulled from RenderBiped
float f3 = 0.625F;
GL11.glTranslatef(0.0F, 0.125F, 0.3125F);
GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F);
@@ -75,7 +76,6 @@ public class RenderBow implements IItemRenderer {
GL11.glPopMatrix(); // prevents GL Underflow errors
}
private void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) {
RenderBlocks renderBlocksIr = new RenderBlocks();
@@ -89,8 +89,11 @@ public class RenderBow implements IItemRenderer {
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(par2ItemStack, type);
if (customRenderer != null) {
texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber()));
ForgeHooksClient.renderEquippedItem(type, customRenderer, renderBlocksIr, par1EntityLivingBase, par2ItemStack);
} else if (par2ItemStack.getItemSpriteNumber() == 0 && item instanceof ItemBlock && RenderBlocks.renderItemIn3d(block.getRenderType())) {
ForgeHooksClient.renderEquippedItem(
type, customRenderer, renderBlocksIr, par1EntityLivingBase, par2ItemStack);
} else if (par2ItemStack.getItemSpriteNumber() == 0
&& item instanceof ItemBlock
&& RenderBlocks.renderItemIn3d(block.getRenderType())) {
texturemanager.bindTexture(texturemanager.getResourceLocation(0));
if (par2ItemStack != null && par2ItemStack.getItem() instanceof ItemCloth) {
@@ -112,7 +115,7 @@ public class RenderBow implements IItemRenderer {
}
texturemanager.bindTexture(texturemanager.getResourceLocation(par2ItemStack.getItemSpriteNumber()));
//TextureUtil.func_147950_a(false, false);
// TextureUtil.func_147950_a(false, false);
Tessellator tessellator = Tessellator.instance;
float f = iicon.getMinU();
float f1 = iicon.getMaxU();
@@ -127,7 +130,8 @@ public class RenderBow implements IItemRenderer {
GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F);
ItemRenderer.renderItemIn2D(tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F);
ItemRenderer.renderItemIn2D(
tessellator, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625F);
if (par2ItemStack.hasEffect(par3)) {
ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png");
@@ -167,6 +171,4 @@ public class RenderBow implements IItemRenderer {
GL11.glPopMatrix();
}
}
@@ -22,9 +22,11 @@ public class RenderBowModel implements IItemRenderer {
this.draconic = draconic;
for (int i = 0; i < 4; i++)
wyvernModels[i] = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/tools/WyvernBow0" + i + ".obj"));
wyvernModels[i] =
AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/tools/WyvernBow0" + i + ".obj"));
for (int i = 0; i < 4; i++)
draconicModels[i] = AdvancedModelLoader.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"));
}
@@ -35,14 +37,14 @@ public class RenderBowModel implements IItemRenderer {
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return false;//type == ItemRenderType.ENTITY && helper == ItemRendererHelper.ENTITY_ROTATION;
return false; // type == ItemRenderType.ENTITY && helper == ItemRendererHelper.ENTITY_ROTATION;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glPushMatrix();
//String currentMode = ItemNBTHelper.getString(item, "mode", "rapidfire");
// String currentMode = ItemNBTHelper.getString(item, "mode", "rapidfire");
float j = 0F;
int selection = 0;
BowHandler.BowProperties properties = null;
@@ -65,7 +67,6 @@ public class RenderBowModel implements IItemRenderer {
IModelCustom activeModel;
if (draconic) {
activeModel = draconicModels[selection];
ResourceHandler.bindResource("textures/models/tools/DraconicBow0" + selection + ".png");
@@ -74,13 +75,13 @@ public class RenderBowModel implements IItemRenderer {
ResourceHandler.bindResource("textures/models/tools/WyvernBow0" + selection + ".png");
}
if (activeModel != null) doRender(activeModel, type, j > 0 ? selection : -1, properties);
GL11.glPopMatrix();
}
private void doRender(IModelCustom modelCustom, ItemRenderType type, int drawState, BowHandler.BowProperties properties) {
private void doRender(
IModelCustom modelCustom, ItemRenderType type, int drawState, BowHandler.BowProperties properties) {
if (type == ItemRenderType.EQUIPPED) {
GL11.glScaled(0.8, 0.8, 0.8);
@@ -104,11 +105,11 @@ public class RenderBowModel implements IItemRenderer {
GL11.glRotatef(-90, 1, 0, 0);
}
modelCustom.renderAll();
if (drawState != -1) {
GL11.glTranslated(0.3, 0.151, -0.2 + (drawState == 1 ? 0 : drawState == 2 ? 0.55 : drawState == 3 ? 1 : -0.7));
GL11.glTranslated(
0.3, 0.151, -0.2 + (drawState == 1 ? 0 : drawState == 2 ? 0.55 : drawState == 3 ? 1 : -0.7));
GL11.glRotatef(90, 0, 0, 1);
if (properties != null && properties.energyBolt) {
@@ -12,7 +12,8 @@ import org.lwjgl.opengl.GL11;
* Created by brandon3055 on 1/10/2015.
*/
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();
@@ -11,7 +11,8 @@ import org.lwjgl.opengl.GL11;
* Created by brandon3055 on 1/10/2015.
*/
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
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
@@ -14,7 +14,27 @@ import org.lwjgl.opengl.GL11;
public class RenderMobSoul implements IItemRenderer {
private Minecraft mc;
private Entity randomEntity = null;
private String[] randomEntitys = new String[]{"Pig", "Sheep", "Enderman", "Zombie", "Creeper", "Cow", "Chicken", "Ozelot", "Witch", "Wolf", "MushroomCow", "Squid", "EntityHorse", "Spider", "Skeleton", "Blaze", "Bat", "Villager", "Silverfish"};
private String[] randomEntitys = new String[] {
"Pig",
"Sheep",
"Enderman",
"Zombie",
"Creeper",
"Cow",
"Chicken",
"Ozelot",
"Witch",
"Wolf",
"MushroomCow",
"Squid",
"EntityHorse",
"Spider",
"Skeleton",
"Blaze",
"Bat",
"Villager",
"Silverfish"
};
public RenderMobSoul() {
this.mc = Minecraft.getMinecraft();
@@ -22,11 +42,13 @@ public class RenderMobSoul implements IItemRenderer {
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON || type == ItemRenderType.INVENTORY || type == ItemRenderType.ENTITY;
return type == ItemRenderType.EQUIPPED
|| type == ItemRenderType.EQUIPPED_FIRST_PERSON
|| type == ItemRenderType.INVENTORY
|| type == ItemRenderType.ENTITY;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return false;
}
@@ -34,7 +56,8 @@ public class RenderMobSoul implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
Entity mob = EntityList.createEntityByName(ItemNBTHelper.getString(item, "Name", "Pig"), mc.theWorld);
randomEntity = EntityList.createEntityByName(randomEntitys[(int) ((Minecraft.getSystemTime() / 1000) % 18)], mc.theWorld);
randomEntity = EntityList.createEntityByName(
randomEntitys[(int) ((Minecraft.getSystemTime() / 1000) % 18)], mc.theWorld);
if (ItemNBTHelper.getString(item, "Name", "Pig").equals("Any")) mob = randomEntity;
if (mob instanceof EntitySkeleton)
((EntitySkeleton) mob).setSkeletonType(ItemNBTHelper.getInteger(item, "SkeletonType", 0));
@@ -88,6 +111,5 @@ public class RenderMobSoul implements IItemRenderer {
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
@@ -33,14 +33,14 @@ public class RenderStabilizerPart implements IItemRenderer {
GL11.glTranslated(0.5, 0.5, 0.5);
switch (item.getItemDamage()) {
case 0://frame
case 0: // frame
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
modelBase.basePlate.render(0.0625F);
break;
case 1://rotor inner
case 1: // rotor inner
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
// GL11.glScaled(2, 2, 2);
// GL11.glTranslated(-0.2, 0, 0);
// GL11.glScaled(2, 2, 2);
// GL11.glTranslated(-0.2, 0, 0);
modelBaseRotors.rotor1R.childModels.clear();
modelBaseRotors.rotor1R.render(0.0625F);
modelBaseRotors.rotor1R_1.render(0.0625F);
@@ -48,10 +48,10 @@ public class RenderStabilizerPart implements IItemRenderer {
modelBaseRotors.rotor1R_3.render(0.0625F);
modelBaseRotors.rotor1R_4.render(0.0625F);
break;
case 2://rotor outer
case 2: // rotor outer
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
// GL11.glScaled(2, 2, 2);
// GL11.glTranslated(-0.3, 0, 0);
// GL11.glScaled(2, 2, 2);
// GL11.glTranslated(-0.3, 0, 0);
modelBaseRotors.rotor2R.childModels.clear();
modelBaseRotors.rotor2R.render(0.0625F);
modelBaseRotors.rotor2R_1.render(0.0625F);
@@ -59,10 +59,10 @@ public class RenderStabilizerPart implements IItemRenderer {
modelBaseRotors.rotor2R_3.render(0.0625F);
modelBaseRotors.rotor2R_4.render(0.0625F);
break;
case 3://rotor assembly
case 3: // rotor assembly
ResourceHandler.bindResource("textures/models/reactorStabilizerCore.png");
// GL11.glScaled(1.5, 1.5, 1.5);
// GL11.glTranslated(-0.05, 0, 0);
// GL11.glScaled(1.5, 1.5, 1.5);
// GL11.glTranslated(-0.05, 0, 0);
GL11.glRotatef(30F, 0F, 0F, 1F);
modelBase.rotor1R.render(0.0625F);
modelBase.hub1.render(0.0625F);
@@ -70,7 +70,7 @@ public class RenderStabilizerPart implements IItemRenderer {
modelBase.hub2.render(0.0625F);
modelBase.rotor2R.render(0.0625F);
break;
case 4://stabilizer ring
case 4: // stabilizer ring
ResourceHandler.bindResource("textures/models/reactorStabilizerRing.png");
GL11.glRotatef(90F, 0F, 0F, 1F);
modelRing.render(null, -30, 1, 0, 0, 0, 1F / 16F);
@@ -16,7 +16,7 @@ public class RenderTool implements IItemRenderer {
private String toolTexture;
private IRenderTweak tool;
//Draconic Sword
// Draconic Sword
public RenderTool(String model, String texture, IRenderTweak tool) {
this.tool = tool;
@@ -16,12 +16,21 @@ public class ParticleCustom extends EntityFX {
public int fadeLength = 0;
public float gravity = 0F;
public ParticleCustom(World world, double spawnX, double spawnY, double spawnZ, float spawnMotionX, float spawnMotionY, float spawnMotionZ, float scale, boolean canCollide, int index) {
public ParticleCustom(
World world,
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);
this.motionX = spawnMotionX;//initial motion value X
this.motionY = spawnMotionY;//initial motion value Y
this.motionZ = spawnMotionZ;//initial motion value Z
this.motionX = spawnMotionX; // initial motion value X
this.motionY = spawnMotionY; // initial motion value Y
this.motionZ = spawnMotionZ; // initial motion value Z
this.particleTextureIndexX = index - 1; //
this.particleTextureIndexY = 0;
@@ -30,7 +39,6 @@ public class ParticleCustom extends EntityFX {
this.noClip = !canCollide;
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
@@ -43,23 +51,28 @@ public class ParticleCustom extends EntityFX {
fadeTime--;
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);// also important if you want your particle to move
//this.motionX = motionX * (1 - (worldObj.rand.nextFloat() / 10F));
this.moveEntity(this.motionX, this.motionY, this.motionZ); // also important if you want your particle to move
// this.motionX = motionX * (1 - (worldObj.rand.nextFloat() / 10F));
this.motionY = motionY - (gravity / 100F);
//this.motionZ = motionZ * (1 - (worldObj.rand.nextFloat() / 10F));
// this.motionZ = motionZ * (1 - (worldObj.rand.nextFloat() / 10F));
}
@Override
@SideOnly(Side.CLIENT)
public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y
public void renderParticle(
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tesselator.draw();
ResourceHandler.bindParticles();
tesselator.startDrawingQuads();
tesselator.setBrightness(200);//make sure you have this!!
tesselator.setBrightness(200); // make sure you have this!!
float minU = (float) this.particleTextureIndexX / 8.0F;
float maxU = minU + 0.124F;
@@ -80,14 +93,33 @@ public class ParticleCustom extends EntityFX {
tesselator.setColorRGBA(red, green, blue, (int) (this.particleAlpha * 255F));
tesselator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV);
tesselator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV);
tesselator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV);
tesselator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV);
tesselator.addVertexWithUV(
(double) (drawX - par3 * drawScale - par6 * drawScale),
(double) (drawY - par4 * drawScale),
(double) (drawZ - par5 * drawScale - par7 * drawScale),
(double) maxU,
(double) maxV);
tesselator.addVertexWithUV(
(double) (drawX - par3 * drawScale + par6 * drawScale),
(double) (drawY + par4 * drawScale),
(double) (drawZ - par5 * drawScale + par7 * drawScale),
(double) maxU,
(double) minV);
tesselator.addVertexWithUV(
(double) (drawX + par3 * drawScale + par6 * drawScale),
(double) (drawY + par4 * drawScale),
(double) (drawZ + par5 * drawScale + par7 * drawScale),
(double) minU,
(double) minV);
tesselator.addVertexWithUV(
(double) (drawX + par3 * drawScale - par6 * drawScale),
(double) (drawY - par4 * drawScale),
(double) (drawZ + par5 * drawScale - par7 * drawScale),
(double) minU,
(double) maxV);
tesselator.draw();
ResourceHandler.bindDefaultParticles();
tesselator.startDrawingQuads();
}
}
@@ -11,36 +11,46 @@ public class ParticleDistortion extends EntityFX {
double originalX;
double originalZ;
public ParticleDistortion(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float scale) {
public ParticleDistortion(
World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float scale) {
this(par1World, par2, par4, par6, 1.0F, par8, par9, par10, scale);
}
public ParticleDistortion(World world, double par2, double par4, double par6, float par8, float par9, float par10, float par11, float scale) {
public ParticleDistortion(
World world,
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);
this.motionX = par9;//initial motion value X
this.motionY = par10;//initial motion value Y
this.motionZ = par11;//initial motion value Z
this.motionX = par9; // initial motion value X
this.motionY = par10; // initial motion value Y
this.motionZ = par11; // initial motion value Z
this.originalX = par9;
this.originalZ = par11;
if (par9 == 0.0F) {
par9 = 1.0F;
}
//float var12 = (float) Math.random() * 0.4F + 0.6F;
// float var12 = (float) Math.random() * 0.4F + 0.6F;
this.particleTextureIndexX = 0; //
this.particleTextureIndexY = 0;
this.particleRed = 0.7F;//RGB of your particle
this.particleRed = 0.7F; // RGB of your particle
this.particleGreen = 0.8F;
this.particleBlue = 1.0F;
//this.particleScale *= 0.05f + world.rand.nextFloat()*0.005;
//this.particleScale *= par8;
// this.particleScale *= 0.05f + world.rand.nextFloat()*0.005;
// this.particleScale *= par8;
this.particleScale = scale;
this.particleMaxAge = 40 + world.rand.nextInt(40);//how soon the particle dies. You can use randomizer for this
this.noClip = true;//does your particle collide with blocks?
this.particleMaxAge =
40 + world.rand.nextInt(40); // how soon the particle dies. You can use randomizer for this
this.noClip = true; // does your particle collide with blocks?
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
@@ -48,30 +58,35 @@ public class ParticleDistortion extends EntityFX {
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();//make sure to have this
this.setDead(); // make sure to have this
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);// also important if you want your particle to move
this.moveEntity(this.motionX, this.motionY, this.motionZ); // also important if you want your particle to move
this.motionX = motionX * (1 - (worldObj.rand.nextFloat() / 10F));
this.motionY = motionY * (1 - (worldObj.rand.nextFloat() / 10F));
this.motionZ = motionZ * (1 - (worldObj.rand.nextFloat() / 10F));
this.particleAlpha = (1F - ((float) this.particleAge / (float) this.particleMaxAge)) * 0.5F;
}
@Override
@SideOnly(Side.CLIENT)
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y
public void renderParticle(
Tessellator tessellator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tessellator.draw();
ResourceHandler.bindParticles();
tessellator.startDrawingQuads();
tessellator.setBrightness(200);//make sure you have this!!
tessellator.setBrightness(200); // make sure you have this!!
float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F;
float maxU = 0.0F + 0.1245F;//minU + 0.124F;
float minV = 0F;//(float)this.particleTextureIndexY / 32.0F;
float maxV = 0.1245F;//minV + 0.124F;
float minU = 0.0F + 0F; // (float)this.particleTextureIndexX / 32.0F;
float maxU = 0.0F + 0.1245F; // minU + 0.124F;
float minV = 0F; // (float)this.particleTextureIndexY / 32.0F;
float maxV = 0.1245F; // minV + 0.124F;
float drawScale = 0.1F * this.particleScale;
if (this.particleIcon != null) {
@@ -88,14 +103,33 @@ public class ParticleDistortion extends EntityFX {
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
tessellator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F));
tessellator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV);
tessellator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV);
tessellator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV);
tessellator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV);
tessellator.addVertexWithUV(
(double) (drawX - par3 * drawScale - par6 * drawScale),
(double) (drawY - par4 * drawScale),
(double) (drawZ - par5 * drawScale - par7 * drawScale),
(double) maxU,
(double) maxV);
tessellator.addVertexWithUV(
(double) (drawX - par3 * drawScale + par6 * drawScale),
(double) (drawY + par4 * drawScale),
(double) (drawZ - par5 * drawScale + par7 * drawScale),
(double) maxU,
(double) minV);
tessellator.addVertexWithUV(
(double) (drawX + par3 * drawScale + par6 * drawScale),
(double) (drawY + par4 * drawScale),
(double) (drawZ + par5 * drawScale + par7 * drawScale),
(double) minU,
(double) minV);
tessellator.addVertexWithUV(
(double) (drawX + par3 * drawScale - par6 * drawScale),
(double) (drawY - par4 * drawScale),
(double) (drawZ + par5 * drawScale - par7 * drawScale),
(double) minU,
(double) maxV);
tessellator.draw();
ResourceHandler.bindDefaultParticles();
tessellator.startDrawingQuads();
}
}
@@ -15,7 +15,8 @@ public class ParticleEnergy extends EntityFX {
public int particle;
public boolean expand = true;
public ParticleEnergy(World world, double x, double y, double z, double tX, double tY, double tZ, int particle, boolean expand) {
public ParticleEnergy(
World world, double x, double y, double z, double tX, double tY, double tZ, int particle, boolean expand) {
this(world, x, y, z, tX, tY, tZ, particle);
this.expand = expand;
this.particleRed = 185F / 255F;
@@ -43,14 +44,13 @@ public class ParticleEnergy extends EntityFX {
this.particleRed = particle == 1 ? 0F : 1.0F;
this.particleGreen = particle == 1 ? 1F : 0.2F;
this.particleBlue = particle == 1 ? 1F : 0.0F;
//this.particleScale *= 0.05f + world.rand.nextFloat()*0.005;
//this.particleScale *= par8;
// this.particleScale *= 0.05f + world.rand.nextFloat()*0.005;
// this.particleScale *= par8;
this.particleScale = 0.5F;
this.particleMaxAge = 80;
this.noClip = true;
}
@Override
public void onUpdate() {
prevPosX = posX;
@@ -66,7 +66,7 @@ public class ParticleEnergy extends EntityFX {
if (particleAge++ >= particleMaxAge) {
setDead();
}
moveEntity(motionX, motionY, motionZ);// also important if you want your particle to move
moveEntity(motionX, motionY, motionZ); // also important if you want your particle to move
float speedMultiplyer = 0.000501F;
float ySpeedMultiplyer = 0.1006F;
if (expand) {
@@ -78,7 +78,10 @@ public class ParticleEnergy extends EntityFX {
motionY = (targetY - posY) * ySpeedMultiplyer;
motionZ = (targetZ - posZ) * speedMultiplyer;
}
if (expand && Math.abs(targetX - posX) < 0.01 && Math.abs(targetY - posY) < 0.01 && Math.abs(targetZ - posZ) < 0.01) {
if (expand
&& Math.abs(targetX - posX) < 0.01
&& Math.abs(targetY - posY) < 0.01
&& Math.abs(targetZ - posZ) < 0.01) {
motionX = 0;
motionY = 0;
motionZ = 0;
@@ -88,23 +91,28 @@ public class ParticleEnergy extends EntityFX {
particleScale = 2;
particleAlpha = (1F - ((float) particleAge / (float) particleMaxAge)) * 1F;
}
}
@Override
//@SideOnly(Side.CLIENT)
public void renderParticle(Tessellator tesselator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y
// @SideOnly(Side.CLIENT)
public void renderParticle(
Tessellator tesselator,
float par2,
float par3,
float par4,
float par5,
float par6,
float par7) { // Note U=X V=Y
tesselator.draw();
ResourceHandler.bindParticles();
tesselator.startDrawingQuads();
tesselator.setBrightness(200);//make sure you have this!!
tesselator.setBrightness(200); // make sure you have this!!
float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F;
float maxU = 0.0F + 0.1245F;//minU + 0.124F;
float minV = 0F;//(float)this.particleTextureIndexY / 32.0F;
float maxV = 0.1245F;//minV + 0.124F;
float minU = 0.0F + 0F; // (float)this.particleTextureIndexX / 32.0F;
float maxU = 0.0F + 0.1245F; // minU + 0.124F;
float minV = 0F; // (float)this.particleTextureIndexY / 32.0F;
float maxV = 0.1245F; // minV + 0.124F;
float drawScale = 0.1F * this.particleScale;
if (this.particleIcon != null) {
@@ -119,16 +127,35 @@ public class ParticleEnergy extends EntityFX {
float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tesselator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
//tesselator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F));
// tesselator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F));
tesselator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV);
tesselator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV);
tesselator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV);
tesselator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV);
tesselator.addVertexWithUV(
(double) (drawX - par3 * drawScale - par6 * drawScale),
(double) (drawY - par4 * drawScale),
(double) (drawZ - par5 * drawScale - par7 * drawScale),
(double) maxU,
(double) maxV);
tesselator.addVertexWithUV(
(double) (drawX - par3 * drawScale + par6 * drawScale),
(double) (drawY + par4 * drawScale),
(double) (drawZ - par5 * drawScale + par7 * drawScale),
(double) maxU,
(double) minV);
tesselator.addVertexWithUV(
(double) (drawX + par3 * drawScale + par6 * drawScale),
(double) (drawY + par4 * drawScale),
(double) (drawZ + par5 * drawScale + par7 * drawScale),
(double) minU,
(double) minV);
tesselator.addVertexWithUV(
(double) (drawX + par3 * drawScale - par6 * drawScale),
(double) (drawY - par4 * drawScale),
(double) (drawZ + par5 * drawScale - par7 * drawScale),
(double) minU,
(double) maxV);
tesselator.draw();
ResourceHandler.bindDefaultParticles();
tesselator.startDrawingQuads();
}
}
@@ -1,9 +1,9 @@
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 com.brandon3055.brandonscore.common.utills.Utills;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
@@ -38,6 +38,7 @@ public class ParticleEnergyBeam extends EntityFX {
* Modified Target X
*/
private boolean advanced;
private boolean renderParticle = true;
private float length = 0.0F;
private float rotYaw = 0.0F;
@@ -46,16 +47,28 @@ public class ParticleEnergyBeam extends EntityFX {
private float prevPitch = 0.0F;
private EntityPlayer player;
//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 = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyBeamBlue.png");
private static ResourceLocation beamTextureAdvanced = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyBeamRed.png");
// 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 =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyBeamBlue.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
*/
public ParticleEnergyBeam(World world, double x, double y, double z, double tX, double tY, double tZ, int maxAge, int flow, boolean advanced, int offsetMode) {
public ParticleEnergyBeam(
World world,
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);
this.particleRed = 1F;
this.particleGreen = 1F;
@@ -82,7 +95,7 @@ public class ParticleEnergyBeam extends EntityFX {
double xOff = xDist / dist;
double zOff = zDist / dist;
if (xOff == 0 && zOff == 0) xOff = 1;
//LogHelper.info(xOff + " " + zOff);
// LogHelper.info(xOff + " " + zOff);
double offM = 0.4D;
if (offsetMode == 2 || offsetMode == 3) setPosition(posX - xOff * offM, posY, posZ - zOff * offM);
@@ -93,20 +106,18 @@ public class ParticleEnergyBeam extends EntityFX {
this.tZ = tZ + zOff * offM;
}
}
}
public void update(int flow, boolean render) {
this.renderParticle = render;
for (this.flow = flow; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {
}
for (this.flow = flow; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {}
}
@Override
public void onUpdate() {
//1.570797f
// double sin = Math.sin(-1f + (float)(particleAge % 360) / 180f * 1.570797f);
// LogHelper.info(sin + " " + particleAge % 360);
// 1.570797f
// double sin = Math.sin(-1f + (float)(particleAge % 360) / 180f * 1.570797f);
// LogHelper.info(sin + " " + particleAge % 360);
this.prevPosX = this.posX;
this.prevPosY = this.posY;
@@ -125,7 +136,6 @@ public class ParticleEnergyBeam extends EntityFX {
this.prevYaw = this.rotYaw;
this.prevPitch = this.rotPitch;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
@@ -139,14 +149,15 @@ public class ParticleEnergyBeam extends EntityFX {
}
@Override
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
public void renderParticle(
Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
if (!renderParticle) return;
tessellator.draw();
GL11.glPushMatrix();
//GL11.glPushAttrib(GL11.GL_ATTRIB_STACK_DEPTH);
// GL11.glPushAttrib(GL11.GL_ATTRIB_STACK_DEPTH);
float var9 = 1.0F;
float slide = (float) getPlayer().ticksExisted;
float size = (float) flow / 100f * 2f; //0.7F;
float size = (float) flow / 100f * 2f; // 0.7F;
if (advanced) Minecraft.getMinecraft().renderEngine.bindTexture(beamTextureAdvanced);
else Minecraft.getMinecraft().renderEngine.bindTexture(beamTextureBasic);
GL11.glTexParameterf(3553, 10242, 10497.0F);
@@ -191,8 +202,8 @@ public class ParticleEnergyBeam extends EntityFX {
var44 = -0.15D * (double) 1;
var17 = 0.15D * (double) 1;
//GL11.glColor4f(1f, 1f, 1f, 1f);
//GL11.glTranslated(0.1, 0, 0);
// GL11.glColor4f(1f, 1f, 1f, 1f);
// GL11.glTranslated(0.1, 0, 0);
for (int t = 0; t < 2; ++t) {
double var29 = (double) (this.length * var9);
double var31 = 0D;
@@ -212,14 +223,12 @@ public class ParticleEnergyBeam extends EntityFX {
}
}
//GL11.glDepthMask(true);
// GL11.glDepthMask(true);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glPopAttrib();
GL11.glPopMatrix();
ResourceHandler.bindDefaultParticles();
tessellator.startDrawingQuads();
}
@@ -15,6 +15,7 @@ public class ParticleEnergyField extends EntityFX {
* Particle Type 0 = Energy Ring, 1 = single particle
*/
private int type;
private boolean advanced;
private boolean renderParticle = true;
@@ -34,8 +35,7 @@ public class ParticleEnergyField extends EntityFX {
}
public void update(boolean render) {
for (this.renderParticle = render; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {
}
for (this.renderParticle = render; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {}
}
@Override
@@ -45,30 +45,29 @@ public class ParticleEnergyField extends EntityFX {
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
}
@Override
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
public void renderParticle(
Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
if (!renderParticle) return;
tessellator.draw();
GL11.glPushMatrix();
//GL11.glPushAttrib(GL11.GL_ATTRIB_STACK_DEPTH);
// GL11.glPushAttrib(GL11.GL_ATTRIB_STACK_DEPTH);
GL11.glDepthMask(false);
ResourceHandler.bindParticles();
float minU = 0.0F + 0.125F * (advanced ? 4 : 3);
float maxU = 0.0F + 0.125F * (advanced ? 5 : 4);//minU + 0.124F;
float maxU = 0.0F + 0.125F * (advanced ? 5 : 4); // minU + 0.124F;
if (type == 2) {
minU = 0.0F + 0.125F * 5;
maxU = 0.0F + 0.125F * 6;
}
float minV = 0F;//(float)this.particleTextureIndexY / 32.0F;
float maxV = 0.123F;//minV + 0.124F;
float minV = 0F; // (float)this.particleTextureIndexY / 32.0F;
float maxV = 0.123F; // minV + 0.124F;
float drawScale = 0.2f;
if (this.particleIcon != null) {
@@ -82,7 +81,6 @@ public class ParticleEnergyField extends EntityFX {
float drawY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) partialTick - interpPosY);
float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTick - interpPosZ);
if (type == 0 || type == 2) {
tessellator.startDrawingQuads();
tessellator.setBrightness(200);
@@ -90,7 +88,7 @@ public class ParticleEnergyField extends EntityFX {
double pCount = Minecraft.getMinecraft().gameSettings.fancyGraphics ? 35 : 15;
for (int i = 0; i < pCount; i++) {
double rot = i / pCount * (3.141 * 2D) + particleAge / 3D;//1D;//i / 10D;
double rot = i / pCount * (3.141 * 2D) + particleAge / 3D; // 1D;//i / 10D;
double offset = 0.4;
double ox = Math.sin(rot) * offset;
double oz = Math.cos(rot) * offset;
@@ -98,10 +96,30 @@ public class ParticleEnergyField extends EntityFX {
float drawXX = drawX + (float) ox;
float drawZZ = drawZ + (float) oz;
tessellator.addVertexWithUV((double) (drawXX - rotX * drawScale - rotYZ * drawScale), (double) (drawY - rotXZ * drawScale), (double) (drawZZ - rotZ * drawScale - rotXY * drawScale), (double) maxU, (double) maxV);
tessellator.addVertexWithUV((double) (drawXX - rotX * drawScale + rotYZ * drawScale), (double) (drawY + rotXZ * drawScale), (double) (drawZZ - rotZ * drawScale + rotXY * drawScale), (double) maxU, (double) minV);
tessellator.addVertexWithUV((double) (drawXX + rotX * drawScale + rotYZ * drawScale), (double) (drawY + rotXZ * drawScale), (double) (drawZZ + rotZ * drawScale + rotXY * drawScale), (double) minU, (double) minV);
tessellator.addVertexWithUV((double) (drawXX + rotX * drawScale - rotYZ * drawScale), (double) (drawY - rotXZ * drawScale), (double) (drawZZ + rotZ * drawScale - rotXY * drawScale), (double) minU, (double) maxV);
tessellator.addVertexWithUV(
(double) (drawXX - rotX * drawScale - rotYZ * drawScale),
(double) (drawY - rotXZ * drawScale),
(double) (drawZZ - rotZ * drawScale - rotXY * drawScale),
(double) maxU,
(double) maxV);
tessellator.addVertexWithUV(
(double) (drawXX - rotX * drawScale + rotYZ * drawScale),
(double) (drawY + rotXZ * drawScale),
(double) (drawZZ - rotZ * drawScale + rotXY * drawScale),
(double) maxU,
(double) minV);
tessellator.addVertexWithUV(
(double) (drawXX + rotX * drawScale + rotYZ * drawScale),
(double) (drawY + rotXZ * drawScale),
(double) (drawZZ + rotZ * drawScale + rotXY * drawScale),
(double) minU,
(double) minV);
tessellator.addVertexWithUV(
(double) (drawXX + rotX * drawScale - rotYZ * drawScale),
(double) (drawY - rotXZ * drawScale),
(double) (drawZZ + rotZ * drawScale - rotXY * drawScale),
(double) minU,
(double) maxV);
}
tessellator.draw();
@@ -111,20 +129,39 @@ public class ParticleEnergyField extends EntityFX {
tessellator.setBrightness(200);
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1f);
tessellator.addVertexWithUV((double) (drawX - rotX * drawScale - rotYZ * drawScale), (double) (drawY - rotXZ * drawScale), (double) (drawZ - rotZ * drawScale - rotXY * drawScale), (double) maxU, (double) maxV);
tessellator.addVertexWithUV((double) (drawX - rotX * drawScale + rotYZ * drawScale), (double) (drawY + rotXZ * drawScale), (double) (drawZ - rotZ * drawScale + rotXY * drawScale), (double) maxU, (double) minV);
tessellator.addVertexWithUV((double) (drawX + rotX * drawScale + rotYZ * drawScale), (double) (drawY + rotXZ * drawScale), (double) (drawZ + rotZ * drawScale + rotXY * drawScale), (double) minU, (double) minV);
tessellator.addVertexWithUV((double) (drawX + rotX * drawScale - rotYZ * drawScale), (double) (drawY - rotXZ * drawScale), (double) (drawZ + rotZ * drawScale - rotXY * drawScale), (double) minU, (double) maxV);
tessellator.addVertexWithUV(
(double) (drawX - rotX * drawScale - rotYZ * drawScale),
(double) (drawY - rotXZ * drawScale),
(double) (drawZ - rotZ * drawScale - rotXY * drawScale),
(double) maxU,
(double) maxV);
tessellator.addVertexWithUV(
(double) (drawX - rotX * drawScale + rotYZ * drawScale),
(double) (drawY + rotXZ * drawScale),
(double) (drawZ - rotZ * drawScale + rotXY * drawScale),
(double) maxU,
(double) minV);
tessellator.addVertexWithUV(
(double) (drawX + rotX * drawScale + rotYZ * drawScale),
(double) (drawY + rotXZ * drawScale),
(double) (drawZ + rotZ * drawScale + rotXY * drawScale),
(double) minU,
(double) minV);
tessellator.addVertexWithUV(
(double) (drawX + rotX * drawScale - rotYZ * drawScale),
(double) (drawY - rotXZ * drawScale),
(double) (drawZ + rotZ * drawScale - rotXY * drawScale),
(double) minU,
(double) maxV);
tessellator.draw();
}
// GL11.glDepthMask(true);
//GL11.glPopAttrib();
// GL11.glDepthMask(true);
// GL11.glPopAttrib();
GL11.glPopMatrix();
ResourceHandler.bindDefaultParticles();
tessellator.startDrawingQuads();
}
}
}
@@ -23,6 +23,7 @@ public class ParticleReactorBeam extends EntityFX {
* Particle Type 0 = Energy Ring, 1 = single particle
*/
private boolean renderParticle = true;
private TileEntity tile;
private boolean isInjectorBeam = false;
@@ -42,8 +43,7 @@ public class ParticleReactorBeam extends EntityFX {
}
public void update(boolean render) {
for (this.renderParticle = render; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {
}
for (this.renderParticle = render; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {}
}
@Override
@@ -53,15 +53,14 @@ public class ParticleReactorBeam extends EntityFX {
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
}
@Override
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
public void renderParticle(
Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
if (!((IReactorPart) tile).isActive()) return;
tessellator.draw();
GL11.glPushMatrix();
@@ -73,20 +72,29 @@ public class ParticleReactorBeam extends EntityFX {
float zz = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTick - interpPosZ);
GL11.glTranslated((double) xx, (double) yy, (double) zz);
//Common Fields
// Common Fields
MultiblockHelper.TileLocation master = ((IReactorPart) tile).getMaster();
float offsetX = (float) (master.posX - tile.xCoord);
float offsetY = (float) ((double) master.posY - tile.yCoord);
float offsetZ = (float) (master.posZ - tile.zCoord);
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);
GL11.glRotatef((float) (-Math.atan2((double) offsetZ, (double) offsetX)) * 180.0F / (float) Math.PI - 90.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, 0.0F);
GL11.glRotatef(
(float) (-Math.atan2((double) offsetZ, (double) offsetX)) * 180.0F / (float) Math.PI - 90.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,
0.0F);
TileReactorCore reactor = ((IReactorPart) tile).getMaster().getTileEntity(worldObj) instanceof TileReactorCore ? (TileReactorCore) ((IReactorPart) tile).getMaster().getTileEntity(worldObj) : null;
TileReactorCore reactor = ((IReactorPart) tile).getMaster().getTileEntity(worldObj) instanceof TileReactorCore
? (TileReactorCore) ((IReactorPart) tile).getMaster().getTileEntity(worldObj)
: null;
if (tile instanceof TileReactorStabilizer && reactor != null)
renderStabilizerEffect(tessellator, reactor, offsetX, offsetY, offsetZ, length, partialTick);
@@ -94,20 +102,20 @@ public class ParticleReactorBeam extends EntityFX {
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glTranslated(0, 0, 0.3);
//GL11.glPushMatrix();
// GL11.glPushMatrix();
GL11.glRotatef(((float) particleAge + partialTick) * 20F, 0, 0, 1);
ResourceHandler.bindResource("textures/particle/reactorEnergyBeam.png");
// float sizeOrigin = 0.5F;
// float sizeTarget = 0.2F;
// float sizeOrigin = 0.5F;
// float sizeTarget = 0.2F;
float sizeOrigin = 0.5F;
int color = 0xFF2200;
int alpha = (int) (200D * reactor.renderSpeed);
float speed = 20F;
float texV2 = 0.0F + ((float) particleAge + partialTick) * 0.01F * speed;
float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) + ((float) particleAge + partialTick) * 0.01F * speed;
float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ)
+ ((float) particleAge + partialTick) * 0.01F * speed;
tessellator.startDrawing(5);
tessellator.setBrightness(200);
@@ -122,12 +130,17 @@ public class ParticleReactorBeam extends EntityFX {
float texU = (float) (i % b0) * 1.0F / (float) b0;
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
tessellator.addVertexWithUV((double) (verX * sizeOrigin), (double) (verY * sizeOrigin), -0.55D, (double) texU, (double) texV1);
tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), -0.55D, (double) texU, (double)
texV1);
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);
}
length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) - (float) (reactor.getCoreDiameter() / 2D) - 0.3F;
length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ)
- (float) (reactor.getCoreDiameter() / 2D)
- 0.3F;
sizeTarget = (float) (reactor.getCoreDiameter() / 2 * 0.2D);
sizeOrigin = 0.1F / sizeTarget;
@@ -137,14 +150,16 @@ public class ParticleReactorBeam extends EntityFX {
float texU = (float) (i % b0) * 1.0F / (float) b0;
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
tessellator.addVertexWithUV((double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) texV1);
tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double)
texV1);
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();
//GL11.glPopMatrix();
// GL11.glPopMatrix();
GL11.glRotatef(((float) particleAge + partialTick) * -30F, 0, 0, 1);
tessellator.startDrawing(5);
@@ -162,9 +177,12 @@ public class ParticleReactorBeam extends EntityFX {
float texU = (float) (i % b0) * 1.0F / (float) b0;
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha / 2);
tessellator.addVertexWithUV((double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) texV1);
tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double)
texV1);
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();
@@ -177,33 +195,92 @@ public class ParticleReactorBeam extends EntityFX {
tessellator.startDrawingQuads();
}
private void renderStabilizerEffect(Tessellator tessellator, TileReactorCore reactor, float offsetX, float offsetY, float offsetZ, float length, float partialTick) {
private void renderStabilizerEffect(
Tessellator tessellator,
TileReactorCore reactor,
float offsetX,
float offsetY,
float offsetZ,
float length,
float partialTick) {
GL11.glShadeModel(GL11.GL_SMOOTH);
//Draw Beams
// Draw Beams
GL11.glPushMatrix();
GL11.glTranslated(0, 0, -0.35);
ResourceHandler.bindResource("textures/particle/reactorBeam.png");
drawBeam(tessellator, reactor, 1F, 0.355F, 0.8F, offsetX, offsetY, offsetZ, particleAge, partialTick, true, false, 0x00ffff);
drawBeam(
tessellator,
reactor,
1F,
0.355F,
0.8F,
offsetX,
offsetY,
offsetZ,
particleAge,
partialTick,
true,
false,
0x00ffff);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 0.45);
float coreSize = (float) (reactor.getCoreDiameter() / 2) * 0.9F;
float s = 0.355F;
drawBeam(tessellator, reactor, s / coreSize, coreSize, length - (float) (reactor.getCoreDiameter() / 2.5D), offsetX, offsetY, offsetZ, particleAge, partialTick, false, false, 0x00ffff);
drawBeam(
tessellator,
reactor,
s / coreSize,
coreSize,
length - (float) (reactor.getCoreDiameter() / 2.5D),
offsetX,
offsetY,
offsetZ,
particleAge,
partialTick,
false,
false,
0x00ffff);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, -0.35);
drawBeam(tessellator, reactor, 1F, 0.263F, 0.8F, offsetX, offsetY, offsetZ, particleAge, partialTick, true, true, 0xff6600);
drawBeam(
tessellator,
reactor,
1F,
0.263F,
0.8F,
offsetX,
offsetY,
offsetZ,
particleAge,
partialTick,
true,
true,
0xff6600);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(0, 0, 0.45);
coreSize = (float) (reactor.getCoreDiameter() / 2) * 0.4F;
s = 0.263F;
drawBeam(tessellator, reactor, s / coreSize, coreSize, length - 0.5F, offsetX, offsetY, offsetZ, particleAge, partialTick, false, true, 0xff6600);
drawBeam(
tessellator,
reactor,
s / coreSize,
coreSize,
length - 0.5F,
offsetX,
offsetY,
offsetZ,
particleAge,
partialTick,
false,
true,
0xff6600);
GL11.glPopMatrix();
GL11.glShadeModel(GL11.GL_FLAT);
@@ -213,10 +290,24 @@ public class ParticleReactorBeam extends EntityFX {
* Size Origin is the fraction of size start Target
* So if size target is 10 and size origin is 0.5 origin will actually be 5
*/
private void drawBeam(Tessellator tessellator, TileReactorCore reactor, float sizeOrigin, float sizeTarget, float length, float offsetX, float offsetY, float offsetZ, int tick, float partialTick, boolean reverseTransparency, boolean reverseDirection, int color) {
private void drawBeam(
Tessellator tessellator,
TileReactorCore reactor,
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 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) tick + partialTick) * (reverseDirection ? -0.01F : 0.01F) * speed;
float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) / 32.0F
+ ((float) tick + partialTick) * (reverseDirection ? -0.01F : 0.01F) * speed;
tessellator.startDrawing(5);
tessellator.setBrightness(200);
@@ -226,9 +317,18 @@ public class ParticleReactorBeam extends EntityFX {
float verX = MathHelper.sin((float) (i % b0) * (float) Math.PI * 2.13325F / (float) b0) * sizeTarget;
float verY = MathHelper.cos((float) (i % b0) * (float) Math.PI * 2.13325F / (float) b0) * sizeTarget;
float texU = (float) (i % b0) * 1.0F / (float) b0;
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), reverseTransparency ? 0 : (int) (255D * reactor.renderSpeed));
tessellator.addVertexWithUV((double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) texV1);
tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), reverseTransparency ? (int) (255D * reactor.renderSpeed) : 0);
tessellator.setColorRGBA(
(color & 0xFF0000) >> 16,
(color & 0xFF00) >> 8,
(color & 0xFF),
reverseTransparency ? 0 : (int) (255D * reactor.renderSpeed));
tessellator.addVertexWithUV(
(double) (verX * sizeOrigin), (double) (verY * sizeOrigin), 0.0D, (double) texU, (double) texV1);
tessellator.setColorRGBA(
(color & 0xFF0000) >> 16,
(color & 0xFF00) >> 8,
(color & 0xFF),
reverseTransparency ? (int) (255D * reactor.renderSpeed) : 0);
tessellator.addVertexWithUV((double) verX, (double) verY, (double) length, (double) texU, (double) texV2);
}
@@ -237,7 +337,8 @@ public class ParticleReactorBeam extends EntityFX {
}
// @Override
// public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
// public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float
// rotYZ, float rotXY) {
// if (!((IIsSlave)tile).isActive()) return;
// tessellator.draw();
// GL11.glPushMatrix();
@@ -259,10 +360,13 @@ public class ParticleReactorBeam extends EntityFX {
//
// //Rotate beam to face target
// 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, 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);
// GL11.glRotatef((float) (-Math.atan2((double) offsetZ, (double) offsetX)) * 180.0F / (float) Math.PI - 90.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,
// 0.0F);
//
// if (tile instanceof TileReactorStabilizer) renderStabilizerEffect(tessellator, offsetX, offsetY, offsetZ, length, partialTick);
// if (tile instanceof TileReactorStabilizer) renderStabilizerEffect(tessellator, offsetX, offsetY, offsetZ, length,
// partialTick);
// else {
// GL11.glShadeModel(GL11.GL_SMOOTH);
// GL11.glTranslated(0, 0, 0.3);
@@ -280,7 +384,8 @@ public class ParticleReactorBeam extends EntityFX {
//
// float speed = 20F;
// float texV2 = 0.0F + ((float)particleAge + partialTick) * 0.01F * speed;
// float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) + ((float)particleAge + partialTick) * 0.01F * speed;
// float texV1 = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ) +
// ((float)particleAge + partialTick) * 0.01F * speed;
//
// tessellator.startDrawing(5);
// tessellator.setBrightness(200);
@@ -293,7 +398,8 @@ public class ParticleReactorBeam extends EntityFX {
// float texU = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
//
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU, (double)texV1);
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU,
// (double)texV1);
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
// tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2);
// }
@@ -308,7 +414,8 @@ public class ParticleReactorBeam extends EntityFX {
// float texU = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
//
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), -0.55D, (double)texU, (double)texV1);
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), -0.55D, (double)texU,
// (double)texV1);
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha);
// tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2);
// }
@@ -332,7 +439,8 @@ public class ParticleReactorBeam extends EntityFX {
// float texU = (float)(i % b0) * 1.0F / (float)b0;
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), alpha/2);
//
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU, (double)texV1);
// tessellator.addVertexWithUV((double)(verX * sizeOrigin), (double)(verY * sizeOrigin), 0.0D, (double)texU,
// (double)texV1);
// tessellator.setColorRGBA((color & 0xFF0000) >> 16, (color & 0xFF00) >> 8, (color & 0xFF), 0);
// tessellator.addVertexWithUV((double)verX, (double)verY, (double)length, (double)texU, (double)texV2);
// }
@@ -345,4 +453,4 @@ public class ParticleReactorBeam extends EntityFX {
// GL11.glEnable(GL11.GL_CULL_FACE);
// ResourceHandler.bindDefaultParticles();
// tessellator.startDrawingQuads();
// }
// }
File diff suppressed because it is too large. Load diff
@@ -15,7 +15,8 @@ import org.lwjgl.opengl.GL11;
* Created by brandon3055 on 24/9/2015.
*/
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
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float tick) {
@@ -60,7 +61,7 @@ public class RenderTileChaosShard extends TileEntitySpecialRenderer {
double d12 = 0.8D + size;
double d14 = 0.8D + size;
double d16 = 0.8D + size;
double d18 = 10.0D; //Height
double d18 = 10.0D; // Height
double d20 = 0.0D;
double d22 = 1.0D;
double d24 = (double) (-1.0F + f3);
@@ -20,19 +20,25 @@ import org.lwjgl.opengl.GL11;
*/
public class RenderTileCrystal extends TileEntitySpecialRenderer {
private static ResourceLocation texrure = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalPurpleTransparent.png");
private static ResourceLocation crystalBlue = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalBlue.png");
private static ResourceLocation crystalBlueAlpha = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalBlueAlpha.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 static ResourceLocation texrure =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalPurpleTransparent.png");
private static ResourceLocation crystalBlue =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalBlue.png");
private static ResourceLocation crystalBlueAlpha =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/CrystalBlueAlpha.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 modelCrystalTransceiver;
public RenderTileCrystal() {
modelCrystal = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/CCrystal.obj"));
modelCrystalTransceiver = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/CrystalTransceiver.obj"));
modelCrystal = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/CCrystal.obj"));
modelCrystalTransceiver = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/CrystalTransceiver.obj"));
}
@Override
@@ -43,9 +49,8 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
renderTransceiver((TileEnergyTransceiver) tileEntity, x, y, z, partialTick);
}
public void renderEnergyRelay(TileRemoteEnergyBase tileEntity, double x, double y, double z, float partialTick) {
//--- Pre Render ---//
// --- Pre Render ---//
tileEntity.inView = 10;
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
@@ -57,14 +62,13 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, innerLight, innerLight);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
//--- Render Bottom Layer ---//
// --- Render Bottom Layer ---//
if (tileEntity.getPowerTier() == 0) bindTexture(crystalBlue);
else bindTexture(crystalRed);
modelCrystal.renderAll();
//--- Render Alpha Overlay ---//
// --- Render Alpha Overlay ---//
if (tileEntity.getPowerTier() == 0) bindTexture(crystalBlueAlpha);
else bindTexture(crystalRedAlpha);
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -73,26 +77,23 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
modelCrystal.renderAll();
GL11.glAlphaFunc(GL11.GL_GREATER, 0f);
// GL11.glDisable(GL11.GL_ALPHA_TEST);
// GL11.glDisable(GL11.GL_ALPHA_TEST);
//--- Render Overlay ---//
// --- Render Overlay ---//
bindTexture(texrure);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, outerLight, outerLight);
modelCrystal.renderAll();
//--- Post Render ---//
// --- Post Render ---//
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
GL11.glDisable(GL11.GL_BLEND);
RenderHelper.enableStandardItemLighting();
GL11.glPopMatrix();
}
public void renderTransceiver(TileEnergyTransceiver tileEntity, double x, double y, double z, float partialTick) {
//--- Pre Render ---//
// --- Pre Render ---//
tileEntity.inView = 10;
GL11.glPushMatrix();
@@ -120,21 +121,20 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
GL11.glTranslated(0, -1, 0);
GL11.glDisable(GL11.GL_LIGHTING);
// RenderHelper.disableStandardItemLighting();
// RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_BLEND);
float innerLight = 100f;
float outerLight = 140f + ClientEventHandler.energyCrystalAlphaValue * 40F;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, innerLight, innerLight);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
//--- Render Bottom Layer ---//
// --- Render Bottom Layer ---//
if (tileEntity.getPowerTier() == 0) bindTexture(crystalBlue);
else bindTexture(crystalRed);
modelCrystalTransceiver.renderAll();
//--- Render Alpha Overlay ---//
// --- Render Alpha Overlay ---//
if (tileEntity.getPowerTier() == 0) bindTexture(crystalBlueAlpha);
else bindTexture(crystalRedAlpha);
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -144,17 +144,15 @@ public class RenderTileCrystal extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_ALPHA_TEST);
//--- Render Overlay ---//
// --- Render Overlay ---//
bindTexture(texrure);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, outerLight, outerLight);
modelCrystalTransceiver.renderAll();
//--- Post Render ---//
// --- Post Render ---//
GL11.glDisable(GL11.GL_BLEND);
// RenderHelper.enableStandardItemLighting();
// RenderHelper.enableStandardItemLighting();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
@@ -3,7 +3,6 @@ package com.brandon3055.draconicevolution.client.render.tile;
/**
* 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;
@@ -25,7 +24,8 @@ public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
public void renderTile(CustomSpawnerBaseLogic customSpawnerBaseLogic, double x, double y, double z, float partialTick) {
public void renderTile(
CustomSpawnerBaseLogic customSpawnerBaseLogic, double x, double y, double z, float partialTick) {
Tessellator tessellator = Tessellator.instance;
Entity entity = customSpawnerBaseLogic.getEntityForRenderer();
@@ -36,7 +36,14 @@ public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
entity.setWorld(customSpawnerBaseLogic.getSpawnerWorld());
float f1 = 0.4375F;
GL11.glTranslatef(0.0F, 0.4F, 0.0F);
GL11.glRotatef((float) (customSpawnerBaseLogic.renderRotation1 + (customSpawnerBaseLogic.renderRotation0 - customSpawnerBaseLogic.renderRotation1) * (double) partialTick) * 10.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(
(float) (customSpawnerBaseLogic.renderRotation1
+ (customSpawnerBaseLogic.renderRotation0 - customSpawnerBaseLogic.renderRotation1)
* (double) partialTick)
* 10.0F,
0.0F,
1.0F,
0.0F);
GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glScalef(f1, f1, f1);
@@ -86,7 +93,8 @@ public class RenderTileCustomSpawner extends TileEntitySpecialRenderer {
}
@Override
public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
public void renderTileEntityAt(
TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) {
this.renderTileEntityAt((TileCustomSpawner) p_147500_1_, p_147500_2_, p_147500_4_, p_147500_6_, p_147500_8_);
}
}
@@ -16,9 +16,10 @@ import org.lwjgl.opengl.GL11;
public class RenderTileDissEnchanter extends TileEntitySpecialRenderer {
//private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyInfuserTextureSheet.png");
// private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(),
// "textures/models/EnergyInfuserTextureSheet.png");
//private static float pxl = 1F / 256F;
// private static float pxl = 1F / 256F;
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
@@ -33,7 +34,7 @@ public class RenderTileDissEnchanter extends TileEntitySpecialRenderer {
public void renderBlock(TileDissEnchanter tile, World world, int x, int y, int z, float f) {
Tessellator tessellator = Tessellator.instance;
//bindTexture(texture);
// bindTexture(texture);
tessellator.setColorRGBA(255, 255, 255, 255);
tessellator.setBrightness(200);
@@ -1,24 +1,24 @@
package com.brandon3055.draconicevolution.client.render.tile;
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 net.minecraft.client.model.ModelChest;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import java.util.Random;
import static org.lwjgl.opengl.GL11.*;
/**
* Created by Brandon on 25/10/2014.
*/
public class RenderTileDraconiumChest extends TileEntitySpecialRenderer {
ModelChest model;
private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/DraconiumChest.png");
private final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/DraconiumChest.png");
private Random random;
public RenderTileDraconiumChest() {
@@ -15,7 +15,8 @@ import org.lwjgl.opengl.GL11;
public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyInfuserTextureSheet.png");
private final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/EnergyInfuserTextureSheet.png");
private static float pxl = 1F / 256F;
@@ -41,7 +42,6 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
drawBase(tessellator);
drawWings(tessellator, tile);
renderChargingItem(tile);
}
private void drawBase(Tessellator tess) {
@@ -59,7 +59,6 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
tess.addVertexWithUV(1, 0.0005D, 1, srcXMax, srcYMax);
tess.addVertexWithUV(0, 0.0005D, 1, srcXMin, srcYMax);
srcXMin = 128D * pxl;
srcYMin = 0D;
srcXMax = 192D * pxl;
@@ -97,21 +96,19 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
tess.draw();
GL11.glPopMatrix();
}
private void drawWings(Tessellator tess, TileEnergyInfuser tile) {
GL11.glPushMatrix();
float srcXMin = 0F; //iicon.getMinU();
float srcYMin = 64F * pxl; //iicon.getMaxU();
float srcXMax = 92F * pxl; //iicon.getMinV();
float srcYMax = 115F * pxl; //iicon.getMaxV();
float srcXMin = 0F; // iicon.getMinU();
float srcYMin = 64F * pxl; // iicon.getMaxU();
float srcXMax = 92F * pxl; // iicon.getMinV();
float srcYMax = 115F * pxl; // iicon.getMaxV();
GL11.glTranslatef(-0.64F, 0.365F, 0.51F);
GL11.glScalef(0.7F, 0.7F, 0.7F);
float xTrans = 0.025F;
{
GL11.glTranslatef(1.62F, 0F, -xTrans);
GL11.glRotatef(tile.rotation, 0F, 1F, 0F);
@@ -137,10 +134,10 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
render2DWithThicness(tess, srcXMax, srcYMin, srcXMin, srcYMax, 92, 51, 0.0625F);
}
{
srcXMin = 64F * pxl; //iicon.getMinU();
srcYMin = 24F * pxl; //iicon.getMaxU();
srcXMax = 96F * pxl; //iicon.getMinV();
srcYMax = 56F * pxl; //iicon.getMaxV();
srcXMin = 64F * pxl; // iicon.getMinU();
srcYMin = 24F * pxl; // iicon.getMaxU();
srcXMax = 96F * pxl; // iicon.getMinV();
srcYMax = 56F * pxl; // iicon.getMaxV();
GL11.glTranslatef(1.26F, 0F, 0.31F);
GL11.glTranslatef(0F, 0F, 0F);
GL11.glRotatef(90, 0F, 1F, 0F);
@@ -152,7 +149,8 @@ public class RenderTileEnergyInfiser extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
public static void render2DWithThicness(Tessellator tess, float maxU, float minV, float minU, float maxV, int width, int height, float thickness) {
public static void render2DWithThicness(
Tessellator tess, float maxU, float minV, float minU, float maxV, int width, int height, float thickness) {
double pix = 1D / 64D;
tess.startDrawingQuads();
tess.setNormal(0.0F, 0.0F, 1.0F);
@@ -15,11 +15,13 @@ import org.lwjgl.opengl.GL11;
*/
public class RenderTileEnergyPylon extends TileEntitySpecialRenderer {
private static final ResourceLocation model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/pylon_sphere_texture.png");
private static final ResourceLocation model_texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/pylon_sphere_texture.png");
private IModelCustom model;
public RenderTileEnergyPylon() {
model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/pylon_sphere.obj"));
model = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/pylon_sphere.obj"));
}
@Override
@@ -95,6 +97,5 @@ public class RenderTileEnergyPylon extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
// private void renderSphere()
// private void renderSphere()
}
@@ -17,12 +17,15 @@ import org.lwjgl.opengl.GL11;
*/
public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
private static final ResourceLocation iner_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png");
private static final ResourceLocation outer_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.png");
private static final ResourceLocation iner_model_texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png");
private static final ResourceLocation outer_model_texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.png");
private IModelCustom iner_model;
public RenderTileEnergyStorageCore() {
iner_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
iner_model = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
}
@Override
@@ -65,7 +68,8 @@ public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
FMLClientHandler.instance().getClient().getTextureManager().bindTexture(iner_model_texture);
double colour = (double) ((TileEnergyStorageCore) tile).getEnergyStored() / (double) ((TileEnergyStorageCore) tile).getMaxEnergyStored();
double colour = (double) ((TileEnergyStorageCore) tile).getEnergyStored()
/ (double) ((TileEnergyStorageCore) tile).getMaxEnergyStored();
float brightness = (float) Math.abs(Math.sin((float) Minecraft.getSystemTime() / 3000f) * 100f);
colour = 1f - colour;
@@ -77,19 +81,19 @@ public class RenderTileEnergyStorageCore extends TileEntitySpecialRenderer {
iner_model.renderAll();
GL11.glPopMatrix();
// GL11.glPushMatrix();
// GL11.glScalef(0.8F, 0.8F, 0.8F);
// GL11.glColor4d(1F, 1f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll();
// GL11.glPopMatrix();
//
// GL11.glPushMatrix();
// GL11.glScalef(0.9F, 0.9F, 0.9F);
// GL11.glColor4d(1F, 0f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll();
// GL11.glPopMatrix();
// GL11.glPushMatrix();
// GL11.glScalef(0.8F, 0.8F, 0.8F);
// GL11.glColor4d(1F, 1f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll();
// GL11.glPopMatrix();
//
// GL11.glPushMatrix();
// GL11.glScalef(0.9F, 0.9F, 0.9F);
// GL11.glColor4d(1F, 0f, 0.2f, 1F);
// GL11.glRotatef(rotation, 0F, 1F, 0.5F);
// //iner_model.renderAll();
// GL11.glPopMatrix();
GL11.glScalef(1.1F, 1.1F, 1.1F);
GL11.glDepthMask(false);
@@ -16,19 +16,22 @@ import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class RenderTileParticleGen extends TileEntitySpecialRenderer {
private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/ParticleGenTextureSheet.png");
private final ResourceLocation beamTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_beam.png");
private static final ResourceLocation modelTexture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_sphere.png");
private final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/ParticleGenTextureSheet.png");
private final ResourceLocation beamTexture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_beam.png");
private static final ResourceLocation modelTexture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/stabilizer_sphere.png");
private IModelCustom stabilizerSphereModel;
private float pxl = 1F / 64;
public RenderTileParticleGen() {
stabilizerSphereModel = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/stabilizer_sphere.obj"));
stabilizerSphereModel = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/stabilizer_sphere.obj"));
}
@Override
@@ -39,7 +42,6 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
TileParticleGenerator tileEntityGen = (TileParticleGenerator) tileEntity;
renderBlock(tileEntityGen, f);
GL11.glPopMatrix();
}
@@ -51,14 +53,14 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
//GL11.glDisable(GL11.GL_LIGHTING);
// GL11.glDisable(GL11.GL_LIGHTING);
bindTexture(texture);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.setColorRGBA(255, 255, 255, 255);
{//Draw Corners
{ // Draw Corners
float f = 0.4F;
drawCornerCube(tessellator, f, f, f, 1F - f, inverted, stabilizerMode);
drawCornerCube(tessellator, f, -f, f, 1F - f, inverted, stabilizerMode);
@@ -69,7 +71,7 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
drawCornerCube(tessellator, f, -f, -f, 1F - f, inverted, stabilizerMode);
drawCornerCube(tessellator, -f, -f, f, 1F - f, inverted, stabilizerMode);
}
{//Draw Beams
{ // Draw Beams
float f = 0.45F;
float f2 = 0.4F;
drawBeamX(tessellator, 0, f2, f2, 1F - f);
@@ -89,7 +91,7 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
}
tessellator.draw();
//GL11.glEnable(GL11.GL_LIGHTING);
// GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
if (stabilizerMode) {
@@ -97,7 +99,6 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
}
if (tl.beam_enabled) preRenderBeam(tessellator, tl, f3);
}
private void drawEnergyBeam(Tessellator tess, TileParticleGenerator gen, float f) {
@@ -133,7 +134,7 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
public void renderStabilizerSphere(TileParticleGenerator tile) {
GL11.glPushMatrix();
//GL11.glColor4f(0.5F, 0.0F, 0.0F, 1F);
// GL11.glColor4f(0.5F, 0.0F, 0.0F, 1F);
GL11.glColor4f(0.0F, 2.0F, 0.0F, 1F);
GL11.glTranslated(0.5, 0, 0.5);
GL11.glScalef(0.4F, 0.4F, 0.4F);
@@ -192,22 +193,21 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glDepthMask(true);
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
//float time = (float)tile.getWorldObj().getTotalWorldTime() + f;
// float time = (float)tile.getWorldObj().getTotalWorldTime() + f;
float time = tile.rotation + f;
float upMot = -time * 0.2F - (float) MathHelper.floor_float(-time * 0.1F);
byte scaleMult = 1;
double rotation = (double) time * 0.025D * (1.0D - (double) (scaleMult & 1) * 2.5D);
tess.startDrawingQuads();
tess.setColorRGBA(255, 255, 255, 32);
double scale = (double) scaleMult * 0.2D;
double d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; //x point 1
double d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; //z point 1
double d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; //x point 2
double d13 = 0.5D + Math.sin(rotation + (Math.PI / 4D)) * scale; //z point 2
double d15 = 0.5D + Math.cos(rotation + 3.9269908169872414D) * scale;//Dist from x-3
double d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; // x point 1
double d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; // z point 1
double d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; // x point 2
double d13 = 0.5D + Math.sin(rotation + (Math.PI / 4D)) * scale; // z point 2
double d15 = 0.5D + Math.cos(rotation + 3.9269908169872414D) * scale; // Dist from x-3
double d17 = 0.5D + Math.sin(rotation + 3.9269908169872414D) * scale;
double d19 = 0.5D + Math.cos(rotation + 5.497787143782138D) * scale;
double d21 = 0.5D + Math.sin(rotation + 5.497787143782138D) * scale;
@@ -323,15 +323,15 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
private void drawCornerCube(Tessellator tess, float x, float y, float z, float FP, boolean inverted, boolean stabalizerMode) {
private void drawCornerCube(
Tessellator tess, float x, float y, float z, float FP, boolean inverted, boolean stabalizerMode) {
float srcXMin = inverted ? 38F * pxl : 32F * pxl;
float srcYMin = 0F;
float srcXMax = inverted ? 44F * pxl : 38F * pxl;
float srcYMax = 6 * pxl;
//float FP = 0.6F; //Scale
// float FP = 0.6F; //Scale
float FN = 1F - FP;
if (stabalizerMode) {
@@ -339,37 +339,37 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
srcXMax = 50F * pxl;
}
//X+
// X+
tess.addVertexWithUV(FP + x, FN + y, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, FN + z, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(FP + x, FN + y, FP + z, srcXMin, srcYMax);
//X-
// X-
tess.addVertexWithUV(FN + x, FN + y, FP + z, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, FN + z, srcXMax, srcYMax);
tess.addVertexWithUV(FN + x, FN + y, FN + z, srcXMin, srcYMax);
//Y+
// Y+
tess.addVertexWithUV(FN + x, FP + y, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(FP + x, FP + y, FN + z, srcXMin, srcYMax);
//Y-
// Y-
tess.addVertexWithUV(FN + x, FN + y, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, FN + y, FN + z, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, FN + y, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(FN + x, FN + y, FP + z, srcXMin, srcYMax);
//Z+
// Z+
tess.addVertexWithUV(FP + x, FN + y, FP + z, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(FN + x, FN + y, FP + z, srcXMin, srcYMax);
//Z-
// Z-
tess.addVertexWithUV(FN + x, FN + y, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, FN + z, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, FN + z, srcXMax, srcYMax);
@@ -386,25 +386,25 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
float XX = 0.9F;
float XM = 0.1F;
//Y+
// Y+
tess.addVertexWithUV(XM, FP + y, FN + z, srcXMin, srcYMax);
tess.addVertexWithUV(XM, FP + y, FP + z, srcXMin, srcYMin);
tess.addVertexWithUV(XX, FP + y, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(XX, FP + y, FN + z, srcXMax, srcYMax);
//Y-
// Y-
tess.addVertexWithUV(XM, FN + y, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(XX, FN + y, FN + z, srcXMax, srcYMin);
tess.addVertexWithUV(XX, FN + y, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(XM, FN + y, FP + z, srcXMin, srcYMax);
//Z+
// Z+
tess.addVertexWithUV(XX, FN + y, FP + z, srcXMin, srcYMax);
tess.addVertexWithUV(XX, FP + y, FP + z, srcXMin, srcYMin);
tess.addVertexWithUV(XM, FP + y, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(XM, FN + y, FP + z, srcXMax, srcYMax);
//Z-
// Z-
tess.addVertexWithUV(XM, FN + y, FN + z, srcXMin, srcYMax);
tess.addVertexWithUV(XM, FP + y, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(XX, FP + y, FN + z, srcXMax, srcYMin);
@@ -421,30 +421,29 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
float XX = 0.9F;
float XM = 0.1F;
//X+
// X+
tess.addVertexWithUV(FP + x, XM, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, XX, FN + z, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, XX, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(FP + x, XM, FP + z, srcXMin, srcYMax);
//X-
// X-
tess.addVertexWithUV(FN + x, XM, FP + z, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, XX, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(FN + x, XX, FN + z, srcXMax, srcYMax);
tess.addVertexWithUV(FN + x, XM, FN + z, srcXMin, srcYMax);
//Z+
// Z+
tess.addVertexWithUV(FP + x, XM, FP + z, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, XX, FP + z, srcXMax, srcYMin);
tess.addVertexWithUV(FN + x, XX, FP + z, srcXMax, srcYMax);
tess.addVertexWithUV(FN + x, XM, FP + z, srcXMin, srcYMax);
//Z-
// Z-
tess.addVertexWithUV(FN + x, XM, FN + z, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, XX, FN + z, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, XX, FN + z, srcXMax, srcYMax);
tess.addVertexWithUV(FP + x, XM, FN + z, srcXMin, srcYMax);
}
private void drawBeamZ(Tessellator tess, float x, float y, float z, float FP) {
@@ -457,30 +456,29 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
float XX = 0.9F;
float XM = 0.1F;
//X+
// X+
tess.addVertexWithUV(FP + x, FN + y, XM, srcXMin, srcYMax);
tess.addVertexWithUV(FP + x, FP + y, XM, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, XX, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, FN + y, XX, srcXMax, srcYMax);
//X-
// X-
tess.addVertexWithUV(FN + x, FN + y, XX, srcXMin, srcYMax);
tess.addVertexWithUV(FN + x, FP + y, XX, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, XM, srcXMax, srcYMin);
tess.addVertexWithUV(FN + x, FN + y, XM, srcXMax, srcYMax);
//Y+
// Y+
tess.addVertexWithUV(FN + x, FP + y, XM, srcXMin, srcYMin);
tess.addVertexWithUV(FN + x, FP + y, XX, srcXMax, srcYMin);
tess.addVertexWithUV(FP + x, FP + y, XX, srcXMax, srcYMax);
tess.addVertexWithUV(FP + x, FP + y, XM, srcXMin, srcYMax);
//Y-
// Y-
tess.addVertexWithUV(FN + x, FN + y, XM, srcXMin, srcYMax);
tess.addVertexWithUV(FP + x, FN + y, XM, srcXMin, srcYMin);
tess.addVertexWithUV(FP + x, FN + y, XX, srcXMax, srcYMin);
tess.addVertexWithUV(FN + x, FN + y, XX, srcXMax, srcYMax);
}
private void preRenderBeam(Tessellator tess, TileParticleGenerator gen, float f) {
@@ -526,23 +524,22 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glDepthMask(true);
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
//float time = (float)tile.getWorldObj().getTotalWorldTime() + f;
// float time = (float)tile.getWorldObj().getTotalWorldTime() + f;
float time = tile.rotation + f;
float upMot = -time * 0.2F - (float) MathHelper.floor_float(-time * 0.1F);
float rotValue = tile.beam_rotation * (tile.rotation + f * 0.5F);
double rotation = rotValue;
tess.startDrawingQuads();
tess.setBrightness(200);
tess.setColorRGBA(tile.beam_red, tile.beam_green, tile.beam_blue, 32);
double scale = (double) tile.beam_scale * 0.2D;
double d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; //x point 1
double d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; //z point 1
double d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; //x point 2
double d13 = 0.5D + Math.sin(rotation + (Math.PI / 4D)) * scale; //z point 2
double d15 = 0.5D + Math.cos(rotation + 3.9269908169872414D) * scale;//Dist from x-3
double d7 = 0.5D + Math.cos(rotation + 2.356194490192345D) * scale; // x point 1
double d9 = 0.5D + Math.sin(rotation + 2.356194490192345D) * scale; // z point 1
double d11 = 0.5D + Math.cos(rotation + (Math.PI / 4D)) * scale; // x point 2
double d13 = 0.5D + Math.sin(rotation + (Math.PI / 4D)) * scale; // z point 2
double d15 = 0.5D + Math.cos(rotation + 3.9269908169872414D) * scale; // Dist from x-3
double d17 = 0.5D + Math.sin(rotation + 3.9269908169872414D) * scale;
double d19 = 0.5D + Math.cos(rotation + 5.497787143782138D) * scale;
double d21 = 0.5D + Math.sin(rotation + 5.497787143782138D) * scale;
@@ -610,8 +607,8 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
tess.draw();
GL11.glPushMatrix();
//GL11.glTranslated(0, 0.4, 0);
//length -= 0.5F;
// GL11.glTranslated(0, 0.4, 0);
// length -= 0.5F;
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
@@ -656,13 +653,10 @@ public class RenderTileParticleGen extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(true);
//
// GL11.glEnable(GL11.GL_LIGHTING);
// GL11.glEnable(GL11.GL_TEXTURE_2D);
//
// GL11.glEnable(GL11.GL_LIGHTING);
// GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
}
}
@@ -20,8 +20,7 @@ import org.lwjgl.opengl.GL11;
*/
public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
public RenderTilePlacedItem() {
}
public RenderTilePlacedItem() {}
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float timeSinceLastTick) {
@@ -41,7 +40,7 @@ public class RenderTilePlacedItem extends TileEntitySpecialRenderer {
World world = Minecraft.getMinecraft().theWorld;
EntityItem itemEntity = new EntityItem(tile.getWorldObj(), 0, 0, 0, stack);
int meta = world.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
//itemEntity.getEntityItem().stackSize = 1;
// itemEntity.getEntityItem().stackSize = 1;
itemEntity.hoverStart = 0.0F;
boolean is3D = stack.getItem().isFull3D();
boolean isBlock = stack.getItem() instanceof ItemBlock;
@@ -18,34 +18,34 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
public static IModelCustom reactorModel;
public RenderTileReactorCore() {
reactorModel = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
reactorModel = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/reactorCoreModel.obj"));
}
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) {
TileReactorCore tile = (TileReactorCore) tileEntity;
// tile.renderList.clear();
// tile.renderList.clear();
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
renderReactorCore(tile, partialTick);
// for (MultiblockHelper.TileOffset offset : tile.stabilizerLocations){
// if (!(offset.getTileEntity(tileEntity) instanceof TileReactorStabilizer)) continue;
// GL11.glPushMatrix();
//
// TileReactorStabilizer stabilizer = (TileReactorStabilizer)offset.getTileEntity(tileEntity);
// GL11.glTranslated(-offset.offsetX, -offset.offsetY, -offset.offsetZ);
// //RenderTileReactorStabilizer.renderCore(stabilizer, partialTick);
// //RenderTileReactorStabilizer.renderEffects(stabilizer, partialTick);
//
// GL11.glPopMatrix();
// }
// for (MultiblockHelper.TileOffset offset : tile.stabilizerLocations){
// if (!(offset.getTileEntity(tileEntity) instanceof TileReactorStabilizer)) continue;
// GL11.glPushMatrix();
//
// TileReactorStabilizer stabilizer = (TileReactorStabilizer)offset.getTileEntity(tileEntity);
// GL11.glTranslated(-offset.offsetX, -offset.offsetY, -offset.offsetZ);
// //RenderTileReactorStabilizer.renderCore(stabilizer, partialTick);
// //RenderTileReactorStabilizer.renderEffects(stabilizer, partialTick);
//
// GL11.glPopMatrix();
// }
GL11.glPopMatrix();
}
public void renderReactorCore(TileReactorCore tile, float partialTick) {
float rotation = (tile.renderRotation * 0.2F) + (partialTick * (tile.renderSpeed * 0.2F));
double ff = tile.maxFieldCharge > 0 ? tile.fieldCharge / tile.maxFieldCharge : 0;
@@ -54,14 +54,14 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
double b = ff * 2;
double a = ff < 0.1 ? (ff * 10) : 1;
//Pre Render
// Pre Render
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 200F, 200F);
//Render inner
// Render inner
if (tile.reactorFuel + tile.convertedFuel < 144) {
ResourceHandler.bindResource("textures/blocks/draconic_block_blank.png");
GL11.glPushMatrix();
@@ -78,7 +78,7 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
GL11.glScaled(r3, r3, r3);
reactorModel.renderAll();
//Mid Render
// Mid Render
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -91,7 +91,7 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
reactorModel.renderAll();
}
//Render Outer
// Render Outer
ResourceHandler.bindResource("textures/models/reactorShieldPlate.png");
GL11.glColor4d(r, g, b, a);
GL11.glScaled(1.03F, 1.03F, 1.03F);
@@ -99,12 +99,11 @@ public class RenderTileReactorCore extends TileEntitySpecialRenderer {
GL11.glRotatef(-rotation * 2, 0.5F, 1F, 0.5F);
reactorModel.renderAll();
//Post Render
// Post Render
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1f, 1f, 1f, 1f);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY);
GL11.glPopMatrix();
}
}
@@ -50,5 +50,4 @@ public class RenderTileReactorEnergyInjector extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
}
@@ -22,7 +22,7 @@ public class RenderTileReactorStabilizer extends TileEntitySpecialRenderer {
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
renderCore((TileReactorStabilizer) tileEntity, partialTick);
//renderEffects((TileReactorStabilizer) tileEntity, partialTick);
// renderEffects((TileReactorStabilizer) tileEntity, partialTick);
GL11.glPopMatrix();
}
@@ -62,71 +62,75 @@ public class RenderTileReactorStabilizer extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
}
// public static void renderEffects(TileReactorStabilizer tile, float partialTick) {
// if (tile.isValid)
// {
// //Common Fields
// MultiblockHelper.TileLocation master = tile.masterLocation;
// float offsetX = (float)(master.posX - tile.xCoord);
// float offsetY = (float)((double)master.posY - tile.yCoord);
// float offsetZ = (float)(master.posZ - tile.zCoord);
// float length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ);
//
// Tessellator tessellator = Tessellator.instance;
//
// //Pre Render
// GL11.glPushMatrix();
//// RenderHelper.disableStandardItemLighting();
// GL11.glDisable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_SMOOTH);
// GL11.glEnable(GL11.GL_BLEND);
// OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
// GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
// GL11.glDisable(GL11.GL_LIGHTING);
// GL11.glDepthMask(false);
//
// //Rotate beam to face target
// 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, 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);
//
//
// //Draw Beams
// GL11.glPushMatrix();
// GL11.glTranslated(0, 0, -0.35);
// ResourceHandler.bindTexture(new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"));
//// drawBeam(tessellator, 1F, 0.355F, 0.8F, offsetX, offsetY, offsetZ, tile.tick, partialTick, true, false);
// GL11.glPopMatrix();
//
// GL11.glPushMatrix();
// GL11.glTranslated(0, 0, 0.4526);
// float coreSize = 1.1F;
// float s = 0.355F;
//// drawBeam(tessellator, s/coreSize, coreSize, length - 0.5F, offsetX, offsetY, offsetZ, tile.tick, partialTick, false, false);
// GL11.glPopMatrix();
//
//// GL11.glPushMatrix();
//// GL11.glTranslated(0, 0, -0.35);
//// ResourceHandler.bindTexture(new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"));
//// drawBeam(tessellator, 1F, 0.26F, 0.8F, offsetX, offsetY, offsetZ, tile.tick, partialTick, true, true);
//// GL11.glPopMatrix();
////
//// GL11.glPushMatrix();
//// GL11.glTranslated(0, 0, 0.4526);
//// coreSize = 1.1F;
//// s = 0.263F;
//// drawBeam(tessellator, s/coreSize, coreSize, length - 0.5F, offsetX, offsetY, offsetZ, tile.tick, partialTick, false, true);
//// GL11.glPopMatrix();
//
// //Post Render
// GL11.glDepthMask(true);
// GL11.glEnable(GL11.GL_LIGHTING);
// GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_FLAT);
//// RenderHelper.enableStandardItemLighting();
// GL11.glDisable(GL11.GL_BLEND);
// GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
// GL11.glPopMatrix();
// }
// }
// public static void renderEffects(TileReactorStabilizer tile, float partialTick) {
// if (tile.isValid)
// {
// //Common Fields
// MultiblockHelper.TileLocation master = tile.masterLocation;
// float offsetX = (float)(master.posX - tile.xCoord);
// float offsetY = (float)((double)master.posY - tile.yCoord);
// float offsetZ = (float)(master.posZ - tile.zCoord);
// float length = MathHelper.sqrt_float(offsetX * offsetX + offsetY * offsetY + offsetZ * offsetZ);
//
// Tessellator tessellator = Tessellator.instance;
//
// //Pre Render
// GL11.glPushMatrix();
//// RenderHelper.disableStandardItemLighting();
// GL11.glDisable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_SMOOTH);
// GL11.glEnable(GL11.GL_BLEND);
// OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
// GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
// GL11.glDisable(GL11.GL_LIGHTING);
// GL11.glDepthMask(false);
//
// //Rotate beam to face target
// 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, 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);
//
//
// //Draw Beams
// GL11.glPushMatrix();
// GL11.glTranslated(0, 0, -0.35);
// ResourceHandler.bindTexture(new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"));
//// drawBeam(tessellator, 1F, 0.355F, 0.8F, offsetX, offsetY, offsetZ, tile.tick, partialTick, true, false);
// GL11.glPopMatrix();
//
// GL11.glPushMatrix();
// GL11.glTranslated(0, 0, 0.4526);
// float coreSize = 1.1F;
// float s = 0.355F;
//// drawBeam(tessellator, s/coreSize, coreSize, length - 0.5F, offsetX, offsetY, offsetZ, tile.tick, partialTick,
// false, false);
// GL11.glPopMatrix();
//
//// GL11.glPushMatrix();
//// GL11.glTranslated(0, 0, -0.35);
//// ResourceHandler.bindTexture(new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"));
//// drawBeam(tessellator, 1F, 0.26F, 0.8F, offsetX, offsetY, offsetZ, tile.tick, partialTick, true, true);
//// GL11.glPopMatrix();
////
//// GL11.glPushMatrix();
//// GL11.glTranslated(0, 0, 0.4526);
//// coreSize = 1.1F;
//// s = 0.263F;
//// drawBeam(tessellator, s/coreSize, coreSize, length - 0.5F, offsetX, offsetY, offsetZ, tile.tick, partialTick,
// false, true);
//// GL11.glPopMatrix();
//
// //Post Render
// GL11.glDepthMask(true);
// GL11.glEnable(GL11.GL_LIGHTING);
// GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glShadeModel(GL11.GL_FLAT);
//// RenderHelper.enableStandardItemLighting();
// GL11.glDisable(GL11.GL_BLEND);
// GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
// GL11.glPopMatrix();
// }
// }
}
@@ -1,12 +1,13 @@
package com.brandon3055.draconicevolution.client.render.tile;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.brandonscore.common.utills.Utills;
import com.brandon3055.draconicevolution.client.model.ModelTeleporterStand;
import com.brandon3055.draconicevolution.common.handler.ConfigHandler;
import com.brandon3055.draconicevolution.common.items.tools.TeleporterMKII;
import com.brandon3055.draconicevolution.common.lib.References;
import com.brandon3055.draconicevolution.common.tileentities.TileTeleporterStand;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.brandonscore.common.utills.Utills;
import java.awt.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer;
@@ -24,17 +25,15 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import java.awt.*;
/**
* Created by Brandon on 25/10/2014.
*/
public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
ModelTeleporterStand model = new ModelTeleporterStand();
private final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/TeleporterStand.png");
private final ResourceLocation texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/TeleporterStand.png");
@Override
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
@@ -64,7 +63,6 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
if (item != null) renderItem(tileentity, item, f);
GL11.glPopMatrix();
}
public void renderItem(TileEntity tile, ItemStack item, float f) {
@@ -96,12 +94,15 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
private void drawNameString(ItemStack item, float rotation, TileEntity tileentity, float f) {
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
MovingObjectPosition mop = player.rayTrace(10, f);
boolean isCursorOver = mop != null && mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK && mop.blockX == tileentity.xCoord && mop.blockY == tileentity.yCoord && mop.blockZ == tileentity.zCoord;
boolean isCursorOver = mop != null
&& mop.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
&& mop.blockX == tileentity.xCoord
&& mop.blockY == tileentity.yCoord
&& mop.blockZ == tileentity.zCoord;
boolean isSneaking = player.isSneaking();
if (!isCursorOver && (isSneaking != ConfigHandler.invertDPDSB)) return;
String s = item.hasDisplayName() ? item.getDisplayName() : "";
if (item.getItem() instanceof TeleporterMKII) {
short selected = ItemNBTHelper.getShort(item, "Selection", (short) 0);
@@ -114,7 +115,6 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
}
if (s.isEmpty()) return;
FontRenderer fontRenderer = RenderManager.instance.getFontRenderer();
Tessellator tess = Tessellator.instance;
@@ -123,7 +123,6 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
GL11.glRotated(180, 0, 1, 0);
GL11.glTranslated(0, -40, 0);
Point.Double p1 = new Point.Double(tileentity.xCoord + 0.5, tileentity.zCoord + 0.5);
Point.Double p2 = new Point.Double(player.posX, player.posZ);
@@ -131,7 +130,15 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
double yDiff = player.posY - (tileentity.yCoord + 0.5);
double zDiff = player.posZ - (tileentity.zCoord + 0.5);
double yawAngle = Math.toDegrees(Math.atan2(zDiff, xDiff));
double pitchAngle = Math.toDegrees(Math.atan2(yDiff, Utills.getDistanceAtoB(player.posX, player.posY, player.posZ, tileentity.xCoord + 0.5, tileentity.yCoord + 0.5, tileentity.zCoord + 0.5)));
double pitchAngle = Math.toDegrees(Math.atan2(
yDiff,
Utills.getDistanceAtoB(
player.posX,
player.posY,
player.posZ,
tileentity.xCoord + 0.5,
tileentity.yCoord + 0.5,
tileentity.zCoord + 0.5)));
GL11.glRotated(yawAngle + 90 - rotation, 0, 1, 0);
GL11.glRotated(-pitchAngle, 1, 0, 0);
@@ -161,6 +168,5 @@ public class RenderTileTeleporterStand extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
}
@@ -16,14 +16,18 @@ import org.lwjgl.opengl.GL11;
*/
public class RenderTileTestBlock extends TileEntitySpecialRenderer {
private static final ResourceLocation iner_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png");
private static final ResourceLocation outer_model_texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.png");
private static final ResourceLocation iner_model_texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_1.png");
private static final ResourceLocation outer_model_texture =
new ResourceLocation(References.MODID.toLowerCase(), "textures/models/power_sphere_layer_2.png");
private IModelCustom iner_model;
private IModelCustom outer_model;
public RenderTileTestBlock() {
iner_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
//outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_2.obj"));
iner_model = AdvancedModelLoader.loadModel(
new ResourceLocation(References.MODID.toLowerCase(), "models/power_sphere_layer_1.obj"));
// outer_model = AdvancedModelLoader.loadModel(new ResourceLocation(References.MODID.toLowerCase(),
// "models/power_sphere_layer_2.obj"));
}
@Override
@@ -34,7 +38,7 @@ public class RenderTileTestBlock extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
//GL11.glDepthMask(false);
// GL11.glDepthMask(false);
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
@@ -42,7 +46,7 @@ public class RenderTileTestBlock extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glRotatef(((TileTestBlock) var1).modelRotation, 0F, 1F, 0.5F);
//GL11.glColor4f(2F, 2F, 2F, 1F);
// GL11.glColor4f(2F, 2F, 2F, 1F);
iner_model.renderAll();
GL11.glPopMatrix();
@@ -58,7 +62,6 @@ public class RenderTileTestBlock extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
}
@@ -14,7 +14,6 @@ import org.lwjgl.opengl.GL11;
public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
private static float pxl = 1F / 256F;
@Override
@@ -61,10 +60,8 @@ public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
GL11.glPopMatrix();
drawBase(tess);
renderChargingItem(tile, pt);
}
private void drawBase(Tessellator tess) {
@@ -83,7 +80,6 @@ public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
tess.addVertexWithUV(1, 0.0005D, 1, srcXMax, srcYMax);
tess.addVertexWithUV(0, 0.0005D, 1, srcXMin, srcYMax);
srcXMin = 128D * pxl;
srcYMin = 0D;
srcXMax = 192D * pxl;
@@ -121,10 +117,10 @@ public class RenderTileUpgradeModifier extends TileEntitySpecialRenderer {
tess.draw();
GL11.glPopMatrix();
}
public static void render2DWithThicness(Tessellator tess, float maxU, float minV, float minU, float maxV, int width, int height, float thickness) {
public static void render2DWithThicness(
Tessellator tess, float maxU, float minV, float minU, float maxV, int width, int height, float thickness) {
double pix = 1D / 64D;
tess.startDrawingQuads();
tess.setNormal(0.0F, 0.0F, 1.0F);
@@ -27,7 +27,6 @@ import com.brandon3055.draconicevolution.common.tileentities.multiblocktiles.rea
import com.brandon3055.draconicevolution.common.utills.DragonChunkLoader;
import com.brandon3055.draconicevolution.common.utills.LogHelper;
import com.brandon3055.draconicevolution.common.world.DraconicWorldGenerator;
import com.brandon3055.draconicevolution.integration.ModHelper;
import com.brandon3055.draconicevolution.integration.computers.CCOCIntegration;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@@ -58,29 +57,29 @@ public class CommonProxy {
registerOres();
DraconicEvolution.reaperEnchant = new EnchantmentReaper(ConfigHandler.reaperEnchantID);
//
// Potion[] potionTypes = null;
// LogHelper.info("Expanding Potion array size to 256");
//
// for (Field f : Potion.class.getDeclaredFields()) {
// f.setAccessible(true);
//
// try {
// if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
// Field modfield = Field.class.getDeclaredField("modifiers");
// modfield.setAccessible(true);
// modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
// potionTypes = (Potion[]) f.get(null);
// final Potion[] newPotionTypes = new Potion[256];
// System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
// f.set(null, newPotionTypes);
// }
// }
// catch (Exception e) {
// LogHelper.error("Severe error, please report this to the mod author:");
// e.printStackTrace();
// }
// }
//
// Potion[] potionTypes = null;
// LogHelper.info("Expanding Potion array size to 256");
//
// for (Field f : Potion.class.getDeclaredFields()) {
// f.setAccessible(true);
//
// try {
// if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
// Field modfield = Field.class.getDeclaredField("modifiers");
// modfield.setAccessible(true);
// modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
// potionTypes = (Potion[]) f.get(null);
// final Potion[] newPotionTypes = new Potion[256];
// System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
// f.set(null, newPotionTypes);
// }
// }
// catch (Exception e) {
// LogHelper.error("Severe error, please report this to the mod author:");
// e.printStackTrace();
// }
// }
Achievements.addModAchievements();
LogHelper.info("Finished PreInitialization");
@@ -109,63 +108,95 @@ public class CommonProxy {
public void initializeNetwork() {
DraconicEvolution.network = NetworkRegistry.INSTANCE.newSimpleChannel(DraconicEvolution.networkChannelName);
DraconicEvolution.network.registerMessage(ButtonPacket.Handler.class, ButtonPacket.class, 0, Side.SERVER);
DraconicEvolution.network.registerMessage(ParticleGenPacket.Handler.class, ParticleGenPacket.class, 1, Side.SERVER);
DraconicEvolution.network.registerMessage(PlacedItemPacket.Handler.class, PlacedItemPacket.class, 2, Side.SERVER);
DraconicEvolution.network.registerMessage(PlayerDetectorButtonPacket.Handler.class, PlayerDetectorButtonPacket.class, 3, Side.SERVER);
DraconicEvolution.network.registerMessage(PlayerDetectorStringPacket.Handler.class, PlayerDetectorStringPacket.class, 4, Side.SERVER);
DraconicEvolution.network.registerMessage(TeleporterPacket.Handler.class, TeleporterPacket.class, 5, Side.SERVER);
DraconicEvolution.network.registerMessage(TileObjectPacket.Handler.class, TileObjectPacket.class, 6, Side.CLIENT);
DraconicEvolution.network.registerMessage(MountUpdatePacket.Handler.class, MountUpdatePacket.class, 7, Side.CLIENT);
DraconicEvolution.network.registerMessage(MountUpdatePacket.Handler.class, MountUpdatePacket.class, 8, Side.SERVER);
DraconicEvolution.network.registerMessage(ItemConfigPacket.Handler.class, ItemConfigPacket.class, 9, Side.SERVER);
DraconicEvolution.network.registerMessage(TileObjectPacket.Handler.class, TileObjectPacket.class, 10, Side.SERVER);
DraconicEvolution.network.registerMessage(BlockUpdatePacket.Handler.class, BlockUpdatePacket.class, 11, Side.SERVER);
DraconicEvolution.network.registerMessage(SpeedRequestPacket.Handler.class, SpeedRequestPacket.class, 12, Side.SERVER);
DraconicEvolution.network.registerMessage(SpeedRequestPacket.Handler.class, SpeedRequestPacket.class, 13, Side.CLIENT);
DraconicEvolution.network.registerMessage(
ParticleGenPacket.Handler.class, ParticleGenPacket.class, 1, Side.SERVER);
DraconicEvolution.network.registerMessage(
PlacedItemPacket.Handler.class, PlacedItemPacket.class, 2, Side.SERVER);
DraconicEvolution.network.registerMessage(
PlayerDetectorButtonPacket.Handler.class, PlayerDetectorButtonPacket.class, 3, Side.SERVER);
DraconicEvolution.network.registerMessage(
PlayerDetectorStringPacket.Handler.class, PlayerDetectorStringPacket.class, 4, Side.SERVER);
DraconicEvolution.network.registerMessage(
TeleporterPacket.Handler.class, TeleporterPacket.class, 5, Side.SERVER);
DraconicEvolution.network.registerMessage(
TileObjectPacket.Handler.class, TileObjectPacket.class, 6, Side.CLIENT);
DraconicEvolution.network.registerMessage(
MountUpdatePacket.Handler.class, MountUpdatePacket.class, 7, Side.CLIENT);
DraconicEvolution.network.registerMessage(
MountUpdatePacket.Handler.class, MountUpdatePacket.class, 8, Side.SERVER);
DraconicEvolution.network.registerMessage(
ItemConfigPacket.Handler.class, ItemConfigPacket.class, 9, Side.SERVER);
DraconicEvolution.network.registerMessage(
TileObjectPacket.Handler.class, TileObjectPacket.class, 10, Side.SERVER);
DraconicEvolution.network.registerMessage(
BlockUpdatePacket.Handler.class, BlockUpdatePacket.class, 11, Side.SERVER);
DraconicEvolution.network.registerMessage(
SpeedRequestPacket.Handler.class, SpeedRequestPacket.class, 12, Side.SERVER);
DraconicEvolution.network.registerMessage(
SpeedRequestPacket.Handler.class, SpeedRequestPacket.class, 13, Side.CLIENT);
DraconicEvolution.network.registerMessage(ToolModePacket.Handler.class, ToolModePacket.class, 14, Side.SERVER);
DraconicEvolution.network.registerMessage(GenericParticlePacket.Handler.class, GenericParticlePacket.class, 15, Side.CLIENT);
DraconicEvolution.network.registerMessage(ShieldHitPacket.Handler.class, ShieldHitPacket.class, 16, Side.CLIENT);
DraconicEvolution.network.registerMessage(ContributorPacket.Handler.class, ContributorPacket.class, 17, Side.CLIENT);
DraconicEvolution.network.registerMessage(ContributorPacket.Handler.class, ContributorPacket.class, 18, Side.SERVER);
DraconicEvolution.network.registerMessage(MagnetTogglePacket.Handler.class, MagnetTogglePacket.class, 19, Side.SERVER);
DraconicEvolution.network.registerMessage(MagnetToggleAckPacket.Handler.class, MagnetToggleAckPacket.class, 20, Side.CLIENT);
DraconicEvolution.network.registerMessage(
GenericParticlePacket.Handler.class, GenericParticlePacket.class, 15, Side.CLIENT);
DraconicEvolution.network.registerMessage(
ShieldHitPacket.Handler.class, ShieldHitPacket.class, 16, Side.CLIENT);
DraconicEvolution.network.registerMessage(
ContributorPacket.Handler.class, ContributorPacket.class, 17, Side.CLIENT);
DraconicEvolution.network.registerMessage(
ContributorPacket.Handler.class, ContributorPacket.class, 18, Side.SERVER);
DraconicEvolution.network.registerMessage(
MagnetTogglePacket.Handler.class, MagnetTogglePacket.class, 19, Side.SERVER);
DraconicEvolution.network.registerMessage(
MagnetToggleAckPacket.Handler.class, MagnetToggleAckPacket.class, 20, Side.CLIENT);
}
public void registerTileEntities() {
GameRegistry.registerTileEntity(TileWeatherController.class, References.RESOURCESPREFIX + "TileWeatherController");
GameRegistry.registerTileEntity(
TileWeatherController.class, References.RESOURCESPREFIX + "TileWeatherController");
GameRegistry.registerTileEntity(TileSunDial.class, References.RESOURCESPREFIX + "TileSunDial");
GameRegistry.registerTileEntity(TileGrinder.class, References.RESOURCESPREFIX + "TileGrinder");
GameRegistry.registerTileEntity(TilePotentiometer.class, References.RESOURCESPREFIX + "TilePotentiometer");
GameRegistry.registerTileEntity(TileParticleGenerator.class, References.RESOURCESPREFIX + "TileParticleGenerator");
GameRegistry.registerTileEntity(
TileParticleGenerator.class, References.RESOURCESPREFIX + "TileParticleGenerator");
GameRegistry.registerTileEntity(TilePlayerDetector.class, References.RESOURCESPREFIX + "TilePlayerDetector");
GameRegistry.registerTileEntity(TilePlayerDetectorAdvanced.class, References.RESOURCESPREFIX + "TilePlayerDetectorAdvanced");
GameRegistry.registerTileEntity(
TilePlayerDetectorAdvanced.class, References.RESOURCESPREFIX + "TilePlayerDetectorAdvanced");
GameRegistry.registerTileEntity(TileEnergyInfuser.class, References.RESOURCESPREFIX + "TileEnergyInfuser");
GameRegistry.registerTileEntity(TileCustomSpawner.class, References.RESOURCESPREFIX + "TileCustomSpawner");
GameRegistry.registerTileEntity(TileGenerator.class, References.RESOURCESPREFIX + "TileGenerator");
GameRegistry.registerTileEntity(TileEnergyStorageCore.class, References.RESOURCESPREFIX + "TileEnergyStorageCore");
GameRegistry.registerTileEntity(TileInvisibleMultiblock.class, References.RESOURCESPREFIX + "TileInvisibleMultiblock");
GameRegistry.registerTileEntity(
TileEnergyStorageCore.class, References.RESOURCESPREFIX + "TileEnergyStorageCore");
GameRegistry.registerTileEntity(
TileInvisibleMultiblock.class, References.RESOURCESPREFIX + "TileInvisibleMultiblock");
GameRegistry.registerTileEntity(TileEnergyPylon.class, References.RESOURCESPREFIX + "TileEnergyPylon");
GameRegistry.registerTileEntity(TileEnderResurrection.class, References.RESOURCESPREFIX + "TileEnderResurrection");
GameRegistry.registerTileEntity(
TileEnderResurrection.class, References.RESOURCESPREFIX + "TileEnderResurrection");
GameRegistry.registerTileEntity(TilePlacedItem.class, References.RESOURCESPREFIX + "TilePlacedItem");
GameRegistry.registerTileEntity(TileCKeyStone.class, References.RESOURCESPREFIX + "TileCKeyStone");
GameRegistry.registerTileEntity(TileDissEnchanter.class, References.RESOURCESPREFIX + "TileDissEnchanter");
GameRegistry.registerTileEntity(TileTeleporterStand.class, References.RESOURCESPREFIX + "TileTeleporterStand");
GameRegistry.registerTileEntity(TileDraconiumChest.class, References.RESOURCESPREFIX + "TileDraconiumChest");
GameRegistry.registerTileEntity(TileEnergyRelay.class, References.RESOURCESPREFIX + "TileEnergyRelay");
GameRegistry.registerTileEntity(TileEnergyTransceiver.class, References.RESOURCESPREFIX + "TileEnergyTransceiver");
GameRegistry.registerTileEntity(TileWirelessEnergyTransceiver.class, References.RESOURCESPREFIX + "TileWirelessEnergyTransceiver");
GameRegistry.registerTileEntity(TileDislocatorReceptacle.class, References.RESOURCESPREFIX + "TileDislocatorReceptacle");
GameRegistry.registerTileEntity(
TileEnergyTransceiver.class, References.RESOURCESPREFIX + "TileEnergyTransceiver");
GameRegistry.registerTileEntity(
TileWirelessEnergyTransceiver.class, References.RESOURCESPREFIX + "TileWirelessEnergyTransceiver");
GameRegistry.registerTileEntity(
TileDislocatorReceptacle.class, References.RESOURCESPREFIX + "TileDislocatorReceptacle");
GameRegistry.registerTileEntity(TilePortalBlock.class, References.RESOURCESPREFIX + "TilePortalBlock");
GameRegistry.registerTileEntity(TileReactorCore.class, References.RESOURCESPREFIX + "TileReactorCore");
GameRegistry.registerTileEntity(TileFluxGate.class, References.RESOURCESPREFIX + "TileFluxGate");
GameRegistry.registerTileEntity(TileFluidGate.class, References.RESOURCESPREFIX + "TileFluidGate");
GameRegistry.registerTileEntity(TileReactorStabilizer.class, References.RESOURCESPREFIX + "TileReactorStabilizer");
GameRegistry.registerTileEntity(TileReactorEnergyInjector.class, References.RESOURCESPREFIX + "TileReactorEnergyInjector");
GameRegistry.registerTileEntity(
TileReactorStabilizer.class, References.RESOURCESPREFIX + "TileReactorStabilizer");
GameRegistry.registerTileEntity(
TileReactorEnergyInjector.class, References.RESOURCESPREFIX + "TileReactorEnergyInjector");
GameRegistry.registerTileEntity(TileChaosShard.class, References.RESOURCESPREFIX + "TileChaosShard");
GameRegistry.registerTileEntity(TileUpgradeModifier.class, References.RESOURCESPREFIX + "TileEnhancementModifier");
GameRegistry.registerTileEntity(
TileUpgradeModifier.class, References.RESOURCESPREFIX + "TileEnhancementModifier");
if (DraconicEvolution.debug) {
GameRegistry.registerTileEntity(TileTestBlock.class, References.RESOURCESPREFIX + "TileTestBlock");
GameRegistry.registerTileEntity(TileContainerTemplate.class, References.RESOURCESPREFIX + "TileContainerTemplate");
GameRegistry.registerTileEntity(
TileContainerTemplate.class, References.RESOURCESPREFIX + "TileContainerTemplate");
}
}
@@ -204,28 +235,59 @@ public class CommonProxy {
}
}
//@Callback
// @Callback
public void registerEntities() {
EntityRegistry.registerModEntity(EntityCustomDragon.class, "EnderDragon", 0, DraconicEvolution.instance, 256, 3, true);
EntityRegistry.registerModEntity(EntityPersistentItem.class, "Persistent Item", 1, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityDraconicArrow.class, "Arrow", 2, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityEnderArrow.class, "Ender Arrow", 3, DraconicEvolution.instance, 32, 1, true);
//EntityRegistry.registerModEntity(EntityChaosDrill.class, "Chaos Drill", 4, DraconicEvolution.instance, 10, 5, false);
EntityRegistry.registerModEntity(EntityDragonHeart.class, "Dragon Heart Item", 5, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityChaosGuardian.class, "ChaosGuardian", 6, DraconicEvolution.instance, 256, 1, true);
EntityRegistry.registerModEntity(EntityDragonProjectile.class, "DragonProjectile", 7, DraconicEvolution.instance, 256, 1, true);
EntityRegistry.registerModEntity(EntityChaosCrystal.class, "ChaosCrystal", 8, DraconicEvolution.instance, 256, 5, false);
EntityRegistry.registerModEntity(EntityChaosBolt.class, "ChaosBolt", 9, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(EntityChaosVortex.class, "EntityChaosEnergyVortex", 10, DraconicEvolution.instance, 512, 5, true);
EntityRegistry.registerModEntity(EntityCustomArrow.class, "CustomArrow", 11, DraconicEvolution.instance, 128, 1, true);
EntityRegistry.registerModEntity(
EntityCustomDragon.class, "EnderDragon", 0, DraconicEvolution.instance, 256, 3, true);
EntityRegistry.registerModEntity(
EntityPersistentItem.class, "Persistent Item", 1, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(
EntityDraconicArrow.class, "Arrow", 2, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(
EntityEnderArrow.class, "Ender Arrow", 3, DraconicEvolution.instance, 32, 1, true);
// EntityRegistry.registerModEntity(EntityChaosDrill.class, "Chaos Drill", 4, DraconicEvolution.instance, 10, 5,
// false);
EntityRegistry.registerModEntity(
EntityDragonHeart.class, "Dragon Heart Item", 5, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(
EntityChaosGuardian.class, "ChaosGuardian", 6, DraconicEvolution.instance, 256, 1, true);
EntityRegistry.registerModEntity(
EntityDragonProjectile.class, "DragonProjectile", 7, DraconicEvolution.instance, 256, 1, true);
EntityRegistry.registerModEntity(
EntityChaosCrystal.class, "ChaosCrystal", 8, DraconicEvolution.instance, 256, 5, false);
EntityRegistry.registerModEntity(
EntityChaosBolt.class, "ChaosBolt", 9, DraconicEvolution.instance, 32, 5, true);
EntityRegistry.registerModEntity(
EntityChaosVortex.class, "EntityChaosEnergyVortex", 10, DraconicEvolution.instance, 512, 5, true);
EntityRegistry.registerModEntity(
EntityCustomArrow.class, "CustomArrow", 11, DraconicEvolution.instance, 128, 1, true);
}
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
public ParticleEnergyBeam energyBeam(
World worldObj,
double x,
double y,
double z,
double tx,
double ty,
double tz,
int powerFlow,
boolean advanced,
ParticleEnergyBeam oldBeam,
boolean render,
int beamType) {
return null;
}
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced, ParticleEnergyField oldBeam, boolean render) {
public ParticleEnergyField energyField(
World worldObj,
double x,
double y,
double z,
int type,
boolean advanced,
ParticleEnergyField oldBeam,
boolean render) {
return null;
}
@@ -233,12 +295,9 @@ public class CommonProxy {
return null;
}
public void spawnParticle(Object particle, int range) {
}
public void spawnParticle(Object particle, int range) {}
public ISound playISound(ISound sound) {
return null;
}
}
@@ -50,7 +50,9 @@ public class ModBlocks {
public static BlockDE chaosCrystal;
public static BlockDE upgradeModifier;
public static Block safetyFlame;
public static Block chaosShardAtmos = new ChaosShardAtmos().setBlockName(References.RESOURCESPREFIX + "chaosShardAtmos").setBlockTextureName(References.RESOURCESPREFIX + "transparency");
public static Block chaosShardAtmos = new ChaosShardAtmos()
.setBlockName(References.RESOURCESPREFIX + "chaosShardAtmos")
.setBlockTextureName(References.RESOURCESPREFIX + "transparency");
public static ItemStack resurrectionStone;
@@ -113,7 +115,8 @@ public class ModBlocks {
}
public static void registerOther(Block block) {
String name = block.getUnlocalizedName().substring(block.getUnlocalizedName().indexOf(".") + 1);
String name =
block.getUnlocalizedName().substring(block.getUnlocalizedName().indexOf(".") + 1);
if (isEnabled(block)) GameRegistry.registerBlock(block, name.substring(name.indexOf(":") + 1));
}
@@ -21,8 +21,10 @@ import net.minecraftforge.common.util.EnumHelper;
@GameRegistry.ObjectHolder(References.MODID)
public class ModItems {
public static ArmorMaterial WYVERN_ARMOR = EnumHelper.addArmorMaterial("WYVERN_ARMOR", -1, new int[]{3, 8, 6, 3}, 30);
public static ArmorMaterial DRACONIC_ARMOR = EnumHelper.addArmorMaterial("DRACONIC_ARMOR", -1, new int[]{3, 8, 6, 3}, 30);
public static ArmorMaterial WYVERN_ARMOR =
EnumHelper.addArmorMaterial("WYVERN_ARMOR", -1, new int[] {3, 8, 6, 3}, 30);
public static ArmorMaterial DRACONIC_ARMOR =
EnumHelper.addArmorMaterial("DRACONIC_ARMOR", -1, new int[] {3, 8, 6, 3}, 30);
public static ToolMaterial WYVERN = EnumHelper.addToolMaterial("WYVERN", 10, -1, 12.0F, 20.0F, 35);
public static ToolMaterial AWAKENED = EnumHelper.addToolMaterial("AWAKENED", 10, -1, 16.0F, 40.0F, 40);
public static ToolMaterial CHAOTIC = EnumHelper.addToolMaterial("CHAOTIC", 10, -1, 400.0F, 60.0F, 45);
@@ -147,7 +149,7 @@ public class ModItems {
dezilsMarshmallow = new DezilsMarshmallow();
//Custom ItemStacks
// Custom ItemStacks
wyvernEnergyCore = new ItemStack(ModItems.draconiumEnergyCore, 1, 0);
draconicEnergyCore = new ItemStack(ModItems.draconiumEnergyCore, 1, 1);
wyvernFluxCapacitor = new ItemStack(ModItems.draconiumFluxCapacitor, 1, 0);
@@ -1,10 +1,11 @@
package com.brandon3055.draconicevolution.common.achievements;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import com.brandon3055.draconicevolution.common.ModBlocks;
import com.brandon3055.draconicevolution.common.ModItems;
import com.brandon3055.brandonscore.common.utills.ItemNBTHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import java.util.HashMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
@@ -12,8 +13,6 @@ import net.minecraft.util.StatCollector;
import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import java.util.HashMap;
/**
* Created by Brandon on 18/11/2014.
*/
@@ -52,62 +51,406 @@ public class Achievements {
public static void addModAchievements() {
int x = 5;
addAchievement("draconicevolution.dust", new Achievement("draconicevolution.dust", "draconicevolution.dust", -10 + x, 0, ModItems.draconiumDust, null).initIndependentStat().setSpecial(), "pickup");
addAchievement("draconicevolution.ingot", new Achievement("draconicevolution.ingot", "draconicevolution.ingot", -8 + x, 0, ModItems.draconiumIngot, getAchievement("draconicevolution.dust")), "smelt");
addAchievement("draconicevolution.core", new Achievement("draconicevolution.core", "draconicevolution.core", -6 + x, 0, ModItems.draconicCore, getAchievement("draconicevolution.ingot")), "craft");
addAchievement("draconicevolution.core2", new Achievement("draconicevolution.core2", "draconicevolution.core2", -4 + x, 0, ModItems.wyvernCore, getAchievement("draconicevolution.core")).setSpecial(), "craft");
addAchievement(
"draconicevolution.dust",
new Achievement(
"draconicevolution.dust",
"draconicevolution.dust",
-10 + x,
0,
ModItems.draconiumDust,
null)
.initIndependentStat()
.setSpecial(),
"pickup");
addAchievement(
"draconicevolution.ingot",
new Achievement(
"draconicevolution.ingot",
"draconicevolution.ingot",
-8 + x,
0,
ModItems.draconiumIngot,
getAchievement("draconicevolution.dust")),
"smelt");
addAchievement(
"draconicevolution.core",
new Achievement(
"draconicevolution.core",
"draconicevolution.core",
-6 + x,
0,
ModItems.draconicCore,
getAchievement("draconicevolution.ingot")),
"craft");
addAchievement(
"draconicevolution.core2",
new Achievement(
"draconicevolution.core2",
"draconicevolution.core2",
-4 + x,
0,
ModItems.wyvernCore,
getAchievement("draconicevolution.core"))
.setSpecial(),
"craft");
addAchievement("draconicevolution.dislocator", new Achievement("draconicevolution.dislocator", "draconicevolution.dislocator", -8 + x, 1, ModItems.teleporterMKI, getAchievement("draconicevolution.dust")), "craft");
addAchievement("draconicevolution.chest", new Achievement("draconicevolution.chest", "draconicevolution.chest", -5 + x, 2, ModBlocks.draconiumChest, getAchievement("draconicevolution.core")), "craft");
addAchievement("draconicevolution.particles", new Achievement("draconicevolution.particles", "draconicevolution.particles", -7 + x, 2, ModBlocks.particleGenerator, getAchievement("draconicevolution.core")), "craft");
addAchievement("draconicevolution.weather", new Achievement("draconicevolution.weather", "draconicevolution.weather", -5 + x, -2, ModBlocks.weatherController, getAchievement("draconicevolution.core")), "craft");
addAchievement("draconicevolution.dissenchanter", new Achievement("draconicevolution.dissenchanter", "draconicevolution.dissenchanter", -7 + x, -2, ModBlocks.dissEnchanter, getAchievement("draconicevolution.core")), "craft");
addAchievement("draconicevolution.ecore", new Achievement("draconicevolution.ecore", "draconicevolution.ecore", -4 + x, -6, ModBlocks.energyStorageCore, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wpick", new Achievement("draconicevolution.wpick", "draconicevolution.wpick", -2 + x, 1, ModItems.wyvernPickaxe, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wshovel", new Achievement("draconicevolution.wshovel", "draconicevolution.wshovel", -2 + x, -1, ModItems.wyvernShovel, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wsword", new Achievement("draconicevolution.wsword", "draconicevolution.wsword", -2 + x, 2, ModItems.wyvernSword, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wbow", new Achievement("draconicevolution.wbow", "draconicevolution.wbow", -2 + x, -2, ModItems.wyvernBow, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.whelm", new Achievement("draconicevolution.whelm", "draconicevolution.whelm", -2 + x, -4, ModItems.wyvernHelm, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wchest", new Achievement("draconicevolution.wchest", "draconicevolution.wchest", -2 + x, -3, ModItems.wyvernChest, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wleggs", new Achievement("draconicevolution.wleggs", "draconicevolution.wleggs", -2 + x, 3, ModItems.wyvernLeggs, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.wboots", new Achievement("draconicevolution.wboots", "draconicevolution.wboots", -2 + x, 4, ModItems.wyvernBoots, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.resurrection", new Achievement("draconicevolution.resurrection", "draconicevolution.resurrection", -4 + x, 6, ModBlocks.resurrectionStone, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.dislocator2", new Achievement("draconicevolution.dislocator2", "draconicevolution.dislocator2", -2 + x, -5, ModItems.teleporterMKII, getAchievement("draconicevolution.core2")), "craft");
addAchievement("draconicevolution.flux", new Achievement("draconicevolution.flux", "draconicevolution.flux", -2 + x, 5, ModItems.wyvernFluxCapacitor, getAchievement("draconicevolution.core2")), "craft");
addAchievement(
"draconicevolution.dislocator",
new Achievement(
"draconicevolution.dislocator",
"draconicevolution.dislocator",
-8 + x,
1,
ModItems.teleporterMKI,
getAchievement("draconicevolution.dust")),
"craft");
addAchievement(
"draconicevolution.chest",
new Achievement(
"draconicevolution.chest",
"draconicevolution.chest",
-5 + x,
2,
ModBlocks.draconiumChest,
getAchievement("draconicevolution.core")),
"craft");
addAchievement(
"draconicevolution.particles",
new Achievement(
"draconicevolution.particles",
"draconicevolution.particles",
-7 + x,
2,
ModBlocks.particleGenerator,
getAchievement("draconicevolution.core")),
"craft");
addAchievement(
"draconicevolution.weather",
new Achievement(
"draconicevolution.weather",
"draconicevolution.weather",
-5 + x,
-2,
ModBlocks.weatherController,
getAchievement("draconicevolution.core")),
"craft");
addAchievement(
"draconicevolution.dissenchanter",
new Achievement(
"draconicevolution.dissenchanter",
"draconicevolution.dissenchanter",
-7 + x,
-2,
ModBlocks.dissEnchanter,
getAchievement("draconicevolution.core")),
"craft");
addAchievement(
"draconicevolution.ecore",
new Achievement(
"draconicevolution.ecore",
"draconicevolution.ecore",
-4 + x,
-6,
ModBlocks.energyStorageCore,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wpick",
new Achievement(
"draconicevolution.wpick",
"draconicevolution.wpick",
-2 + x,
1,
ModItems.wyvernPickaxe,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wshovel",
new Achievement(
"draconicevolution.wshovel",
"draconicevolution.wshovel",
-2 + x,
-1,
ModItems.wyvernShovel,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wsword",
new Achievement(
"draconicevolution.wsword",
"draconicevolution.wsword",
-2 + x,
2,
ModItems.wyvernSword,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wbow",
new Achievement(
"draconicevolution.wbow",
"draconicevolution.wbow",
-2 + x,
-2,
ModItems.wyvernBow,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.whelm",
new Achievement(
"draconicevolution.whelm",
"draconicevolution.whelm",
-2 + x,
-4,
ModItems.wyvernHelm,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wchest",
new Achievement(
"draconicevolution.wchest",
"draconicevolution.wchest",
-2 + x,
-3,
ModItems.wyvernChest,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wleggs",
new Achievement(
"draconicevolution.wleggs",
"draconicevolution.wleggs",
-2 + x,
3,
ModItems.wyvernLeggs,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.wboots",
new Achievement(
"draconicevolution.wboots",
"draconicevolution.wboots",
-2 + x,
4,
ModItems.wyvernBoots,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.resurrection",
new Achievement(
"draconicevolution.resurrection",
"draconicevolution.resurrection",
-4 + x,
6,
ModBlocks.resurrectionStone,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.dislocator2",
new Achievement(
"draconicevolution.dislocator2",
"draconicevolution.dislocator2",
-2 + x,
-5,
ModItems.teleporterMKII,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement(
"draconicevolution.flux",
new Achievement(
"draconicevolution.flux",
"draconicevolution.flux",
-2 + x,
5,
ModItems.wyvernFluxCapacitor,
getAchievement("draconicevolution.core2")),
"craft");
addAchievement("draconicevolution.heart", new Achievement("draconicevolution.heart", "draconicevolution.heart", 0 + x, 0, ModItems.dragonHeart, getAchievement("draconicevolution.core2")).setSpecial(), "pickup");
addAchievement("draconicevolution.awakenedblock", new Achievement("draconicevolution.awakenedblock", "draconicevolution.awakenedblock", 2 + x, 0, ModBlocks.draconicBlock, getAchievement("draconicevolution.heart")), "pickup");
addAchievement("draconicevolution.core3", new Achievement("draconicevolution.core3", "draconicevolution.core3", 4 + x, 0, ModItems.awakenedCore, getAchievement("draconicevolution.awakenedblock")).setSpecial(), "craft");
addAchievement(
"draconicevolution.heart",
new Achievement(
"draconicevolution.heart",
"draconicevolution.heart",
0 + x,
0,
ModItems.dragonHeart,
getAchievement("draconicevolution.core2"))
.setSpecial(),
"pickup");
addAchievement(
"draconicevolution.awakenedblock",
new Achievement(
"draconicevolution.awakenedblock",
"draconicevolution.awakenedblock",
2 + x,
0,
ModBlocks.draconicBlock,
getAchievement("draconicevolution.heart")),
"pickup");
addAchievement(
"draconicevolution.core3",
new Achievement(
"draconicevolution.core3",
"draconicevolution.core3",
4 + x,
0,
ModItems.awakenedCore,
getAchievement("draconicevolution.awakenedblock"))
.setSpecial(),
"craft");
addAchievement("draconicevolution.dhelm", new Achievement("draconicevolution.dhelm", "draconicevolution.dhelm", 2 + x, -3, ModItems.draconicHelm, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dChest", new Achievement("draconicevolution.dChest", "draconicevolution.dChest", 2 + x, -2, ModItems.draconicChest, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dleggs", new Achievement("draconicevolution.dleggs", "draconicevolution.dleggs", 2 + x, 2, ModItems.draconicLeggs, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dboots", new Achievement("draconicevolution.dboots", "draconicevolution.dboots", 2 + x, 3, ModItems.draconicBoots, getAchievement("draconicevolution.core3")), "craft");
addAchievement(
"draconicevolution.dhelm",
new Achievement(
"draconicevolution.dhelm",
"draconicevolution.dhelm",
2 + x,
-3,
ModItems.draconicHelm,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dChest",
new Achievement(
"draconicevolution.dChest",
"draconicevolution.dChest",
2 + x,
-2,
ModItems.draconicChest,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dleggs",
new Achievement(
"draconicevolution.dleggs",
"draconicevolution.dleggs",
2 + x,
2,
ModItems.draconicLeggs,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dboots",
new Achievement(
"draconicevolution.dboots",
"draconicevolution.dboots",
2 + x,
3,
ModItems.draconicBoots,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement("draconicevolution.dpick", new Achievement("draconicevolution.dpick", "draconicevolution.dpick", 6 + x, 0, ModItems.draconicPickaxe, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dshovel", new Achievement("draconicevolution.dshovel", "draconicevolution.dshovel", 6 + x, -1, ModItems.draconicShovel, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.daxe", new Achievement("draconicevolution.daxe", "draconicevolution.daxe", 6 + x, 1, ModItems.draconicAxe, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dsword", new Achievement("draconicevolution.dsword", "draconicevolution.dsword", 6 + x, -2, ModItems.draconicSword, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dbow", new Achievement("draconicevolution.dbow", "draconicevolution.dbow", 6 + x, 2, ModItems.draconicBow, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.flux2", new Achievement("draconicevolution.flux2", "draconicevolution.flux2", 6 + x, -3, ModItems.draconicFluxCapacitor, getAchievement("draconicevolution.core3")), "craft");
addAchievement("draconicevolution.dhoe", new Achievement("draconicevolution.dhoe", "draconicevolution.dhoe", 6 + x, 3, ModItems.draconicHoe, getAchievement("draconicevolution.core3")), "craft");
addAchievement(
"draconicevolution.dpick",
new Achievement(
"draconicevolution.dpick",
"draconicevolution.dpick",
6 + x,
0,
ModItems.draconicPickaxe,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dshovel",
new Achievement(
"draconicevolution.dshovel",
"draconicevolution.dshovel",
6 + x,
-1,
ModItems.draconicShovel,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.daxe",
new Achievement(
"draconicevolution.daxe",
"draconicevolution.daxe",
6 + x,
1,
ModItems.draconicAxe,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dsword",
new Achievement(
"draconicevolution.dsword",
"draconicevolution.dsword",
6 + x,
-2,
ModItems.draconicSword,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dbow",
new Achievement(
"draconicevolution.dbow",
"draconicevolution.dbow",
6 + x,
2,
ModItems.draconicBow,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.flux2",
new Achievement(
"draconicevolution.flux2",
"draconicevolution.flux2",
6 + x,
-3,
ModItems.draconicFluxCapacitor,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement(
"draconicevolution.dhoe",
new Achievement(
"draconicevolution.dhoe",
"draconicevolution.dhoe",
6 + x,
3,
ModItems.draconicHoe,
getAchievement("draconicevolution.core3")),
"craft");
addAchievement("draconicevolution.dstaff", new Achievement("draconicevolution.dstaff", "draconicevolution.dstaff", 8 + x, 0, ModItems.draconicDestructionStaff, getAchievement("draconicevolution.dpick")).setSpecial(), "craft");
addAchievement(
"draconicevolution.dstaff",
new Achievement(
"draconicevolution.dstaff",
"draconicevolution.dstaff",
8 + x,
0,
ModItems.draconicDestructionStaff,
getAchievement("draconicevolution.dpick"))
.setSpecial(),
"craft");
ItemStack mobSoul = new ItemStack(ModItems.mobSoul);
ItemNBTHelper.setString(mobSoul, "Name", "Any");
addAchievement("draconicevolution.soul", new Achievement("draconicevolution.soul", "draconicevolution.soul", 0 + x, -2, mobSoul, null).initIndependentStat(), "null");
//if (ConfigHandler.disableSunDial == 0)addAchievement("draconicevolution.sundial", new Achievement("draconicevolution.sundial", "draconicevolution.sundial", 4+x, -4, ModBlocks.sunDial, getAchievement("draconicevolution.core3")).setSpecial(), "craft");
addAchievement("draconicevolution.manual", new Achievement("draconicevolution.manual", "draconicevolution.manual", -8 + x, -1, ModItems.infoTablet, getAchievement("draconicevolution.dust")), "craft");
addAchievement(
"draconicevolution.soul",
new Achievement("draconicevolution.soul", "draconicevolution.soul", 0 + x, -2, mobSoul, null)
.initIndependentStat(),
"null");
// if (ConfigHandler.disableSunDial == 0)addAchievement("draconicevolution.sundial", new
// Achievement("draconicevolution.sundial", "draconicevolution.sundial", 4+x, -4, ModBlocks.sunDial,
// getAchievement("draconicevolution.core3")).setSpecial(), "craft");
addAchievement(
"draconicevolution.manual",
new Achievement(
"draconicevolution.manual",
"draconicevolution.manual",
-8 + x,
-1,
ModItems.infoTablet,
getAchievement("draconicevolution.dust")),
"craft");
}
public static void registerAchievementPane() {
Achievement[] achievements = new Achievement[achievementsList.size()];
achievements = achievementsList.values().toArray(achievements);
achievementsPage = new AchievementPage(StatCollector.translateToLocal("draconicevolution.achievementPage.name"), achievements);
achievementsPage = new AchievementPage(
StatCollector.translateToLocal("draconicevolution.achievementPage.name"), achievements);
AchievementPage.registerAchievementPage(achievementsPage);
}
@@ -115,8 +458,11 @@ public class Achievements {
public void entityPickupEvent(EntityItemPickupEvent event) {
ItemStack stack = event.item.getEntityItem().copy();
stack.stackSize = 1;
if (achievementItems.containsKey(stack.getUnlocalizedName()) && achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("pickup")) {
triggerAchievement(event.entityPlayer, achievementItems.get(stack.getUnlocalizedName()).getName());
if (achievementItems.containsKey(stack.getUnlocalizedName())
&& achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("pickup")) {
triggerAchievement(
event.entityPlayer,
achievementItems.get(stack.getUnlocalizedName()).getName());
}
}
@@ -124,8 +470,11 @@ public class Achievements {
public void craftEvent(PlayerEvent.ItemCraftedEvent event) {
ItemStack stack = event.crafting.copy();
stack.stackSize = 1;
if (achievementItems.containsKey(stack.getUnlocalizedName()) && achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("craft")) {
triggerAchievement(event.player, achievementItems.get(stack.getUnlocalizedName()).getName());
if (achievementItems.containsKey(stack.getUnlocalizedName())
&& achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("craft")) {
triggerAchievement(
event.player,
achievementItems.get(stack.getUnlocalizedName()).getName());
}
}
@@ -133,8 +482,11 @@ public class Achievements {
public void smeltEvent(PlayerEvent.ItemSmeltedEvent event) {
ItemStack stack = event.smelting.copy();
stack.stackSize = 1;
if (achievementItems.containsKey(stack.getUnlocalizedName()) && achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("smelt")) {
triggerAchievement(event.player, achievementItems.get(stack.getUnlocalizedName()).getName());
if (achievementItems.containsKey(stack.getUnlocalizedName())
&& achievementItems.get(stack.getUnlocalizedName()).isCorrectCondition("smelt")) {
triggerAchievement(
event.player,
achievementItems.get(stack.getUnlocalizedName()).getName());
}
}
@@ -155,5 +507,4 @@ public class Achievements {
return name;
}
}
}
@@ -45,9 +45,11 @@ public class BlockContainerTemplate extends BlockContainerDE {
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float prx, float pry, float prz) {
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int side, float prx, float pry, float prz) {
if (!world.isRemote) {
FMLNetworkHandler.openGui(player, DraconicEvolution.instance, GuiHandler.GUIID_CONTAINER_TEMPLATE, world, x, y, z);
FMLNetworkHandler.openGui(
player, DraconicEvolution.instance, GuiHandler.GUIID_CONTAINER_TEMPLATE, world, x, y, z);
}
return true;
}
Loaded 100 of 326 files, more files were not shown because too many files have changed in this diff. Show more