Not bad, but there are a few commands that cause issues with some setups. On mine, those are -XX:+UseInlineCache and -XX:+UseAggressiveOps, and possibly -XX:+UseInterpreter. If you want a minimalist version of this setup, with just memory optimizations, this should work for anybody and reduce lag spiking when loading a chunk:
-Xmx(2/3 of total RAM)
-Xmn(3/8 of Xmx) (these two set the maximum space and the space before a minor garbage collection/lag spike)
Then, add -XX:+UseConcMarkSweepGC which is the better Garbage collector for avoiding fps lag.
Finally, to squeeze a bit more out, use the optimizations (high risk, high return):
-XX:+UseAggressiveOps (optimize at all costs)
-XX:+UseInterpreter (read minecraft line by line instead of saving it all to memory; faster execution)
-XX:+OptimizeStringConcat (optimize putting two sentences together; should yield small boost with text displayed)
-XX:+UseFastAccessorMethods (optimize data retrieval; should yield HUGE returns for games like minecraft)
Aside from that, I don't recall off the top of my head, but those alone will yield a decent boost without going overboard.
Could you just create a new entity that extends EntitySkeleton, overload that function and then spawn your new entity instead of EntitySkeleton? I believe that would be the simplest solution with the least overhead for use.
Hey CraftMuch, thanks for your reply
I won't have access to my computer for a day or two, but I'll try it out as soon as I can and respond with the results good or bad. By the look of it, you've got a solution that should work, and I had been wondering why forge completely ignored my every attempt to specify a file path. With luck, that's exactly my problem.
Alright, well I'm currently working in eclipse and I call 'mySword.setTextureName("examplemod:mySword.png");'. I've also tried without '.png'
I have tried placing the icon at: src/assets/minecraft/examplemod/textures/items and at src/minecraft/assets/examplemod/textures/items.
Neither one loads properly and I receive the following errors:
[18:39:49] [Client thread/ERROR]: Couldn't set icon
javax.imageio.IIOException: Can't read input file!
at javax.imageio.ImageIO.read(Unknown Source) ~[?:1.7.0_17]
at net.minecraft.client.Minecraft.readImage(Minecraft.java:680) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:509) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_17]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_17]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_17]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_17]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
[18:40:35] [Client thread/ERROR]: Using missing texture, unable to load minecraft:textures/items/MISSING_ICON_ITEM_4096_mySword.png
java.io.FileNotFoundException: minecraft:textures/items/MISSING_ICON_ITEM_4096_mySword.png
at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[SimpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.TextureMap.loadTextureAtlas(TextureMap.java:128) [TextureMap.class:?]
at net.minecraft.client.renderer.texture.TextureMap.loadTexture(TextureMap.java:93) [TextureMap.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTickableTexture(TextureManager.java:71) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTextureMap(TextureManager.java:58) [TextureManager.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:621) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_17]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_17]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_17]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_17]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
Where exactly do I place my texture file? What method do I call to load it? I've looked up numerous threads about textures failing to load and although many of them give me a directory to place the file in, it doesn't load the texture and gives me the two errors above.
I'm currently fooling around with forge figuring out the basics of mod development. Although I'm quite a fluent programmer in java, I've found it very difficult to get a texture loaded and the error messages only tell me that it failed to load, not where it looks for the texture I specified.
As such, could somebody please explain how to load a single, 16x16 png image as a texture, and how to tell forge where to load it from. I have already made a custom item and an image.
No problem, I'll explain. Just go to your first post in the topic and click edit. Then just add '[solved]' to the topic title (Use full editor). That way it's quick and easy for them to find out how to fix this problem
Into your mod's main class (not into the item classes).The super method is an easy way to add to a pre-existing method.
I'm just booting up eclipse so that I can give you more details about where to put the 'load' method I gave you.
EDIT:So, here's where my main class is:
package com.example.examplemod;
import ....
@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
ToolMaterial myMaterial = EnumHelper.addToolMaterial("myMaterial", 2, 1, 9F, 2, 14);
Item mySword = new ItemSword(myMaterial).setCreativeTab(CreativeTabs.tabCombat).setUnlocalizedName("mySword");
@EventHandler
public void init(FMLInitializationEvent event) {
// some example code
System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
}
@EventHandler public void load(FMLPreInitializationEvent event) throws Exception { GameRegistry.registerItem(mySword, "mySword");
}
}
I'm pretty sure you put it in the same class file where you put your @mod declaration
The first value is the harvestLevel, second is maxUses (1561 diamond, 29 wood), third is block breaking speed (2.0F wood, 8.0F diamond), fourth is damage ((this + 4) / 2 = hearts), fifth is enchantability.
Then you create a new item:
yoursword = new ItemYourSword(yourtoolmaterial).setUnlocalizedName("yourSword");
That should work. Also, a value of -1 or null in maxUses will yield an unbreakable weapon.
This does everything but load a texture for the item.
EDIT: See Darkhax' answer below. That is exactly what your problem is. As for the solution, whenever you need to add an effect to code, try using 'super'. 'super' uses the parent class' version of the method before running your version. Try this:
I believe this is your problem: cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: Pixel.ruby_mod.Main
It can't find 'Main.java' in the folder Pixel.ruby_mod. I'd say that either you are calling a class that doesn't exist, or forge expects it to exist. Either way, it isn't there.
You call 'public static Main instance'. Instead of importing Pixel.ruby_mod.CommonProxy, import Pixel.ruby_mod.*; Which imports all files in Pixel.ruby_mod. That should work. Read the error log and find the first error. That's almost always the reason everything else failed.
Actually, double check that Main.java is in Pixel.ruby_mod and try rebuilding
Wuppy has started a tutorial series blog for 1.3.2 forge modding which can be found in the URL below. Once you have it all set up and installed and you are at the same point you are at now only the following line of code would need to be added.
EnumHelper.addToolMaterial - The Forge method we are referencing. You might have to manually import net.minecraft.src.forge.EnumHelper this time if you get an error. You can, and should be changing all of the following values... "BLUE" - The material name 2 - The harvest level that this tool set can harvest successfully (Obsidian ore is 3, Diamond ore is 2, Iron ore is 1) 171 - The amount of times you can use the tools before they break (Wood is 59, Diamond is 1561) 5F - The speed which you break blocks using this tool set. You can play around with this number to get it right (Wood is 2.0F, Diamond is 8.0F) 1 - The damage this tool does to entities. Add 4 and divide by two to get the number measured in hearts of damage. (eg. this would be 2.5 hearts damage) 5 - Enchantability. This might be changing in 1.3 with the new enchantment system.. I am not sure. (Stone is 5, Diamond is 10, Gold is 22)
...
Once you've done that, go to your load() method and add: Into load():
MinecraftForge.setToolClass(blueStonePickaxe, "pickaxe", 2);
MinecraftForge.setToolClass(blueStoneShovel, "shovel", 2);
MinecraftForge.setToolClass(blueStoneAxe, "axe", 2);
MinecraftForge.setToolClass - The method we are invoking which sets our items to the appropriate tool classes. blueStonePickaxe - The pickaxe item we are passing over. Also do the same for shovel and axe. "pickaxe" - In lower case, add the tool type. 2 - The harvest level I am using, you should have this the same as you set in your EnumToolMaterial above.
Note: You only have to do this for pickaxes, axes, and shovels!
If you want to get started in 1.7.2, try this video:
You'll have to do a lot of trial and error for 1.7.2 because nobody's fully de-obfuscated the game classes, but it should be relatively easy to mod items, blocks and entities into the game.
I am thinking that your code is not thinking in java terms correctly.
if(stack == new ItemStack(VanillaPudding.acr_emeraldHelmet) || stack == new ItemStack ...
An object created on the fly (with new()) can never be == to any other created object. You might want to try another way of seeing if your armor is in the ItemStack in question.
try something like if(stack.getItem() == VanillaPudding.acr_emeraldHelmet...
ItemStack.getItem() returns a type of net.minecraft.item.Item, I assume this is the method that tells you what item has been stacked. I assume the reason you did new ItemStack(myArmour) was so that the types match. It's easier to turn an ItemStack into an Item because ItemStack already contains an Item. Don't shave against the grain when you don't need to
Details
I have encountered a bug. When I try loading a map, it'll build the terrain for the map and then sit at the main menu doing nothing. After clicking Play Selected World a couple times, it will sit at the main menu for about 10 seconds, then load the map. Sometimes it loads without bugs afterward. Sometimes I appear at the spawn without my experience or inventory. When this happens, my chest inventories and world are exactly as I left them. So far, my solution is to leave everything in a chest before quitting.
Is there any fix?
Additional Information
I run two different versions. Both versions encounter this bug on every save file I have/make.
The versions I run are:
0
-Xmx(2/3 of total RAM)
-Xmn(3/8 of Xmx) (these two set the maximum space and the space before a minor garbage collection/lag spike)
Then, add -XX:+UseConcMarkSweepGC which is the better Garbage collector for avoiding fps lag.
Finally, to squeeze a bit more out, use the optimizations (high risk, high return):
-XX:+UseAggressiveOps (optimize at all costs)
-XX:+UseInterpreter (read minecraft line by line instead of saving it all to memory; faster execution)
-XX:+OptimizeStringConcat (optimize putting two sentences together; should yield small boost with text displayed)
-XX:+UseFastAccessorMethods (optimize data retrieval; should yield HUGE returns for games like minecraft)
Aside from that, I don't recall off the top of my head, but those alone will yield a decent boost without going overboard.
0
1
I won't have access to my computer for a day or two, but I'll try it out as soon as I can and respond with the results good or bad. By the look of it, you've got a solution that should work, and I had been wondering why forge completely ignored my every attempt to specify a file path. With luck, that's exactly my problem.
1
I have tried placing the icon at: src/assets/minecraft/examplemod/textures/items and at src/minecraft/assets/examplemod/textures/items.
Neither one loads properly and I receive the following errors:
Where exactly do I place my texture file? What method do I call to load it? I've looked up numerous threads about textures failing to load and although many of them give me a directory to place the file in, it doesn't load the texture and gives me the two errors above.
1
As such, could somebody please explain how to load a single, 16x16 png image as a texture, and how to tell forge where to load it from. I have already made a custom item and an image.
Thanks for any insight you can give me
0
0
Into your mod's main class (not into the item classes).The super method is an easy way to add to a pre-existing method.
I'm just booting up eclipse so that I can give you more details about where to put the 'load' method I gave you.
EDIT:So, here's where my main class is:
0
The first value is the harvestLevel, second is maxUses (1561 diamond, 29 wood), third is block breaking speed (2.0F wood, 8.0F diamond), fourth is damage ((this + 4) / 2 = hearts), fifth is enchantability.
Then you create a new item:
Finally, you register the item: That should work. Also, a value of -1 or null in maxUses will yield an unbreakable weapon.
This does everything but load a texture for the item.
EDIT: See Darkhax' answer below. That is exactly what your problem is. As for the solution, whenever you need to add an effect to code, try using 'super'. 'super' uses the parent class' version of the method before running your version. Try this:
0
0
It can't find 'Main.java' in the folder Pixel.ruby_mod. I'd say that either you are calling a class that doesn't exist, or forge expects it to exist. Either way, it isn't there.
You call 'public static Main instance'. Instead of importing Pixel.ruby_mod.CommonProxy, import Pixel.ruby_mod.*; Which imports all files in Pixel.ruby_mod.That should work. Read the error log and find the first error. That's almost always the reason everything else failed.Actually, double check that Main.java is in Pixel.ruby_mod and try rebuilding
0
Step by Step Guide
Hopefully these help.
0
Where did you hear about the server: This post
Do you understand and accept the rules: I do.
What's our policy on raging: Don't.
Also, could you host a mirror of the resource pack? Dropbox is blocking downloads from you guys for generating too much traffic.
0
You'll have to do a lot of trial and error for 1.7.2 because nobody's fully de-obfuscated the game classes, but it should be relatively easy to mod items, blocks and entities into the game.
0
try something like if(stack.getItem() == VanillaPudding.acr_emeraldHelmet...
ItemStack.getItem() returns a type of net.minecraft.item.Item, I assume this is the method that tells you what item has been stacked. I assume the reason you did new ItemStack(myArmour) was so that the types match. It's easier to turn an ItemStack into an Item because ItemStack already contains an Item. Don't shave against the grain when you don't need to
0
I have encountered a bug. When I try loading a map, it'll build the terrain for the map and then sit at the main menu doing nothing. After clicking Play Selected World a couple times, it will sit at the main menu for about 10 seconds, then load the map. Sometimes it loads without bugs afterward. Sometimes I appear at the spawn without my experience or inventory. When this happens, my chest inventories and world are exactly as I left them. So far, my solution is to leave everything in a chest before quitting.
Is there any fix?
Additional Information
I run two different versions. Both versions encounter this bug on every save file I have/make.
The versions I run are: