-
Posts
884 -
Joined
-
Last visited
-
Days Won
9
Everything posted by Jay Avery
-
Why are item textures not displaying?
Jay Avery replied to an_awsome_person's topic in Modder Support
You said that's the path of your model, but the output log suggests that it can't find a file at that location. Are you certain that's the exact path with no typos? Maybe post a screenshot of your file structure to check. -
[1.11] Vanilla 3x3 recipes on larger crafting grids.
Jay Avery replied to wehttam664's topic in Modder Support
You can create your own IRecipe implementation, and use it in a custom crafting manager for your 5x5 device - it'll just mean manually re-adding the vanilla recipes you want to keep. -
Give achievement based on item in hand.
Jay Avery replied to ModderInTraining's topic in Modder Support
Next time, please post your code using the <> button and a spoiler (eye icon), it makes it much easier to read. I'm really confused about what you're doing here. You declare two ItemStacks which you then never refer to (getItem and getItem1). You declare two booleans which you then never refer to (iterator and iterator1 - and why on earth did you pick such confusing variable names?) You still haven't used ItemStack#getItem in the way I suggested, so you are still comparing an ItemStack instance to an Item instance in the line player.getHeldItemMainhand().equals(ModCombat.titaniumSword). You're using a while loop for something which doesn't need to be looped at all, and seem to have a random mess of opening and closing brackets in the middle for no reason. You don't actually check any of the item conditions before applying the achievement. -
Give achievement based on item in hand.
Jay Avery replied to ModderInTraining's topic in Modder Support
You should start by learning some general Java. ItemStack#getItem is a method which you call on an ItemStack instance, and returns an Item instance. You have access to an ItemStack (in the player's hand) and you want an Item (to compare to the correct Item for your achievement). If that isn't enough information for you to get started, you probably need a better understanding of Java before you will make much progress with modding. -
Give achievement based on item in hand.
Jay Avery replied to ModderInTraining's topic in Modder Support
Yes, use ItemStack#getItem. -
It won't crash when you run it as a client, but it will crash when you run it as a server.
-
If you want to use an IProxy interface you need to define it yourself.
-
Well, the 'cross' model doesn't contain a water surface element, so of course it won't be there. You'll need to create a custom model for your plants to give the appearance of the water surface above the plant part. I have a similar water plant which I render using a multi-layer model, if you want to see how I do it: block class, blockstates, cutout model part, translucent model part.
-
Look at the class you're extending to see what it does in those methods. getMetaFromState takes an IBlockState and returns an int, getStateFromMeta takes an int and returns an IBlockState. They are used to store the block's state information in the form of a number and then convert it back.
-
EntityPlayer#getHeldItem(EnumHand)
-
Please use the code tags (the <> button) and a spoiler (the eye icon) to post your code, it makes it much easier to read. This is a problem with Eclipse. It happens when you try to launch your project while you don't have a project class selected. Just click on any file in your project and then launch again and it should work. You have a typo here. The second parameter of your constructor is called reistryName instead of registryName. That means you are assigning this.registryName to itself, which is null.
-
I'm afraid I don't - reading through the actual source code of vanilla classes is a good source of information if you're able to figure out (although that's not always easy). I learned about AxisAlignedBB through a combination of reading the code carefully, looking through different ways it's implemented in various vanilla blocks, and then a fair bit of experimenting with creating my own to see how they acted.
-
The parameters of the AxisAlignedBB constructor are two sets of x,y,z co-ordinates. The bounding box is then created as a cuboid with those two sets of co-ordinates defining opposite corners. So if you want the box to start at somewhere other than the bottom corner then you can just make the first set of co-ordinates in the constructor something other than 0,0,0.
-
diesieben's explanation should work for your system. The server reads its stored data from NBT when the player is read, then you can use PlayLoggedInEvent (and the others) to send that data to the client for an initial sync.
-
Hmm, there's nothing obviously wrong that should be causing a MalformedJsonException. It's pointing to: Expected name at line 1 column 2 Are you certain that you don't have any extra or missing characters in your blockstates file? Did you copy and paste it directly when you showed it above?
-
Use a world.isRemote check before getting the player position.
-
What is the name of your blockstates file?
-
That slash at the beginning shouldn't be there, although that's not what's causing the problem in this case. You bind a texture and then call super#drawScreen, but if you look at GuiScreen#drawScreen, you'll find that all it does is draw buttons and labels if any are present - your bound texture is never used. If you want to draw an image, you need to call Gui#drawTexturedModalRect (or a related method) yourself.
-
A vanilla format blockstate file will work just fine - it's not incorrect.
-
A NullPointerException means that something is null where it shouldn't be. Use printlns or the debugger to check the values of all the variables you pass to EntityPlayer#openGui, and see which is null. Edit: scratch that, I read wrong. The null value happens further on, probably as a result of the problem larsgerrits pointed out.
-
replace all blocks within a 16 block radius
Jay Avery replied to jamiemac262's topic in Modder Support
I'm not sure I understand your question. What have you got so far, and what is/isn't working how you want it to? -
In the Forge blockstates format, the normal variant needs to be formatted as an empty array (a pair of curly braces inside a pair of square brackets), like this: "normal": [{ }] The inventory variant also needs to be defined explicitly, in exactly the same format as normal. You've also got a comma after your normal variant, which is a JSON syntax error - you should put your files through a validator or use a plugin in your IDE to avoid problems like that. Edit: you also shouldn't have a space after the colon in your model definition string "factionmod: block/grass_normal".
-
It would require the mod to be installed on the server; OP wants a mod that will function when it's only installed on the client.
-
[1.11.2] Message value is null / Capabilities
Jay Avery replied to Dragonisser's topic in Modder Support
A ByteBuf is always read completely in order. When you read it in these printlns, you are 'using up' the values you want to read. Then when you try to read them in order to set the actual message data, there's nothing left in the ByteBuf to read. Try commenting out these printlns and see if the behaviour is the same