Jump to content

American2050

Members
  • Posts

    553
  • Joined

Everything posted by American2050

  1. Recipe registration event? But that you mean in case I do it "The old way style" from the code itself right? I was talking about the recipes on the assets/recipe folder that apparently is what we should be using now. I see you mentions something about conditions on the link you posted, gonna take a look at that. Lot has changed kinda lost here, but I guess I will figure it out or not once I get into doing it. Thanks
  2. Thanks a lot man Gonna give it a try.
  3. So my best option would be to register them the old way for now, until it's completely necessary to update? (I think I would much rather create some json generator to make those for me, probably takes me more time now, but it will be handy to have) Thanks.
  4. Do you get any error on the console? Make sure the file has the .json extension.
  5. Well I read that you can do anything that you can do in code, the same for JSON recipes. I have a question, how do I register / or not a recipe depending on the value of a config on the .cfg file? ***** Another question. I used to have in 1.10.2 a function to register recipes that always have the same shape, it only changes the ingredients and results, so I made something like this: registerRecipesFor(Items.NETHER_STAR, ModCompressedBlocks.COMP_NETHER_STAR_1, ModCompressedBlocks.COMP_NETHER_STAR_2, ModCompressedBlocks.COMP_NETHER_STAR_3, ModCompressedBlocks.COMP_NETHER_STAR_4, ModCompressedBlocks.COMP_NETHER_STAR_5, ModCompressedBlocks.COMP_NETHER_STAR_6, ModCompressedBlocks.COMP_NETHER_STAR_7, ModCompressedBlocks.COMP_NETHER_STAR_8, ModCompressedBlocks.COMP_NETHER_STAR_9); And then the function just create the recipes private static void registerRecipesFor(Item base, CompressBlock comp1, CompressBlock comp2, CompressBlock comp3, CompressBlock comp4, CompressBlock comp5, CompressBlock comp6, CompressBlock comp7, CompressBlock comp8, CompressBlock comp9){ //COMP1 GameRegistry.addRecipe(new ItemStack(comp1, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(base, 1, 0)); //COMP2 GameRegistry.addRecipe(new ItemStack(comp2, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp1, 1, 0)); //COMP3 GameRegistry.addRecipe(new ItemStack(comp3, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp2, 1, 0)); //COMP4 GameRegistry.addRecipe(new ItemStack(comp4, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp3, 1, 0)); //COMP5 GameRegistry.addRecipe(new ItemStack(comp5, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp4, 1, 0)); //COMP6 GameRegistry.addRecipe(new ItemStack(comp6, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp5, 1, 0)); //COMP7 GameRegistry.addRecipe(new ItemStack(comp7, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp6, 1, 0)); //COMP8 GameRegistry.addRecipe(new ItemStack(comp8, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp7, 1, 0)); //COMP9 GameRegistry.addRecipe(new ItemStack(comp9, 1, 0), "XXX", "XXX", "XXX", 'X', new ItemStack(comp8, 1, 0)); //UNCOMP1 GameRegistry.addShapelessRecipe(new ItemStack(base, 9, 0), new ItemStack(comp1, 1, 0)); //UNCOMP2 GameRegistry.addShapelessRecipe(new ItemStack(comp1, 9, 0), new ItemStack(comp2, 1, 0)); //UNCOMP3 GameRegistry.addShapelessRecipe(new ItemStack(comp2, 9, 0), new ItemStack(comp3, 1, 0)); //UNCOMP4 GameRegistry.addShapelessRecipe(new ItemStack(comp3, 9, 0), new ItemStack(comp4, 1, 0)); //UNCOMP5 GameRegistry.addShapelessRecipe(new ItemStack(comp4, 9, 0), new ItemStack(comp5, 1, 0)); //UNCOMP6 GameRegistry.addShapelessRecipe(new ItemStack(comp5, 9, 0), new ItemStack(comp6, 1, 0)); //UNCOMP7 GameRegistry.addShapelessRecipe(new ItemStack(comp6, 9, 0), new ItemStack(comp7, 1, 0)); //UNCOMP8 GameRegistry.addShapelessRecipe(new ItemStack(comp7, 9, 0), new ItemStack(comp8, 1, 0)); //UNCOMP9 GameRegistry.addShapelessRecipe(new ItemStack(comp8, 9, 0), new ItemStack(comp9, 1, 0)); } My question is, how I do this with JSON? Or will I actually have to create 1 file for each and everyone of the recipes? Thanks a lot for the help. Sure will have more questions, but for now those 2 are the ones that have me more worried Thanks
  6. Thanks. Yes not even sure why this happen, I saw Java 9 but I installed the 8. I guess IntelliJ wanted to check against Java 9 anyway. That fixed it making sure I had selected Java 8 everywhere and finally was able to launch
  7. Thanks a lot. Gonna save that for reference. I just uninstalled IntelliJ, Java JDK and JRE reinstall everything and after another minor bump with IntelliJ trying to "Compile"(?) agains't Java 9 and changing that to Java 8 in 3 different places, I now finally got it to launch Now let's this experience begin. I have used IntelliJ in the past for Android, but never for MC. Let's see how it goes. Thanks once again.
  8. So I had give IntelliJ a try like about 3 times already, and always have some problem when trying to use it as a Minecraft Development Environment. There is always some issue and I give up and keep using Eclipse. This time I followed yet another Youtube tutorial, and I'm having some issues. When I try to launch MC now I get this error: Anyone know what could it be that I'm missing. Or anyone has some fools proof tutorial of the step by step on how to set up IntelliJ, it looks like the ones I followed always forget to cover some topic and that makes it so it doesn't work for me. Thanks a lot.
  9. Thanks a lot, will start to do that from now on so I avoid this problems.
  10. I have a question, I notice this happens for entities but not for items/blocks I have a class for example named "ModItems" and in there I have 2 methods, one for registering the items (called from the mod main class) and other for registering the renders (called from the client proxy) So far so good. Problem is, when I do the same for TileEntities, when I try to launch server it complains that I'm calling the register of renders for entities from the server side. Even when that's not actually happening. java.lang.NoClassDefFoundError: net/minecraft/client/renderer/tileentity/TileEntitySpecialRenderer at com.mramericanmike.irishluck.IrishLuck.preInit(IrishLuck.java:88) ~[bin/:?] That line actually is ModTE.init(); And ModTE is public class ModTE { public static void init() { GameRegistry.registerTileEntity(TEBlockError404.class, "block_irishluck_big_404"); GameRegistry.registerTileEntity(TEBlockGhost.class, "block_ghost"); } public static void registerRenders() { TileEntitySpecialRenderer renderBE404 = new RenderBlockError404(); ClientRegistry.bindTileEntitySpecialRenderer(TEBlockError404.class, renderBE404); } } And... Probably here is my problem, as I write it I notice this, I'm calling that regsterRenders from ClientProxy preInit public void preInit() { //Register Renders on Client Side Only ModItems.registerRenders(); ModBlocks.registerRenders(); ModTE.registerRenders(); } What could be causing this behavior? Thanks a lot. PS: As I write this and compare with my other classes I notice I was missing the @SideOnly(Side.CLIENT) But I'm confuse... If the method isn't getting called, why it executes it anyway? And... Weren't we supposed to not use @SideOnly(Side.CLIENT) anymore? Once again, thanks for any clarification about this
  11. I don't like too much to do "Bumps" but if anyone knows and can give me some advice on where to look for this, I will appreciate, I'm lost in this one. Thanks a lot.
  12. So, I know there are some AI already in the game that you can attach to custom entities. For example, I know there are 2 "EntityAIWatchClosest" What I don't know, because I don't fully understand the AI, for this example, how do I tell the game what parts of my entity are the "Head" that should rotate towards the player (And in this case, how do I tell the game that the whole entity is a "head" so it all turns towards the player) Thanks in advance for any help.
  13. As why am I using RenderManager directly, the answer I guess it's because it always worked for me, for a long time with no issues at all Sorry I don't have a better reason. As for the code that is called Client-Side, again I always had it like that without any issues, even using this mod on servers. So not sure if it's just a bad practice coming from me, or something that just works, and that's why I have it like that. I guess I should move the rendering to it's own class? And call those from Client Proxy? I will give the RegistryEvent.Register<Item> a try and see how it goes. Again, I was calling the render on init because I believe that was suggested to me time ago, where if I called my rendering on pre-init it just wouldn't work. I just updated to the newest Forge, and I believe I did some update time ago, so probably that was what broke my renderings. Thanks a lot for your help.
  14. So, I don't know why this happens, and not sure if I even touch anything like to "break it" but my items and blocks aren't rendering anymore, and I can't find anything on the logs as to what the problem could be. On my main class I have on preInit //INIT ITEMS ModItems.init(); //INIT BLOCKS ModBlocks.init(); ModItems looks like this: public class ModItems { //CREATE THE ITEMS public static final ModItem CLOVER = new Clover("clover"); public static void init() { registerItem(CLOVER); } //This gets called on ClientPoxy public static void registerRenders() { registerRender(CLOVER); } private static void registerItem(Item item){ GameRegistry.register(item); } public static void registerRender(Item item) { ModelResourceLocation modelLocation = new ModelResourceLocation(item.getRegistryName(), "inventory"); ModelLoader.setCustomModelResourceLocation(item, 0, modelLocation); } } ClientProxy is called on init and looks like this: public class ClientProxy extends CommonProxy { @Override public void registerRender() { //Register Renders on Client Side Only ModItems.registerRenders(); ModBlocks.registerRenders(); RenderManager renderManager = Minecraft.getMinecraft().getRenderManager(); renderManager.entityRenderMap.put(MyDragon.class, new RenderMyDragon(renderManager)); } } The item clover.json is: (Located at: assets.irishluck.models.item and the clover.png at assets.irishluck.textures.items) { "parent": "item/generated", "textures": { "layer0": "irishluck:items/clover" } } Not sure what's going on here. In the meanwhile I'm gonna rebuild my workspace and let you guys know. Any ideas? Thanks a lot. PS: My latest log https://pastebin.com/yCL7AqHH
  15. Thanks, I will try it, yes I'm using Eclipse
  16. Yes, that combination was still making so that special Wither attack, destroyed the block.
  17. I went from this.setResistance(6000000.0F); to this.setResistance(600000000.0F); (adding two 0) that didn't do it... I now added this other method: @Override public boolean canDropFromExplosion(Explosion explosion) { return false; } and apparently does the trick. From what I saw on the Wither code itself, it's there where it says that Wither can't destroy certain blocks, so it's not because block is set as unbreakable, but because of those lines on the Wither Code. Wither code: public static boolean canDestroyBlock(Block blockIn) { return blockIn != Blocks.BEDROCK && blockIn != Blocks.END_PORTAL && blockIn != Blocks.END_PORTAL_FRAME && blockIn != Blocks.COMMAND_BLOCK && blockIn != Blocks.REPEATING_COMMAND_BLOCK && blockIn != Blocks.CHAIN_COMMAND_BLOCK && blockIn != Blocks.BARRIER; }
  18. So... I'm having a problem with a block I made. I set it as "unbreakable" so it's like Bedrock. However a Wither can still destroy it, not with a regular attack, but if the Wither can't see me and starts shooting enchanted heads, those break my blocks. What could the problem be? PS: I'm now adding the method canEntityDestroy but that's a temporary fix, as it still means that my block is somehow still breakable by other means. PS2: Not even having that method helps.
  19. Well, the title pretty much already explains it. Is there any way to have one workspace set up to work with for example MC 1.10.2 and have all my mods there, and be able to work on them and launch them individually? How would it be done? Thanks a lot.
  20. Anyone has a clear guide for this explaining step by step everything that is needed? I see once again I wont learn how to do this I guess it's not just 1 line of code as Draco posted, but I need more stuff somewhere for this to work
  21. So today, I redid it, so I could post the error I was getting, and for some reason I don't get the error anymore. So not sure, if either I did something different today, or if the other day it was Gradle doing some weird stuff. Now the problem is, that it's not doing anything. Not sure what I'm missing. Main Class package com.mramericanmike.karatgarden; import java.io.File; import com.mramericanmike.karatgarden.configuration.ConfigValues; import com.mramericanmike.karatgarden.configuration.ConfigurationHandler; import com.mramericanmike.karatgarden.init.GeneralRecipes; import com.mramericanmike.karatgarden.init.ModBlocks; import com.mramericanmike.karatgarden.init.ModItems; import com.mramericanmike.karatgarden.proxy.IProxy; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; @Mod(modid = ModInfo.MODID, name = ModInfo.MOD_NAME, version = "{@version:mod}", guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "{@version:mc}") public class KaratGarden { @Mod.Instance(ModInfo.MODID) public static KaratGarden instance; @SidedProxy(clientSide = ModInfo.CLIENT_PROXY_CLASS, serverSide = ModInfo.SERVER_PROXY_CLASS) public static IProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { //CONFIGURATION ConfigurationHandler.init(new File(event.getModConfigurationDirectory(), ModInfo.MOD_NAME+".cfg")); MinecraftForge.EVENT_BUS.register(new ConfigurationHandler()); //INIT ITEMS ModItems.init(); //INIT BLOCKS ModBlocks.init(); //Register Renders - This will call the right Side - Check ClientProxy for Items and Blocks render registration proxy.registerRender(); //Init other Proxy stuff here - Check ClientProxy and ServerPorxy proxy.otherInits(); //ADD SEEDS TO GRASS if(ConfigValues.seedsDropsFromGrass){ MinecraftForge.addGrassSeed(new ItemStack(ModItems.SEED_CARROT_BASE), 10); } } @EventHandler public void init(FMLInitializationEvent event) { //INIT RECIPES GeneralRecipes.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } The build.gradle buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' } } apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. def modVersion = "0.1.1" def mcVersion = "1.11.2" version = modVersion+"-["+mcVersion+"]" group = "com.mramericanmike.karatgarden" archivesBaseName = "KaratGarden" sourceCompatibility = targetCompatibility = "1.8" compileJava { sourceCompatibility = targetCompatibility = "1.8" } minecraft { version = "1.11.2-13.20.0.2296" runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20161220" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. replace "{@version:mod}":modVersion,"{@version:mc}":mcVersion } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, // except that these dependencies get remapped to your current MCP mappings //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } I see the "processResources" there, I assume it's related with what I want to achieve here, but again, not sure, and don't understand what's going on there, that's why I'm asking here. That is all default as it comes with Forge I do believe 1 time it did replaced somewhere, because when I launch on a test environment the built jar I get this: So a 0.1.1 from somewhere and somewhere, got replaced.
  22. Yes I guess that is, gonna take a look to see if I figure out how this works. That is basically what already comes with the example mod I believe, that I don't know how to get it working. So.... kinda lost here. There must be more than just those def and that replace line, because when I try to build I get
  23. So, long time ago I asked and was told it was not easy, that I stick to doing it manually, but I think it's time to do it, and learn how to do it. Even if it's not easy, it can't be impossible and should there be someone that can explain it on an easy way step by step. The question is easy, how do I make so I can change the version of my mode in only 1 place, and it gets updated on ModInfo.java / mcmod.info and build.gradle I think it's the same Forge example that comes with a {$version} or something like that, but I never knew how to use it. Thanks a lot for the help
  24. Ohh ok. Yes that was other one I was having to change while updating to 1.11.2 the Chat messages. Interesting, and for sure, it makes things more clear and nice looking.
  25. I was wondering why between version and versions we get minor changes like 1.10.2 Minecraft.getMinecraft().theWorld; 1.11.2 Minecraft.getMinecraft().world; Is it really that important to rename those things, what's the overall idea behind this changes? Well, just wondering this, thanks for the feedback.
×
×
  • Create New...

Important Information

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