Jump to content

darkness3608

Members
  • Posts

    15
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed

darkness3608's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Well I was just being dumb. I could have used the same code I had from my block class when creating the same idea. If anyone wants code that does this: if(block.blockID == Block.stone.blockID){ event.drops.clear(); event.drops.add(new ItemStack(Block.cobblestone, random.nextInt(2) + 1)); if(random.nextInt(10) == 0){ event.drops.add(new ItemStack(Block.stone,1)); } event.dropChance = 1.0F; } I woke up this morning just thinking... why didn't you just do that lol.
  2. try @Override public void registerIcons(IconRegister reg) { this.blockIcon = reg.registerIcon("modpack:Redgem_ore"); } I would try public Redgemore(int par1, String texture) { super(par1, Material.iron); setCreativeTab(CreativeTabs.tabBlock); } //into public Redgemore(int par1, Material material) { super(par1, Material.iron); setCreativeTab(CreativeTabs.tabBlock); setTextureName("modpack:Redgem_ore"); } Then make sure that your block is declared in your main/base class, with registering them into your load method.
  3. Cool, that worked, when using the HarvestDropsEvent feature, now I have a new question, I am having an issue trying to make the drops either call twice. I want some blocks to drop with the normal block that drops with it, plus a special block or chance. But what seems to be happening is that every item in the ItemStack gets the same drop chance. For example, I would want Stone to drop cobblestone with 100% and then a 10% chance for like normal stone to drop along with the cobblestone, (or however many different items with different chances I want). I spent awhile on this code, even recreating the BlockEvent class (which may still be the route I need to go) but I still cannot get it to work.
  4. Oh dang, I think it used to do it that way. Interesting. Guess ill rework my idea some then. (didn't think that infinite flint would be possible) never worked when I tried it before. Oh well haha Thanks
  5. I am pretty sure that minecraft has something like this, and I wanted to know if there is variable or boolean function to get this. Isn't it used in gravel or something like that so you don't get infinite flint? Just wondering where the function is, I thought for a second that block.getEnableStats() would work but it didn't work.
  6. Is there any way to change the quantity/products of how/what a mob/block drops, with pre-existing mobs and blocks. I figured out a way with my own created blocks, I know I could just re-create every block in minecraft with my own, and then just generate those instead of the ones used in minecraft. but I just wanted to check. I feel like there could just be a simple way with object oriented programming, or (my brain thinks I would have to do what I stated in my second comment)
  7. If I was to guess anything, you should look into the gui overlay? I have spent some time with that recently. You may be able to look into the GuiContainerCreative.java code to see if something will help you there. I am not sure if the forge mod loader one will be what you are looking for(I could be wrong though).
  8. Life of a programmer... had the path almost right, I didn't realize I had another bit to add with it also changed it to look like this.mc.renderEngine.bindTexture(new ResourceLocation("enhanced","textures/gui/container/inventory.png"));
  9. So after doing some tinkering with my code. this.mc.renderEngine.bindTexture(potionEffectIcons); this section seems to be causing an error when running inside of the code, saying that it cannot find the texture. How are you supposed to define a texture using the Resource Locations Here is how I have it defined public static final ResourceLocation potionEffectIcons = new ResourceLocation("gui/container/inventory.png");
  10. Hi, I have an issue with the tutorial, I am not really sure what is going wrong in the drawing portion on the screen, the boxes are just showing up black. I tried changing the path in different ways (not sure if I am just doing that wrong) but can someone take a look at the code here: package darkness3608.enhanced; import java.util.Collection; import java.util.Iterator; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; import net.minecraftforge.event.EventPriority; import net.minecraftforge.event.ForgeSubscribe; import org.lwjgl.opengl.GL11; public class GuiBuffBar extends Gui { private Minecraft mc; public GuiBuffBar(Minecraft mc) { super(); // We need this to invoke the render engine. this.mc = mc; } private static final int BUFF_ICON_SIZE = 18; private static final int BUFF_ICON_SPACING = BUFF_ICON_SIZE + 2; // 2 pixels between buff icons private static final int BUFF_ICON_BASE_U_OFFSET = 0; private static final int BUFF_ICON_BASE_V_OFFSET = 198; private static final int BUFF_ICONS_PER_ROW = 8; public static final ResourceLocation potionEffectIcons = new ResourceLocation("gui/container/inventory.png"); //enhanced:inventory /gui/container/inventory.png // This event is called by GuiIngameForge during each frame by // GuiIngameForge.pre() and GuiIngameForce.post(). // @ForgeSubscribe(priority = EventPriority.NORMAL) public void onRenderExperienceBar(RenderGameOverlayEvent event) { // // We draw after the ExperienceBar has drawn. The event raised by GuiIngameForge.pre() // will return true from isCancelable. If you call event.setCanceled(true) in // that case, the portion of rendering which this event represents will be canceled. // We want to draw *after* the experience bar is drawn, so we make sure isCancelable() returns // false and that the eventType represents the ExperienceBar event. if(event.isCancelable() || event.type != ElementType.EXPERIENCE) { return; } // Starting position for the buff bar - 2 pixels from the top left corner. int xPos = 2; int yPos = 2; Collection collection = this.mc.thePlayer.getActivePotionEffects(); if (!collection.isEmpty()) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); this.mc.renderEngine.bindTexture(potionEffectIcons); for (Iterator iterator = this.mc.thePlayer.getActivePotionEffects().iterator(); iterator.hasNext(); xPos += BUFF_ICON_SPACING) { PotionEffect potioneffect = (PotionEffect) iterator.next(); Potion potion = Potion.potionTypes[potioneffect.getPotionID()]; if (potion.hasStatusIcon()) { int iconIndex = potion.getStatusIconIndex(); this.drawTexturedModalRect(xPos, yPos,BUFF_ICON_BASE_U_OFFSET + iconIndex % BUFF_ICONS_PER_ROW * BUFF_ICON_SIZE, BUFF_ICON_BASE_V_OFFSET + iconIndex / BUFF_ICONS_PER_ROW * BUFF_ICON_SIZE, BUFF_ICON_SIZE, BUFF_ICON_SIZE); } } } } }
  11. Thanks! Yeah I read this last night and thought of where the problem was, so I checked my imports, and the two mods were importing the same proxy... Easily fixed, thanks!
  12. Hi everyone, I am working with the tutorial: http://www.minecraftforge.net/wiki/Gui_Overlay and about the only thing I had to change was the line of code with: this.mc.renderEngine.bindTexture("/gui/inventory.png") and had to add a resource by doing: public static final ResourceLocation potionEffectIcons = new ResourceLocation("gui/container/inventory.png"); Not sure if this is where my compiling is crashing. Ill add my crash report here: (I wish I could figure out why the embedding button isn't working). --------------------------------------------------------------------------- Description: There was a severe problem during mod loading that has caused the game to fail cpw.mods.fml.common.LoaderException: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:75) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:524) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:201) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:181) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:112) at cpw.mods.fml.common.Loader.loadMods(Loader.java:511) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:183) at net.minecraft.client.Minecraft.startGame(Minecraft.java:473) at net.minecraft.client.Minecraft.run(Minecraft.java:808) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) Caused by: cpw.mods.fml.common.LoaderException at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:68) ... 33 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.6.4 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_10-ea, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 961984848 bytes (917 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.11 FML v6.4.45.953 Minecraft Forge 9.11.1.953 5 mods loaded, 5 mods active mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{6.4.45.953} [Forge Mod Loader] (bin) Unloaded->Constructed Forge{9.11.1.953} [Minecraft Forge] (bin) Unloaded->Constructed darkness3608EnhancedMinecraft{0.0.0} [darkness3608's Enhanced Minecraft] (bin) Unloaded->Errored Basic{0.0.0} [basic] (bin) Unloaded->Errored ---------------------------------------------------------------------------------------- Any help would be appreciated... I feel like its probably something minor, or a step I forgot.
  13. Hello, I am not sure if one exists, but through what I was searching I couldn't find a intimidate answer to my question. I was wondering if anyone has/knows where a 1 to 1 obfuscated minecraft code to readable deobfuscated code is. I know I have the deobfuscated versions, but I was just wondering if such a guide is out there. Like: atv == "<insert readable name>" EDIT: I found out you could use the MCP files and then use Client.srg file, open it in a text editor (or well I used notepad++) to read what I meant.
  14. Thanks for the quick response! Will do my research, and if I come into any issues, I will come back with more questions.
  15. Hello Community, Running through the codes of MCP, and tutorials. I do have java experience, and I would say a great deal of it through being a computer science student, going into my Junior year. Just started looking through the MCP yesterday. I am not sure how much support I should expect out of this post, but here is my question. Does anyone have a few places for me to start looking inside of the MCP for modding my own, use of an additional bar like food for example. My idea is to make water a use, for dehydration. Possibly using the pre built water bar, but I would rather be able to import my own water droplet images. Also I would be looking for any code that may help me realize what blocks the character is near. My idea is to add a water usage to intensify hunger games/pvp type games, where you have to stay hydrated or else over time you will get a nausea effect on your character. This hydration would be fixed by walking into a source of water, or drinking a waterbottle (kinda like darkcloud). I would be adding my own temperature to the game (unless there is one already). But I will be looking through the forge notes, other posts, and such to find out what I can about this as well, just any additional help would be great. Thanks, Minecrafter starting Modding.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.