1.21.2-pre1
This commit is contained in:
1 parent
ef8a9fd4a4
commit
8acbfa5d90
3 files changed
+11
-5
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check https://fabricmc.net/develop/
|
||||
minecraft_version=24w40a
|
||||
minecraft_version=1.21.2-pre1
|
||||
loader_version=0.16.5
|
||||
jsr305_version=3.0.2
|
||||
fabric_version=0.105.1+1.21.2
|
||||
|
||||
@@ -36,6 +36,7 @@ import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.util.context.ContextMap;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
@@ -50,6 +51,7 @@ import net.minecraft.world.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.world.item.crafting.ShapelessRecipe;
|
||||
import net.minecraft.world.item.crafting.SingleItemRecipe;
|
||||
import net.minecraft.world.item.crafting.display.SlotDisplay;
|
||||
import net.minecraft.world.item.crafting.display.SlotDisplayContext;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
public class Inventories
|
||||
@@ -121,7 +123,7 @@ public class Inventories
|
||||
}
|
||||
List<Value> recipesOutput = new ArrayList<>();
|
||||
RegistryAccess regs = cc.registryAccess();
|
||||
SlotDisplay.ResolutionContext context = SlotDisplay.ResolutionContext.forLevel(cc.level());
|
||||
ContextMap context = SlotDisplayContext.fromLevel(cc.level());
|
||||
for (Recipe<?> recipe : recipes)
|
||||
{
|
||||
List<Value> results = new ArrayList<>();
|
||||
|
||||
@@ -3,11 +3,12 @@ package carpet.script.utils;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.context.ContextMap;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeManager;
|
||||
import net.minecraft.world.item.crafting.RecipeType;
|
||||
import net.minecraft.world.item.crafting.display.RecipeDisplay;
|
||||
import net.minecraft.world.item.crafting.display.SlotDisplay;
|
||||
import net.minecraft.world.item.crafting.display.SlotDisplayContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -18,7 +19,9 @@ public class RecipeHelper
|
||||
public static List<Recipe<?>> getRecipesForOutput(RecipeManager recipeManager, RecipeType<?> type, ResourceLocation id, Level level)
|
||||
{
|
||||
List<Recipe<?>> results = new ArrayList<>();
|
||||
SlotDisplay.ResolutionContext context = SlotDisplay.ResolutionContext.forLevel(level);
|
||||
|
||||
|
||||
ContextMap context = SlotDisplayContext.fromLevel(level);
|
||||
recipeManager.getRecipes().forEach(r -> {
|
||||
if (r.value().getType() == type)
|
||||
{
|
||||
@@ -39,7 +42,8 @@ public class RecipeHelper
|
||||
public static List<Recipe<?>> getRecipesForOutput(RecipeManager recipeManager, ResourceLocation id, Level level)
|
||||
{
|
||||
List<Recipe<?>> results = new ArrayList<>();
|
||||
SlotDisplay.ResolutionContext context = SlotDisplay.ResolutionContext.forLevel(level);
|
||||
|
||||
ContextMap context = SlotDisplayContext.fromLevel(level);
|
||||
recipeManager.getRecipes().forEach(r -> {
|
||||
for (RecipeDisplay recipeDisplay : r.value().display())
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user