
madcrazydrumma
Members-
Posts
48 -
Joined
-
Last visited
Everything posted by madcrazydrumma
-
Vanilla gui objects not showing up but my custom ones do
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
Anyone? -
Vanilla gui objects not showing up but my custom ones do
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
No even the normal drawRect method doesnt work -
Vanilla gui objects not showing up but my custom ones do
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
Also, Why isn't my rectangle being drawn? drawBorderedRect(width / 2 - 16, 0, width / 2 + 8, 20, 2, 0xffffff, 0x000000); Im using this method: public void drawBorderedRect(int x, int y, int x1, int y1, int size, int borderC, int insideC) { drawVerticalLine(x, y, y1 -1, borderC); drawVerticalLine(x1 - 1, y, y1 - 1, borderC); drawHorizontalLine(x, x1 - 1, y, borderC); drawHorizontalLine(x, x1 - 1, y1 -1, borderC); drawRect(x + size, y + size, x1 - size, y1 - size, insideC); } -
Hey guys! I looked through the event reference and couldn't find a suitable way to check if the player has destroyed a specific block.. I was wondering if anyone knew how? Thanks ~MCD
-
Vanilla gui objects not showing up but my custom ones do
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
I changed it to .Post, but it still doesnt work... How do i reset the texture afterwards? -
Hey guys I have created a gui handler to add my gui objects to the ingame gui.. However, only my items show, and the hunger bars etc... don't show up, and is just blue things on the screen... Here is my code: package net.madcrazydrumma; import java.util.Calendar; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.event.EventPriority; import net.minecraftforge.event.ForgeSubscribe; import org.lwjgl.Sys; import org.lwjgl.opengl.GL11; public class GuiHandler extends Gui { private Minecraft mc = Minecraft.getMinecraft(); public GuiHandler() { } public void drawBRect(int x1, int y1, int x2, int y2, int clr){ drawHorizontalLine(x1, x2, y1, 0x00ff); drawHorizontalLine(x1, x2, y2, 0x00ff); drawVerticalLine(x1, y1, y2, 0x00ff); drawVerticalLine(x2, y1, y2, 0x00ff); drawRect(x1 + 1, y1 + 1, x2, y2, clr); } @ForgeSubscribe(priority = EventPriority.NORMAL) public void renderIngameGUI(RenderGameOverlayEvent event) { //Skill Icons GL11.glPushMatrix(); ResourceLocation icons = new ResourceLocation("minecraft", "overhaul/textures/gui/icons.png"); drawBRect(20, 20, 30, 30, 0x00ffff); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.func_110577_a(icons); drawTexturedModalRect(380, 60, 0, 0, 16, 16); //swords drawTexturedModalRect(380, 80, 16, 0, 16, 16); //bow drawTexturedModalRect(380, 100, 33, 0, 16, 16); //woodcutting drawTexturedModalRect(380, 120, 48, 0, 16, 16); //farming drawCenteredString(mc.fontRenderer, "" + mc.thePlayer.getExtendedProperties("skills"), 410, 64, 0xfffff); drawCenteredString(mc.fontRenderer, "" + mc.thePlayer.getExtendedProperties("skills"), 410, 84, 0xfffff); drawCenteredString(mc.fontRenderer, "" + mc.thePlayer.getExtendedProperties("skills"), 410, 104, 0xfffff); drawCenteredString(mc.fontRenderer, "" + mc.thePlayer.getExtendedProperties("skills"), 410, 124, 0xfffff); GL11.glPopMatrix(); //Skill Icons End // Clock --> //drawString(mc.fontRenderer, "" + Calendar.getInstance().getTime(), 2, 12, 0x00ffff); } }
-
This is my skill handler class: package net.madcrazydrumma; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.entity.EntityEvent; public class SkillsHandler implements IExtendedEntityProperties { public int swordsLevel; public SkillsHandler instance; @Override public void saveNBTData(NBTTagCompound compound) { compound.setInteger("swordsLevel", swordsLevel); } @Override public void loadNBTData(NBTTagCompound compound) { compound.getInteger("swordsLevel"); } @Override public void init(Entity entity, World world) { } @ForgeSubscribe public void constructEntity(EntityEvent.EntityConstructing event) { if(event.entity instanceof EntityPlayer) { instance = new SkillsHandler(); } } } Is that what you mean? I dont know what you mean by registering instance with identifier and then how to use player.getExtendedProperties(identifier)
-
You can extend block glass, and then when you declare the variable in your main mod file, just use = new BlockGlass(id, otherparamsifany?).setHardness(float f);
-
I tried using that, but i didnt know where to start.. Any help? Thanks i really appreciate it EDIT:: I made the method: @ForgeSubscribe public void constructEntity(EntityEvent.EntityConstruction event) { } but what next?
-
@diesieben what shall i use then?
-
Hey everyone, Firstly I need to paste my code to further explain so here it is: package net.madcrazydrumma; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagInt; public class SkillMethods { private Minecraft mc = Minecraft.getMinecraft(); private EntityClientPlayerMP player = mc.thePlayer; NBTTagCompound tag = player.getEntityData(); NBTBase swordsLevel = tag.getTag("swordsLevel"); NBTBase woodcuttingLevel = tag.getTag("woodcuttingLevel"); NBTBase bowsLevel = tag.getTag("bowsLevel"); NBTBase farmingLevel = tag.getTag("farmingLevel"); public SkillMethods() {} public int getSwordsLevel() { return ((NBTTagInt)swordsLevel).data; } public int getWoodcuttingLevel() { return ((NBTTagInt)woodcuttingLevel).data; } public int getBowsLevel() { return ((NBTTagInt)bowsLevel).data; } public int getFarmingLevel() { return ((NBTTagInt)farmingLevel).data; } public void addSwordsLevel(int par1) { tag.setInteger("swordsLevel", (((NBTTagInt)swordsLevel).data) += par1); } public void addWoodcuttingLevel(int par1) { tag.setInteger("woodcuttingLevel", (((NBTTagInt)woodcuttingLevel).data) += par1); } public void addBowsLevel(int par1) { tag.setInteger("bowsLevel", (((NBTTagInt)bowsLevel).data) += par1); } public void addFarmingLevel(int par1) { tag.setInteger("farmingLevel", (((NBTTagInt)farmingLevel).data) += par1); } } Now the error is throwing a nullpointer for this line: NBTTagCompound tag = player.getEntityData(); and the game just crashes... Here is the full error log: ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 8/28/13 10:15 AM Description: Initializing game java.lang.NullPointerException at net.madcrazydrumma.SkillMethods.<init>(SkillMethods.java:14) at net.madcrazydrumma.OverhaulEvents.<init>(OverhaulEvents.java:17) at net.madcrazydrumma.Overhaul.load(Overhaul.java:53) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) 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:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 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:105) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:232) at net.minecraft.client.Minecraft.startGame(Minecraft.java:506) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) 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:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.madcrazydrumma.SkillMethods.<init>(SkillMethods.java:14) at net.madcrazydrumma.OverhaulEvents.<init>(OverhaulEvents.java:17) at net.madcrazydrumma.Overhaul.load(Overhaul.java:53) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) 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:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 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:105) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:232) at net.minecraft.client.Minecraft.startGame(Minecraft.java:506) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) 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:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) -- System Details -- Details: Minecraft Version: 1.6.2 Operating System: Windows 8 (x86) version 6.2 Java Version: 1.7.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation Memory: 945042856 bytes (901 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.04 FML v6.2.35.804 Minecraft Forge 9.10.0.804 4 mods loaded, 4 mods active mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{6.2.35.804} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized Forge{9.10.0.804} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized overhaul{1.6.2} [Overhaul] (bin) Unloaded->Constructed->Pre-initialized->Errored Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: Intel(R) HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2843, Intel Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Pack: Default Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null Thank you for the help!
-
How do i check if player killed a mob?
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
Thanks! -
Jetpack allows flying when it shouldn't
madcrazydrumma replied to DtrollMC's topic in Modder Support
I have never done this, but try putting player.sendAbilities(); back in the else statement when the armor is unequipped, so you're resending the details Other than that, i have no idea -
Storing variables in player's NBT
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
@Mazetar do you mind posting the link to the Minecraft Forums tutorial thread? Thanks ~MCD -
Hey everyone, I have a few integer values i want to store in NBT, and well the only way i saw was editing directly into EntityPlayerMP, however through MCP it didnt store after i closed the game So yeah i was wondering if there is a way to do this? Thanks ~MCD
-
How do i check if player killed a mob?
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
I figured it out: Entity e = event.entity; DamageSource source = event.source; if(source.getSourceOfDamage() instanceof EntityPlayer) { mc.thePlayer.swordsLevel++; } -
How do i check if player killed a mob?
madcrazydrumma replied to madcrazydrumma's topic in Modder Support
Thanks! I was using this, but I don't know how to check if the player was the source of damage.. Any idea @Targren ? -
Hey everyone, well the title clearly states it, but I am wondering if there is an event to check whether the player has killed a mob entity, or a way to check this.. Thanks! ~MCD
-
How do i check if my block has a redstone connection
madcrazydrumma posted a topic in Modder Support
Hey everyone, For my mod i am struggling with finding out: How do i check if my block has a redstone connection, and if that connection leads to another block? I want to have my custom block transfer a signal to another specific block, to perform an action. E.g. a button click to send a signal to another block to make it explode. Thanks for the help! ~MCD