-
Posts
43 -
Joined
-
Last visited
Everything posted by Corgam
-
Unfortunately no, isStickyBlock makes that it can move other blocks (all of movable blocks), but doesn't prevent it from sticking to another slime block or honeyblock. canStickTo makes it that other sticky blocks cannot move it, but as for now I didn't find a way to stop the new block from moving other sticky blocks while being moved. (so it works only one way) Edit: This is what I mean: https://imgur.com/J6TRxXx
-
It works but only in one way. When slime and honey blocks are pushed they don't move the new slime block, but when you try to push the new slime block with the piston is moves normal slime block and honey with it. Any idea how to fix that? I think I would need to override canStickTo() methode in normal SlimeBlock and honey block, but how can I do it, If I cannot modify the vanilla code?
-
Hi, I would like to add a new slime block to the game, which works in a simular way to the original slime block, that is: it can move other blocks around and other slime blocks of the same type, but not other sticky blocks (honey blocks). I found two functions in IForgeBlock file: default boolean isStickyBlock(BlockState state) { return state.getBlock() == Blocks.SLIME_BLOCK || state.getBlock() == Blocks.field_226907_mc_; } default boolean canStickTo(BlockState state, BlockState other) { if (state.getBlock() == Blocks.field_226907_mc_ && other.getBlock() == Blocks.SLIME_BLOCK) return false; if (state.getBlock() == Blocks.SLIME_BLOCK && other.getBlock() == Blocks.field_226907_mc_) return false; return state.isStickyBlock() || other.isStickyBlock(); } Is there a way to replace them and add the new block to the functions so they also check for it? Or is there another way to do that? Cheers, Corgam
-
Ok, now it works, but not completely, when I place the bottom half first I can place the second in the same block with no problem, but when I place the upper half first I can not place the second part of the slab underneath it. And the second problem is that WAILA doesn't work with double version, it just disappeares (so it might be a problem with a double version registering, maybe beacuse there is no item for it?) Updated files: https://github.com/Corgam/Slavicraft-1.12
-
I just have a file "sand.json" in assets.mymodid.recipes folder and I think no other code is required
-
Hi, I want to add slab to my mod, everything works except that if I try to make double slab it just places new block on top of previous one, And I don't know why https://github.com/Corgam/Slavicraft-1.12
-
This works for me: { "type": "minecraft:crafting_shaped", "group": "planks", "pattern": [ " ", " A ", " " ], "key": { "A": { "item": "minecraft:sand", "data": 0 } }, "result": { "item": "minecraft:sand", "count": 1, "data": 0 } } Screenshot:
-
Personally I started with some youtube tutorials (MrCrayfish, Loremaster or SilentChaos512) they can help you with beginnings, although most of them don't have newest methods or solutions, which you need to look up in other sources. You can also check Githubs of other more experienced modders for some interesting code or read Forge docs (https://mcforge.readthedocs.io/en/latest/).
-
I tried this before: But the game crashes with error: java.lang.NullPointerException: Can't use a null-name for the registry, object null. Edit1: Solved! I used set instead of array (public static final Set<Item> ITEMS = new HashSet<>(); ) and than in my mod items parent class I added RegisterHandler.ITEMS.add(this); and everything works as I wanted
-
Ok, thanks to your help I made this: _Items class: And my question is if I can get it working with only one Array? And it will be also ideal to only leave array in this class and the rest of the code for register and models in other classes, but I don't know exactly how :v
-
Helpful tips, thanks!
-
I managed to get everything working, thanks! (now I only need to write something to it to handle more items) Are there benefits of using @ObjectHolders or arrays? Here is code for others with the same problem to look at: RegisterHandler class:
-
so is this good? @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(***); } And what do I write in *** blank ?
-
Here you go: https://github.com/Corgam/Items-problem I tried to add: @SubscribeEvent public void registerItems(RegistryEvent.Register<Item> event) { _Items.register(); } But the game crashes: (there are also some other mods, but I think they don't interfere at all)
-
I added it, but the texture only works when I reload resource packs (F3 + T) and I don't have a clue why. (btw, what is the difference between @Mod.EventBusSubscriber and @EventBusSubscriber ? )
-
Ok, I after one week break I tried to get it working, but still there is something wrong and I need help to understand it better. Here are my files: EventHandler class: _Items class (ModItems): ItemBlankRune class (class of the item that I try to get the texture working)(extends SlavicraftItem) SlavicraftItem class
-
And how do I use registry events exactly? I would love to see an example, it would help me a lot.
-
Hi, Recently I started modding in minecraft and Java, and while updating to Minecraft 1.12 I broke my item texture (everything else works fine). Unfortunately I cannot get it working. Here is all my code: https://github.com/Corgam/1.12/tree/master