Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for creation of wither-proof machines #9

Merged
merged 3 commits into from Jul 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/gregtech/api/block/machines/BlockMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -481,4 +481,10 @@ public boolean supportsVisualConnections() {
protected Pair<TextureAtlasSprite, Integer> getParticleTexture(World world, BlockPos blockPos) {
return MetaTileEntityRenderer.INSTANCE.getParticleTexture(world, blockPos);
}

@Override
public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity) {
MetaTileEntity metaTileEntity = getMetaTileEntity(world, pos);
return !((entity instanceof EntityWither || entity instanceof EntityWitherSkull) && metaTileEntity.getWitherProof());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1229,4 +1229,8 @@ public float getBlockHardness() {
public float getBlockResistance() {
return 6.0f;
}

public boolean getWitherProof(){
return false;
}
}