King_of_Mines1
-
Posts
16 -
Joined
-
Last visited
Posts posted by King_of_Mines1
-
-
I am trying to make a world generator for one of my blocks but it isn't generating anything.
World Gen Class:
package me.kingofmines1.testmod.worldgen; import java.util.Random; import me.kingofmines1.testmod.init.ModBlocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkGenerator; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.fml.common.IWorldGenerator; public class FoodCrateGen implements IWorldGenerator { private WorldGenerator foodcrate_overworld; public FoodCrateGen() { foodcrate_overworld = new WorldGenMinable(ModBlocks.foodcrate.getDefaultState(), 1); } private void runGenerator(WorldGenerator generator, World world, Random rand, int chunk_X, int chunk_Z, int chancesToSpawn, int minHeight, int maxHeight) { if (minHeight < 0 || maxHeight > 256 || minHeight > maxHeight) throw new IllegalArgumentException("Illegal Height Arguments for WorldGenerator"); int heightDiff = maxHeight - minHeight + 1; for (int i = 0; i < chancesToSpawn; i ++) { int x = chunk_X * 16 + rand.nextInt(16); int y = minHeight + rand.nextInt(heightDiff); int z = chunk_Z * 16 + rand.nextInt(16); generator.generate(world, rand, new BlockPos(x, y, z)); } } @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimension()) { case 0: this.runGenerator(foodcrate_overworld, world, random, chunkX, chunkZ, 100, 50, 90); } } }
Server Proxy Class:
package me.kingofmines1.testmod.proxy; import me.kingofmines1.testmod.util.Utils; import me.kingofmines1.testmod.worldgen.FoodCrateGen; import net.minecraftforge.fml.common.registry.GameRegistry; public class ServerProxy implements CommonProxy { @Override public void init() { } @Override public void genInit() { GameRegistry.registerWorldGenerator(new FoodCrateGen(), 0); Utils.getLogger().info("Registered Food Crate Generator"); } }
Common Proxy Class:
package me.kingofmines1.testmod.proxy; public interface CommonProxy { public void init(); public void genInit(); }
Once I get the generator working I want to make it so that my block only spawns on top of grass on the surface.
-
1 hour ago, diesieben07 said:
No, you understand it and then adapt it to your needs.
How much programming / Java experience do you have?
I have basic java experience. Sorry I'm having so much trouble understanding what you guys are saying. I don't understand how to make this property thing.
-
23 minutes ago, Jay Avery said:
Look at the age property.
There is a lot of age related code in that file. Do I just copy this?
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 7);
-
8 hours ago, Draco18s said:
Go look at BlockCrops.
do I just copy the whole file... There is a lot of code.
-
7 minutes ago, Draco18s said:
You will need to create your own property. It's not hard. As in, you could literally copy-paste it and change one number.
Move it out of your blocks class and into your client proxy.
I know I need to make a property I just don’t know how...
-
25 minutes ago, diesieben07 said:
Your ModBlocks class still has a reference to the client-only class ModelLoader. This means ModBlocks is also implicitly client-only, but you will load it on a server. This will break.
As for how to make it less stages, change the IProperty of your crop to only have values 0-2.
How do I change the IProperty of the crop and how do I fix the ModelLoader thing... sorry I'm such noob :\
-
10 minutes ago, diesieben07 said:
- The models for your blocks and items must be registered in your client proxy. Your current code will crash a server.
- Don't use the unlocalized name to create your ModelResourceLocations. Use something like new ModelResourceLocation(thing.getRegistryName(), "inventory").
- The error message clearly tells you what's wrong, it is trying to load the model for age 7, but you only specified ages 0-2 in your blockstate.
I already have all my models registered in my client proxy:
package me.kingofmines1.testmod.proxy; import me.kingofmines1.testmod.init.ModArmor; import me.kingofmines1.testmod.init.ModBlocks; import me.kingofmines1.testmod.init.ModCrops; import me.kingofmines1.testmod.init.ModItems; import me.kingofmines1.testmod.init.ModTools; public class ClientProxy implements CommonProxy { @Override public void init() { ModCrops.registerRenders(); ModTools.registerRenders(); ModBlocks.registerRenders(); ModArmor.registerRenders(); ModItems.registerRenders(); } }
and I only have ages 0-2 because I don't want anymore stages. How do I stop it from looking for more stages
-
I am having trouble getting the texture for my custom crop to work.
ModCrops Class:
package me.kingofmines1.testmod.init; import me.kingofmines1.testmod.Main; import me.kingofmines1.testmod.Reference; import me.kingofmines1.testmod.init.crops.CornCrop; import me.kingofmines1.testmod.util.Utils; import net.minecraft.block.Block; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModCrops { public static Block corncrop; public static void init() { corncrop = new CornCrop("corncrop", "corncrop"); } public static void register() { registerBlock(corncrop); } public static void registerRenders() { registerRender(corncrop); } public static void registerBlock(Block block) { block.setCreativeTab(Main.tab); GameRegistry.register(block); GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName())); Utils.getLogger().info("Registered Block: " + block.getUnlocalizedName().substring(5)); } public static void registerRender(Block block) { ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(new ResourceLocation(Reference.MODID, block.getUnlocalizedName().substring(5)), "inventory")); Utils.getLogger().info("Registered render for " + block.getUnlocalizedName().substring(5)); } }
CornCrop Class:
package me.kingofmines1.testmod.init.crops; import me.kingofmines1.testmod.Reference; import me.kingofmines1.testmod.init.ModItems; import net.minecraft.block.BlockCrops; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; public class CornCrop extends BlockCrops { public CornCrop(String unlocalizedName, String registryName) { this.setUnlocalizedName(unlocalizedName); this.setRegistryName(new ResourceLocation(Reference.MODID, registryName)); } @Override protected Item getSeed() { return ModItems.cornseed; } @Override protected Item getCrop() { return ModItems.corn; } }
corncrop.json:
{ "variants": { "age=0": { "model": "tm:corncropstage0" }, "age=1": { "model": "tm:corncropstage1" }, "age=2": { "model": "tm:corncropstage2" } } }
corncropstage0.json (same for other stages):
{ "parent": "block/crop", "textures": { "crop": "tm:blocks/corncropstage0" } }
Error:
[19:38:51] [Client thread/ERROR] [FML]: Exception loading model for variant tm:corncrop#age=7 for blockstate "tm:corncrop[age=7]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tm:corncrop#age=7 with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:260) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 21 more [19:38:51] [Client thread/ERROR] [FML]: Exception loading model for variant tm:corncrop#age=6 for blockstate "tm:corncrop[age=6]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tm:corncrop#age=6 with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:260) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 21 more [19:38:51] [Client thread/ERROR] [FML]: Exception loading model for variant tm:corncrop#age=5 for blockstate "tm:corncrop[age=5]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tm:corncrop#age=5 with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:260) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 21 more [19:38:51] [Client thread/ERROR] [FML]: Exception loading model for variant tm:corncrop#age=4 for blockstate "tm:corncrop[age=4]" net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model tm:corncrop#age=4 with loader VariantLoader.INSTANCE, skipping at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?] at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:260) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?] at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:248) ~[ModelLoader.class:?] at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:155) ~[ModelLoader.class:?] at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:541) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:387) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:78) ~[ModelBlockDefinition.class:?] at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1253) ~[ModelLoader$VariantLoader.class:?] at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?] ... 21 more
-
I have created a this recipe but I want to work in the player's inventory not just a crafting table since it is a 2x2 recipe.
GameRegistry.addRecipe(new ItemStack(ModBlocks.condensedpoppydust), new Object[]{" ","DD ","DD ", 'D', ModItems.itempoppydust});
-
6 hours ago, Kriptikz said:
lol yea, but it still works
I edited my comment to reflect what little changes there were.
Im about to try and follow the video you sent me. Im making mods for 1.7.10 so is there anything different I need to do when I follow the video?
-
2 minutes ago, Ugdhar said:
You're right, sorry about that.
When importing the project, if you're using a workspace the level above the folder your mod project is in, I think you just uncheck where it says to copy project files into workspace (since it's already there), and it should work.
Its already unchecked and I still get the error.
-
13 minutes ago, diesieben07 said:
- "create a workspace": Create an empty folder somewhere and point eclipse at it.
- "import your project folder as a project": Go to File > Import > General > Existing Projects into Workspace and select the project folder, i.e. the folder containing your build.gradle (not the eclipse folder inside it!).
The issue is that when I try to import the project it says " Some projects cannot be imported because they already exist in the workspace"
5 minutes ago, Ugdhar said:With no intention of offending, you should really learn how to comfortably manage files/folders on your chosen operating system (windows/mac/etc.), and then proceed to make sure you understand basic java syntax. Without these skills, you will have a lot of trouble even trying to accomplish the most basic of things (especially if you're following the tutorials you linked, they're quite out of date, and will not help you unless you know some java already). While people here are great and will offer tons of help and advice, if you repeatedly demonstrate a lack of basic java/programming knowledge, your welcome will wear out quickly. Again, no offense intended, but the above quoted post indicates that you have a bit of homework to do before you're ready to start making mods for minecraft.
I already know a bit of java and have made a working mod. This issue is just because I am getting an error that I don't know how to fix. And I also haven't linked any outdated tutorials I'm using. I WAS linked outdated tutorials.
-
59 minutes ago, diesieben07 said:
Yes, setting up multiple projects (of which the MDK is an example). Again, the MDK is not an "installation of Forge". It is an example project for making a mod, which then references Forge as a library.
When you run setupDecompWorkspace you are installing forge into the Gradle cache. If you run it again in a 2nd project, it will reference the same cache, and not do anything at all. You will only ever have one copy of each Forge version you use, this is the power of Gradle.
In the link you gave me the step for getting the project says. "For Eclipse, create a workspace anywhere (though the easiest location is one level above your project folder). Then simply import your project folder as a project, everything will be done automatically." What exactly is it asking me to do here.
-
8 minutes ago, Jay Avery said:
This tutorial explains how to set up Forge in its own workspace so that more than one mod can be linked to it.
When I get to the part that where I have to import forge when I click on the eclipse file it says "Some projects cannot be imported because they already exist in the workspace" and it won't let me click finish.
-
Im sure this is extremely simple but for some reason I can't figure out how to do this. I have already setup the JDK, forge, and eclipse and made my first mod but I don't know how to make a new project in eclipse that has all the forge resources and stuff.
[1.11] World Generation
in Modder Support
Posted
Im calling the genInit() method in my main class