Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Sep 21, 2024
1 parent f8a2fb0 commit 416b6f7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
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 >= "11902"
#if MC_VERSION >= "11904"

import net.minecraft.core.NonNullList;
import net.minecraft.world.Container;
Expand Down
12 changes: 1 addition & 11 deletions forge/src/main/java/ziyue/tjmetro/mapping/ContainerAccessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@
* @since 1.0.0-beta-2
*/

#if MC_VERSION >= "11902"

import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemStack;

public interface ContainerAccessor
{
NonNullList<ItemStack> tianjin_Metro$getItemStacks();
}

#elif MC_VERSION >= "11701"
#if MC_VERSION >= "11701"

import net.minecraft.core.NonNullList;
import net.minecraft.world.item.ItemStack;
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 >= "11902"
#if MC_VERSION >= "11904"

import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
Expand Down
4 changes: 2 additions & 2 deletions forge/src/main/java/ziyue/tjmetro/mapping/RegistryHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ static net.minecraft.world.item.ItemStack cloneSingleItemStack(net.minecraft.wor
}

static Identifier getIdentifierByItem(net.minecraft.world.item.Item item) {
#if MC_VERSION >= "11902"
#if MC_VERSION >= "11904"
return new Identifier(net.minecraft.core.registries.BuiltInRegistries.ITEM.getKey(item));
#else
return new Identifier(net.minecraft.core.Registry.ITEM.getKey(item));
#endif
}

static net.minecraft.world.item.ItemStack getItemStackByIdentifier(Identifier identifier) {
#if MC_VERSION >= "11902"
#if MC_VERSION >= "11904"
return net.minecraft.core.registries.BuiltInRegistries.ITEM.get(identifier.data).getDefaultInstance();
#else
return net.minecraft.core.Registry.ITEM.get(identifier.data).getDefaultInstance();
Expand Down

0 comments on commit 416b6f7

Please sign in to comment.