Skip to content

Commit

Permalink
Fixed bug again
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Sep 21, 2024
1 parent 416b6f7 commit 5ff6cf9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @since 1.0.0-beta-2
*/

#if MC_VERSION >= "11902"
#if MC_VERSION >= "11904"

import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
Expand Down Expand Up @@ -78,7 +78,6 @@ public Text getDisplayName() {
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.mtr.mapping.holder.BlockPos;
import org.mtr.mapping.holder.World;
import ziyue.tjmetro.mod.block.BlockMetalDetectionDoor;
Expand Down Expand Up @@ -127,7 +126,11 @@ public int getMaxCountPerStack() {

@Override
public Text getDisplayName() {
return new TranslatableText("gui.tjmetro.metal_detection_door");
#if MC_VERSION >= "11902"
return net.minecraft.text.Text.translatable("gui.tjmetro.metal_detection_door");
#else
return new net.minecraft.text.TranslatableText("gui.tjmetro.metal_detection_door");
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ static ItemStack cloneSingleItemStack(ItemStack itemStack) {
}

static Identifier getIdentifierByItem(net.minecraft.item.Item item) {
#if MC_VERSION >= "11902"
#if MC_VERSION >= "11904"
return new Identifier(net.minecraft.registry.Registries.ITEM.getId(item));
#else
return new Identifier(net.minecraft.util.registry.Registry.ITEM.getId(item));
#endif
}

static ItemStack getItemStackByIdentifier(Identifier identifier) {
#if MC_VERSION >= "11902"
#if MC_VERSION >= "11904"
return net.minecraft.registry.Registries.ITEM.get(identifier.data).getDefaultStack();
#else
return net.minecraft.util.registry.Registry.ITEM.get(identifier.data).getDefaultStack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @since 1.0.0-beta-2
*/

#if MC_VERSION >= "11904"
#if MC_VERSION >= "11902"

import net.minecraft.core.NonNullList;
import net.minecraft.world.Container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @since 1.0.0-beta-2
*/

#if MC_VERSION >= "11904"
#if MC_VERSION >= "11902"

import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
Expand Down

0 comments on commit 5ff6cf9

Please sign in to comment.