Everything posted by Choonster
-
[1.12] Figuring out registries
You must set the registry name of an IForgeRegistryEntry with IForgeRegistryEntry#setRegistryName before registering it. For ItemBlocks, use the Block's registry name.
-
[SOLVED][1.10.2] IStateMapper for invalid side SERVER
I feel like there may have been a misunderstanding here, since TileEntities seem like the ideal tool for this job. Could you link this reaction? I'd like to see the reasoning behind it. I don't really get what nested Maps have to do with packet size. You need to send all three coordinates in the packet regardless of how the position is stored. There shouldn't be any major difference in memory consumption between an array of ints and an array of objects, if anything you're probably increasing the memory overhead by storing arrays of primitive wrapper classes (Integers). I'm not an expert on this, you should profile it if you want actual numbers. Storing object references rather than IDs shouldn't affect CraftTweaker, just convert from the ID to the Material object.
-
[1.11.2] Items with Inventories: Persistence (Solved)
You should be using IItemHandler, Forge's replacement for IInventory. You can use or extend ItemStackHandler, the standard IItemHandler implementation. ItemStackHandler implements INBTSerializable, you should use those methods to read it from/write it to NBT. Alternatively, use the IItemHandler capability's IStorage instance. I'm not sure exactly why your code isn't working, but I noticed that you're comparing the ItemStack to ItemStack.EMPTY directly; don't do this. Use ItemStack#isEmpty to check if an ItemStack is empty, ItemStack.EMPTY is just one possible empty ItemStack.
-
[SOLVED] [1.12] Registered SoundEvent not playing without error
I'm glad you figured it out.
-
[SOLVED] [1.12] Registered SoundEvent not playing without error
Sorry, I missed that. This is very odd, including your mod ID in the sounds.json event name should result in a Sound being registered for the ResourceLocation with <modid> as the domain and <modid>:<name> as the path. Could you post a Git repository of your mod? I'd like to see if I can reproduce and debug this locally.
-
[1.12] Figuring out registries
You're calling Item.getItemFromBlock before you actually create and register the ItemBlocks, so it returns Items.AIR. You need to create and register the ItemBlocks in the RegistryEvent.Register<Item> handler method.
-
[SOLVED][1.10.2] IStateMapper for invalid side SERVER
Switching to registry events won't actually fix either problem itself, it's just something you should do to prepare for updating to newer versions. Moving model registration to a client-only class will fix the first problem. The issue here is that BlockOre references the client-only class Minecraft. You use it in two places (getDrops and getExtendedState) for the same purpose (getting a World when you only have an IBlockAccess), but the replacement will be slightly different in each method due to where they're called from. Since getDrops will usually be called with a World as its IBlockAccess argument, cast it to World (after checking that it is a World) and use that to get the ore data. Since getExtendedState will usually be called with a ChunkCache as its IBlockAccess argument, you can't just cast it to World. Instead, create a method in your proxy classes to get the client World and use this to get the ore data. It's probably best to check if the IBlockAccess is a World first and use that directly, just in case someone calls the method with a World. This would be a lot easier if you just used a TileEntity to store per-position block data. If you're going to stick with the current system, OreSavedData should use a Map with BlockPos keys instead of using nested Maps for each coordinate. Is there a reason you're storing everything as integers rather than storing the Material instances directly?
-
[SOLVED] [1.12] Registered SoundEvent not playing without error
Minecraft automatically uses your mod ID as the domain for the top-level sound event names in sounds.json, don't specify it yourself. Change redplusplus:item.redstone_sandwich.eat to item.redstone_sandwich.eat in your sounds.json file.
-
[SOLVED][1.10.2] IStateMapper for invalid side SERVER
The documentation page I linked explains them. You can see some examples of them in my mod's init classes.
-
GameRegistry.register problem(beginner)
Did you read the thread? You need to use registry events.
-
[SOLVED][1.10.2] IStateMapper for invalid side SERVER
That line references ModFluids, which references the client-only classes StateMapperBase (which references IStateMapper) and ModelLoader, causing this error. All model registration must be done in client-only classes. I recommend switching to registry events now so you can more easily update your code to 1.12.
-
[1.12] SwingItem / sendUseItem
I looked at where they were called in the old version and looked for the same code in the new version. I then looked at the methods called in that section in the new version to see which ones did roughly the same thing as the old ones. Other resources include this issue tracker, which documents most renames in 1.8+ and MCPBot, which you can use to find the new name of a field/method/parameter from the old one. I explain how to use MCPBot in more detail here. NetHandlerPlayClient#sendPacket can be used to send vanilla client-to-server packets. You can get the NetHandlerPlayClient instance from Minecraft#getConnection or EntityPlayerSP#connection.
-
Help with 1.8.9 forge (keeps crashing)
The FML log is the file called fml-client-latest.log in the logs directory of the Minecraft game directory. When asking for help in future, please upload it to Gist or Pastebin and link it in your post. That said, 1.7.10 is no longer supported on this forum. Update if you want help.
-
missing blocks
Post the FML log (logs/fml-client-latest.log) using Gist or Pastebin.
-
Help with 1.8.9 forge (keeps crashing)
No, you should post the FML log like I asked.
-
Help with 1.8.9 forge (keeps crashing)
Post the FML log (logs/fml-client-latest.log) using Gist or Pastebin.
-
1.12 Vanishing painting clone basics
You have two lang files, but neither is correct. You have one with the right name in the wrong location and one with the wrong name in the right location. The correct location and name is assets/<modid>/lang/en_us.lang (when you have a pack.mcmeta file with pack_format set to 3).
-
1.12 Vanishing painting clone basics
Where do you call ModRenderers.register from? Where do you register your item models? Post a screenshot of the item.
-
1.12 Vanishing painting clone basics
There aren't any model errors in the log. What does the item render as? Where are you registering the model? Post your code.
-
1.12 Vanishing painting clone basics
The FML log (logs/fml-client-latest.log) should tell you why the models failed to load. Upload it to Gist or Pastebin and link it here.
-
OSX case sensitive filesystem can't run my mod
Which Minecraft version are you using? 1.11+ requires all resource file names to be lowercase. If you don't have a pack.mcmeta file or you do and it sets pack_format to 2, lang files will be loaded with the old mixed-case names (e.g. en_US.lang) because Forge wraps your mod's IResourcePack in a LegacyV2Adapter. If you have a pack.mcmeta file that sets pack_format to 3 (the current resource pack version), lang files will be loaded with the new lower-case names (e.g. en_us.lang). It's best to convert to pack_format 3 and lowercase names now in case Forge stops special-casingpack_format 2 resource packs in a future version.
-
[1.12] SwingItem / sendUseItem
EntityLivingBase#swingItem has been replaced by EntityLivingBase#swingArm. PlayerControllerMP#sendUseItem has been replaced by PlayerControllerMP#processRightClick.
-
1.12 Vanishing painting clone basics
You need to set the registry name of an IForgeRegistryEntry before registering it. I do this in the constructors of my Items/Blocks.
-
[1.11.2](UNSOLVED) Right click on entity detection.
Your title is a bit vague, what exactly are you trying to do? If it's your own Entity and it doesn't extend EntityLiving, override Entity#processInitialInteract. If it does extend EntityLiving, override EntityLiving#processInteract instead. If it's not your Entity, subscribe to PlayerInteractEvent.EntityInteract or PlayerInteractEvent.EntityInteractSpecific.
-
[1.12] How to register models for items with meta?
So it's working now?
IPS spam blocked by CleanTalk.