
skeddles
Members-
Posts
25 -
Joined
-
Last visited
Everything posted by skeddles
-
I want to make it so some mobs aren't hostile towards players, such as golems or wolves, even after being attacked. What do I need to do to accomplish this?
-
why is registerItems and registerRenders events firing before preinit?
skeddles replied to skeddles's topic in Modder Support
Okay, thanks -
why is registerItems and registerRenders events firing before preinit?
skeddles replied to skeddles's topic in Modder Support
Is that registerItems? I moved it there and it seems to work. I was following this guide which tells you to do it the other way. -
I thought I did this just how I did last time, but for some reason when I run this code, the register items and renders events in the item class come before the preInit event from my main class. What did I do wrong? showing the order: [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO]: [STDOUT]: SIGN VARIETY registerItems() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO]: [STDOUT]: SIGN VARIETY registerRenders() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [13:37:42] [main/INFO] [FML]: Applying holder lookups [13:37:42] [main/INFO] [FML]: Holder lookups applied [13:37:42] [main/INFO] [FML]: Injecting itemstacks [13:37:42] [main/INFO] [FML]: Itemstack injection complete [13:37:42] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: UP_TO_DATE Target: null [13:37:42] [Thread-3/INFO] [FML]: Using sync timing. 200 frames of Display.update took 53019200 nanos [13:37:43] [Sound Library Loader/INFO]: Starting up SoundSystem... [13:37:43] [Thread-5/INFO]: Initializing LWJGL OpenAL [13:37:43] [Thread-5/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [13:37:43] [Thread-5/INFO]: OpenAL initialized. [13:37:43] [Sound Library Loader/INFO]: Sound engine started [13:37:45] [main/INFO] [FML]: Max texture size: 16384 [13:37:45] [main/INFO]: Created: 512x512 textures-atlas [13:37:46] [main/INFO]: [STDOUT]: signvariety:init [13:37:46] [main/INFO]: [STDOUT]: signvariety:preInit [13:37:46] [main/INFO]: [STDOUT]: SIGN VARIETY init() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< [13:37:46] [main/INFO] [FML]: Injecting itemstacks main java file: package signvariety; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; @Mod(modid = signvariety.MODID, version = signvariety.VERSION) public class signvariety { public static final String MODID = "signvariety"; public static final String VERSION = "1.0.0"; @EventHandler public void preInit(FMLInitializationEvent event) { Items.init(); } } items java file package signvariety; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @Mod.EventBusSubscriber(modid="signvariety") public class Items { private static Item mySign; public static void init () { System.out.println("SIGN VARIETY init() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); mySign = new SignItem("mySign"); } @SubscribeEvent public static void registerItems(RegistryEvent.Register<Item> event) { System.out.println("SIGN VARIETY registerItems() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); //event.getRegistry().registerAll(mySign); } @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { System.out.println("SIGN VARIETY registerRenders() <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); //ModelLoader.setCustomModelResourceLocation(mySign, 0, new ModelResourceLocation(mySign.getRegistryName(), "inventory")); } }
-
Is it possible to rename items without breaking people's saves?
skeddles replied to skeddles's topic in Modder Support
How can I look at what events there are? I found this thread which explains it but I can't figure how to do it with my IDE or what exactly to click. I used IntelliJ. Usually I right click > go to > declaration. //loot tables @SubscribeEvent public static void lootLoad(LootTableLoadEvent evt) { //code } -
I want to make it a chance that you get no item from my loot table. I adding the items dynamically, not grabbing them from a json file. How can I add a blank item? Only thing I've found is ItemStack.EMPTY but LootEntryItem wants an Item not an Itemstack. part of my code: ArrayList<LootEntryItem> entries = new ArrayList<LootEntryItem>(); entries.add(new LootEntryItem(abcmExcalibur, 10, 60, new LootFunction[0], new LootCondition[0], "heroicarmory:abcmExcalibur")); LootEntry [] entriesArray = entries.toArray(new LootEntry[entries.size()]); LootPool pool = new LootPool(entriesArray, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "heroicarmorypool"); evt.getTable().addPool(pool); does not work: entries.add(ItemStack.EMPTY ,new LootEntryItem(null, 1169, 60, new LootFunction[0], new LootCondition[0], "heroicarmory:empty"));
-
Is it possible to rename items without breaking people's saves?
skeddles replied to skeddles's topic in Modder Support
I just formatted them poorly like camelCaseStyleName instead of underscore_style_name like people would expect -
Is it possible to choose order of @Config fields?
skeddles replied to skeddles's topic in Modder Support
Not sure if this is possible, but I want to dynamically add options to my config based on loot tables added by any mods. I thought maybe I could create an arraylist and then convert it to an enum? Doesn't seem to work though. Any advice? ArrayList<String> modLootTables = new ArrayList<String>(); //loot tables @SubscribeEvent public static void lootLoadConfig(LootTableLoadEvent evt) { String name = evt.getName().toString(); System.out.println("loot table in config!!!!" + name); entries.add(name); public static float damageScale = 1; } @Name("Loot Tables") public static Enumeration<String> e = Collections.enumeration(modLootTables); -
How do I create a LootPool with multiple entries
skeddles replied to skeddles's topic in Modder Support
I didn't realize that it could be an array. This code seems to work now. I haven't used arrays before, how does this look? Would there be any performance loss doing it this way, even if there was hundreds or thousands of items? //loot tables @SubscribeEvent public static void lootLoad(LootTableLoadEvent evt) { String name = evt.getName().toString(); if (name.contains("chest")) { LootEntry[] entry = { new LootEntryItem(Items.COOKIE, 1, 60, new LootFunction[0], new LootCondition[0], "test:cookie"), new LootEntryItem(Items.SKULL, 1, 60, new LootFunction[0], new LootCondition[0], "test:skull") }; LootPool pool = new LootPool(entry, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "testpool"); evt.getTable().addPool(pool); } } edit: just realized i need to be able to add to the array at will so probably need an arraylist, workin on that edit: here's what I got now, uses an arraylist and then converts it at the end: ArrayList<LootEntryItem> entries = new ArrayList<LootEntryItem>(); entries.add(new LootEntryItem(Items.COOKIE, 1, 60, new LootFunction[0], new LootCondition[0], "examplemod:cookie")); entries.add(new LootEntryItem(Items.SKULL, 1, 60, new LootFunction[0], new LootCondition[0], "examplemod:skull")); LootEntry [] entriesArray = entries.toArray(new LootEntry[entries.size()]); LootPool pool = new LootPool(entriesArray, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "heroicarmorypool"); evt.getTable().addPool(pool); -
I originally created my LootPool by making my LootEntry a LootEntryTable that gets the items from a loot table json, but now I want to do it with code. I figured out how to create a loot entry for a single item by using LootEntryItem instead of LootEntryTable, but how can I make a list of multiple items? //loot tables @SubscribeEvent public static void lootLoad(LootTableLoadEvent evt) { String name = evt.getName().toString(); if (name.contains("chest")) { LootEntry entry = new LootEntryItem(Items.COOKIE, 15, 60, new LootFunction[0], new LootCondition[0], "modpoolcustomtest"); LootPool pool = new LootPool(new LootEntry[] {entry}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(1), "modpool"); evt.getTable().addPool(pool); } }
-
I'm making a config file with @Config (and to use with the in game editor, which is where I'm looking at it) It seems to sort the fields alphabetically by @Name. Is there a way to set the order or group them? Is there any way to add headings? Also if you know of an example showing how to use the info set in the config file, that would be helpful.
-
I was using latest forge for 1.11 and a couple times the game crashed (probably ran out of ram). It's not that bad it happens a lot, but we lost hours of progress. Isn't minecraft supposed to save occasionally? Is there any way I can make it save more or some way to force a save? Any ideas appreciated.
-
How do I make minecraft open the logging window without going through a launcher, when just running gradlew runClient from command line?
-
Yup, seems I just need that one little word. Thank you.
-
I'm trying to add my items to all chest loot tables. I have attempted to do this and set up a loot table (from a json file) which is supposed to add a nether star to chests. I don't get any build errors, but don't see it in any chests. I registered the resource location and subscribe to the LootTableLoadEvent, where I add my pool. Here is my code: https://github.com/skeddles/heroicarmory/blob/master/src/main/java/HeroicArmory/init/ModItems.java Any help would be appreciated. (also if anyone knows a better way to test this other than flying around looking for villages on a superflat, lemme know)
-
[1.10.2] Change item texture based on NBT values
skeddles replied to skeddles's topic in Modder Support
Any ideas on ways around it? Tinkers Construct has far more combinations than me yet they load almost instantly. -
[1.10.2] Change item texture based on NBT values
skeddles replied to skeddles's topic in Modder Support
There are the two times when it takes an unacceptably long time during loading. Are you saying even if I used NBT data and didn't register each as it's own item in the game, these steps would still have to happen? -
I'm programatically combining textures to create items. Unfortunately there's too many items in the end (thousands) and it makes forge take forever to load. So I think I'll have to use NBT values (can't use damage because it's a tool). Seems like you add the NBT value when returning the itemstack from the recipe, but how do I then change the texture based on that value?
-
[1.10.2] Store Item or Blocks for recipe in same variable
skeddles replied to skeddles's topic in Modder Support
So I added this and it works for accepting one of the two types. public class ModMaterial { private String name; private Item craftingItem; private Block craftingBlock; //tools private int harvestLevel; private int maxUses; private Float efficiency; private Float damage; private int enchantability; private Item.ToolMaterial toolMaterial; //constructor public ModMaterial(final String name, final Item craftingItem, final boolean hiltOnly, final int harvestLevel, final int maxUses, final Float efficiency, final Float damage, final int enchantability) { this.name = name; this.craftingItem = craftingItem; this.harvestLevel = harvestLevel; this.maxUses = maxUses; this.efficiency = efficiency; this.damage = damage; this.enchantability = enchantability; this.toolMaterial = EnumHelper.addToolMaterial(name,harvestLevel, maxUses, efficiency, damage, enchantability); } //constructor public ModMaterial(final String name, final Block craftingBlock, final int harvestLevel, final int maxUses, final Float efficiency, final Float damage, final int enchantability) { this.name = name; this.craftingBlock = craftingBlock; this.harvestLevel = harvestLevel; this.maxUses = maxUses; this.efficiency = efficiency; this.damage = damage; this.enchantability = enchantability; this.toolMaterial = EnumHelper.addToolMaterial(name,harvestLevel, maxUses, efficiency, damage, enchantability); } //output public String name() { return this.name; } public String nameLower() { return this.name.toLowerCase(); } public Item craftingMaterial() { if (this.craftingItem != null) { return this.craftingItem; } else { return this.craftingBlock; } } } The output function (craftingMaterial()) does not work though, because it has to be declared as a type (meaning I can't do the if statement in it which I tried). I don't understand what getItemFromBlock is and can't find it in the documentation and my my ide can't resolve it. -
public class ModMaterial { private String name; private Item craftingMaterial; //tools private int harvestLevel; private int maxUses; private Float efficiency; private Float damage; private int enchantability; private Item.ToolMaterial toolMaterial; //constructor public ModMaterial(final String name, final Item craftingMaterial, final int harvestLevel, final int maxUses, final Float efficiency, final Float damage, final int enchantability) { this.name = name; this.craftingMaterial = craftingMaterial; this.harvestLevel = harvestLevel; this.maxUses = maxUses; this.efficiency = efficiency; this.damage = damage; this.enchantability = enchantability; this.toolMaterial = EnumHelper.addToolMaterial(name,harvestLevel, maxUses, efficiency, damage, enchantability); } } I have this class to create objects which store info about materials for my mod. Right now the crafting material is specified as an Item type, but I want it to also accept Block types as this is used in recipes and some are made from blocks and some are made from items. Any ideas?
-
I'm having frequent crashes with my minecraft forge setup. We're using the JoyPad mod and running 3 copies of minecraft at once using the "Open to LAN" feature. We'll be playing and all of a sudden one of the clients will just instantly close. Lately it only lasts about half an hour before one of the clients crashes. Sometimes it's the server, sometimes it's not. Sometimes we'll getting a warning from windows saying we're low on ram and it want's to close java. Sometimes it will give us a crash log, sometimes it will not. I've included a few at the bottom. It usually includes an OutOfMemoryError line. I'm hoping there's either a way to figure out which mod may be causing a problem, or maybe a change to the JVM arguments that will give us better performance. Minecraft Version: 1.7.10 Forge Version: 10.13.4.1614 JVM arguments: -Xmx5G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M List of Mods: Computer Specs: Crash Reports:
-
Z:\Program Files (x86)\Minecraft\science server>java -Xmx3G -Xms2G -jar BigDig.j ar nogui 2013-10-20 21:51:09 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.2.12.712 for Minecraft 1.5.2 loading 2013-10-20 21:51:09 [iNFO] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Serv er VM, version 1.7.0_45, running on Windows 8:amd64:6.2, installed at C:\Program Files\Java\jre7 2013-10-20 21:51:09 [WARNING] [ForgeModLoader] The coremod bspkrs.treecapitator. fml.asm.TreeCapitatorCorePlugin does not have a MCVersion annotation, it may cau se issues with this version of Minecraft 2013-10-20 21:51:09 [WARNING] [ForgeModLoader] The coremod codechicken.core.asm. CodeChickenCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft 2013-10-20 21:51:09 [WARNING] [ForgeModLoader] The coremod cofh.asm.CoFHPlugin d oes not have a MCVersion annotation, it may cause issues with this version of Mi necraft 2013-10-20 21:51:09 [WARNING] [ForgeModLoader] The coremod micdoodle8.mods.galac ticraft.asm.GalacticraftPlugin does not have a MCVersion annotation, it may caus e issues with this version of Minecraft 2013-10-20 21:51:09 [WARNING] [ForgeModLoader] The coremod mods.immibis.microblo cks.coremod.MicroblocksCoreMod does not have a MCVersion annotation, it may caus e issues with this version of Minecraft 2013-10-20 21:51:09 [WARNING] [ForgeModLoader] The coremod codechicken.nei.asm.N EICorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft 2013-10-20 21:51:09 [iNFO] [ForgeModLoader] Downloading file http://files.minecr aftforge.net/fmllibs/argo-small-3.2.jar 2013-10-20 21:51:09 [iNFO] [ForgeModLoader] Download complete 2013-10-20 21:51:09 [iNFO] [ForgeModLoader] Downloading file http://files.minecr aftforge.net/fmllibs/guava-14.0-rc3.jar 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Download complete 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Downloading file http://files.minecr aftforge.net/fmllibs/asm-all-4.1.jar 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Download complete 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Downloading file http://files.minecr aftforge.net/fmllibs/bcprov-jdk15on-148.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] There was a problem downloading th e file bcprov-jdk15on-148.jar automatically. Perhaps you have an environment wit hout internet access. You will need to download the file manually or restart and let it try again 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Downloading file http://files.minecr aftforge.net/fmllibs/deobfuscation_data_1.5.2.zip 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Download complete 2013-10-20 21:51:11 [iNFO] [ForgeModLoader] Downloading file http://files.minecr aftforge.net/fmllibs/scala-library.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] There was a problem downloading th e file scala-library.jar automatically. Perhaps you have an environment without internet access. You will need to download the file manually or restart and let it try again 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] There were errors during initial F ML setup. Some files failed to download or were otherwise corrupted. You will ne ed to manually obtain the following files from these download links and ensure y our lib directory is clean. 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] *** Download http://files.minecraf tforge.net/fmllibs/argo-small-3.2.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] *** Download http://files.minecraf tforge.net/fmllibs/guava-14.0-rc3.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] *** Download http://files.minecraf tforge.net/fmllibs/asm-all-4.1.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] *** Download http://files.minecraf tforge.net/fmllibs/bcprov-jdk15on-148.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] *** Download http://files.minecraf tforge.net/fmllibs/deobfuscation_data_1.5.2.zip 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] *** Download http://files.minecraf tforge.net/fmllibs/scala-library.jar 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] <===========> 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] The following is the errors that c aused the setup to fail. They may help you diagnose and resolve the issue 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] A download error occured 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] A download error occured 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] <<< ==== >>> 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] The following is diagnostic inform ation for developers to review. 2013-10-20 21:51:11 [sEVERE] [ForgeModLoader] Error details java.lang.RuntimeException: A download error occured at cpw.mods.fml.relauncher.RelaunchLibraryManager.downloadFile(RelaunchL ibraryManager.java:548) at cpw.mods.fml.relauncher.RelaunchLibraryManager.handleLaunch(RelaunchL ibraryManager.java:165) at cpw.mods.fml.relauncher.FMLRelauncher.setupHome(FMLRelauncher.java:17 2) at cpw.mods.fml.relauncher.FMLRelauncher.relaunchServer(FMLRelauncher.ja va:147) at cpw.mods.fml.relauncher.FMLRelauncher.handleServerRelaunch(FMLRelaunc her.java:45) at net.minecraft.server.MinecraftServer.main(MinecraftServer.java:1365) Caused by: java.io.FileNotFoundException: http://files.minecraftforge.net/fmllib s/bcprov-jdk15on-148.jar at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unkno wn Source) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So urce) at cpw.mods.fml.relauncher.RelaunchLibraryManager.downloadFile(RelaunchL ibraryManager.java:532) ... 5 more Caused by: java.io.FileNotFoundException: http://files.minecraftforge.net/fmllib s/bcprov-jdk15on-148.jar at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So urce) at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown So urce) at java.net.URLConnection.getHeaderFieldLong(Unknown Source) at java.net.URLConnection.getContentLengthLong(Unknown Source) at java.net.URLConnection.getContentLength(Unknown Source) at cpw.mods.fml.relauncher.RelaunchLibraryManager.downloadFile(RelaunchL ibraryManager.java:531) ... 5 more Z:\Program Files (x86)\Minecraft\science server>pause Press any key to continue . . . I think that's what's happening at least. This is on a server for big dig from techinc, I haven't touched it, it crashes on first run.
-
when I hit run I get this window, what am I supposed to run to get my mod to open in minecraft? also when I try to add a recipie, I get a red x, is that normal? It doesn't say it's an error here is what it says when I hover over the x: Multiple markers at this line - Syntax error on tokens, ConstructorHeaderName expected instead - Syntax error on token "(", delete this token
-
How to fix "scala-library.jar; cannot read zip file"
skeddles replied to jarrett's topic in Modder Support
Thank you very much for this post, I almost gave up. One thing I noticed is that there's a bit of a gap in between when the installer downloads scala-library.jar and when it extracts it, so if you're quick you can just paste the new one right over the broken one and the installer will run all the way through. Thanks again!