Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Thor597

Forge Modder
  • Posts

    268
  • Joined

  • Last visited

Everything posted by Thor597

  1. Did you read what I said? I asked for something more informational, I've been trying for over a year and I know what classes I potentionally need to use
  2. Ok, I've been seeing alot of different topics and posts about how to have multiple biomes in a dimension and in all of these the people that reply either have no idea what theyre talking about or just reply with "Oh look around" So I ask of people who know how this: PLEASE write some sort of tutorial on how to do this step by step maybe do a video or something as this would be a godsend for all dimension mod makers that are limited to the knowledge of only having one biome with WorldChunkManagerHell which lets you have only one biome. It's one of the most frustrating things to try to figure out when making a dimension. I should know since me and others have been trying to do this for nearly a year and we havent come that far. Thanks in advance -Thor
  3. I posted this in general discussion first by accident So I'm trying to render a blur over the player's view like a pumkin when in the dimension im working on but no matter what i do it just wont work TickHandler: package arcticraft.main; import java.util.EnumSet; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.src.ModLoader; import net.minecraft.util.Icon; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import arcticraft.blocks.BlockACWaterFlowing; import arcticraft.blocks.BlockACWaterStill; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.RENDER))) { float ticks = ((Float)tickData[0]).floatValue(); onRenderTickStart(ticks); } } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.PLAYER))) { EntityPlayer player = (EntityPlayer)tickData[0]; } else if (type.equals(EnumSet.of(TickType.RENDER))) { float ticks = ((Float)tickData[0]).floatValue(); onRenderTickEnd(ticks); GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen; if (guiscreen != null && ModLoader.getMinecraftInstance().thePlayer != null) { onTickInGUI(guiscreen); } } else if (type.equals(EnumSet.of(TickType.CLIENT))) { if(ModLoader.getMinecraftInstance().thePlayer != null){ onTickInGame(); } } } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.RENDER, TickType.CLIENT, TickType.PLAYER); // In my testing only RENDER, CLIENT, & PLAYER did anything on the client side. // Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types } @Override public String getLabel() { return null; } private boolean keyStates[]; /**Key checking function**/ public boolean checkKey(int i) { keyStates = new boolean[256]; if(ModLoader.getMinecraftInstance().currentScreen != null) { return false; } if(Keyboard.isKeyDown(i) != keyStates[i]) { return keyStates[i] = !keyStates[i]; } else { return false; } } private Minecraft mc = FMLClientHandler.instance().getClient(); public void onRenderTickStart(float ticks) { } public void onRenderTickEnd(float ticks) { ScaledResolution var5 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); int var6 = var5.getScaledWidth(); int var7 = var5.getScaledHeight(); if(mc.currentScreen == null) { ACLivingEvent.renderFreezeEffect(var6, var7, mc); } } public void onTickInGUI(GuiScreen gui) { } public void onTickInGame() { } } Event File: package arcticraft.main; import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.block.BlockFluid; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.EntityLiving; import net.minecraft.src.ModLoader; import net.minecraft.util.MathHelper; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.*; import net.minecraftforge.event.entity.player.PlayerEvent; public class ACLivingEvent { public static boolean isFreezing = false; @ForgeSubscribe public void playerEvent(PlayerEvent event) { if(event.entityPlayer.dimension == MainRegistry.dimension) { this.isFreezing = true; } } public static void renderFreezeEffect(int par1, int par2, Minecraft mc) { if (isFreezing) { Minecraft mc8 = ModLoader.getMinecraftInstance(); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc8.renderEngine.getTexture("/mods/AC/textures/misc/freezing.png")); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, par2, -90D, 0.0D, 1.0D); tessellator.addVertexWithUV(par1, par2, -90D, 1.0D, 1.0D); tessellator.addVertexWithUV(par1, 0.0D, -90D, 1.0D, 0.0D); tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } } } MainRegistry.dimension = public static int dimension = DimensionManager.getNextFreeDimId(); Event Registering line in MainRegistry: MinecraftForge.EVENT_BUS.register(new ACLivingEvent()); Any ideas?
  4. So I'm trying to render a blur over the player's view like a pumkin when in the dimension im working on but no matter what i do it just wont work TickHandler: package arcticraft.main; import java.util.EnumSet; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.src.ModLoader; import net.minecraft.util.Icon; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; import arcticraft.blocks.BlockACWaterFlowing; import arcticraft.blocks.BlockACWaterStill; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TickHandler implements ITickHandler { @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.RENDER))) { float ticks = ((Float)tickData[0]).floatValue(); onRenderTickStart(ticks); } } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { if (type.equals(EnumSet.of(TickType.PLAYER))) { EntityPlayer player = (EntityPlayer)tickData[0]; } else if (type.equals(EnumSet.of(TickType.RENDER))) { float ticks = ((Float)tickData[0]).floatValue(); onRenderTickEnd(ticks); GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen; if (guiscreen != null && ModLoader.getMinecraftInstance().thePlayer != null) { onTickInGUI(guiscreen); } } else if (type.equals(EnumSet.of(TickType.CLIENT))) { if(ModLoader.getMinecraftInstance().thePlayer != null){ onTickInGame(); } } } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.RENDER, TickType.CLIENT, TickType.PLAYER); // In my testing only RENDER, CLIENT, & PLAYER did anything on the client side. // Read 'cpw.mods.fml.common.TickType.java' for a full list and description of available types } @Override public String getLabel() { return null; } private boolean keyStates[]; /**Key checking function**/ public boolean checkKey(int i) { keyStates = new boolean[256]; if(ModLoader.getMinecraftInstance().currentScreen != null) { return false; } if(Keyboard.isKeyDown(i) != keyStates[i]) { return keyStates[i] = !keyStates[i]; } else { return false; } } private Minecraft mc = FMLClientHandler.instance().getClient(); public void onRenderTickStart(float ticks) { } public void onRenderTickEnd(float ticks) { ScaledResolution var5 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); int var6 = var5.getScaledWidth(); int var7 = var5.getScaledHeight(); if(mc.currentScreen == null) { ACLivingEvent.renderFreezeEffect(var6, var7, mc); } } public void onTickInGUI(GuiScreen gui) { } public void onTickInGame() { } } Event File: package arcticraft.main; import org.lwjgl.opengl.GL11; import net.minecraft.block.Block; import net.minecraft.block.BlockFluid; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.EntityLiving; import net.minecraft.src.ModLoader; import net.minecraft.util.MathHelper; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.living.*; import net.minecraftforge.event.entity.player.PlayerEvent; public class ACLivingEvent { public static boolean isFreezing = false; @ForgeSubscribe public void playerEvent(PlayerEvent event) { if(event.entityPlayer.dimension == MainRegistry.dimension) { this.isFreezing = true; } } public static void renderFreezeEffect(int par1, int par2, Minecraft mc) { if (isFreezing) { Minecraft mc8 = ModLoader.getMinecraftInstance(); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc8.renderEngine.getTexture("/mods/AC/textures/misc/freezing.png")); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, par2, -90D, 0.0D, 1.0D); tessellator.addVertexWithUV(par1, par2, -90D, 1.0D, 1.0D); tessellator.addVertexWithUV(par1, 0.0D, -90D, 1.0D, 0.0D); tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } } } MainRegistry.dimension = public static int dimension = DimensionManager.getNextFreeDimId(); Event Registering line in MainRegistry: MinecraftForge.EVENT_BUS.register(new ACLivingEvent()); Any ideas?
  5. How would one go about making a custom sun and moon texture in your new dimension using the DimensionManager in forge?
  6. When I try to reobfuscate this happens: == MCP 7.25 (data: 7.25, client: 1.4.6, server: 1.4.6) == # found ff, ff patches, srgs, name csvs, doc csvs, param csvs, renumber csv, ast yle, astyle config > Creating Retroguard config files == Reobfuscating client == > Cleaning reobf > Generating md5s > Packing jar > Reobfuscating jar > Extracting modified classes - Done in 12.37 seconds !! Can not find server md5s !! Press any key to continue . . .
  7. I kind of need this for tomorrow as I am releasing my christmas update
  8. It works fine however it resets to max damage every time I relog, so you basically lose the experience in the bottle new code: Item File package thormod.items; import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.src.ModLoader; import net.minecraft.world.World; import thormod.guis.ThorMod_GuiXPStoring; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ThorMod_ItemXPStoringBottle extends Item { /** The current experience level the player is on. */ public int experienceLevel; public ThorMod_ItemXPStoringBottle(int par1) { super(par1); this.setMaxDamage(100); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(!(par3EntityPlayer instanceof EntityPlayerMP)) { ModLoader.openGUI(par3EntityPlayer, new ThorMod_GuiXPStoring(this, par1ItemStack, par3EntityPlayer)); } return par1ItemStack; } /** * Add experience levels to this player. */ public void addExperienceLevel(int par1, ItemStack par2ItemStack, EntityPlayer par3EntityPlayer) { if (!(par2ItemStack.getItemDamage() == par2ItemStack.getMaxDamage())) { par2ItemStack.damageItem(par1, par3EntityPlayer); } } @SideOnly(Side.CLIENT) /** * allows items to add custom lines of information to the mouseover description */ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(String.valueOf(par1ItemStack.getItemDamage())); } public String getTextureFile() { return "/thormod/textures/items.png"; } } Gui File package thormod.guis; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import thormod.items.ThorMod_ItemXPStoringBottle; public class ThorMod_GuiXPStoring extends GuiScreen { public EntityPlayer theplayer; public ThorMod_ItemXPStoringBottle theBottle; public ItemStack theBottleStack; public ThorMod_GuiXPStoring(ThorMod_ItemXPStoringBottle bottle, ItemStack bottleStack, EntityPlayer entityplayer) { theplayer = entityplayer; theBottle = bottle; theBottleStack = bottleStack; } public void initGui() { controlList.clear(); controlList.add(new GuiButton(1, width / 2, height / 2 + -75, 98, 20, "Deposit 10 Experience Levels")); controlList.add(new GuiButton(2, width / 2, height / 2 + -50, 98, 20, "Withdraw 10 Experience Levels")); } protected void actionPerformed(GuiButton guibutton) { if(theBottle != null) { if(guibutton.id == 1 && theplayer.experienceLevel >= 10 && theBottleStack.getItemDamage() <= theBottleStack.getMaxDamage()) { theBottle.addExperienceLevel(10, theBottleStack, theplayer); theplayer.experienceLevel -= 10; updateScreen(); initGui(); } if(guibutton.id == 2 && theBottle.experienceLevel >= 10) { theplayer.addExperienceLevel(10); theBottle.experienceLevel -= 10; updateScreen(); initGui(); } } } public void keyTyped(char par1, int par2) { if (par2 == 1 || par2 == this.mc.gameSettings.keyBindInventory.keyCode) { this.mc.thePlayer.closeScreen(); } } public boolean doesGuiPauseGame() { return false; } public void onGuiClosed() { } public void drawScreen(int i, int j, float f) { drawDefaultBackground(); String exp = String.valueOf(this.theBottleStack.getItemDamage()); drawCenteredString(fontRenderer, exp, width / 2, height / 4 - 40, 8453920); super.drawScreen(i, j, f); } }
  9. Ah, ok. I will check if everything works alltogether!
  10. Oh wait, sorry. I wasnt actually checking in the entity file itself, wow
  11. My import of EntityRegistry is completely fine. It still doesnt work even after I did Ctrl+Shift-O which for the record, nearly didnt even help me at all
  12. Why do I get errors like: The method registerModEntity(Class<? extends Entity>, String, int, Object, int, int, boolean) in the type EntityRegistry is not applicable for the arguments (Class<ThorMod_EntityEmeraldPrimed>, String, int, ThorMod, int, int, boolean) on EntityRegistry.registerModEntity(ThorMod_EntityEmeraldPrimed.class, "EmBomb", EntityRegistry.findGlobalUniqueEntityId(), this, 64, 10, true); and: The method setBlockName(String) is undefined for the type ThorMod_Ores at Ores = new ThorMod_Ores(oresStartId, Material.rock).setBlockName("ThorOres").setCreativeTab(tBlocksTab).setHardness(4F); It's driving me nuts!
  13. Can someone do a tutorial on updating to 1.4.6? I got pretty discouraged after trying to solve countless errors
  14. Are item damage values big enough to host exp points that is an int though?
  15. Forge could easily do this by adding some code into SlotArmor and things(By that I mean that its a feature I think forge should have)
  16. Yeah, my item is non-stackable so I will have to check that out
  17. Like, is there a way to save a field/variable in an item file like how you can with a TileEntity/Entity?
  18. Im making this item that you can store your experience into and withdraw exp from, and everything was going just fine until when I checked if it would save the exp in the item if I relogged, but what I noticed was that when I stored exp into the bottle the players exp level goes down, but when I relog the player has the experience back again and also the item has the exp the player stored into it before I relogged. So: I have 40 xp, I store the 40 exp in the item, I relog, I have 40 exp again, the bottle also has 40 exp which makes it so you basically have infinite exp. Also when I close Minecraft and open it again the exp levels that was in the bottle are gone Item class: package thormod.items; import java.util.List; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import thormod.guis.ThorMod_GuiXPStoring; import net.minecraft.client.Minecraft; import net.minecraft.src.*; public class ThorMod_ItemXPStoringBottle extends Item { /** The current experience level the player is on. */ public int experienceLevel; /** * The total amount of experience the bottle has. This also includes the amount of experience within their * Experience Bar. */ public int experienceTotal; /** * The current amount of experience the bottle has. */ public float experience; public ThorMod_ItemXPStoringBottle(int par1) { super(par1); this.setMaxStackSize(1); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(!(par3EntityPlayer instanceof EntityPlayerMP)) { ModLoader.openGUI(par3EntityPlayer, new ThorMod_GuiXPStoring(this, par3EntityPlayer)); } return par1ItemStack; } /** * This method increases the player's current amount of experience. */ public void addExperience(int par1) { int var2 = Integer.MAX_VALUE - this.experienceTotal; if (par1 > var2) { par1 = var2; } this.experience += (float)par1 / (float)this.xpBarCap(); for (this.experienceTotal += par1; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); this.addExperienceLevel(1); } } /** * Add experience levels to this player. */ public void addExperienceLevel(int par1) { this.experienceLevel += par1; if (this.experienceLevel < 0) { this.experienceLevel = 0; } } /** * This method returns the cap amount of experience that the experience bar can hold. With each level, the * experience cap on the player's experience bar is raised by 10. */ public int xpBarCap() { return this.experienceLevel >= 30 ? 62 + (this.experienceLevel - 30) * 7 : (this.experienceLevel >= 15 ? 17 + (this.experienceLevel - 15) * 3 : 17); } @SideOnly(Side.CLIENT) /** * allows items to add custom lines of information to the mouseover description */ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add(String.valueOf(this.experienceLevel)); } public String getTextureFile() { return "/thormod/textures/items.png"; } } Gui Class: package thormod.guis; import net.minecraft.src.*; import java.util.Random; import net.minecraft.client.Minecraft; import org.lwjgl.opengl.GL11; import thormod.items.ThorMod_ItemXPStoringBottle; import java.util.Random; public class ThorMod_GuiXPStoring extends GuiScreen { public EntityPlayer theplayer; public ThorMod_ItemXPStoringBottle theBottle; public ThorMod_GuiXPStoring(ThorMod_ItemXPStoringBottle bottle, EntityPlayer entityplayer) { theplayer = entityplayer; theBottle = bottle; } public void initGui() { controlList.clear(); controlList.add(new GuiButton(1, width / 9 + 10, height / 2 + -75, 98, 20, "Deposit 10 Experience Levels")); controlList.add(new GuiButton(2, width / 9 + 10, height / 2 + -50, 98, 20, "Withdraw 10 Experience Levels")); } protected void actionPerformed(GuiButton guibutton) { if(theBottle != null) { if(guibutton.id == 1 && theplayer.experienceLevel >= 10) { theBottle.addExperienceLevel(10); theplayer.experienceLevel -= 10; updateScreen(); initGui(); } if(guibutton.id == 2 && theBottle.experienceLevel >= 10) { theplayer.addExperienceLevel(10); theBottle.experienceLevel -= 10; updateScreen(); initGui(); } } } public boolean doesGuiPauseGame() { return true; } public void onGuiClosed() { } public void drawScreen(int i, int j, float f) { drawDefaultBackground(); String exp = String.valueOf(this.theBottle.experienceLevel); drawCenteredString(fontRenderer, exp, width / 2, height / 4 - 40, 8453920); super.drawScreen(i, j, f); } }
  19. Bump, I also need this knowledge. Why arent anyone responding to this ._.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.