Skip to content

Commit

Permalink
fix: compile
Browse files Browse the repository at this point in the history
Former-commit-id: 373a096
  • Loading branch information
CoolLoong committed Nov 18, 2023
1 parent 880553e commit 4a83346
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ buildSrc/**
**/server-settings.yml
**/bin/
**/jegenerator/
/worlds/**
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.allaymc.api.entity.metadata.Metadata;
import org.allaymc.api.entity.type.EntityType;
import org.allaymc.api.math.location.Location3fc;
import org.allaymc.api.world.Dimension;
import org.allaymc.api.world.chunk.Chunk;
import org.cloudburstmc.nbt.NbtMap;
import org.cloudburstmc.protocol.bedrock.data.entity.EntityDataType;
Expand Down Expand Up @@ -40,6 +41,8 @@ public interface EntityBaseComponent extends EntityComponent {

Location3fc getLocation();

Dimension getDimension();

boolean willBeAddedNextTick();

@ApiStatus.Internal
Expand Down Expand Up @@ -86,7 +89,8 @@ default boolean computeBlockCollisionMotion() {
return false;
}

default void onCollideWith(Entity other) {}
default void onCollideWith(Entity other) {
}

@UnmodifiableView
Map<Long, EntityPlayer> getViewers();
Expand Down Expand Up @@ -121,6 +125,8 @@ default void spawnTo(Set<EntityPlayer> players) {

void despawnFromAll();

void removeEntity();

BedrockPacket createSpawnPacket();

void sendPacketToViewers(BedrockPacket packet);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.allaymc.api.math.location.Location3f;
import org.allaymc.api.math.location.Location3fc;
import org.allaymc.api.server.Server;
import org.allaymc.api.world.Dimension;
import org.cloudburstmc.math.vector.Vector2f;
import org.cloudburstmc.nbt.NbtMap;
import org.cloudburstmc.nbt.NbtType;
Expand Down Expand Up @@ -135,6 +136,16 @@ public Location3fc getLocation() {
return location;
}

@Override
public Dimension getDimension() {
return location.dimension;
}

@Override
public void removeEntity() {
getDimension().getEntityUpdateService().removeEntity(thisEntity);
}

@Override
public boolean willBeRemovedNextTick() {
return willBeRemovedNextTick;
Expand Down

0 comments on commit 4a83346

Please sign in to comment.