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

So, I've implemented sideways-slabs, and I'm trying to add a outer/inner corner effect on them, just like stairs have.
I'm having a few problems with collisionBoxes, but that's beside the point for now.

Now, my problem:
For some reason, I get this error, when placing a sideways-double-slab:

java.lang.IllegalArgumentException:
Cannot get property PropertyEnum{name=position, clazz=class com.bte.mod.block.BlockSlabVerticalBase$EnumPosition, values=[north, south, east, west]} as it does not exist in BlockStateContainer{block=bte:smoothstone_vertical_doubleslab, properties=[]}
	at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204)
	at com.bte.mod.block.BlockSlabVerticalBase.getPaneShape(BlockSlabVerticalBase.java:134)
	at com.bte.mod.block.BlockSlabVerticalBase.getActualState(BlockSlabVerticalBase.java:122)

 

Which makes NO sense, since this is what the code looks like in BlockSlabVerticalBase.getActualState():
 

public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
    {
        if(isDouble())
        {
            return state;
        }
        else
        {
            return state.withProperty(SHAPE, getPaneShape(state, worldIn, pos));
        }
    }


For some reason, the instance of bte:smoothstone_vertical_doubleslab seems to return isDouble() as false, even though it's class has:

    @Override
    public boolean isDouble() {
        return true;
    }


I'm going insane trying to figure out why this is happening...
All my code is available on https://github.com/44tim44/BetterThanElectricity in case you want to check on anything.

Any help at all would be tremendously appreciated!

Edited by 44tim44
Updated link to new repo

  • Author

Yeah, sorry wasn't aware of the package naming conventions.
I fixed that, and all the other things you mentioned, except for EntityEntryBuilder. Gonna take a look at that later.


I've cleaned up my repo now, and it should compile properly now. Sorry, and thanks!

 

https://github.com/44tim44/BetterThanElectricity

Edited by 44tim44

  • Author
18 hours ago, diesieben07 said:

The issue are these lines. isBlockPane will return true for any pane block, even double ones. But then you assume they have a POSITION property, which is not true for double ones.


That fixed it! 
I changed is BlockPane to this and now it works!

public static boolean isBlockPane(IBlockState state)
    {
        return state.getBlock() instanceof BlockSlabVerticalBase && !((BlockSlabVerticalBase) state.getBlock()).isDouble();
    }

 

But since I've already started this thread I'm gonna hijack it and ask for help with the collision boxes too.

The Vertical Slabs don't have the correct collision boxes.
Even though I am overriding

addCollisionBoxToList

the Vertical Slabs still have "full block" collision boxes.
And I have no idea why.

Github is up to date.

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.