diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-07-01 16:11:31 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-07-01 16:11:31 +0100 |
| commit | 46186569d5cb462f90e59a37dc17a9fad51cfa4a (patch) | |
| tree | 7d0915f21cb4b9d10bb37ae7b6054dfd0f9b1ac5 | |
| parent | b65c980fffb286feb2853245411f5bafb73daf15 (diff) | |
Added a curse tab, added a config to enable/disable extra jewelry info,
plus more!
31 files changed, 1137 insertions, 990 deletions
diff --git a/changelog.txt b/changelog.txt index 1d97764..f0634e3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,16 +1,11 @@ Added:
-- Hearts now have spawn eggs
-- There is now a config option to disable structures from spawning; you can chose to disable each structure individually or every single one (note, this will disable the Shadow ore as well)
+- A Gui for Curses
Removed:
-- Had to remove the better Alpaca modelling system until Fisk decides to create a page where I can find all the downloads (post it on curse already :p)
+
Changed:
-- Improved molten liquids
-- Improved the Cursed Eye following the player algorithm
-- Improved Hearts mechanics, now they should be a bit more reliable
-- Hearts now render on the right side of the hotbar rather than the left
-- Improved color detection system (should be less laggy now)
+
Fixed:
-- Structures crashing servers
+
diff --git a/src/main/java/darkknight/jewelrycraft/api/Curse.java b/src/main/java/darkknight/jewelrycraft/api/Curse.java index bf21a5e..beff14b 100644 --- a/src/main/java/darkknight/jewelrycraft/api/Curse.java +++ b/src/main/java/darkknight/jewelrycraft/api/Curse.java @@ -15,11 +15,12 @@ import net.minecraftforge.event.world.BlockEvent; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-public class Curse
+public abstract class Curse
{
protected int textureID;
protected String name, description, texturePackName;
protected Random rand = new Random();
+ protected Minecraft mc = Minecraft.getMinecraft();
private static ArrayList<Curse> curses = new ArrayList<Curse>();
public static ArrayList<Curse> availableCurses = new ArrayList<Curse>();
@@ -44,6 +45,8 @@ public class Curse {
return name;
}
+
+ public abstract String getDisplayName();
/**
* @return The description of the curse
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java new file mode 100644 index 0000000..e9878b0 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java @@ -0,0 +1,27 @@ +package darkknight.jewelrycraft.client;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+
+public class TabCurses extends AbstractTab
+{
+ public TabCurses()
+ {
+ super(0, 0, 0, new ItemStack(Items.ender_eye));
+ }
+
+ @Override
+ public void onTabClicked ()
+ {
+ JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(1));
+ }
+
+ @Override
+ public boolean shouldAddToList ()
+ {
+ return true;
+ }
+}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java index 6ba37ad..e35f305 100644 --- a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java +++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java @@ -1,86 +1,86 @@ -package darkknight.jewelrycraft.client; - -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiInventory; -import net.minecraft.network.play.client.C0DPacketCloseWindow; -import net.minecraftforge.client.event.GuiScreenEvent; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.client.*; - -/** - * @author TinkersConstruct - */ -public class TabRegistry -{ - private static ArrayList<AbstractTab> tabList = new ArrayList<AbstractTab>(); - - public static void registerTab(AbstractTab tab) - { - tabList.add(tab); - } - - public static ArrayList<AbstractTab> getTabList() - { - return tabList; - } - - @SideOnly (Side.CLIENT) - @SubscribeEvent - public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) - { - if ((event.gui instanceof GuiInventory)){ - int xSize = 176; - int ySize = 166; - int guiLeft = (event.gui.width - xSize) / 2; - int guiTop = (event.gui.height - ySize) / 2; - if (!mc.thePlayer.getActivePotionEffects().isEmpty()) if (Loader.isModLoaded("NotEnoughItems")){ - try{ - // Check whether NEI is hidden and enabled - Class<?> c = Class.forName("codechicken.nei.NEIClientConfig"); - Object hidden = c.getMethod("isHidden").invoke(null); - Object enabled = c.getMethod("isEnabled").invoke(null); - if (hidden != null && hidden instanceof Boolean && enabled != null && enabled instanceof Boolean) if ((Boolean)hidden || !((Boolean)enabled)) guiLeft += 60; - } - catch(Exception e){} - }else guiLeft += 60; - updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class); - addTabsToList(event.buttonList); - } - } - - private static Minecraft mc = FMLClientHandler.instance().getClient(); - - public static void openInventoryGui() - { - mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); - GuiInventory inventory = new GuiInventory(mc.thePlayer); - mc.displayGuiScreen(inventory); - } - - public static void updateTabValues(int cornerX, int cornerY, Class<?> selectedButton) - { - int count = 1; - for(int i = 0; i < tabList.size(); i++){ - AbstractTab t = tabList.get(i); - if (t.shouldAddToList()){ - t.id = count; - t.xPosition = cornerX + 151 + (t.id==1?9:0); - t.yPosition = cornerY + 64; - t.enabled = !t.getClass().equals(selectedButton); - count++; - } - } - } - - public static void addTabsToList(List buttonList) - { - for(AbstractTab tab: tabList) - if (tab.shouldAddToList() && tab.enabled) buttonList.add(tab); - } +package darkknight.jewelrycraft.client;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiInventory;
+import net.minecraft.network.play.client.C0DPacketCloseWindow;
+import net.minecraftforge.client.event.GuiScreenEvent;
+import cpw.mods.fml.client.FMLClientHandler;
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.client.*;
+
+/**
+ * @author TinkersConstruct
+ */
+public class TabRegistry {
+ private static ArrayList<AbstractTab> tabList = new ArrayList<AbstractTab>();
+
+ public static void registerTab(AbstractTab tab) {
+ tabList.add(tab);
+ }
+
+ public static ArrayList<AbstractTab> getTabList() {
+ return tabList;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @SubscribeEvent
+ public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
+ if ((event.gui instanceof GuiInventory)) {
+ int xSize = 176;
+ int ySize = 166;
+ int guiLeft = (event.gui.width - xSize) / 2;
+ int guiTop = (event.gui.height - ySize) / 2;
+ if (!mc.thePlayer.getActivePotionEffects().isEmpty()) if (Loader.isModLoaded("NotEnoughItems")) {
+ try {
+ // Check whether NEI is hidden and enabled
+ Class<?> c = Class.forName("codechicken.nei.NEIClientConfig");
+ Object hidden = c.getMethod("isHidden").invoke(null);
+ Object enabled = c.getMethod("isEnabled").invoke(null);
+ if (hidden != null && hidden instanceof Boolean && enabled != null && enabled instanceof Boolean) if ((Boolean) hidden || !((Boolean) enabled)) guiLeft += 60;
+ } catch (Exception e) {
+ }
+ } else guiLeft += 60;
+ updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
+ addTabsToList(event.buttonList);
+ }
+ }
+
+ private static Minecraft mc = FMLClientHandler.instance().getClient();
+
+ public static void openInventoryGui() {
+ mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId));
+ GuiInventory inventory = new GuiInventory(mc.thePlayer);
+ mc.displayGuiScreen(inventory);
+ }
+
+ public static void updateTabValues(int cornerX, int cornerY, Class<?> selectedButton) {
+ int count = 0;
+ for (int i = 0; i < tabList.size(); i++) {
+ AbstractTab t = tabList.get(i);
+ if (t.shouldAddToList()) {
+ if (selectedButton.equals(TabCurses.class)) {
+ t.xPosition = cornerX + 195;
+ t.yPosition = cornerY + count*20;
+ }else if (selectedButton.equals(TabJewelry.class)) {
+ t.xPosition = cornerX + 140 + count * 20;
+ t.yPosition = cornerY + 64;
+ } else {
+ t.xPosition = cornerX + 131 + count * 20;
+ t.yPosition = cornerY + 64;
+ }
+ t.enabled = !t.getClass().equals(selectedButton);
+ if (t.enabled) count++;
+ }
+ }
+ }
+
+ public static void addTabsToList(List buttonList) {
+ for (AbstractTab tab : tabList)
+ if (tab.shouldAddToList() && tab.enabled) buttonList.add(tab);
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java index 5489911..2b3faa0 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java @@ -1,58 +1,133 @@ -package darkknight.jewelrycraft.client.gui; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.events.PlayerRenderHandler; -import darkknight.jewelrycraft.events.ScreenHandler; -import darkknight.jewelrycraft.network.PacketRequestPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class GuiCurseInfo extends GuiScreen -{ - World world; - EntityPlayer player; - - public GuiCurseInfo(Container container, World world, EntityPlayer player) - { - super(); - this.world = world; - this.player = player; - } - - public void drawScreen(int x, int y, float size) - { - super.drawScreen(x, y, size); - this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); - int ind = 0; - if (player != null){ - NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - if (!playerInfo.hasNoTags()){ - for(Curse curse: Curse.getCurseList()) - if (playerInfo.getInteger(curse.getName()) > 0){ - int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2; - mc.renderEngine.bindTexture(Variables.MISC_TEXTURE); - this.drawRect(0, 12 + ind * 34, this.width, 10 + (ind + 1) * 34, 0xff000000); - mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png")); - int tag = curse.getTextureID(); - GL11.glColor3f(1F, 1F, 1F); - drawTexturedModalRect(this.width/2 - halfDescrSize - 35, 12 + ind * 34, tag % 8 * 32, tag / 8 * 32, 32, 32); - this.drawString(fontRendererObj, curse.getName().substring(curse.getName().indexOf(':') + 1), this.width/2 - halfDescrSize, 20 + ind * 34, 0xffff00); - this.drawCenteredString(fontRendererObj, curse.getDescription(), this.width/2, 30 + ind * 34, 0xffffff); - ind++; - } - } - } - } +package darkknight.jewelrycraft.client.gui;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+
+import org.lwjgl.opengl.GL11;
+
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.client.TabCurses;
+import darkknight.jewelrycraft.client.TabRegistry;
+import darkknight.jewelrycraft.events.KeyBindings;
+import darkknight.jewelrycraft.util.PlayerUtils;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiCurseInfo extends GuiContainer {
+ World world;
+ EntityPlayer player;
+ ResourceLocation texture;
+
+ public GuiCurseInfo(Container container, World world, EntityPlayer player, ResourceLocation texture) {
+ super(container);
+ this.world = world;
+ this.player = player;
+ this.texture = texture;
+ xSize = 214;
+ ySize = 166;
+ }
+
+ public void drawScreen(int x, int y, float size) {
+ super.drawScreen(x, y, size);
+ // this.drawGradientRect(0, 0, this.width, this.height, -1072689136,
+ // -804253680);
+ // int ind = 0;
+ // if (player != null){
+ // NBTTagCompound playerInfo =
+ // PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
+ // if (!playerInfo.hasNoTags()){
+ // for(Curse curse: Curse.getCurseList())
+ // if (playerInfo.getInteger(curse.getName()) > 0){
+ // int halfDescrSize =
+ // fontRendererObj.getStringWidth(curse.getDescription()) / 2;
+ // mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ // this.drawRect(0, 12 + ind * 34, this.width, 10 + (ind + 1) * 34,
+ // 0xff000000);
+ // mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID,
+ // "textures/gui/" + curse.getTexturePack() + ".png"));
+ // int tag = curse.getTextureID();
+ // GL11.glColor3f(1F, 1F, 1F);
+ // drawTexturedModalRect(this.width/2 - halfDescrSize - 35, 12 + ind *
+ // 34, tag % 8 * 32, tag / 8 * 32, 32, 32);
+ // this.drawString(fontRendererObj,
+ // curse.getName().substring(curse.getName().indexOf(':') + 1),
+ // this.width/2 - halfDescrSize, 20 + ind * 34, 0xffff00);
+ // this.drawCenteredString(fontRendererObj, curse.getDescription(),
+ // this.width/2, 30 + ind * 34, 0xffffff);
+ // ind++;
+ // }
+ // }
+ // }
+ }
+
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ int ind = 0;
+ int size = 32;
+ if (player != null) {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
+ if (!playerInfo.hasNoTags()) {
+ for (Curse curse : Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0) {
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ drawTexturedModalRect(guiLeft + 43, guiTop + 5 + (size - 8) * ind, 0, 32, 112, 22);
+ if (playerInfo.getInteger(curse.getName()) == 1) {
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glColor4f(1f, 1f, 1f, 0.5f);
+ drawTexturedModalRect(guiLeft + 134, guiTop + 8 + (size - 8) * ind, 3 * 16, 0, 16, 16);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glPopMatrix();
+ }
+ int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2;
+ mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
+ int tag = curse.getTextureID();
+ GL11.glPushMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glScalef(0.5f, 0.5f, 0.0f);
+ drawTexturedModalRect(guiLeft*2 + 100, guiTop*2 + 16 + ind * 48, tag % 8 * 32, tag / 8 * 32, 32, 32);
+ GL11.glPopMatrix();
+ this.drawString(fontRendererObj, curse.getDisplayName(), guiLeft + 70, guiTop + 12 + ind * (size - 8), 0xffffff);
+ // this.drawCenteredString(fontRendererObj,
+ // curse.getDescription(), this.width/2, 30 + ind * 34,
+ // 0xffffff);
+ ind++;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ }
+
+ @Override
+ protected void keyTyped(char charecter, int key)
+ {
+ super.keyTyped(charecter, key);
+ if (key == KeyBindings.curses.getKeyCode()) mc.thePlayer.closeScreen();
+ }
+
+ @Override
+ public void initGui() {
+ super.initGui();
+ int cornerX = guiLeft;
+ int cornerY = guiTop;
+ this.buttonList.clear();
+ TabRegistry.updateTabValues(cornerX, cornerY, TabCurses.class);
+ TabRegistry.addTabsToList(this.buttonList);
+ }
+
+ protected void mouseClicked(int x, int y, int id) {
+ super.mouseClicked(x, y, id);
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java index b9427d7..e91abc0 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java @@ -1,92 +1,93 @@ -package darkknight.jewelrycraft.client.gui; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.InventoryBasic; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import cpw.mods.fml.common.network.IGuiHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.client.JewelryInventory; -import darkknight.jewelrycraft.client.gui.container.ContainerCurseInfo; -import darkknight.jewelrycraft.client.gui.container.ContainerGuide; -import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier; -import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; -import darkknight.jewelrycraft.client.gui.container.ContainerRingChest; -import darkknight.jewelrycraft.util.Variables; - -public class GuiHandler implements IGuiHandler -{ - ResourceLocation pageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePage.png"); - ResourceLocation flippedPageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png"); - ResourceLocation chestTexture = new ResourceLocation(Variables.MODID, "textures/gui/chest_ring.png"); - ResourceLocation jewelryInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_tab.png"); - ResourceLocation jewlryModTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_modifier.png"); - - /** - * - */ - public GuiHandler() - { - NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this); - } - - /** - * @param ID - * @param player - * @param world - * @param x - * @param y - * @param z - * @return - */ - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - switch(ID) - { - case 0: - return new ContainerRingChest(player.inventory, (TileEntityChest)world.getTileEntity(x, y, z)); - case 1: - return new ContainerGuide(); - case 2: - return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)); - case 3: - return new ContainerJewelryModifier(player.inventory, new InventoryBasic("ItemModifier", false, 37)); - case 4: - return new ContainerCurseInfo(); - default: - return null; - } - } - - /** - * @param ID - * @param player - * @param world - * @param x - * @param y - * @param z - * @return - */ - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - switch(ID) - { - case 0: - return new GuiRingChest((ContainerRingChest)getServerGuiElement(ID, player, world, x, y, z), chestTexture); - case 1: - return new GuiGuide((ContainerGuide)getServerGuiElement(ID, player, world, x, y, z), world, pageTexture, flippedPageTexture); - case 2: - return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)), jewelryInvTexture); - case 3: - return new GuiJewelryModifier((ContainerJewelryModifier)getServerGuiElement(ID, player, world, x, y, z), jewlryModTexture); - case 4: - return new GuiCurseInfo((ContainerCurseInfo)getServerGuiElement(ID, player, world, x, y, z), world, player); - default: - return null; - } - } -} +package darkknight.jewelrycraft.client.gui;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.InventoryBasic;
+import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.client.JewelryInventory;
+import darkknight.jewelrycraft.client.gui.container.ContainerCurseInfo;
+import darkknight.jewelrycraft.client.gui.container.ContainerGuide;
+import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier;
+import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
+import darkknight.jewelrycraft.client.gui.container.ContainerRingChest;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiHandler implements IGuiHandler
+{
+ ResourceLocation pageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePage.png");
+ ResourceLocation flippedPageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png");
+ ResourceLocation chestTexture = new ResourceLocation(Variables.MODID, "textures/gui/chest_ring.png");
+ ResourceLocation jewelryInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_tab.png");
+ ResourceLocation cursesInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses_tab.png");
+ ResourceLocation jewlryModTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_modifier.png");
+
+ /**
+ *
+ */
+ public GuiHandler()
+ {
+ NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this);
+ }
+
+ /**
+ * @param ID
+ * @param player
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
+ {
+ switch(ID)
+ {
+ case 0:
+ return new ContainerRingChest(player.inventory, (TileEntityChest)world.getTileEntity(x, y, z));
+ case 1:
+ return new ContainerGuide();
+ case 2:
+ return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player));
+ case 3:
+ return new ContainerJewelryModifier(player.inventory, new InventoryBasic("ItemModifier", false, 37));
+ case 4:
+ return new ContainerCurseInfo();
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * @param ID
+ * @param player
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
+ {
+ switch(ID)
+ {
+ case 0:
+ return new GuiRingChest((ContainerRingChest)getServerGuiElement(ID, player, world, x, y, z), chestTexture);
+ case 1:
+ return new GuiGuide((ContainerGuide)getServerGuiElement(ID, player, world, x, y, z), world, pageTexture, flippedPageTexture);
+ case 2:
+ return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)), jewelryInvTexture);
+ case 3:
+ return new GuiJewelryModifier((ContainerJewelryModifier)getServerGuiElement(ID, player, world, x, y, z), jewlryModTexture);
+ case 4:
+ return new GuiCurseInfo((ContainerCurseInfo)getServerGuiElement(ID, player, world, x, y, z), world, player, cursesInvTexture);
+ default:
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java index fc4f15b..3ca0a20 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java @@ -1,74 +1,74 @@ -package darkknight.jewelrycraft.client.gui; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiInventory; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import darkknight.jewelrycraft.client.TabJewelry; -import darkknight.jewelrycraft.client.TabRegistry; -import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab; -import darkknight.jewelrycraft.events.KeyBindings; - -public class GuiJewelry extends GuiContainer -{ - ResourceLocation texture; - - /** - * @param containerJewelryTab - * @param texture - */ - public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture) - { - super(containerJewelryTab); - xSize = 194; - ySize = 166; - this.texture = texture; - } - - /** - * @param f - * @param mouseX - * @param mouseY - */ - @Override - public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) - { - GL11.glColor3f(1, 1, 1); - Minecraft.getMinecraft().getTextureManager().bindTexture(texture); - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - GL11.glPushMatrix(); - GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60, (float)(guiLeft - 24) - mouseX, (float)(guiTop + 124 - 90) - mouseY, this.mc.thePlayer); - GL11.glPopMatrix(); - } - - /** - * @param mouseX - * @param mouseY - */ - @Override - public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) - {} - - /** - * @param charecter - * @param key - */ - @Override - protected void keyTyped(char charecter, int key) - { - super.keyTyped(charecter, key); - if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen(); - } - - @Override - public void initGui () - { - super.initGui(); - int cornerX = guiLeft; - int cornerY = guiTop; - this.buttonList.clear(); - TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class); - TabRegistry.addTabsToList(this.buttonList); - } -} +package darkknight.jewelrycraft.client.gui;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.gui.inventory.GuiInventory;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.client.TabJewelry;
+import darkknight.jewelrycraft.client.TabRegistry;
+import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
+import darkknight.jewelrycraft.events.KeyBindings;
+
+public class GuiJewelry extends GuiContainer
+{
+ ResourceLocation texture;
+
+ /**
+ * @param containerJewelryTab
+ * @param texture
+ */
+ public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture)
+ {
+ super(containerJewelryTab);
+ xSize = 194;
+ ySize = 166;
+ this.texture = texture;
+ }
+
+ /**
+ * @param f
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
+ {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ GL11.glPushMatrix();
+ GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60, (float)(guiLeft - 24) - mouseX, (float)(guiTop + 124 - 90) - mouseY, this.mc.thePlayer);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
+ {}
+
+ /**
+ * @param charecter
+ * @param key
+ */
+ @Override
+ protected void keyTyped(char charecter, int key)
+ {
+ super.keyTyped(charecter, key);
+ if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen();
+ }
+
+ @Override
+ public void initGui ()
+ {
+ super.initGui();
+ int cornerX = guiLeft;
+ int cornerY = guiTop;
+ this.buttonList.clear();
+ TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class);
+ TabRegistry.addTabsToList(this.buttonList);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java index 115f3b1..8252f1a 100644 --- a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java +++ b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java @@ -33,6 +33,7 @@ public class ConfigHandler public static boolean CRYSTAL_GLOW;
public static boolean HEARTS_DESPAWN;
+ public static boolean JEWELRY_INFO;
public static boolean CURSES_ENABLED = true;
public static boolean CURSE_ROTTEN_HEART = true;
@@ -68,7 +69,7 @@ public class ConfigHandler INGOT_MELTING_TIME = config.getInt("Ingot Melting Time", categories[0], 1500, 5, Integer.MAX_VALUE, "This sets the number of ticks you need to wait before an ingot is completely smelted.");
GEM_PLACEMENT_TIME = config.getInt( "Jewelry Crafting Time", categories[0], 200, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for a jewel to be modified.");
RITUAL_TIME = config.getInt( "Ritual Time", categories[0], 1000, 5, Integer.MAX_VALUE, "This sets the number of ticks it takes for the ritual to end.");
- HEART_DESPAWN_TIME = config.getInt( "Hearts Despawn Time", categories[0], 600, 20, Integer.MAX_VALUE, "This sets the number of ticks it takes for hearts to despawn, 20=1 second");
+ HEART_DESPAWN_TIME = config.getInt( "Hearts Despawn Time", categories[0], 900, 20, Integer.MAX_VALUE, "This sets the number of ticks it takes for hearts to despawn, 20=1 second");
GENERATE_VILLAGE_NETHERSTAR = config.getBoolean("Netherstar Generation", categories[1], false, "If set to true Nether Stars will be able to generate in Jewelers chests.");
CAN_FURNACE_GENERATE_INGOTS = config.getBoolean("Furnace Ingots Generation", categories[1], true, "If set to true jewelers will generate ingots in furnaces.");
@@ -85,6 +86,7 @@ public class ConfigHandler CRYSTAL_GLOW = config.getBoolean("Crystal Glow", categories[2], false, "If true, then crystal will slowly glow (can cause lag)");
HEARTS_DESPAWN = config.getBoolean("Hearts Despawn", categories[2], true, "If false, then Hearts and Half-hearts will no longer despawn");
+ JEWELRY_INFO = config.getBoolean("Jewelry Info", categories[2], true, "If false, then extra info won't be show when hovering over a jewelery.");
ENABLE_WORLD_GEN = config.getBoolean("World Generation", categories[3], true, "If false, nothing will generate (this includes ore)");
ORE_GEN = config.getBoolean("Ore Generation", categories[3], true, "If false, ores won't generate");
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java index 932e23b..f7ab76f 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.curses;
import java.util.Random;
+
import darkknight.jewelrycraft.api.Curse;
import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.util.Variables;
@@ -39,4 +40,10 @@ public class CurseBlind extends Curse {
return 7;
}
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".blind");
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java index ed7cd2d..4a559b6 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java @@ -1,33 +1,39 @@ -package darkknight.jewelrycraft.curses; - -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -public class CurseFlamingSoul extends Curse -{ - public CurseFlamingSoul(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) - { - player.setFire(5); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_FLAMING_SOUL; - } -} +package darkknight.jewelrycraft.curses;
+
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+
+public class CurseFlamingSoul extends Curse
+{
+ public CurseFlamingSoul(String name, int txtID, String pack)
+ {
+ super(name, txtID, pack);
+ }
+
+ public void attackedByPlayerAction(World world, EntityPlayer player, Entity target)
+ {
+ player.setFire(5);
+ }
+
+ public String getDescription()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul.description");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world)
+ {
+ return ConfigHandler.CURSE_FLAMING_SOUL;
+ }
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java index be5dd83..37a774a 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java @@ -1,40 +1,46 @@ -package darkknight.jewelrycraft.curses; - -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -public class CurseGreed extends Curse -{ - public CurseGreed(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - @Override - public void action(World world, EntityPlayer player) - { - } - - @Override - public boolean itemToss() - { - return true; - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_GREED; - } -} +package darkknight.jewelrycraft.curses;
+
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+
+public class CurseGreed extends Curse
+{
+ public CurseGreed(String name, int txtID, String pack)
+ {
+ super(name, txtID, pack);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player)
+ {
+ }
+
+ @Override
+ public boolean itemToss()
+ {
+ return true;
+ }
+
+ public String getDescription()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed.description");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world)
+ {
+ return ConfigHandler.CURSE_GREED;
+ }
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java index c65d9b7..855277c 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java @@ -1,67 +1,74 @@ -/** - * - */ -package darkknight.jewelrycraft.curses; - -import java.util.ArrayList; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.event.world.BlockEvent; -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - * - */ -public class CurseHumbleBundle extends Curse -{ - protected CurseHumbleBundle(String name, int txtID, String texturepack) - { - super(name, txtID, texturepack); - } - - @Override - public void entityDropItems(EntityPlayer player, Entity target, ArrayList<EntityItem> drops) - { - for(EntityItem item: drops){ - ItemStack drop = item.getEntityItem().copy(); - target.entityDropItem(drop, 0.5F); - } - } - - public void onBlockItemsDrop(EntityPlayer player, BlockEvent.HarvestDropsEvent event) - { - for(ItemStack item: event.drops){ - ItemStack drop = item.copy(); - if(drop.getItem() != Item.getItemFromBlock(event.block)) dropItem(event.world, event.x, event.y, event.z, drop); - } - } - - public void dropItem(World world, double x, double y, double z, ItemStack stack) - { - EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); - entityitem.motionX = 0; - entityitem.motionZ = 0; - entityitem.motionY = 0.11000000298023224D; - world.spawnEntityInWorld(entityitem); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_HUMBLE_BUNDLE; - } -} +/**
+ *
+ */
+package darkknight.jewelrycraft.curses;
+
+import java.util.ArrayList;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.event.world.BlockEvent;
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.Variables;
+
+/**
+ * @author Sorin
+ *
+ */
+public class CurseHumbleBundle extends Curse
+{
+ protected CurseHumbleBundle(String name, int txtID, String texturepack)
+ {
+ super(name, txtID, texturepack);
+ }
+
+ @Override
+ public void entityDropItems(EntityPlayer player, Entity target, ArrayList<EntityItem> drops)
+ {
+ for(EntityItem item: drops){
+ ItemStack drop = item.getEntityItem().copy();
+ target.entityDropItem(drop, 0.5F);
+ }
+ }
+
+ public void onBlockItemsDrop(EntityPlayer player, BlockEvent.HarvestDropsEvent event)
+ {
+ for(ItemStack item: event.drops){
+ ItemStack drop = item.copy();
+ if(drop.getItem() != Item.getItemFromBlock(event.block)) dropItem(event.world, event.x, event.y, event.z, drop);
+ }
+ }
+
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ public String getDescription()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle.description");
+ }
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world)
+ {
+ return ConfigHandler.CURSE_HUMBLE_BUNDLE;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java index c30ca8a..138f322 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.curses;
import org.lwjgl.opengl.GL11;
+
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -70,6 +71,12 @@ public class CurseInfamy extends Curse {
return StatCollector.translateToLocal("curse." + Variables.MODID + ".infamy.description");
}
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".infamy");
+ }
@Override
public boolean canCurseBeActivated(World world)
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java index 198a0e0..8133b75 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.curses;
import java.util.Random;
+
import net.minecraft.block.Block;
import net.minecraft.block.BlockCompressed;
import net.minecraft.block.BlockPressurePlate;
@@ -96,6 +97,12 @@ public class CurseMidasTouch extends Curse {
return StatCollector.translateToLocal("curse." + Variables.MODID + ".midastouch.description");
}
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".midastouch");
+ }
@Override
public boolean canCurseBeActivated(World world)
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java index f59e92e..60608fb 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java @@ -15,7 +15,9 @@ import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.client.event.RenderHandEvent;
import net.minecraftforge.client.event.RenderPlayerEvent;
+
import org.lwjgl.opengl.GL11;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import darkknight.jewelrycraft.api.Curse;
@@ -23,82 +25,109 @@ import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.damage.DamageSourceList;
import darkknight.jewelrycraft.util.Variables;
-public class CursePentagram extends Curse
-{
- float rot = 0F;
-
- public CursePentagram(String name, int txtID, String pack)
- {
- super(name, txtID, pack);
- }
-
- @Override
- public void action(World world, EntityPlayer player)
- {
- // FMLInterModComms.sendMessage(modId, key, value);
- // GameRegistry.findItem("Botania", "flower");
- // FMLInterModComms.fetchRuntimeMessages(forMod)
- if (!world.isRemote){
- for(Object entity: world.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(player.boundingBox.minX - 0.5F, player.boundingBox.minY, player.boundingBox.minZ - 0.5F, player.boundingBox.maxX + 0.5F, player.boundingBox.maxY, player.boundingBox.maxZ + 0.5F))){
- if (entity instanceof EntityLivingBase && rand.nextInt(40) == 0){
- ((EntityLivingBase)entity).attackEntityFrom(DamageSourceList.shadows, 2f);
- if (player.shouldHeal()) player.heal(2F);
- else player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f);
- }
- }
- }
- }
-
- @Override
- public void attackedByPlayerAction(World world, EntityPlayer player, Entity target)
- {}
-
- @Override
- public void playerRender(EntityPlayer player, RenderPlayerEvent.Specials.Post event)
- {}
-
- @SideOnly (Side.CLIENT)
- public void playerHandRender(EntityPlayer player, RenderHandEvent event)
- {
- ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(Variables.MODID, "textures/gui/" + getTexturePack() + ".png");
- GL11.glPushMatrix();
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR);
- Tessellator tessellator = Tessellator.instance;
- TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
- texturemanager.bindTexture(PENTAGRAM_TEXTURE);
- GL11.glRotatef(rot, 0F, 1F, 0F);
- GL11.glTranslatef(-0.8F, (player.isSneaking() ? 0.1625F : 0F) + -1.6F, -0.8F);
- GL11.glRotatef(90F, 1F, 0F, 0F);
- GL11.glScalef(0.05F, 0.05F, 0.05F);
- rot += 3F;
- if (rot > 360F) rot = 0F;
- float f = 0.00390625F;
- float f1 = 0.00390625F;
- int x = 0;
- int y = 0;
- int u = 32 * 7;
- int v = 0;
- int width = 32;
- int height = 32;
- tessellator.startDrawingQuads();
- tessellator.addVertexWithUV((double)(x + 0), (double)(y + height), (double)0, (double)((float)(u + 0) * f), (double)((float)(v + height) * f1));
- tessellator.addVertexWithUV((double)(x + width), (double)(y + height), (double)0, (double)((float)(u + width) * f), (double)((float)(v + height) * f1));
- tessellator.addVertexWithUV((double)(x + width), (double)(y + 0), (double)0, (double)((float)(u + width) * f), (double)((float)(v + 0) * f1));
- tessellator.addVertexWithUV((double)(x + 0), (double)(y + 0), (double)0, (double)((float)(u + 0) * f), (double)((float)(v + 0) * f1));
- tessellator.draw();
- GL11.glDisable(GL11.GL_BLEND);
- GL11.glPopMatrix();
- }
-
- public String getDescription()
- {
- return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram.description");
- }
-
- @Override
- public boolean canCurseBeActivated(World world)
- {
- return ConfigHandler.CURSE_PENTAGRAM;
- }
+public class CursePentagram extends Curse {
+ float rot = 0F;
+
+ public CursePentagram(String name, int txtID, String pack) {
+ super(name, txtID, pack);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player) {
+ if (!world.isRemote) {
+ for (Object entity : world.getEntitiesWithinAABBExcludingEntity(player, AxisAlignedBB.getBoundingBox(player.boundingBox.minX - 0.5F, player.boundingBox.minY, player.boundingBox.minZ - 0.5F, player.boundingBox.maxX + 0.5F, player.boundingBox.maxY, player.boundingBox.maxZ + 0.5F))) {
+ if (entity instanceof EntityLivingBase && rand.nextInt(40) == 0) {
+ ((EntityLivingBase) entity).attackEntityFrom(DamageSourceList.shadows, 2f);
+ if (player.shouldHeal()) player.heal(2F);
+ else player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f);
+ }
+ }
+ }
+ }
+
+ @Override
+ public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) {
+ }
+
+ @Override
+ public void playerRender(EntityPlayer player, RenderPlayerEvent.Specials.Post event) {
+ ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(Variables.MODID, "textures/gui/" + getTexturePack() + ".png");
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR);
+ Tessellator tessellator = Tessellator.instance;
+ TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
+ texturemanager.bindTexture(PENTAGRAM_TEXTURE);
+ GL11.glRotatef(rot, 0F, 1F, 0F);
+ GL11.glTranslatef(-0.8F, (player.isSneaking() ? 0.1625F : 0F) + 1.5F, -0.8F);
+ GL11.glRotatef(90F, 1F, 0F, 0F);
+ GL11.glScalef(0.05F, 0.05F, 0.05F);
+ rot += 3F;
+ if (rot > 360F) rot = 0F;
+ float f = 0.00390625F;
+ float f1 = 0.00390625F;
+ int x = 0;
+ int y = 0;
+ int u = 32 * 7;
+ int v = 0;
+ int width = 32;
+ int height = 32;
+ tessellator.startDrawingQuads();
+ tessellator.addVertexWithUV((double) (x + 0), (double) (y + height), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + height) * f1));
+ tessellator.addVertexWithUV((double) (x + width), (double) (y + height), (double) 0, (double) ((float) (u + width) * f), (double) ((float) (v + height) * f1));
+ tessellator.addVertexWithUV((double) (x + width), (double) (y + 0), (double) 0, (double) ((float) (u + width) * f), (double) ((float) (v + 0) * f1));
+ tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + 0) * f1));
+ tessellator.draw();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glPopMatrix();
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void playerHandRender(EntityPlayer player, RenderHandEvent event) {
+ if (mc.gameSettings.thirdPersonView == 0) {
+ ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(Variables.MODID, "textures/gui/" + getTexturePack() + ".png");
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR);
+ Tessellator tessellator = Tessellator.instance;
+ TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
+ texturemanager.bindTexture(PENTAGRAM_TEXTURE);
+ GL11.glRotatef(rot, 0F, 1F, 0F);
+ GL11.glTranslatef(-0.8F, (player.isSneaking() ? 0.1625F : 0F) - 1.6F, -0.8F);
+ GL11.glRotatef(90F, 1F, 0F, 0F);
+ GL11.glScalef(0.05F, 0.05F, 0.05F);
+ rot += 3F;
+ if (rot > 360F) rot = 0F;
+ float f = 0.00390625F;
+ float f1 = 0.00390625F;
+ int x = 0;
+ int y = 0;
+ int u = 32 * 7;
+ int v = 0;
+ int width = 32;
+ int height = 32;
+ tessellator.startDrawingQuads();
+ tessellator.addVertexWithUV((double) (x + 0), (double) (y + height), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + height) * f1));
+ tessellator.addVertexWithUV((double) (x + width), (double) (y + height), (double) 0, (double) ((float) (u + width) * f), (double) ((float) (v + height) * f1));
+ tessellator.addVertexWithUV((double) (x + width), (double) (y + 0), (double) 0, (double) ((float) (u + width) * f), (double) ((float) (v + 0) * f1));
+ tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + 0) * f1));
+ tessellator.draw();
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glPopMatrix();
+ }
+ }
+
+ public String getDescription() {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram.description");
+ }
+
+ @Override
+ public String getDisplayName() {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world) {
+ return ConfigHandler.CURSE_PENTAGRAM;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java index b675954..ed4d294 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java @@ -4,6 +4,7 @@ package darkknight.jewelrycraft.curses;
import java.util.ArrayList;
+
import darkknight.jewelrycraft.api.Curse;
import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.entities.EntityHalfHeart;
@@ -64,6 +65,12 @@ public class CurseRabbitsPaw extends Curse {
return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw.description");
}
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw");
+ }
@Override
public boolean canCurseBeActivated(World world)
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java index afc05b0..5cb47cd 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java @@ -1,35 +1,41 @@ -package darkknight.jewelrycraft.curses; - -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -public class CurseRottenHeart extends Curse -{ - public CurseRottenHeart(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - @Override - public void action(World world, EntityPlayer player) - { - if (!player.isPotionActive(Potion.poison) || player.getActivePotionEffect(Potion.poison).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.poison.id, 80)); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return world.getWorldInfo().isHardcoreModeEnabled() ? false : ConfigHandler.CURSE_ROTTEN_HEART; - } -} +package darkknight.jewelrycraft.curses;
+
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+
+public class CurseRottenHeart extends Curse
+{
+ public CurseRottenHeart(String name, int txtID, String pack)
+ {
+ super(name, txtID, pack);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player)
+ {
+ if (!player.isPotionActive(Potion.poison) || player.getActivePotionEffect(Potion.poison).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.poison.id, 80));
+ }
+
+ public String getDescription()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart.description");
+ }
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world)
+ {
+ return world.getWorldInfo().isHardcoreModeEnabled() ? false : ConfigHandler.CURSE_ROTTEN_HEART;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java index 3c63641..c486e5d 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java @@ -1,40 +1,46 @@ -/** - * - */ -package darkknight.jewelrycraft.curses; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - * - */ -public class CurseVampireHunger extends Curse -{ - protected CurseVampireHunger(String name, int txtID, String texturepack) - { - super(name, txtID, texturepack); - } - - public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) - { - if(player.shouldHeal() && rand.nextInt(5) == 0) player.heal(1F); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_VAMPIRE_HUNGER; - } -} +/**
+ *
+ */
+package darkknight.jewelrycraft.curses;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.Variables;
+
+/**
+ * @author Sorin
+ *
+ */
+public class CurseVampireHunger extends Curse
+{
+ protected CurseVampireHunger(String name, int txtID, String texturepack)
+ {
+ super(name, txtID, texturepack);
+ }
+
+ public void attackedByPlayerAction(World world, EntityPlayer player, Entity target)
+ {
+ if(player.shouldHeal() && rand.nextInt(5) == 0) player.heal(1F);
+ }
+
+ public String getDescription()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger.description");
+ }
+
+ @Override
+ public String getDisplayName()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world)
+ {
+ return ConfigHandler.CURSE_VAMPIRE_HUNGER;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java b/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java index 6612c52..26f6d2e 100644 --- a/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java +++ b/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java @@ -22,121 +22,112 @@ import darkknight.jewelrycraft.util.Variables; /**
* @author Sorin
*/
-public class EntityHeart extends EntityLiving
-{
- public EntityHeart(World world)
- {
- super(world);
- this.setSize(0.4F, 0.4F);
- }
-
- protected void applyEntityAttributes()
- {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(getQuantity());
- }
-
- @Override
- public void updateEntityActionState()
- {
- if(ConfigHandler.HEARTS_DESPAWN) ++this.entityAge;
- }
-
- public void onLivingUpdate()
- {
- super.onLivingUpdate();
- if (ConfigHandler.HEARTS_DESPAWN && this.entityAge > ConfigHandler.HEART_DESPAWN_TIME) this.setDead();
- }
-
- protected void collideWithEntity(Entity entity)
- {
- super.collideWithEntity(entity);
- if (!this.worldObj.isRemote && entity instanceof EntityHeart && getType().equals(((EntityHeart)entity).getType())){
- setQuantity(getQuantity() + ((EntityHeart)entity).getQuantity());
- getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(getQuantity() + ((EntityHeart)entity).getQuantity());
- this.heal(getQuantity());
- entity.setDead();
- }
- }
-
- @Override
- public void onCollideWithPlayer(EntityPlayer player)
- {
- if (!this.worldObj.isRemote){
- NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- if (getType() == "Red" && player.getHealth() < player.getMaxHealth()){
- float healAmount = player.getMaxHealth() - player.getHealth();
- if (getQuantity() > healAmount){
- player.heal(healAmount);
- this.setQuantity(getQuantity() - healAmount);
- }else{
- player.heal(getQuantity());
- this.setDead();
- }
- }else if (getType().equals("White") && playerInfo.getFloat("WhiteHeart") > 0.1F){
- playerInfo.setFloat(getType() + "Heart", 0F);
- player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + playerInfo.getFloat("WhiteHeart"));
- this.setDead();
- }else if (getType() != "Red"){
- playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + getQuantity());
- JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
- this.setDead();
- }
- }
- }
-
- @SideOnly (Side.CLIENT)
- public boolean canRenderOnFire()
- {
- return false;
- }
-
- protected void entityInit()
- {
- super.entityInit();
- this.dataWatcher.addObject(16, "Red");
- this.dataWatcher.addObject(17, 2f);
- }
-
- public void writeEntityToNBT(NBTTagCompound nbt)
- {
- super.writeEntityToNBT(nbt);
- nbt.setString("Type", getType());
- nbt.setFloat("Quantity", getQuantity());
- }
-
- /**
- * (abstract) Protected helper method to read subclass entity data from NBT.
- */
- public void readEntityFromNBT(NBTTagCompound nbt)
- {
- super.readEntityFromNBT(nbt);
- setType(nbt.getString("Type"));
- setQuantity(nbt.getFloat("Quantity"));
- }
-
- public String getType()
- {
- return this.dataWatcher.getWatchableObjectString(16);
- }
-
- public void setType(String type)
- {
- this.dataWatcher.updateObject(16, type);
- }
-
- public Float getQuantity()
- {
- return this.dataWatcher.getWatchableObjectFloat(17);
- }
-
- public void setQuantity(Float qty)
- {
- this.dataWatcher.updateObject(17, qty);
- }
-
- public EnumCreatureAttribute getCreatureAttribute()
- {
- return JewelrycraftUtil.HEART;
- }
+public class EntityHeart extends EntityLiving {
+ public EntityHeart(World world) {
+ super(world);
+ this.setSize(0.4F, 0.4F);
+ }
+
+ protected void applyEntityAttributes() {
+ super.applyEntityAttributes();
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(getQuantity());
+ }
+
+ @Override
+ public void updateEntityActionState() {
+ if (ConfigHandler.HEARTS_DESPAWN) ++this.entityAge;
+ this.setCanPickUpLoot(true);
+ }
+
+ public void onLivingUpdate() {
+ super.onLivingUpdate();
+ if (ConfigHandler.HEARTS_DESPAWN && this.entityAge > ConfigHandler.HEART_DESPAWN_TIME) this.setDead();
+ }
+
+ protected void collideWithEntity(Entity entity) {
+ super.collideWithEntity(entity);
+ if (!this.worldObj.isRemote && entity instanceof EntityHeart && getType().equals(((EntityHeart) entity).getType())) {
+ setQuantity(getQuantity() + ((EntityHeart) entity).getQuantity());
+ getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(getQuantity() + ((EntityHeart) entity).getQuantity());
+ this.heal(getQuantity());
+ entity.setDead();
+ }
+ }
+
+ @Override
+ public void onCollideWithPlayer(EntityPlayer player) {
+ if (!this.worldObj.isRemote) {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
+ if (playerInfo != null) {
+ if (getType() == "Red" && player.getHealth() < player.getMaxHealth()) {
+ float healAmount = player.getMaxHealth() - player.getHealth();
+ if (getQuantity() > healAmount) {
+ player.heal(healAmount);
+ this.setQuantity(getQuantity() - healAmount);
+ } else {
+ player.heal(getQuantity());
+ this.setDead();
+ }
+ } else if (getType().equals("White") && playerInfo.getFloat("WhiteHeart") > 0.1F) {
+ playerInfo.setFloat(getType() + "Heart", 0F);
+ player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + playerInfo.getFloat("WhiteHeart"));
+ this.setDead();
+ } else if (getType().equals("Black") || getType().equals("Blue")) {
+ playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + getQuantity());
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ this.setDead();
+ }
+ }
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public boolean canRenderOnFire() {
+ return false;
+ }
+
+ protected void entityInit() {
+ super.entityInit();
+ this.dataWatcher.addObject(16, "Red");
+ this.dataWatcher.addObject(17, 2f);
+ }
+
+ public void writeEntityToNBT(NBTTagCompound nbt) {
+ super.writeEntityToNBT(nbt);
+ nbt.setString("Type", getType());
+ nbt.setFloat("Quantity", getQuantity());
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound nbt) {
+ super.readEntityFromNBT(nbt);
+ setType(nbt.getString("Type"));
+ setQuantity(nbt.getFloat("Quantity"));
+ }
+
+ public String getType() {
+ return this.dataWatcher.getWatchableObjectString(16);
+ }
+
+ public void setType(String type) {
+ this.dataWatcher.updateObject(16, type);
+ }
+
+ public Float getQuantity() {
+ return this.dataWatcher.getWatchableObjectFloat(17);
+ }
+
+ public void setQuantity(Float qty) {
+ this.dataWatcher.updateObject(17, qty);
+ }
+
+ public EnumCreatureAttribute getCreatureAttribute() {
+ return JewelrycraftUtil.HEART;
+ }
+
+ public boolean isEntityInvulnerable() {
+ return false;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java index 0bc2257..0419c7f 100644 --- a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java @@ -22,7 +22,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
+import net.minecraft.util.StatCollector;
import net.minecraft.util.WeightedRandom;
import net.minecraftforge.client.event.EntityViewRenderEvent;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
@@ -148,8 +150,7 @@ public class EntityEventHandler { JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
if (addedCurses) {
JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
- // player.openGui(JewelrycraftMod.instance, 4,
- // player.worldObj, 0, 0, 0);
+ player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("curse." + Variables.MODID + ".activated")));
addedCurses = false;
}
}
@@ -184,7 +185,7 @@ public class EntityEventHandler { if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- if (!(event.source.getEntity() instanceof EntityPlayer)) {
+ if (!(event.source.getEntity() instanceof EntityPlayer) && !player.capabilities.isCreativeMode) {
if (!player.worldObj.isRemote) for (int i = 0; i < 18; i++)
if (playerInfo.hasKey("ext" + i)) {
NBTTagCompound nbt = (NBTTagCompound) playerInfo.getTag("ext" + i);
@@ -207,7 +208,7 @@ public class EntityEventHandler { if (curse.canCurseBeActivated(player.worldObj) && playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player);
}
- if (!player.worldObj.isRemote && (float) player.hurtResistantTime <= (float) player.maxHurtResistantTime / 2.0F && !event.source.isUnblockable()) {
+ if (!player.worldObj.isRemote && !player.capabilities.isCreativeMode && (float) player.hurtResistantTime <= (float) player.maxHurtResistantTime / 2.0F && !event.source.isUnblockable()) {
if (playerInfo.getFloat("WhiteHeart") > 0) {
playerInfo.setFloat("WhiteHeart", 0f);
JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
@@ -232,7 +233,7 @@ public class EntityEventHandler { Iterator iterator = enemies.iterator();
while (iterator.hasNext()) {
Entity enemy = (Entity) iterator.next();
- enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount);
+ enemy.attackEntityFrom(DamageSourceList.blackHeart, 2f * event.ammount);
}
}
float damage = playerInfo.getFloat("BlackHeart") - event.ammount;
@@ -270,6 +271,7 @@ public class EntityEventHandler { }
if (ConfigHandler.CURSES_ENABLED) for (Curse curse : Curse.getCurseList())
if (curse.canCurseBeActivated(player.worldObj) && playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity);
+ if(entity instanceof EntityHeart && entity.getAge() < 50) event.setCanceled(true);
}
}
diff --git a/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java b/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java index 948a422..5104426 100644 --- a/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java +++ b/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java @@ -1,35 +1,38 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.client.settings.KeyBinding; -import org.lwjgl.input.Keyboard; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.InputEvent; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.network.PacketKeyPressEvent; -import darkknight.jewelrycraft.util.Variables; - -public class KeyBindings -{ - public static KeyBinding render = new KeyBinding("Pretty Render", Keyboard.KEY_Z, Variables.MODNAME); - public static KeyBinding inventory = new KeyBinding("Jewelry Inventory", Keyboard.KEY_J, Variables.MODNAME); - - /** - * - */ - public KeyBindings() - { - ClientRegistry.registerKeyBinding(render); - ClientRegistry.registerKeyBinding(inventory); - } - - /** - * @param event - */ - @SubscribeEvent - public void onKeyInput(InputEvent.KeyInputEvent event) - { - if (render.isPressed()) JewelrycraftMod.fancyRender = !JewelrycraftMod.fancyRender; - if (inventory.isPressed()) JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0)); - } +package darkknight.jewelrycraft.events;
+
+import net.minecraft.client.settings.KeyBinding;
+import org.lwjgl.input.Keyboard;
+import cpw.mods.fml.client.registry.ClientRegistry;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.InputEvent;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+import darkknight.jewelrycraft.util.Variables;
+
+public class KeyBindings
+{
+ public static KeyBinding render = new KeyBinding("Pretty Render", Keyboard.KEY_Z, Variables.MODNAME);
+ public static KeyBinding inventory = new KeyBinding("Jewelry Inventory", Keyboard.KEY_J, Variables.MODNAME);
+ public static KeyBinding curses = new KeyBinding("Curses Tab", Keyboard.KEY_C, Variables.MODNAME);
+
+ /**
+ *
+ */
+ public KeyBindings()
+ {
+ ClientRegistry.registerKeyBinding(render);
+ ClientRegistry.registerKeyBinding(inventory);
+ ClientRegistry.registerKeyBinding(curses);
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onKeyInput(InputEvent.KeyInputEvent event)
+ {
+ if (render.isPressed()) JewelrycraftMod.fancyRender = !JewelrycraftMod.fancyRender;
+ if (inventory.isPressed()) JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
+ if (curses.isPressed()) JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(1));
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java b/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java index b8df767..c86597e 100644 --- a/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java +++ b/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java @@ -15,84 +15,40 @@ import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.util.Variables;
-public class ScreenHandler extends Gui
-{
- private Minecraft mc;
- public static NBTTagCompound tagCache = null;
- public static int cooldown;
-
- public ScreenHandler(Minecraft mc)
- {
- super();
- this.mc = mc;
- }
-
- @SubscribeEvent
- public void renderScreen(RenderGameOverlayEvent event)
- {
- if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return;
- if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){
- int count = 0;
- int size = 32;
- ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
- if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){
- mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- if (ConfigHandler.CURSES_ENABLED) for(Curse curse: Curse.getCurseList()){
- if (curse.canCurseBeActivated(mc.theWorld) && tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){
- drawTexturedModalRect(-16, -16 + (size - 6) * count, 0, 32, 144, 60);
- count++;
- }
- }
- count = 0;
- if (ConfigHandler.CURSES_ENABLED) for(Curse curse: Curse.getCurseList())
- if (curse.canCurseBeActivated(mc.theWorld) && tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){
- mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
- int tag = curse.getTextureID();
- GL11.glPushMatrix();
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glScalef(0.45f, 0.45f, 0.0f);
- drawTexturedModalRect(28, 18 + (size + 26) * count, tag % 8 * size, tag / 8 * size, size, size);
- GL11.glPopMatrix();
- count++;
- }
- count = 0;
- size = 16;
- if (ConfigHandler.CURSES_ENABLED) for(Curse curse: Curse.getCurseList())
- if (curse.canCurseBeActivated(mc.theWorld) && tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){
- mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 30, 11 + (size + 10) * count, 16777215);
- if (tagCache.getInteger(curse.getName()) == 2){
- mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- GL11.glPushMatrix();
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- GL11.glColor4f(1f, 1f, 1f, 0.5f);
- drawTexturedModalRect(95, 7 + (size + 10) * count, 3 * size, 0, size, size);
- GL11.glPopMatrix();
- }
- count++;
- }
- }
- GL11.glPushMatrix();
- GL11.glColor4f(1f, 1f, 1f, 1.0f);
- mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- count = 0;
- size = 16;
- if (tagCache.getFloat("BlueHeart") > 0){
- drawTexturedModalRect(resolution.getScaledWidth()/2 + 90 + 35*count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size);
- mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), resolution.getScaledWidth()/2 + 105 + 35*count, resolution.getScaledHeight() - 16, 16777215);
- }
- count++;
- mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- if (tagCache.getFloat("BlackHeart") > 0){
- drawTexturedModalRect(resolution.getScaledWidth()/2 + 90 + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F))) - 14) + 35*count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size);
- mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), resolution.getScaledWidth()/2 + 105 + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F))) - 14) + 35*count, resolution.getScaledHeight() - 16, 16777215);
- }
- count++;
- mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- if (tagCache.getFloat("WhiteHeart") > 0)
- drawTexturedModalRect(resolution.getScaledWidth()/2 + 90 + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F))) - 14) + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F))) - 14) + 35*count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size);
- GL11.glPopMatrix();
- }
- }
+public class ScreenHandler extends Gui {
+ private Minecraft mc;
+ public static NBTTagCompound tagCache = null;
+ public static int cooldown;
+
+ public ScreenHandler(Minecraft mc) {
+ super();
+ this.mc = mc;
+ }
+
+ @SubscribeEvent
+ public void renderScreen(RenderGameOverlayEvent event) {
+ if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return;
+ int count = 0;
+ int size = 32;
+ ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
+ GL11.glPushMatrix();
+ GL11.glColor4f(1f, 1f, 1f, 1.0f);
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ count = 0;
+ size = 16;
+ if (tagCache.getFloat("BlueHeart") > 0) {
+ drawTexturedModalRect(resolution.getScaledWidth() / 2 + 90 + 35 * count, resolution.getScaledHeight() - 20, 0 * size, 0 * size, size, size);
+ mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F), resolution.getScaledWidth() / 2 + 105 + 35 * count, resolution.getScaledHeight() - 16, 16777215);
+ }
+ count++;
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ if (tagCache.getFloat("BlackHeart") > 0) {
+ drawTexturedModalRect(resolution.getScaledWidth() / 2 + 90 + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F))) - 14) + 35 * count, resolution.getScaledHeight() - 20, 1 * size, 0 * size, size, size);
+ mc.fontRenderer.drawStringWithShadow("x" + (MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F), resolution.getScaledWidth() / 2 + 105 + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F))) - 14) + 35 * count, resolution.getScaledHeight() - 16, 16777215);
+ }
+ count++;
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ if (tagCache.getFloat("WhiteHeart") > 0) drawTexturedModalRect(resolution.getScaledWidth() / 2 + 90 + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlueHeart")) / 2.0F))) - 14) + (mc.fontRenderer.getStringWidth(String.valueOf((MathHelper.ceiling_float_int(tagCache.getFloat("BlackHeart")) / 2.0F))) - 14) + 35 * count, resolution.getScaledHeight() - 20, 2 * size, 1 * size, size, size);
+ GL11.glPopMatrix();
+ }
}
\ No newline at end of file diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java index 204ec9b..f5dafb8 100644 --- a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java @@ -32,6 +32,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly;
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.api.ModifierEffects;
+import darkknight.jewelrycraft.config.ConfigHandler;
import darkknight.jewelrycraft.util.JewelryNBT;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.Variables;
@@ -79,7 +80,7 @@ public abstract class ItemBaseJewelry extends Item */
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
- if (stack.hasTagCompound()){
+ if (stack.hasTagCompound() && ConfigHandler.JEWELRY_INFO){
ItemStack ingot = JewelryNBT.ingot(stack);
if (ingot != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0) list.add(StatCollector.translateToLocal("info." + Variables.MODID + ".metal") + ": " + EnumChatFormatting.YELLOW + ingot.getDisplayName().replace(StatCollector.translateToLocal("info." + Variables.MODID + ".ingot"), " "));
ItemStack gem = JewelryNBT.gem(stack);
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java b/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java index e2f339d..1962aa8 100644 --- a/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java @@ -119,8 +119,11 @@ public class ModelShadowEye extends ModelBase { else { Eye.rotateAngleX = 0F; - Eye.rotateAngleY = 0F; - Eye.rotateAngleZ = 0F; + Eye.rotateAngleZ = 0F; + if (f3 == 0) Eye.rotateAngleY = (float) (0.5F*Math.PI); + else if (f3 == 1) Eye.rotateAngleY = (float) (Math.PI); + else if (f3 == 2) Eye.rotateAngleY = (float) (1.5F*Math.PI); + else if (f3 == 3) Eye.rotateAngleY = (float) (0F*Math.PI); } } diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java b/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java index 13d0969..34e8364 100644 --- a/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java @@ -1,59 +1,60 @@ -package darkknight.jewelrycraft.network; - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import darkknight.jewelrycraft.JewelrycraftMod; - -public class PacketKeyPressEvent implements IMessage, IMessageHandler<PacketKeyPressEvent, IMessage> -{ - public int actionID; - - /** - * @param id - */ - public PacketKeyPressEvent(int id) - { - actionID = id; - } - - /** - * - */ - public PacketKeyPressEvent() - {} - - /** - * @param message - * @param ctx - * @return - */ - @Override - public IMessage onMessage(PacketKeyPressEvent message, MessageContext ctx) - { - EntityPlayer sender = ctx.getServerHandler().playerEntity; - // Jewelry inventory - if (message.actionID == 0) sender.openGui(JewelrycraftMod.instance, 2, sender.worldObj, (int)sender.posX, (int)sender.posY, (int)sender.posZ); - return null; - } - - /** - * @param buf - */ - @Override - public void fromBytes(ByteBuf buf) - { - actionID = buf.readInt(); - } - - /** - * @param buf - */ - @Override - public void toBytes(ByteBuf buf) - { - buf.writeInt(actionID); - } -} +package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.entity.player.EntityPlayer;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class PacketKeyPressEvent implements IMessage, IMessageHandler<PacketKeyPressEvent, IMessage>
+{
+ public int actionID;
+
+ /**
+ * @param id
+ */
+ public PacketKeyPressEvent(int id)
+ {
+ actionID = id;
+ }
+
+ /**
+ *
+ */
+ public PacketKeyPressEvent()
+ {}
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketKeyPressEvent message, MessageContext ctx)
+ {
+ EntityPlayer sender = ctx.getServerHandler().playerEntity;
+ // Jewelry inventory
+ if (message.actionID == 0) sender.openGui(JewelrycraftMod.instance, 2, sender.worldObj, (int)sender.posX, (int)sender.posY, (int)sender.posZ);
+ if (message.actionID == 1) sender.openGui(JewelrycraftMod.instance, 4, sender.worldObj, (int)sender.posX, (int)sender.posY, (int)sender.posZ);
+ return null;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {
+ actionID = buf.readInt();
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {
+ buf.writeInt(actionID);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java b/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java index ba70925..dbb68be 100644 --- a/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java +++ b/src/main/java/darkknight/jewelrycraft/proxy/ClientProxy.java @@ -14,6 +14,7 @@ import darkknight.jewelrycraft.JewelrycraftMod; import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.block.render.BlockCrystalRenderer;
import darkknight.jewelrycraft.client.InventoryTabVanilla;
+import darkknight.jewelrycraft.client.TabCurses;
import darkknight.jewelrycraft.client.TabJewelry;
import darkknight.jewelrycraft.client.TabRegistry;
import darkknight.jewelrycraft.entities.EntityHalfHeart;
@@ -106,6 +107,7 @@ public class ClientProxy extends CommonProxy TabRegistry.registerTab(new InventoryTabVanilla());
TabRegistry.registerTab(new TabJewelry());
+ TabRegistry.registerTab(new TabCurses());
MinecraftForge.EVENT_BUS.register(new TabRegistry());
MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler());
MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft()));
diff --git a/src/main/resources/assets/jewelrycraft2/Changelog.txt b/src/main/resources/assets/jewelrycraft2/Changelog.txt index eef8146..82c1a2f 100644 --- a/src/main/resources/assets/jewelrycraft2/Changelog.txt +++ b/src/main/resources/assets/jewelrycraft2/Changelog.txt @@ -1,81 +1,65 @@ -Both 1.6.4 and 1.7.10 -- Fixed bug with Natura causing the game to crash -Only 1.7.10 -- Updated the mod to Minecraft 1.7.10 -- Added more config options regarding Jeweler house generation -- Reduced the number of possible jewelers to spawn in a village to 1 -- Added Molten Metal and Molten Metal Buckets -- Buckets of the molten metal can be obtained either by filling a smelter with the metal of your choice and then right clicking the smelter with an empty bucket, -or by destroying the filled smelter, causing the metal to pour out and then use a bucket to pick it up. -- Smelters now spawn molten metal, if they have any, when broken -- Added the possibility to smelt ores -- Smelted ores give double the amount of ingots -- Jewelers houses now have a chance to also generate ores -- Jewelers can sell ores now -- Fixed a bug where the first time you would pour metal in a molder it would generate 2 items instead of one - -TODO -- Make a way so that the ingot affects the jewels somehow -- Add a ring of Resistance -- Think of a way to balance the rings -- (MAYBE) Shadow Ring -> Shadow ingot ring, nether star, obsidian - makes you appear as hostile so mobs actually leave you alone -- Elemental jewellery -> punch a creature with it in your hand to do different things, lightning, fling into the air, set on fire, - encase in ice/fences/iron bars, turn into a sheep (like that spell from Warcraft 2, if anyone remembers that), blindness, extreme - knockback, charm (turns on your enemies), tame - tames any tamable mob -!- Add Necklaces, bracelets and earrings; Necklaces could have an AOE effect; -- Shadow armor and tools -- Add an item that can store rings (maybe a keychain?) -- Monks Ring -> ups your unarmed damage / block breaking speed / ability to break harder blocks with bare hands, made with a block of iron and a jewel. -- Ring of Strength -> self explanatory -- (MAYBE) Add a Shadow Merchant (a villager that trades only shadow related stuff and appears randomly at night) -- Add a blast protection jewelry -- Add a jewelery of the Arrow Catcher - each tier of protection gives you a certain % chance of catching arrows instead of being hit by them. -- (MAYBE) Render the rings on the character -- In the case of passive benefits, might it be possible to make it so, with fire resistance for example, it refreshes the buff as long as you're not in fire, - but as soon as you are it gains a limited duration (better jewels for longer durations) that, when it expires there goes the buff and you can burn to death. - Then you'd need to avoid being on fire for a cooldown period of a few seconds before it could refresh back to the passive state (this part reduced by better jewels)? - Invisibility could turn off for a period when you punch a mob, that kind of thing. -- Glowstone Block (Modifier): Places a torch-like blob of light in exchange for 1/2 a heart, higher-tier jewels increase the light emitted. -- Ghast Tear (Modifier): Allows for a limited-duration flight buff, say starting at 3 seconds all the way to 60 when combined with a nether star. When the timer expires - you have to land again to reset the usage. -- Any Color Dye (Modifier): Right-click a sheep to dye it the chosen color. Posted Image -- Beacon (Modifier): Portable beacon, with the tier based on the jewel added. Shift + Right-click to open the beacon GUI, which would work just like the vanilla one. -- Water Bucket (Modifier): Right-click the air to start a storm. -- Lava Bucket (Modifier): Passively adds fire aspect to your weapons and tools. -- Sand (Modifier): Shift + right-click to advance the day 1 hour. Only usable once per day by default, better jewels increase this. -- Glass (Jewel): Right-click while holding the ring to zoom in! -- Lapis Piece (Modifier): Passively adds a slowing effect to your weapons. Better jewels improve this. -- Lapis Block (Jewel): A jewel that looks pretty but doesn't do much else. -- Bone (Jewel): Right-click to trade 1/2 a hunger for a bonemeal effect. Otherwise a white jewel with no benefit. -- Carrot (Modifier): Right-click to trade 1/2 a heart for 1/2 a hunger. Better jewels increase these values. 4 hearts for a steaks-worth of food? XD -- Diamond Block (Jewel): When on a gold ring it turns it into "Ostentatious Wedding Ring". Otherwise the same (or a little better than) diamond. -- Golden Apple (Jewel): Ring becomes named "Discord". Right-clicking gives an entirely random buff, a debuff, launches you high into the air, teleports you to a - random location, sets you on fire, spawns a pig or makes lightning strike. Pretty much anything can happen, and the more biased to negative results the better. :P -- Enchanted Golden Apple (Jewel): As above, but more biased towards positive effects. Hail Discordia! -- Name Tag (Jewel): Right-clicking a mob gives it a random name (bonus points if it's from a user-editable list!) -- Add randomly generated "named" loot to dungeon chests! Ring of Displacement (lets you tele randomly like an enderman), Necklace of Second Chances - (heals you for 50 when you drop to 3 or fewer hearts with a cooldown of ~1 minute), Trinket of the Gale (arrow/fireball immunity!), Goggles of the Merfolk - (water breathing!). Endless possibilities! :D -- Also! Trinkets and Belts! - -Trinkets would probably require a new mold, and should bring out the more passive side of items (like, say, instead of opening an enderchest, it automatically -sucks items into your ender chest, or instead of teleporting you it prevents endermen from teleporting away from you [which could be done pretty easily with a -fake screen overlay that's treated like the pumpkin one]). - -Belts... I'd personally see belts as a ring crafted with a piece of Leather as the "jewel" and could provide conditional buffs proportionate to some factor, like -say increasing strength buff the lower your HP is. The idea being that the belt should assist you in a useful way, but only when its needed. I'd probably limit it -to HP and Hunger as determining factors. Things like resistance, regeneration and strength could be applied at low HP, while things like jump boost, haste and speed -could be applied at high hunger meter values. I wouldn't tie anything to having high/max HP or no hunger since those would be things that players normally try to -avoid or always have. - -And as for goggles... A new mold for the base goggle template, and have it only accept "jewel"-typed items (as "lenses"). If you can't think of where to put a neat -effect it should probably end up on goggles. Off the top of my head I can think of a few neat uses: Ore Radar (2x diamonds), Clear Vision (2x glass), Mob Spawnable -Area Highlighting (2x ender pearl), Compass and Clock overlays (doy), Coordinate HUD (map and glass), Speedometer (glass and enderpearl), Altimiter (glass and emerald), -Thermometer (diamond and glass)... Required Pickaxe Level HUD (no idea). XD - -Oooh! And last but not least: Cursed items! I'd probably start with an upgraded jewelry table requiring a regular one, a brewing stand, a piece of glass and a stick. -You could initially use this upgraded stand to add additional effects, or merge two items into one. Should operate kind of like a furnace, but only accepts blaze powder -and rods as fuel (about 1 rod or 2 powder = 1 process, the idea being using the blaze stuff like welding materials). But the other use would be cursing jewelry! Why? -Because nothing says "I hate you so much." like a non-dequipable piece of jewelry that gives you blindness and slowness! Slimeballs could add a cursed sticky effect -that prevents you dropping it without dying. Fermented spider eye, like with brewing potions, could corrupt the effects on the item. Flint and steel could randomly set +TODO
+- Make a way so that the ingot affects the jewels somehow
+- Add a ring of Resistance
+- Think of a way to balance the rings
+- (MAYBE) Shadow Ring -> Shadow ingot ring, nether star, obsidian - makes you appear as hostile so mobs actually leave you alone
+- Elemental jewellery -> punch a creature with it in your hand to do different things, lightning, fling into the air, set on fire,
+ encase in ice/fences/iron bars, turn into a sheep (like that spell from Warcraft 2, if anyone remembers that), blindness, extreme
+ knockback, charm (turns on your enemies), tame - tames any tamable mob
+!- Add Necklaces, bracelets and earrings; Necklaces could have an AOE effect;
+- Shadow armor and tools
+- Add an item that can store rings (maybe a keychain?)
+- Monks Ring -> ups your unarmed damage / block breaking speed / ability to break harder blocks with bare hands, made with a block of iron and a jewel.
+- Ring of Strength -> self explanatory
+- (MAYBE) Add a Shadow Merchant (a villager that trades only shadow related stuff and appears randomly at night)
+- Add a blast protection jewelry
+- Add a jewelery of the Arrow Catcher - each tier of protection gives you a certain % chance of catching arrows instead of being hit by them.
+- (MAYBE) Render the rings on the character
+- In the case of passive benefits, might it be possible to make it so, with fire resistance for example, it refreshes the buff as long as you're not in fire,
+ but as soon as you are it gains a limited duration (better jewels for longer durations) that, when it expires there goes the buff and you can burn to death.
+ Then you'd need to avoid being on fire for a cooldown period of a few seconds before it could refresh back to the passive state (this part reduced by better jewels)?
+ Invisibility could turn off for a period when you punch a mob, that kind of thing.
+- Glowstone Block (Modifier): Places a torch-like blob of light in exchange for 1/2 a heart, higher-tier jewels increase the light emitted.
+- Ghast Tear (Modifier): Allows for a limited-duration flight buff, say starting at 3 seconds all the way to 60 when combined with a nether star. When the timer expires
+ you have to land again to reset the usage.
+- Any Color Dye (Modifier): Right-click a sheep to dye it the chosen color. Posted Image
+- Beacon (Modifier): Portable beacon, with the tier based on the jewel added. Shift + Right-click to open the beacon GUI, which would work just like the vanilla one.
+- Water Bucket (Modifier): Right-click the air to start a storm.
+- Lava Bucket (Modifier): Passively adds fire aspect to your weapons and tools.
+- Sand (Modifier): Shift + right-click to advance the day 1 hour. Only usable once per day by default, better jewels increase this.
+- Glass (Jewel): Right-click while holding the ring to zoom in!
+- Lapis Piece (Modifier): Passively adds a slowing effect to your weapons. Better jewels improve this.
+- Lapis Block (Jewel): A jewel that looks pretty but doesn't do much else.
+- Bone (Jewel): Right-click to trade 1/2 a hunger for a bonemeal effect. Otherwise a white jewel with no benefit.
+- Carrot (Modifier): Right-click to trade 1/2 a heart for 1/2 a hunger. Better jewels increase these values. 4 hearts for a steaks-worth of food? XD
+- Diamond Block (Jewel): When on a gold ring it turns it into "Ostentatious Wedding Ring". Otherwise the same (or a little better than) diamond.
+- Golden Apple (Jewel): Ring becomes named "Discord". Right-clicking gives an entirely random buff, a debuff, launches you high into the air, teleports you to a
+ random location, sets you on fire, spawns a pig or makes lightning strike. Pretty much anything can happen, and the more biased to negative results the better. :P
+- Enchanted Golden Apple (Jewel): As above, but more biased towards positive effects. Hail Discordia!
+- Name Tag (Jewel): Right-clicking a mob gives it a random name (bonus points if it's from a user-editable list!)
+- Add randomly generated "named" loot to dungeon chests! Ring of Displacement (lets you tele randomly like an enderman), Necklace of Second Chances
+ (heals you for 50 when you drop to 3 or fewer hearts with a cooldown of ~1 minute), Trinket of the Gale (arrow/fireball immunity!), Goggles of the Merfolk
+ (water breathing!). Endless possibilities! :D
+- Also! Trinkets and Belts!
+
+Trinkets would probably require a new mold, and should bring out the more passive side of items (like, say, instead of opening an enderchest, it automatically
+sucks items into your ender chest, or instead of teleporting you it prevents endermen from teleporting away from you [which could be done pretty easily with a
+fake screen overlay that's treated like the pumpkin one]).
+
+Belts... I'd personally see belts as a ring crafted with a piece of Leather as the "jewel" and could provide conditional buffs proportionate to some factor, like
+say increasing strength buff the lower your HP is. The idea being that the belt should assist you in a useful way, but only when its needed. I'd probably limit it
+to HP and Hunger as determining factors. Things like resistance, regeneration and strength could be applied at low HP, while things like jump boost, haste and speed
+could be applied at high hunger meter values. I wouldn't tie anything to having high/max HP or no hunger since those would be things that players normally try to
+avoid or always have.
+
+And as for goggles... A new mold for the base goggle template, and have it only accept "jewel"-typed items (as "lenses"). If you can't think of where to put a neat
+effect it should probably end up on goggles. Off the top of my head I can think of a few neat uses: Ore Radar (2x diamonds), Clear Vision (2x glass), Mob Spawnable
+Area Highlighting (2x ender pearl), Compass and Clock overlays (doy), Coordinate HUD (map and glass), Speedometer (glass and enderpearl), Altimiter (glass and emerald),
+Thermometer (diamond and glass)... Required Pickaxe Level HUD (no idea). XD
+
+Oooh! And last but not least: Cursed items! I'd probably start with an upgraded jewelry table requiring a regular one, a brewing stand, a piece of glass and a stick.
+You could initially use this upgraded stand to add additional effects, or merge two items into one. Should operate kind of like a furnace, but only accepts blaze powder
+and rods as fuel (about 1 rod or 2 powder = 1 process, the idea being using the blaze stuff like welding materials). But the other use would be cursing jewelry! Why?
+Because nothing says "I hate you so much." like a non-dequipable piece of jewelry that gives you blindness and slowness! Slimeballs could add a cursed sticky effect
+that prevents you dropping it without dying. Fermented spider eye, like with brewing potions, could corrupt the effects on the item. Flint and steel could randomly set
you on fire. Eye of Ender could randomly tell the world your coordinates.
\ No newline at end of file diff --git a/src/main/resources/assets/jewelrycraft2/TODO.txt b/src/main/resources/assets/jewelrycraft2/TODO.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/main/resources/assets/jewelrycraft2/TODO.txt diff --git a/src/main/resources/assets/jewelrycraft2/lang/en_US.lang b/src/main/resources/assets/jewelrycraft2/lang/en_US.lang index 0d0cee7..ec05cce 100644 --- a/src/main/resources/assets/jewelrycraft2/lang/en_US.lang +++ b/src/main/resources/assets/jewelrycraft2/lang/en_US.lang @@ -118,6 +118,19 @@ curse.jewelrycraft2.rabbitspaw.description=The Dark Lord is giving you a gift. D curse.jewelrycraft2.rottenheart.description=Your heart slowly rots inside
curse.jewelrycraft2.vampirehunger.description=You feel the need for blood
+curse.jewelrycraft2.blind=Blind
+curse.jewelrycraft2.flamingsoul=Flaming Soul
+curse.jewelrycraft2.greed=Greed
+curse.jewelrycraft2.humblebundle=2 for 1
+curse.jewelrycraft2.infamy=Infamy
+curse.jewelrycraft2.midastouch=Midas Touch
+curse.jewelrycraft2.pentagram=Pentagram
+curse.jewelrycraft2.rabbitspaw=Rabbit's Paw
+curse.jewelrycraft2.rottenheart=Rotten Heart
+curse.jewelrycraft2.vampirehunger=Vampire Hunger
+
+curse.jewelrycraft2.activated=You got cursed, press C to open the tab to see the active curses.
+
death.attack.weak=%1$s was weakened by a piece of jewelry and died
death.attack.shadows=%1$s was consumed by the shadows
death.attack.blackHeart=%1$s was killed by %2$s's curse
diff --git a/src/main/resources/assets/jewelrycraft2/textures/gui/curses_tab.png b/src/main/resources/assets/jewelrycraft2/textures/gui/curses_tab.png Binary files differnew file mode 100644 index 0000000..5c5ef83 --- /dev/null +++ b/src/main/resources/assets/jewelrycraft2/textures/gui/curses_tab.png diff --git a/src/main/resources/assets/jewelrycraft2/textures/gui/hearts.png b/src/main/resources/assets/jewelrycraft2/textures/gui/hearts.png Binary files differindex 3ac201f..4238307 100644 --- a/src/main/resources/assets/jewelrycraft2/textures/gui/hearts.png +++ b/src/main/resources/assets/jewelrycraft2/textures/gui/hearts.png |
