Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've maded a plant that looks like chorus plant but grows underwater. But, due to it's model, there is a graphical glitch bot underwater or when it grows outside of the water. In this image you can see what i mean.

4lIpHcg.png

So my question is: is there a way to remove this glitch? Maybe a custom model or something? I've seen some mods that has underwater plants and they don't have this glitch, but they don't have an open source code, so how can i do that? :)

If this needs this are the classes for the plant

BlockBlueCoral (the chorus fruit-like block) [url]http://pastebin.com/ZZFvJuMR[/url]
BlockBlueCoralPlant (the chorus plant-like block) [url]http://pastebin.com/vqyuqfbk[/url]
The json files for models are the same as the chorus plant/flower

Don't blame me if i always ask for your help. I just want to learn to be better :)

I'm pretty sure that you have to set the Block's materials to

Material.water

to fix this.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author

Changing to that material gives me this error when i place the block

java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=level, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]} as it does not exist in BlockStateContainer{block=mw:blue_coral, properties=[age]}
at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:192)
at net.minecraft.block.BlockDynamicLiquid.getPossibleFlowDirections(BlockDynamicLiquid.java:226)
at net.minecraft.block.BlockDynamicLiquid.updateTick(BlockDynamicLiquid.java:137)
at net.minecraft.block.Block.randomTick(Block.java:552)
at net.minecraft.world.WorldServer.updateBlocks(WorldServer.java:480)
at net.minecraft.world.WorldServer.tick(WorldServer.java:224)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:768)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:683)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:155)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:532)
at java.lang.Thread.run(Unknown Source)

Don't blame me if i always ask for your help. I just want to learn to be better :)

You also need to include the

BlockLiquid.LEVEL

property in your

BlockStateContainer

and register an

IStateMapper

to ignore that property in your blockstates file (if you don't want its value to affect the model).

 

You can see my implementation of a basic water plant here, with the

IStateMapper

registration here (called in preInit from the client proxy).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Thanks a lot :D By doing that the plant is rendered good underwater. But when this grows outside it still have this glitch :(

R4yH8IV.jpg

Don't blame me if i always ask for your help. I just want to learn to be better :)

You'll probably need to override

Block#getMaterial(IBlockState)

to return a different

Material

when the block isn't submerged in water.

 

You don't have access to the world or position in this method, so you'll need to create an

IProperty

for this (probably a

PropertyBool

called

IN_WATER

) and store it in the metadata.

 

When the block is placed and when a neighbouring block changes, set the value of this property based on the surrounding blocks. I'm not sure exactly how to determine what qualifies as submerged and what doesn't, but start by checking if any of the horizontally adjacent blocks are something other than water or your plant.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Due to the model i think the glitch will still be there even with different material. By now i've solved doing a check in the update tick function, so if the plant is trying to grow up but it's near the surface of water then it stops growing :) Thanks anyway for the help :)

Don't blame me if i always ask for your help. I just want to learn to be better :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.