Skip to content

Commit

Permalink
Fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavid04 committed Apr 25, 2024
1 parent 3e0e4ec commit 72ec8b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/gdavid/phi/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void init(RegisterEvent event) {
handler.register(PsimetalCrusherBlock.id, PsimetalCrusherTile.type = BlockEntityType.Builder.of(PsimetalCrusherTile::new, psimetalCrusher).build(null));
});
event.register(Keys.POI_TYPES, handler -> {
handler.register("mpu", mpuPOI = new PoiType(ImmutableSet.of(mpu.defaultBlockState()), 0, 1));
handler.register("mpu", mpuPOI = new PoiType(ImmutableSet.copyOf(mpu.getStateDefinition().getPossibleStates()), 0, 1));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public static void speech(ServerChatEvent.Submitted event) {
PoiManager poiManager = ((ServerLevel) player.level).getPoiManager();
poiManager.getInRange(type -> type.get() == ModBlocks.mpuPOI, pos, (int) SpellContext.MAX_DISTANCE, Occupancy.ANY)
.forEach(poi -> {
BlockEntity tile = player.level.getBlockEntity(poi.getPos());
if (tile instanceof MPUTile) ((MPUTile) tile).setNearbySpeech(event.getRawText());
player.level.getServer().execute(() -> {
BlockEntity tile = player.level.getBlockEntity(poi.getPos());
if (tile instanceof MPUTile) ((MPUTile) tile).setNearbySpeech(event.getRawText());
});
});
}

Expand Down

0 comments on commit 72ec8b5

Please sign in to comment.