Exception in thread "main" java.lang.ExceptionInInitializerError
at net.minecraft.src.BlockFire.initializeBlock(BlockFire.java:43)
at net.minecraft.src.Block.(Block.java:1184)
at net.minecraft.src.TextureWaterFX.(TextureWaterFX.java:20)
at net.minecraft.client.Minecraft.(Minecraft.java:241)
at net.minecraft.src.MinecraftAppletImpl.(MinecraftAppletImpl.java:15)
at net.minecraft.client.MinecraftApplet.init(MinecraftApplet.java:25)
at net.minecraft.client.Minecraft.main(Minecraft.java:2156)
at Start.main(Start.java:22)
And also I tried your code and it says the method setBurnRate() doesn't exist in type Block, which is true because it only exists in BlockFire and not any other classes, eg it can only be called from within BlockFire
EDIT: I fixed it! Still, thanks for the help though.
In case anyone else is having this problem: I figured that the error was occurring because I'm trying to access the my custom blocks from mod_** before the mod was loaded... So I wrote a method in BlockFire..
so it's made sure that the burn rates are set after the custom blocks have been declared.
I believe a better idea may be to simply extend BlockFire and override the initializeBlock() method (which is actually a method BlockFire overrides from the Block.java), then use the static method that the setBurnRate() method in BlockFire uses which is
package ghosrec35.enchantments.common;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFire;
public class BlockTest extends BlockFire
{
protected BlockTest(int par1, int par2)
{
super(par1, par2);
}
public void initializeBlock()
{
Block.setBurnProperties(id, encouragement, flammability);
Block.setBurnProperties(id, encouragement, flammability);
}
}
This means of programming allows you to use the Polymorphic design of the Block.java to perform actions which would otherwise require you to edit files (which you have), which I strongly recommend against.
You actually wouldn't even have to create this overriden file, you could simply just call
in your mod_ file and it will still perform the same effects, and you will have complete control as to when in the code it is called.
Of course, if you really wanted to get stupidly overcomplicated about it, while simultaneously reducing performance, and allowing for more possibilities of error to occur, you could probably use Reflection to invoke the private setBurnRate() method from the BlockFire.java.
You should NOT do this, as like I said before, it has a pretty big performance decrease at load time, and can be accomplished much more simply by invoking the static method from the Block class.
This example is more so to show you that there are other means of programming that do not require you to edit files, though they may have decreased performance.
(I'll be honest, I haven't even tested this specific setup, but I believe it's correct in how it's set up).
I believe a better idea may be to simply extend BlockFire and override the initializeBlock() method (which is actually a method BlockFire overrides from the Block.java), then use the static method that the setBurnRate() method in BlockFire uses which is
I see. The thing is for a variety of reasons I'm currently working on this mod in 1.3.2, and in this version the method setBurnProperties() doesn't exist under Block. You bring up a good point though, I'll keep it in mind when I get to upgrade the mod into 1.4
Just for curiosity, I've noticed that editing base files when modding is generally frowned upon, but why is that?
I see. The thing is for a variety of reasons I'm currently working on this mod in 1.3.2, and in this version the method setBurnProperties() doesn't exist under Block. You bring up a good point though, I'll keep it in mind when I get to upgrade the mod into 1.4
Just for curiosity, I've noticed that editing base files when modding is generally frowned upon, but why is that?
Beyond the fact that it's just purely bad practice, it also causes issues when combining multiple mods that edit the same file, possibly even preventing the usage of the two mods together at all. This was one issue addressed by Forge with the EnumHelper.java using the ReflectionFactory class to actually "add" enumerations to the EnumToolMaterial, EnumArmorMaterial, and the many other Enumerations in Minecraft without editing the files, as this prevented incompatibilities with mods that added their own Tool and Armor materials to their respective enumerations.
ModLoader.addSmelting(mod_ores.sarliteore.blockID, new ItemStack(mod_ores.sarliteingot, 1), 100.0F);
Why 100? Well because it still adds just 1 of the little sections of the experience bar! Why does this happens?? Help!
I've also tryied lots of different values and it always gives me the same ammount of experience :c
I'm not sure (I'm using Forge) but even though it asks for an experience parameter it may still default to 1.0F. Go to ModLoader.java and search for "addSmelting" and see.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Anyone know if it's possible to be able to change a custom mob's skin in-game? Say, via right-clicking said mob with a specific item?
Well, you could define the mob's texture string as Null, then in the constructer give it a value, then you could use the mechanic that's used by cow milking to change the skin.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Well, you could define the mob's texture string as Null, then in the constructer give it a value, then you could use the mechanic that's used by cow milking to change the skin.
I see, sort of having trouble with getting the code to work, how exactly do i set the string as null? .-.
in the EntityKtf.java:
public String getTexture;
{
this.texture = "/moditems/modskin.png";
public boolean interact(EntityPlayer par1EntityPlayer)
{
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
if (var2 != null && var2.itemID == mod_KtfMod.ItemMask.shiftedIndex)
{
if (--var2.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk));
}
else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk)))
{
par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.shiftedIndex, 1, 0));
}
return true;
}
else
{
return super.interact(par1EntityPlayer);
}
}
}
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I'll gladly help if you can give me the error log. I've updated my mod to 1.4.6 and my items didn't require any changing to support 3d in-map rendering. It may require updating if you use a custom item renderer, otherwise, it should work; your item defaults to the global item renderer.
--- BEGIN ERROR REPORT 888ad383 --------
Full report at:
C:\Users\Jason\Desktop\Minecraft Modding\JASON\Myth Mod\jars\.\crash-reports\crash-2013-01-07_10.54.25-client.txt
Please show that file to Mojang, NOT just this screen!
Generated 7/01/13 10:54 AM
-- Head --
Stacktrace:
at net.minecraft.src.RenderItem.func_77020_a(RenderItem.java:252)
at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:184)
at net.minecraft.src.RenderItem.doRender(RenderItem.java:571)
-- Entity being rendered --
Details:
Entity Type: Item (net.minecraft.src.EntityItem)
Entity ID: 6396
Name: item.item.Aqua Potion
Exact location: 358.31, 5.31, -599.66
Block location: World: (358,5,-600), Chunk: (at 6,0,8 in 22,-38; contains blocks 352,0,-608 to 367,255,-593), Region: (0,-2; contains chunks 0,-64 to 31,-33, blocks 0,0,-1024 to 511,255,-513)
Momentum: -0.25, -0.01, 0.08
-- Renderer details --
Details:
Assigned renderer: [email protected]
Location: -0.01,-0.31,-0.00 - World: (-1,-1,-1), Chunk: (at 15,-1,15 in -1,-1; contains blocks -16,0,-16 to -1,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)
Rotation: 52.014706
Delta: 0.18043041
Stacktrace:
at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:219)
at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:188)
at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:438)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1100)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player234'/76, l='MpServer', x=358.32, y=5.62, z=-599.66]]
Chunk stats: MultiplayerChunkCache: 441
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options:
Level spawn location: World: (449,4,-666), Chunk: (at 1,0,6 in 28,-42; contains blocks 448,0,-672 to 463,255,-657), Region: (0,-2; contains chunks 0,-64 to 31,-33, blocks 0,0,-1024 to 511,255,-513)
Level time: 21533 game time, 8743 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 17 total; [EntityBlueWizard['entity.BlueWizard.name'/34, l='MpServer', x=370.74, y=4.00, z=-599.19], EntityRedWizard['entity.RedWizard.name'/35, l='MpServer', x=375.38, y=4.00, z=-605.00], EntityImp['entity.IMP.name'/32, l='MpServer', x=367.45, y=4.00, z=-604.47], EntityItem['item.item.Aqua Potion'/6396, l='MpServer', x=358.31, y=5.31, z=-599.66], EntityImp['entity.IMP.name'/33, l='MpServer', x=368.38, y=4.00, z=-604.96], EntitySaberTooth['entity.SaberTooth.name'/38, l='MpServer', x=368.50, y=4.00, z=-597.97], EntityImp['entity.IMP.name'/39, l='MpServer', x=368.50, y=4.00, z=-605.97], EntityYellowWizard['entity.YellowWizard.name'/36, l='MpServer', x=376.50, y=4.00, z=-606.00], EntityUnicorn['entity.Unicorn.name'/37, l='MpServer', x=375.72, y=4.00, z=-595.85], EntitySlime['Slime'/40, l='MpServer', x=425.65, y=4.61, z=-637.84], EntityClientPlayerMP['Player234'/76, l='MpServer', x=358.32, y=5.62, z=-599.66], EntitySlime['Slime'/13, l='MpServer', x=290.41, y=4.00, z=-588.44], EntityPig['Pig'/44, l='MpServer', x=439.13, y=4.00, z=-522.13], EntityVillager['Villager'/19, l='MpServer', x=281.59, y=4.00, z=-533.78], EntityVillager['Villager'/20, l='MpServer', x=284.25, y=4.00, z=-542.75], EntityVillager['Villager'/26, l='MpServer', x=287.59, y=4.00, z=-530.44], EntitySaberTooth['entity.SaberTooth.name'/31, l='MpServer', x=368.56, y=4.00, z=-596.97]]
Retry entities: 0 total; []
Stacktrace:
at net.minecraft.src.WorldClient.addWorldInfoToCrashReport(WorldClient.java:406)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2434)
at net.minecraft.client.Minecraft.run(Minecraft.java:784)
at java.lang.Thread.run(Unknown Source)
-- System Details --
Details:
Minecraft Version: 1.4.6
Operating System: Windows 8 (x86) version 6.2
Java Version: 1.7.0_10, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
Memory: 875445880 bytes (834 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 9255 (518280 bytes; 0 MB) allocated, 260 (14560 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, MinecraftError, ReportedException, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 2
ModLoader 1.4.6
mod_Mythical v0.1
LWJGL: 2.4.2
OpenGL: AMD Radeon HD 6450 GL version 4.2.11931 Compatibility Profile Context, ATI Technologies Inc.
Is Modded: Very likely; Jar signature invalidated
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: 208 (11648 bytes; 0 MB) allocated, 137 (7672 bytes; 0 MB) used
java.lang.ArrayIndexOutOfBoundsException: 22363
at net.minecraft.src.RenderItem.func_77020_a(RenderItem.java:252)
at net.minecraft.src.RenderItem.doRenderItem(RenderItem.java:184)
at net.minecraft.src.RenderItem.doRender(RenderItem.java:571)
at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:219)
at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:188)
at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:438)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:1100)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:943)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:878)
at net.minecraft.client.Minecraft.run(Minecraft.java:768)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 90030bc9 ----------
A GUI = a Guide User Interface. So basically what you see when you open a furnace or crafting table. Not just them though, anything like enchanting, chests, dispensers, they all have a GUI to allow you to interact with them.
And the GUI has my vote. I can't wait for a tutorial on this!
That is correct, but Strange was just referring to a tutorial on GUI's for the player to interact with. eg. the furnace, crafting...
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I don't know what people are on about using itemID instead of shiftedIndex. shiftedIndex still works perfectly in 1.4.6...
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI believe a better idea may be to simply extend BlockFire and override the initializeBlock() method (which is actually a method BlockFire overrides from the Block.java), then use the static method that the setBurnRate() method in BlockFire uses which is
Example:
package ghosrec35.enchantments.common; import net.minecraft.block.Block; import net.minecraft.block.BlockFire; public class BlockTest extends BlockFire { protected BlockTest(int par1, int par2) { super(par1, par2); } public void initializeBlock() { Block.setBurnProperties(id, encouragement, flammability); Block.setBurnProperties(id, encouragement, flammability); } }This means of programming allows you to use the Polymorphic design of the Block.java to perform actions which would otherwise require you to edit files (which you have), which I strongly recommend against.
You actually wouldn't even have to create this overriden file, you could simply just call in your mod_ file and it will still perform the same effects, and you will have complete control as to when in the code it is called.
Of course, if you really wanted to get stupidly overcomplicated about it, while simultaneously reducing performance, and allowing for more possibilities of error to occur, you could probably use Reflection to invoke the private setBurnRate() method from the BlockFire.java.
You should NOT do this, as like I said before, it has a pretty big performance decrease at load time, and can be accomplished much more simply by invoking the static method from the Block class.
This example is more so to show you that there are other means of programming that do not require you to edit files, though they may have decreased performance.
(I'll be honest, I haven't even tested this specific setup, but I believe it's correct in how it's set up).
Example:
private void setBurnRates() { try { Method method = BlockFire.class.getDeclaredMethod("setBurnRate", int.class, int.class, int.class); method.setAccessible(true); method.invoke(block, 10, 15, 15); } catch(NoSuchMethodException e){ e.printStackTrace(); } catch (IllegalAccessException e){ e.printStackTrace(); } catch (IllegalArgumentException e){ e.printStackTrace(); } catch (InvocationTargetException e){ e.printStackTrace(); } }I see. The thing is for a variety of reasons I'm currently working on this mod in 1.3.2, and in this version the method setBurnProperties() doesn't exist under Block. You bring up a good point though, I'll keep it in mind when I get to upgrade the mod into 1.4
Just for curiosity, I've noticed that editing base files when modding is generally frowned upon, but why is that?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumBeyond the fact that it's just purely bad practice, it also causes issues when combining multiple mods that edit the same file, possibly even preventing the usage of the two mods together at all. This was one issue addressed by Forge with the EnumHelper.java using the ReflectionFactory class to actually "add" enumerations to the EnumToolMaterial, EnumArmorMaterial, and the many other Enumerations in Minecraft without editing the files, as this prevented incompatibilities with mods that added their own Tool and Armor materials to their respective enumerations.
Visit my youtube channel?
http://www.youtube.com/user/TheCoolgatty
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou'll need Forge unless you want to edit BaseClasses, which I recommend against.
K thanks!
Visit my youtube channel?
http://www.youtube.com/user/TheCoolgatty
-
View User Profile
-
View Posts
-
Send Message
Retired StaffI'm not sure (I'm using Forge) but even though it asks for an experience parameter it may still default to 1.0F. Go to ModLoader.java and search for "addSmelting" and see.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumwhat are the parameters?
Nothing to see here, move along.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffWell, you could define the mob's texture string as Null, then in the constructer give it a value, then you could use the mechanic that's used by cow milking to change the skin.
I see, sort of having trouble with getting the code to work, how exactly do i set the string as null? .-.
in the EntityKtf.java:
public String getTexture; { this.texture = "/moditems/modskin.png"; public boolean interact(EntityPlayer par1EntityPlayer) { ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); if (var2 != null && var2.itemID == mod_KtfMod.ItemMask.shiftedIndex) { if (--var2.stackSize <= 0) { par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk)); } else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk))) { par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.shiftedIndex, 1, 0)); } return true; } else { return super.interact(par1EntityPlayer); } } }*code is just the "snippet," if you will*
You should be able to find the parameters of onItemPickup in BaseMod or ModLoader. I'm not sure which one anymore as I only use Forge.
together they are powerful beyond imagination."
That is correct, but Strange was just referring to a tutorial on GUI's for the player to interact with. eg. the furnace, crafting...
together they are powerful beyond imagination."
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI saw a lot of people saying that it was something to do with 1.4.7, which confuses me since there isn't an official 1.4.7