Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MerchantPug committed Mar 14, 2024
1 parent 6d80bb6 commit e1d09df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public abstract class LootTableMixin {

@Inject(method = "getRandomItems(Lnet/minecraft/world/level/storage/loot/LootContext;)Lit/unimi/dsi/fastutil/objects/ObjectArrayList;", at = @At("HEAD"), cancellable = true)
private void modifyLootTable(LootContext context, CallbackInfoReturnable<ObjectArrayList<ItemStack>> cir) {
if(((ReplacingLootContext)context).isReplaced((LootTable)(Object)this)) {
if(((ReplacingLootContext)context).isReplaced((LootTable)(Object)this) || lootTableId == null) {
return;
}

Expand Down Expand Up @@ -94,7 +94,7 @@ private void modifyLootTable(LootContext context, CallbackInfoReturnable<ObjectA

@Inject(method = "getRandomItemsRaw(Lnet/minecraft/world/level/storage/loot/LootContext;Ljava/util/function/Consumer;)V", at = @At("HEAD"), cancellable = true)
private void setReplacedLootTable(LootContext context, Consumer<ItemStack> lootConsumer, CallbackInfo ci) {
if (this.lootTableId.equals(ReplaceLootTablePower.REPLACED_TABLE_UTIL_ID)) {
if (this.lootTableId != null && this.lootTableId.equals(ReplaceLootTablePower.REPLACED_TABLE_UTIL_ID)) {
LootTable replace = ReplaceLootTablePower.peek();
replace.getRandomItemsRaw(context, lootConsumer);
ci.cancel();
Expand Down

0 comments on commit e1d09df

Please sign in to comment.