forked from neoforged/NeoForge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/1.20.x' into 1.20.x
- Loading branch information
Showing
295 changed files
with
1,670 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
--- a/net/minecraft/Util.java | ||
+++ b/net/minecraft/Util.java | ||
@@ -261,7 +_,7 @@ | ||
@@ -261,8 +_,8 @@ | ||
.getSchema(DataFixUtils.makeKey(SharedConstants.getCurrentVersion().getDataVersion().getVersion())) | ||
.getChoiceType(p_137552_, p_137553_); | ||
} catch (IllegalArgumentException illegalargumentexception) { | ||
- LOGGER.error("No data fixer registered for {}", p_137553_); | ||
- if (SharedConstants.IS_RUNNING_IN_IDE) { | ||
+ LOGGER.debug("No data fixer registered for {}", p_137553_); | ||
if (SharedConstants.IS_RUNNING_IN_IDE) { | ||
+ if (SharedConstants.IS_RUNNING_IN_IDE && false) { | ||
throw illegalargumentexception; | ||
} | ||
} | ||
@@ -438,20 +_,20 @@ | ||
|
||
public static void logAndPauseIfInIde(String p_143786_) { | ||
LOGGER.error(p_143786_); | ||
- if (SharedConstants.IS_RUNNING_IN_IDE) { | ||
+ if (SharedConstants.IS_RUNNING_WITH_JDWP) { | ||
doPause(p_143786_); | ||
} | ||
} | ||
|
||
public static void logAndPauseIfInIde(String p_200891_, Throwable p_200892_) { | ||
LOGGER.error(p_200891_, p_200892_); | ||
- if (SharedConstants.IS_RUNNING_IN_IDE) { | ||
+ if (SharedConstants.IS_RUNNING_WITH_JDWP) { | ||
doPause(p_200891_); | ||
} | ||
} | ||
|
||
public static <T extends Throwable> T pauseInIde(T p_137571_) { | ||
- if (SharedConstants.IS_RUNNING_IN_IDE) { | ||
+ if (SharedConstants.IS_RUNNING_WITH_JDWP) { | ||
LOGGER.error("Trying to throw a fatal exception, pausing in IDE", p_137571_); | ||
doPause(p_137571_.getMessage()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- a/net/minecraft/client/GameNarrator.java | ||
+++ b/net/minecraft/client/GameNarrator.java | ||
@@ -59,7 +_,7 @@ | ||
} | ||
|
||
private void logNarratedMessage(String p_168788_) { | ||
- if (SharedConstants.IS_RUNNING_IN_IDE) { | ||
+ if (SharedConstants.IS_RUNNING_IN_IDE && false) { | ||
LOGGER.debug("Narrating: {}", p_168788_.replaceAll("\n", "\\\\n")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
patches/net/minecraft/client/renderer/RenderBuffers.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- a/net/minecraft/client/renderer/RenderBuffers.java | ||
+++ b/net/minecraft/client/renderer/RenderBuffers.java | ||
@@ -39,6 +_,7 @@ | ||
put(p_307112_, RenderType.waterMask()); | ||
ModelBakery.DESTROY_TYPES.forEach(p_173062_ -> put(p_307112_, p_173062_)); | ||
}); | ||
+ net.neoforged.fml.ModLoader.get().postEvent(new net.neoforged.neoforge.client.event.RegisterRenderBuffersEvent(sortedmap)); | ||
this.crumblingBufferSource = MultiBufferSource.immediate(new BufferBuilder(1536)); | ||
this.bufferSource = MultiBufferSource.immediateWithBuffers(sortedmap, new BufferBuilder(786432)); | ||
this.outlineBufferSource = new OutlineBufferSource(this.bufferSource); |
47 changes: 47 additions & 0 deletions
47
patches/net/minecraft/data/recipes/ShapedRecipeBuilder.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- a/net/minecraft/data/recipes/ShapedRecipeBuilder.java | ||
+++ b/net/minecraft/data/recipes/ShapedRecipeBuilder.java | ||
@@ -25,6 +_,7 @@ | ||
private final RecipeCategory category; | ||
private final Item result; | ||
private final int count; | ||
+ private final ItemStack resultStack; // Neo: add stack result support | ||
private final List<String> rows = Lists.newArrayList(); | ||
private final Map<Character, Ingredient> key = Maps.newLinkedHashMap(); | ||
private final Map<String, Criterion<?>> criteria = new LinkedHashMap<>(); | ||
@@ -33,9 +_,14 @@ | ||
private boolean showNotification = true; | ||
|
||
public ShapedRecipeBuilder(RecipeCategory p_249996_, ItemLike p_251475_, int p_248948_) { | ||
+ this(p_249996_, new ItemStack(p_251475_, p_248948_)); | ||
+ } | ||
+ | ||
+ public ShapedRecipeBuilder(RecipeCategory p_249996_, ItemStack result) { | ||
this.category = p_249996_; | ||
- this.result = p_251475_.asItem(); | ||
- this.count = p_248948_; | ||
+ this.result = result.getItem(); | ||
+ this.count = result.getCount(); | ||
+ this.resultStack = result; | ||
} | ||
|
||
public static ShapedRecipeBuilder shaped(RecipeCategory p_250853_, ItemLike p_249747_) { | ||
@@ -46,6 +_,10 @@ | ||
return new ShapedRecipeBuilder(p_251325_, p_250636_, p_249081_); | ||
} | ||
|
||
+ public static ShapedRecipeBuilder shaped(RecipeCategory p_251325_, ItemStack result) { | ||
+ return new ShapedRecipeBuilder(p_251325_, result); | ||
+ } | ||
+ | ||
public ShapedRecipeBuilder define(Character p_206417_, TagKey<Item> p_206418_) { | ||
return this.define(p_206417_, Ingredient.of(p_206418_)); | ||
} | ||
@@ -106,7 +_,7 @@ | ||
Objects.requireNonNullElse(this.group, ""), | ||
RecipeBuilder.determineBookCategory(this.category), | ||
shapedrecipepattern, | ||
- new ItemStack(this.result, this.count), | ||
+ this.resultStack, | ||
this.showNotification | ||
); | ||
p_301098_.accept(p_126142_, shapedrecipe, advancement$builder.build(p_126142_.withPrefix("recipes/" + this.category.getFolderName() + "/"))); |
46 changes: 46 additions & 0 deletions
46
patches/net/minecraft/data/recipes/ShapelessRecipeBuilder.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- a/net/minecraft/data/recipes/ShapelessRecipeBuilder.java | ||
+++ b/net/minecraft/data/recipes/ShapelessRecipeBuilder.java | ||
@@ -22,15 +_,21 @@ | ||
private final RecipeCategory category; | ||
private final Item result; | ||
private final int count; | ||
+ private final ItemStack resultStack; // Neo: add stack result support | ||
private final NonNullList<Ingredient> ingredients = NonNullList.create(); | ||
private final Map<String, Criterion<?>> criteria = new LinkedHashMap<>(); | ||
@Nullable | ||
private String group; | ||
|
||
public ShapelessRecipeBuilder(RecipeCategory p_250837_, ItemLike p_251897_, int p_252227_) { | ||
+ this(p_250837_, new ItemStack(p_251897_, p_252227_)); | ||
+ } | ||
+ | ||
+ public ShapelessRecipeBuilder(RecipeCategory p_250837_, ItemStack result) { | ||
this.category = p_250837_; | ||
- this.result = p_251897_.asItem(); | ||
- this.count = p_252227_; | ||
+ this.result = result.getItem(); | ||
+ this.count = result.getCount(); | ||
+ this.resultStack = result; | ||
} | ||
|
||
public static ShapelessRecipeBuilder shapeless(RecipeCategory p_250714_, ItemLike p_249659_) { | ||
@@ -41,6 +_,10 @@ | ||
return new ShapelessRecipeBuilder(p_252339_, p_250836_, p_249928_); | ||
} | ||
|
||
+ public static ShapelessRecipeBuilder shapeless(RecipeCategory p_252339_, ItemStack result) { | ||
+ return new ShapelessRecipeBuilder(p_252339_, result); | ||
+ } | ||
+ | ||
public ShapelessRecipeBuilder requires(TagKey<Item> p_206420_) { | ||
return this.requires(Ingredient.of(p_206420_)); | ||
} | ||
@@ -95,7 +_,7 @@ | ||
ShapelessRecipe shapelessrecipe = new ShapelessRecipe( | ||
Objects.requireNonNullElse(this.group, ""), | ||
RecipeBuilder.determineBookCategory(this.category), | ||
- new ItemStack(this.result, this.count), | ||
+ this.resultStack, | ||
this.ingredients | ||
); | ||
p_301215_.accept(p_126206_, shapelessrecipe, advancement$builder.build(p_126206_.withPrefix("recipes/" + this.category.getFolderName() + "/"))); |
82 changes: 82 additions & 0 deletions
82
patches/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- a/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java | ||
+++ b/net/minecraft/data/recipes/SimpleCookingRecipeBuilder.java | ||
@@ -27,6 +_,7 @@ | ||
private final RecipeCategory category; | ||
private final CookingBookCategory bookCategory; | ||
private final Item result; | ||
+ private final ItemStack stackResult; // Neo: add stack result support | ||
private final Ingredient ingredient; | ||
private final float experience; | ||
private final int cookingTime; | ||
@@ -44,9 +_,22 @@ | ||
int p_250189_, | ||
AbstractCookingRecipe.Factory<?> p_311960_ | ||
) { | ||
+ this(p_251345_, p_251607_, new ItemStack(p_252112_), p_250362_, p_251204_, p_250189_, p_311960_); | ||
+ } | ||
+ | ||
+ private SimpleCookingRecipeBuilder( | ||
+ RecipeCategory p_251345_, | ||
+ CookingBookCategory p_251607_, | ||
+ ItemStack result, | ||
+ Ingredient p_250362_, | ||
+ float p_251204_, | ||
+ int p_250189_, | ||
+ AbstractCookingRecipe.Factory<?> p_311960_ | ||
+ ) { | ||
this.category = p_251345_; | ||
this.bookCategory = p_251607_; | ||
- this.result = p_252112_.asItem(); | ||
+ this.result = result.getItem(); | ||
+ this.stackResult = result; | ||
this.ingredient = p_250362_; | ||
this.experience = p_251204_; | ||
this.cookingTime = p_250189_; | ||
@@ -85,6 +_,38 @@ | ||
return new SimpleCookingRecipeBuilder(p_250319_, CookingBookCategory.FOOD, p_250377_, p_248930_, p_252329_, p_250482_, SmokingRecipe::new); | ||
} | ||
|
||
+ public static <T extends AbstractCookingRecipe> SimpleCookingRecipeBuilder generic( | ||
+ Ingredient p_250999_, | ||
+ RecipeCategory p_248815_, | ||
+ ItemStack result, | ||
+ float p_251320_, | ||
+ int p_248693_, | ||
+ RecipeSerializer<T> p_250921_, | ||
+ AbstractCookingRecipe.Factory<T> p_312657_ | ||
+ ) { | ||
+ return new SimpleCookingRecipeBuilder(p_248815_, determineSmeltingRecipeCategory(result.getItem()), result, p_250999_, p_251320_, p_248693_, p_312657_); | ||
+ } | ||
+ | ||
+ public static SimpleCookingRecipeBuilder campfireCooking(Ingredient p_249393_, RecipeCategory p_249372_, ItemStack result, float p_252321_, int p_251916_) { | ||
+ return new SimpleCookingRecipeBuilder(p_249372_, CookingBookCategory.FOOD, result, p_249393_, p_252321_, p_251916_, CampfireCookingRecipe::new); | ||
+ } | ||
+ | ||
+ public static SimpleCookingRecipeBuilder blasting(Ingredient p_252115_, RecipeCategory p_249421_, ItemStack result, float p_250383_, int p_250476_) { | ||
+ return new SimpleCookingRecipeBuilder( | ||
+ p_249421_, determineBlastingRecipeCategory(result.getItem()), result, p_252115_, p_250383_, p_250476_, BlastingRecipe::new | ||
+ ); | ||
+ } | ||
+ | ||
+ public static SimpleCookingRecipeBuilder smelting(Ingredient p_249223_, RecipeCategory p_251240_, ItemStack result, float p_249452_, int p_250496_) { | ||
+ return new SimpleCookingRecipeBuilder( | ||
+ p_251240_, determineSmeltingRecipeCategory(result.getItem()), result, p_249223_, p_249452_, p_250496_, SmeltingRecipe::new | ||
+ ); | ||
+ } | ||
+ | ||
+ public static SimpleCookingRecipeBuilder smoking(Ingredient p_248930_, RecipeCategory p_250319_, ItemStack result, float p_252329_, int p_250482_) { | ||
+ return new SimpleCookingRecipeBuilder(p_250319_, CookingBookCategory.FOOD, result, p_248930_, p_252329_, p_250482_, SmokingRecipe::new); | ||
+ } | ||
+ | ||
public SimpleCookingRecipeBuilder unlockedBy(String p_176792_, Criterion<?> p_300970_) { | ||
this.criteria.put(p_176792_, p_300970_); | ||
return this; | ||
@@ -110,7 +_,7 @@ | ||
this.criteria.forEach(advancement$builder::addCriterion); | ||
AbstractCookingRecipe abstractcookingrecipe = this.factory | ||
.create( | ||
- Objects.requireNonNullElse(this.group, ""), this.bookCategory, this.ingredient, new ItemStack(this.result), this.experience, this.cookingTime | ||
+ Objects.requireNonNullElse(this.group, ""), this.bookCategory, this.ingredient, this.stackResult, this.experience, this.cookingTime | ||
); | ||
p_301266_.accept(p_126264_, abstractcookingrecipe, advancement$builder.build(p_126264_.withPrefix("recipes/" + this.category.getFolderName() + "/"))); | ||
} |
Oops, something went wrong.