-
Posts
304 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Alpvax
-
-
Is there an error printed to the console? Is your packet registered correctly (on both sides)?
-
9 hours ago, Choonster said:
You're checking if the Block is both replaceable and is equal to Blocks.GRASS, which will never be true because Blocks.GRASS isn't replaceable.
You can use the && (and) operator to combine multiple boolean expressions (like the conditions of the four if statements) into one.
37 minutes ago, funsize888 said:if(world.getBlockState(new BlockPos(i,j+1,k)).getBlock().isReplaceable(world, new BlockPos(i,j+1,k))) { if(world.getBlockState(new BlockPos(i,j,k)).getBlock() == Blocks.GRASS) {
I have this and its still not working
Are you trying to replace the block above the grass or the grass itself?
You are now saying " if the block above is replaceable and the block is grass, do the following:"
-
And before someone states that there is a non-java version of Minecraft, the stuff forge does requires advanced use of the JVM. It has been stated multiple times that forge cannot be ported to the non java version.
-
If you don't want the random part, just delete it (everything after the && and the && itself). As you seem to be struggling with pretty basic stuff (contitions) I would STRONGLY suggest that you go and learn a bit more java and then come back.
- 2
-
BlockStateContainer, not BlockContainer. You need to register all your block state variants in your block. I can't remember to method that you have to override, but look at something like wool.
-
4 hours ago, V0idWa1k3r said:
This should be in a client-only side class. In your client proxy or some place else.
Actually it is fine to have it where it is, as the @SideOnly annotation will cause it to be stripped on the server side, so it won't exist to be called.
- 1
-
12 minutes ago, WildHeart said:
But still for me the innovation in the form of adding models into the event as it is not very practical, I would like the old-fashioned register.
What is not practical about it? It is the new method for a reason, the old one was rather buggy and often didn't work correctly.
-
You should replace the zombie EntityAIBreakDoor task with your own custom version which checks for your block in range in the canExecute method.
-
You need to do a raytrace along the line of your laser and find the block that it hits.
-
The announcement box at the top of this forum says:
QuoteForge for 1.12 06/10/17
Forge for 1.12 is still in early development. Do not use it yet, crashes and bugs are to be expected.So to answer your question, no, there isn't currently a fix. Be patient, forge for 1.12 has only just come out, let them fix all the bugs first, it's probably already on the todo list.
- 1
-
What is the API? How does the API say you should use it?
Looks like you need to include the API before decompiling MC, that is a srg name, not the deobfuscated name that your IDE will display it as. Hence being unable to find it.
Looks to me like Minecraft::getMinecraft or ::getInstance or something along those lines, but you should set up your workspace with the API correctly.
-
1 hour ago, Draconwolver said:
Thanks, I got it working by simply returning in the RenderEntityItem::doRender method that I overrode. However, what if I wanted to only hide specific kinds of EntityItems? If I copy the whole code for the RenderEntityItem::doRender method and paste it in my method override, there are some private fields that I do not have access to. Should I copy those in my class, too?
EDIT: I was able to cancel the rendering of only one kind of item (e.g., diamonds) by copying and pasting like I explained above. Continuing with the additional complexity theme, is there a way to make this rendering toggleable through a KeyBinding or whatnot, or is this way of rendering permanent once the game loads?
Try using inheritance. Check for your item, if you want to render it, call super.doRender. If you want to not render it, just return.
- 1
-
I'm not quite sure why you want this. What are you trying to achieve?
-
I have asked the people working on the PR to integrate the information you posted.
In order to contribute, you need to create a copy (fork) of the repository, make the changes, and then open a PR between the 2 repositories.
-
List::toArray.
But why do you need this? Why not just use the list? Or create an immutable copy if necessary.
-
@Jay Avery Really helpful and fully descriptive post. Could you update the documentation with this information. (Doc repository here).
-
I don't think that is what American means, I think he wants his ModInfo class (Which is presumably used for his @Mod annotation) and his mcmod.info file to be automatically updated from a gradle build property.
-
On 2017-5-2 at 11:53 PM, Sawii00 said:
perfect, I'll try that too. For now this method works because I have just one Item I want to check, but Is there a way to add the pan (or any other item that goes in that single slot) inside a recipe? I that case I would not have to check for the content of the slot but I would just check the whole recipe. I will have probably to change the addRecipe method so that I can consider that extra slot.
One option would be to add that slot to your recipe implementation.
An alternative would be to add a wrapper around your recipe that checks the item in the slot, then passes off the matching to the wrapped recipe. That way you can take full advantage of any normal crafting recipe (shaped, shapeless, oredictionary, custom).
-
Learn java BEFORE learning to make mods. You won't get java help on these forums (or the Minecraft forums).
-
Store the positions relative to the height and width, then scale them to fit the current width when you draw them.
-
12 hours ago, ctbe said:
I fixed it by creating a method in my item's class that sets the creative tab and manually calling said method at preInit, when I know for sure the creative tab for my mod will already exist.
Why? There is already a method to set the creative tab, just call that in preInit
-
You need to invert your isRemote check. That means it is client side, and you cannot open a GUI on a different client from your client.
-
What about supporting other entities? Would it be better to use the join world event?
EDIT: Clearly wasn't thinking straight, most people wouldn't try to send packets to the client who has connected as a creeper!
-
I have a system which reads acquired perks from NBT, then sets the perk level accordingly. Setting the perk level could add abilities, and adding abilities sends a packet to the client to add them client-side.
What would be the best way of implementing this?
How to check if material can be replaced.
in Modder Support
Posted · Edited by Alpvax
Correcting BlockState to BlockPos
Are you calling this on the server side? (Use world.isRemote to check, it will be false on the server).
Where are your i, j, and k variables coming from? You should probably only create the
BlockStateBlockPos once. And you can useBlockStateBlockPos.up (or something similar) to get the BlockPos above.You should post your full structure code (or even better a link to a git repository).