Skip to content

Commit

Permalink
Revert "add radioactive block addition, and damage"
Browse files Browse the repository at this point in the history
This reverts commit 5a84814.
  • Loading branch information
Joshy3282 committed Sep 30, 2024
1 parent 08351e3 commit 6ce6a70
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 75 deletions.
27 changes: 10 additions & 17 deletions src/block/utils/FallableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,42 @@
* TODO: convert this into a dynamic component
* @see Fallable
*/
trait FallableTrait
{
trait FallableTrait{

abstract protected function getPosition(): Position;
abstract protected function getPosition() : Position;

public function onNearbyBlockChange(): void
{
public function onNearbyBlockChange() : void{
$pos = $this->getPosition();
$world = $pos->getWorld();
$down = $world->getBlock($pos->getSide(Facing::DOWN));
if ($down->canBeReplaced()) {
if($down->canBeReplaced()){
$world->setBlock($pos, VanillaBlocks::AIR());

$block = $this;
if (!($block instanceof Block)) throw new AssumptionFailedError(__TRAIT__ . " should only be used by Blocks");
if(!($block instanceof Block)) throw new AssumptionFailedError(__TRAIT__ . " should only be used by Blocks");

$fall = new FallingBlock(Location::fromObject($pos->add(0.5, 0, 0.5), $world), $block);
$fall->spawnToAll();
}
}

public function tickFalling(): ?Block
{
public function tickFalling() : ?Block{
return null;
}

public function onHitGround(FallingBlock $blockEntity): bool
{
public function onHitGround(FallingBlock $blockEntity) : bool{
return true;
}

public function getFallDamagePerBlock(): float
{
public function getFallDamagePerBlock() : float{
return 0.0;
}

public function getMaxFallDamage(): float
{
public function getMaxFallDamage() : float{
return 0.0;
}

public function getLandSound(): ?Sound
{
public function getLandSound() : ?Sound{
return null;
}
}
12 changes: 0 additions & 12 deletions src/block/utils/Radioactive.php

This file was deleted.

45 changes: 0 additions & 45 deletions src/block/utils/RadioactiveTrait.php

This file was deleted.

1 change: 0 additions & 1 deletion src/event/entity/EntityDamageEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class EntityDamageEvent extends EntityEvent implements Cancellable{
public const CAUSE_CUSTOM = 14;
public const CAUSE_STARVATION = 15;
public const CAUSE_FALLING_BLOCK = 16;
public const CAUSE_RADIOACTIVITY = 17;

private float $baseDamage;
private float $originalBase;
Expand Down

0 comments on commit 6ce6a70

Please sign in to comment.