Skip to content

Commit f36f0c0

Browse files
committed
Backport 0c9ca11 (#643)
1 parent d167503 commit f36f0c0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/noobanidus/mods/lootr/block/entities/TileTicker.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class TileTicker {
3333
private final static Set<Entry> pendingEntries = new ObjectLinkedOpenHashSet<>();
3434
private static boolean tickingList = false;
3535

36-
public static void addEntry(Level level, BlockPos position) {
36+
public static void addEntry(RandomizableContainerBlockEntity incoming ,Level level, BlockPos position) {
3737
if (ConfigManager.DISABLE.get()) {
3838
return;
3939
}
@@ -71,6 +71,10 @@ public static void addEntry(Level level, BlockPos position) {
7171
}
7272
}
7373

74+
if (incoming.lootTable == null || ConfigManager.isBlacklisted(incoming.lootTable)) {
75+
return;
76+
}
77+
7478
Entry newEntry = new Entry(dimension, position, chunks, ServerLifecycleHooks.getCurrentServer().getTickCount());
7579
synchronized (listLock) {
7680
if (tickingList) {

src/main/java/noobanidus/mods/lootr/mixins/MixinLevelChunk.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private void lootrUpdateBlockEntityTicker(BlockEntity entity, CallbackInfo cir)
1919
return;
2020
}
2121

22-
if (entity instanceof RandomizableContainerBlockEntity && !(entity instanceof ILootBlockEntity)) {
22+
if (entity instanceof RandomizableContainerBlockEntity incoming && !(entity instanceof ILootBlockEntity)) {
2323
LevelChunk level = (LevelChunk) (Object) this;
2424
if (level.getLevel().isClientSide()) {
2525
return;
@@ -31,7 +31,7 @@ private void lootrUpdateBlockEntityTicker(BlockEntity entity, CallbackInfo cir)
3131
return;
3232
}
3333

34-
TileTicker.addEntry(level.getLevel(), entity.getBlockPos());
34+
TileTicker.addEntry(incoming, level.getLevel(), entity.getBlockPos());
3535
}
3636
}
3737
}

0 commit comments

Comments
 (0)