Posts posted by Choonster
-
-
FruityTileEntity overrides TileEntity#shouldRefresh to return true when the IBlockState has changed, not when the Block has changed.
If you put a breakpoint in BlockBoiler#createNewTileEntity with the condition worldIn.isRemote (i.e. the method is being called on the logical client), can you see what's causing the new TileEntity to be created?
Side note: Don't use ITileEntityProvider, override Block#hasTileEntity(IBlockState) and Block#createTileEntity instead.
-
1 minute ago, ConfusedMerlin said:
I got slowed down because the upper face of the block below that model was always not there, learned about isOpaqueCube and isFullCube (which are deprecated... is there a substitute available, or was that seriously used to "mark" internal functions?)
Most of the deprecated methods in the Block class are deprecated because they should be overridden, but not called. Call the equivalent methods in IBlockProperties (which IBlockState extends) instead.
Don't include block/ in the blockstates file's model locations, Minecraft automatically adds that. I explain how model locations are mapped to model files here.
I believe BlockTorch only does its sate/metadata conversions in that way to maintain compatibility with the original metadata values, which aren't the same as the facing indexes uses in other parts of the game. For your own block, use EnumFacing#getIndex and EnumFacing.getFront instead. See BlockObserver for a simple example of this.
To create a PropertyDirection that accepts all EnumFacing values, you can use the overload of PropertyDirection.create without a Predicate argument.
If you say that it doesn't work even without the block/ prefixes in the blockstates file, I'm not sure exactly what the problem is here.
Could you create a Git repository of your mod (if you haven't already) and link it here? See my mod and its .gitignore file for an example of the repository structure and which files to include.
-
-
-
-
-
3 minutes ago, oa10712 said:
Ah, ok. I was hoping that it would be related to another issue that popped up when I had been using it that way, I'm now getting a
io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (22 > 20)
which I am guessing is from my packet handling somewhere. From what I have seen, this is usually due to scoreboards or entity names, but I don't use either.
Post the full stacktrace.
I suspect it's being thrown because the channel name of your SimpleNetworkWrapper is too long.
When you send a client-to-server IMessage, it's converted to a CPacketCustomPayload with your SimpleNetworkWrapper's channel name. This channel name is limited to 20 characters by CPacketCustomPayload#readPacketData.
Server-to-client IMessages are converted to SPacketCustomPayload, which also has this restriction.
-
Edited by Choonster
Quote[20:09:57] [Client thread/ERROR] [FML]: Exception loading model for variant mainmod:itemeightteen#inventory for item "mainmod:itemeightteen", normal location exception:
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model mainmod:item/itemeightteen with loader VanillaLoader.INSTANCE, skipping
...
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 6 column 2
...
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated string at line 6 column 2This model has a syntax error.
Quote[20:09:57] [Client thread/ERROR] [FML]: Exception loading blockstate for the variant mainmod:blockeightteen#normal:
java.lang.Exception: Could not load model definition for variant mainmod:blockeightteen
...
Caused by: java.lang.RuntimeException: Encountered an exception when loading model definition of 'mainmod:blockeightteen' from: 'mainmod:blockstates/blockeightteen.json' in resourcepack: 'FMLFileResourcePack:The Meat Mod'
...
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 10 column 5
...
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 10 column 5This blockstates file has a syntax error.
Quote[20:09:57] [Client thread/ERROR] [FML]: Exception loading model for variant mainmod:blockeightteen#inventory for item "mainmod:blockeightteen", normal location exception:
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model mainmod:item/blockeightteen with loader VanillaLoader.INSTANCE, skipping
...
Caused by: java.io.FileNotFoundException: mainmod:models/item/blockeightteen.jsonThis item model doesn't exist.
-
1 minute ago, oa10712 said:
from the getExtendedState method, you said to create a method that retrieves an instance of the world, but I'm not quite sure how to do that.
I said to create a method to get the client World, i.e. Minecraft#world. You can only reference Minecraft in the client proxy, you can throw an exception from the server proxy.
I have an example of this in my mod's proxy classes.
-
-
-
5 minutes ago, oa10712 said:
Would DimensionManager be the way to get a copy on the server side? Thats the only place I am finding to get an instance of ServerWorld, since MinecraftServer doesn't have a getInstance method.
Any World on the logical server (when World#isRemote is false) will be a WorldServer.
World#getMinecraftServer will return the MinecraftServer instance (if it's a server-side World).
-
-
-
Edited by Choonster
Quotenet.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Tinkers' Construct (tconstruct)
Caused by: java.lang.NoClassDefFoundError: slimeknights/mantle/pulsar/config/IConfigurationTinkers' Construct requires Mantle, you don't have it installed.
I'm not sure why FML reached the mod construction phase, it should have stopped loading as soon it saw that a dependency (Mantle) was missing and displayed the missing mods GUI.
-
WorldRenderer was renamed to VertexBuffer in 1.9 and then to BufferBuilder in 1.12.
AxisAlignedBB was moved to the net.minecraft.util.math package in 1.9.
BlockPos was moved to the net.minecraft.util.math package in 1.9.
MovingObjectPosition and MovingObjectPosition.MovingObjectType were renamed to RayTraceResult and RayTraceResult.Type in 1.9.
-
8 hours ago, The_Wabbit said:
Wow. That is bad. So the old ore dictionary wildcarding is no longer a thing for input ingredients? What about custom IRecipe implementations? (sorry I've not started 1.12 porting yet but I'm trying to keep track of all the gotchas others seem to be having...)
You can still use OreDictionary.WILDCARD_VALUE (32767) as the metadata of an ingredient to match any metadata value.
You can create custom IRecipe and Ingredient implementations by creating an IRecipeFactory or IIngredientFactory and specifying them in your _factories.json file.
-
-
7 hours ago, CreepersRule said:
I just read the FML log and it is huge. I couldn't even post it on here because then my computer wouldn't respond, but I saw the problem. It was the Pandora's Box mod, which, by happenstance, was one of the mods I just recently downloaded. Now my worlds are fixed. Thanks.
In future, you can use Gist or Pastebin to post large log files.
-
-
-
46 minutes ago, oa10712 said:
When I had asked for help previously, I had been using tile entities, but the community reacted like I had personally kicked their childhood puppy, so I switched to using WorldSavedData.
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.
47 minutes ago, oa10712 said:The reason I use nested maps is to help with networking, since it was the first way I thought of to reduce the size of the update packets, but I will take a look into merging them into a single map.
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.
48 minutes ago, oa10712 said:As far as storing integers, I thought that it would reduce the RAM required, since this is being designed for a relatively large modpack, as well as that you can use CraftTweaker to add extra materials later on if needed.
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.
-
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.
-
One client side TileEntity getting replaced with a new instance for some reason
in Modder Support
TileEntity#shouldRefresh has nothing to with whether Block#onBlockPlaced or Block#onBlockAdded are called, so I'm not sure why that's happening.
The default behaviour of TileEntity#shouldRefresh for non-vanilla TileEntities is actually the same as what you had in FruityTileEntity(return true when the IBlockState changes), so removing the override shouldn't have changed anything.