Skip to content

Commit

Permalink
Drone pad snow problem patch (#397)
Browse files Browse the repository at this point in the history
* Update Drone behavior

It will only explode when hit SOLID blocks, blocks that have a collision shape, so 1 layer snow, string, grass won't cause the drone to explode.

Remove the age check so it will check for collision as soon as it flies, so full blocks that are put right above the pad will causse the drone to explode.

* Remove air check above pads

This check wont be needed because of the drone behaviors update.
  • Loading branch information
TheFriedEgg618 authored Mar 4, 2025
1 parent 1f1e223 commit a85f206
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/main/java/supersymmetry/common/entities/EntityDrone.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void onLivingUpdate() {

this.motionY += 0.125;

if(age >= 90 && this.isCollidingWithBlocks()) {
if (this.isCollidingWithBlocks()) {
this.explode();
}

Expand Down Expand Up @@ -223,8 +223,8 @@ public void onLivingUpdate() {
}

public boolean isCollidingWithBlocks() {
return this.world.getBlockState(mutableBlockPos.setPos(this.posX, this.posY + 1, this.posZ)) != Blocks.AIR.getDefaultState()
|| this.world.getBlockState(mutableBlockPos.setPos(this.posX, this.posY - 1, this.posZ)) != Blocks.AIR.getDefaultState();
return !(this.world.getBlockState(mutableBlockPos.setPos(this.posX, this.posY + 1, this.posZ)).getBlock().isPassable(world, mutableBlockPos)
&& this.world.getBlockState(mutableBlockPos.setPos(this.posX, this.posY - 1, this.posZ)).getBlock().isPassable(world, mutableBlockPos));
}

public boolean reachedSky() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ protected static IBlockState getPadState() {
@Override
protected BlockPattern createStructurePattern() {
return FactoryBlockPattern.start()
.aisle(" CCC ", " ", " ")
.aisle("CPPPC", " AAA ", " AAA ")
.aisle("CPPPC", " AAA ", " AAA ")
.aisle("CPPPC", " AAA ", " AAA ")
.aisle(" CSC ", " ", " ")
.aisle(" CCC ")
.aisle("CPPPC")
.aisle("CPPPC")
.aisle("CPPPC")
.aisle(" CSC ")
.where(' ', any())
.where('A', air())
.where('S', selfPredicate())
.where('C', states(getCasingState()).setMinGlobalLimited(6)
.or(autoAbilities(true, false, true, true, false, false, false)))
Expand Down

0 comments on commit a85f206

Please sign in to comment.