Conversation
|
That's an impressive set of changes. I'll check it out soon |
| public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean isActualState) { | ||
| IBlockState mimicBlock = getMimicBlock(worldIn, pos); | ||
| if (mimicBlock != null) { | ||
| mimicBlock.getBlock().addCollisionBoxToList(mimicBlock, worldIn, pos, entityBox, collidingBoxes, entityIn, isActualState); |
There was a problem hiding this comment.
I'm worried about isActualState here. The mimic block's actual-state-ness isn't necessarily correlated to the real state's actual-state-ness.
There was a problem hiding this comment.
Is something like this better?
IBlockState mimicBlock = getMimicBlock(worldIn, pos);
if (mimicBlock != null) {
mimicBlock = mimicBlock.getActualState(worldIn, pos);
mimicBlock.getBlock().addCollisionBoxToList(mimicBlock, worldIn, pos, entityBox, collidingBoxes, entityIn, true);
return;
}
| public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean isActualState) { | ||
| IBlockState mimicBlock = getMimicBlock(worldIn, pos); | ||
| if (mimicBlock != null) { | ||
| mimicBlock.getBlock().addCollisionBoxToList(mimicBlock, worldIn, pos, entityBox, collidingBoxes, entityIn, isActualState); |
| @SideOnly(Side.CLIENT) | ||
| public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos) { | ||
| IBlockState mimicBlock = getMimicBlock(worldIn, pos); | ||
| return mimicBlock != null ? mimicBlock.getSelectedBoundingBox(worldIn, pos) : FULL_BLOCK_AABB; |
There was a problem hiding this comment.
Is FULL_BLOCK_AABB right here?
There was a problem hiding this comment.
It shouldn't really matter in this case, if it was on the connector it would be an issue but here I don't think so. mimicBlock would normally never be null, so if it was it would be because something was wrong but I'll make it call the super class method instead anyway.
| IBlockState mimicBlock = getMimicBlock(itemstack); | ||
| if (!canMimicFit(state.getBoundingBox(world, pos), mimicBlock.getBoundingBox(world, pos))) { | ||
| if (world.isRemote) { | ||
| player.sendStatusMessage(new TextComponentString(mimicBlock.getBlock().getLocalizedName() + " is too small to fit"), false); |
There was a problem hiding this comment.
Why is this all duplicated from above?
There was a problem hiding this comment.
It's duplicated because is common to both conditions, I can remove the duplicated code but it'll have to check the conditions twice instead.
| } else { | ||
| if (!canMimicFit(GenericCableBlock.AABB_CENTER, state.getBoundingBox(world, pos))) { | ||
| if (world.isRemote) { | ||
| player.sendStatusMessage(new TextComponentString(block.getLocalizedName() + " is too small to mimic"), false); |
There was a problem hiding this comment.
That's slightly different from the above, here we don't know the size of the bounding box of the cable that the mimic block will be applied to so we have to check the "minimum" size to see if it will fit.
|
Splitting these into different PRs will likely get most of them merged more quickly. |
|
@josephcsible Is this better? I also created new PRs for stuff that I think should not have problems being merged. |
|
This PR appears to still contain all of the changes that you split out into the others, so they're now causing conflicts. Can you remove them from here? |
Also returns getSelectedBoundingBox from mimicked blocks.
|
Also, can you split the "fits" check out? It could potentially break people's builds, so I'm not sure if we want to merge it right now. |
|
It's now split in a new PR. I unintentionally deleted one of the commits, but the changes are still there, just not in the same one. Still learning how this works. >.< |
|
Note: we're not forgetting your PRs. Just very busy with other things right now |
This is a collection of small fixes/improvements. Maybe I should have created multiple PRs for this stuff but I thought it wasn't really worth it(I will if you insist though).
1. Added .gitignore
Maybe I'm an idiot and there's a good reason for there not being one but anyway I went and created one.
2. Made cables return BlockFaceShape.UNDEFINED
This is so there's no issues with water textures when cables are underwater.
Before:

After:

3. Added a missing @SideOnly
Added missing @Sidonly annotation to getSelectedBoundingBox.
4. Added proper collision boxes to cables and facades
Closes #23.
Also changed facades so they return the selectedBoundingBox from mimicked blocks.
5. Changed facade raytrace so it uses the mimicked block method
Before:

After:

6. Added a check to see if the mimicked block fits the cable
I'm not sure about this one. This more of an idea. I changed this so things like pressure plates and torches can't be mimicked.
Before:

After:
