Skip to content

Commit

Permalink
Fix Forge registry dump error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeregorix committed Oct 23, 2023
1 parent 3aa2b75 commit 0154757
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@
package org.spongepowered.common.mixin.core.world.item.enchantment;

import com.google.common.base.MoreObjects;
import net.minecraft.core.registries.Registries;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.item.enchantment.Enchantment;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.common.SpongeCommon;

@Mixin(Enchantment.class)
public abstract class EnchantmentMixin {
Expand All @@ -41,7 +40,7 @@ public abstract class EnchantmentMixin {

@Override
public String toString() {
final ResourceKey key = (ResourceKey) (Object) SpongeCommon.vanillaRegistry(Registries.ENCHANTMENT).getKey((Enchantment) (Object) this);
final ResourceKey key = (ResourceKey) (Object) BuiltInRegistries.ENCHANTMENT.getKey((Enchantment) (Object) this);
return MoreObjects.toStringHelper("EnchantmentType")
.add("Name", this.shadow$getDescriptionId())
.add("Key", key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import com.google.common.base.MoreObjects;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -38,7 +38,6 @@
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.common.SpongeCommon;
import org.spongepowered.common.bridge.data.DataCompoundHolder;
import org.spongepowered.common.bridge.world.level.block.entity.BlockEntityBridge;
import org.spongepowered.common.data.DataUtil;
Expand Down Expand Up @@ -96,7 +95,7 @@ public abstract class BlockEntityMixin implements BlockEntityBridge, DataCompoun

@Override
public String toString() {
final ResourceKey key = (ResourceKey) (Object) SpongeCommon.vanillaRegistry(Registries.BLOCK_ENTITY_TYPE).getKey(this.type);
final ResourceKey key = (ResourceKey) (Object) BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.type);

return MoreObjects.toStringHelper(this)
// Double check some mods are registering their tile entities and doing some "interesting"
Expand All @@ -109,7 +108,7 @@ public String toString() {
}

protected MoreObjects.ToStringHelper getPrettyPrinterStringHelper() {
final ResourceKey key = (ResourceKey) (Object) SpongeCommon.vanillaRegistry(Registries.BLOCK_ENTITY_TYPE).getKey(this.type);
final ResourceKey key = (ResourceKey) (Object) BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.type);

return MoreObjects.toStringHelper(this)
.add("type", key)
Expand Down

0 comments on commit 0154757

Please sign in to comment.