55import dev .ftb .mods .ftbchunks .FTBChunks ;
66import dev .ftb .mods .ftbchunks .FTBChunksExpected ;
77import dev .ftb .mods .ftbchunks .FTBChunksWorldConfig ;
8+ import dev .ftb .mods .ftbchunks .PlayerNotifier ;
89import dev .ftb .mods .ftbchunks .api .ClaimedChunk ;
910import dev .ftb .mods .ftbchunks .api .ClaimedChunkManager ;
1011import dev .ftb .mods .ftbchunks .api .Protection ;
1617import it .unimi .dsi .fastutil .longs .Long2ObjectMap ;
1718import it .unimi .dsi .fastutil .longs .Long2ObjectMaps ;
1819import it .unimi .dsi .fastutil .longs .Long2ObjectOpenHashMap ;
20+ import net .minecraft .ChatFormatting ;
1921import net .minecraft .core .BlockPos ;
2022import net .minecraft .nbt .CompoundTag ;
2123import net .minecraft .network .chat .Component ;
@@ -213,8 +215,11 @@ public boolean shouldPreventInteraction(@Nullable Entity actor, InteractionHand
213215 boolean prevented = policy .isOverride () ?
214216 policy .shouldPreventInteraction () :
215217 !player .isSpectator () && (isFake || !getBypassProtection (player .getUUID ()));
216- if (prevented && isFake ) {
217- chunk .getTeamData ().logPreventedAccess (player , System .currentTimeMillis ());
218+ if (prevented ) {
219+ PlayerNotifier .notifyWithCooldown (player , Component .translatable ("ftbchunks.action_prevented" ).withStyle (ChatFormatting .GOLD ), 2000 );
220+ if (isFake ) {
221+ chunk .getTeamData ().logPreventedAccess (player , System .currentTimeMillis ());
222+ }
218223 }
219224 return prevented ;
220225 } else if (FTBChunksWorldConfig .noWilderness (player )) {
@@ -224,7 +229,7 @@ public boolean shouldPreventInteraction(@Nullable Entity actor, InteractionHand
224229 } else if (!isFake && (getBypassProtection (player .getUUID ()) || player .isSpectator ())) {
225230 return false ;
226231 }
227- player . displayClientMessage ( Component .translatable ("ftbchunks.need_to_claim_chunk" ), true );
232+ PlayerNotifier . notifyWithCooldown ( player , Component .translatable ("ftbchunks.need_to_claim_chunk" ). withStyle ( ChatFormatting . GOLD ), 2000 );
228233 return true ;
229234 }
230235
0 commit comments