Update mod to Minecraft 1.21.2 pre-release 3 (#4157)

This commit is contained in:
haykam821 2024-10-11 10:02:38 -04:00 committed by GitHub
parent 344e05376f
commit c811259261
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 49 additions and 46 deletions

View file

@ -57,7 +57,7 @@ abstract class AttachmentTargetsMixin implements AttachmentTargetImpl {
if (thisObject instanceof BlockEntity) {
((BlockEntity) thisObject).markDirty();
} else if (thisObject instanceof Chunk) {
((Chunk) thisObject).setNeedsSaving(true);
((Chunk) thisObject).method_65063();
if (type.isPersistent() && ((Chunk) thisObject).getStatus().equals(ChunkStatus.EMPTY)) {
AttachmentEntrypoint.LOGGER.warn("Attaching persistent attachment {} to chunk with chunk status EMPTY. Attachment might be discarded.", type.identifier());

View file

@ -87,7 +87,10 @@ public class CommonAttachmentTests {
ServerWorld serverWorld = mock(ServerWorld.class, CALLS_REAL_METHODS);
Entity entity = mock(Entity.class, CALLS_REAL_METHODS);
BlockEntity blockEntity = mock(BlockEntity.class, CALLS_REAL_METHODS);
WorldChunk worldChunk = mock(WorldChunk.class, CALLS_REAL_METHODS);
worldChunk.method_65066(pos -> { });
ProtoChunk protoChunk = mock(ProtoChunk.class, CALLS_REAL_METHODS);
for (AttachmentTarget target : new AttachmentTarget[]{serverWorld, entity, blockEntity, worldChunk, protoChunk}) {

View file

@ -263,7 +263,7 @@ transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithoutSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithShearsCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithShearsOrSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithSilkTouchOrShearsCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithoutShearsOrSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator applyExplosionDecay (Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/loot/function/LootFunctionConsumingBuilder;)Lnet/minecraft/loot/function/LootFunctionConsumingBuilder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator addSurvivesExplosionCondition (Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/loot/condition/LootConditionConsumingBuilder;)Lnet/minecraft/loot/condition/LootConditionConsumingBuilder;
@ -291,7 +291,7 @@ transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableG
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator mushroomBlockDrops (Lnet/minecraft/block/Block;Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator shortPlantDrops (Lnet/minecraft/block/Block;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator dropsWithShears (Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator method_65053 (Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator dropsWithSilkTouchOrShears (Lnet/minecraft/item/ItemConvertible;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator multifaceGrowthDrops (Lnet/minecraft/block/Block;Lnet/minecraft/loot/condition/LootCondition$Builder;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator paleMossCarpetDrops (Lnet/minecraft/block/Block;)Lnet/minecraft/loot/LootTable$Builder;
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator leavesDrops (Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;[F)Lnet/minecraft/loot/LootTable$Builder;

View file

@ -71,7 +71,7 @@ public interface CustomIngredient {
*
* <p>Note: no caching needs to be done by the implementation, this is already handled by the ingredient itself.
*/
List<RegistryEntry<Item>> getMatchingStacks();
List<RegistryEntry<Item>> getMatchingItems();
/**
* Returns whether this ingredient always requires {@linkplain #test direct stack testing}.

View file

@ -40,7 +40,7 @@ public interface FabricIngredient {
* and custom ingredients need to {@linkplain CustomIngredient#requiresTesting() provide this information}.
*
* <p>If {@code false}, {@linkplain Ingredient#test testing this ingredient} with an item stack must be equivalent to checking whether
* the item stack's item is included in the ingredient's {@linkplain Ingredient#getMatchingStacks() list of matching stacks}.
* the item stack's item is included in the ingredient's {@linkplain Ingredient#getMatchingItems() list of matching stacks}.
* In that case, optimized matching logic can be used.
*
* <p>If {@code true}, the ingredient must always be tested using {@link Ingredient#test(ItemStack)}.

View file

@ -92,12 +92,12 @@ public class CustomIngredientImpl extends Ingredient {
}
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
if (this.matchingStacks == null) {
this.matchingStacks = customIngredient.getMatchingStacks();
public List<RegistryEntry<Item>> getMatchingItems() {
if (this.matchingItems == null) {
this.matchingItems = customIngredient.getMatchingItems();
}
return this.matchingStacks;
return this.matchingItems;
}
@Override

View file

@ -54,9 +54,9 @@ public class AllIngredient extends CombinedIngredient {
}
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
// There's always at least one sub ingredient, so accessing ingredients[0] is safe.
List<RegistryEntry<Item>> previewStacks = new ArrayList<>(ingredients.getFirst().getMatchingStacks());
List<RegistryEntry<Item>> previewStacks = new ArrayList<>(ingredients.getFirst().getMatchingItems());
for (int i = 1; i < ingredients.size(); ++i) {
Ingredient ing = ingredients.get(i);

View file

@ -54,11 +54,11 @@ public class AnyIngredient extends CombinedIngredient {
}
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
public List<RegistryEntry<Item>> getMatchingItems() {
List<RegistryEntry<Item>> previewStacks = new ArrayList<>();
for (Ingredient ingredient : ingredients) {
previewStacks.addAll(ingredient.getMatchingStacks());
previewStacks.addAll(ingredient.getMatchingItems());
}
return previewStacks;

View file

@ -83,8 +83,8 @@ public class ComponentsIngredient implements CustomIngredient {
}
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
return base.getMatchingStacks().stream()
public List<RegistryEntry<Item>> getMatchingItems() {
return base.getMatchingItems().stream()
.filter(registryEntry -> {
ItemStack itemStack = registryEntry.value().getDefaultStack();
itemStack.applyChanges(components);

View file

@ -59,8 +59,8 @@ public class CustomDataIngredient implements CustomIngredient {
}
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
return base.getMatchingStacks().stream()
public List<RegistryEntry<Item>> getMatchingItems() {
return base.getMatchingItems().stream()
.filter(registryEntry -> {
ItemStack itemStack = registryEntry.value().getDefaultStack();
itemStack.apply(DataComponentTypes.CUSTOM_DATA, NbtComponent.DEFAULT, existingNbt -> NbtComponent.of(existingNbt.copyNbt().copyFrom(nbt)));

View file

@ -49,10 +49,10 @@ public class DifferenceIngredient implements CustomIngredient {
}
@Override
public List<RegistryEntry<Item>> getMatchingStacks() {
final List<RegistryEntry<Item>> subtractedMatchingStacks = subtracted.getMatchingStacks();
return base.getMatchingStacks().stream()
.filter(registryEntry -> !subtractedMatchingStacks.contains(registryEntry))
public List<RegistryEntry<Item>> getMatchingItems() {
final List<RegistryEntry<Item>> subtractedMatchingItems = subtracted.getMatchingItems();
return base.getMatchingItems().stream()
.filter(registryEntry -> !subtractedMatchingItems.contains(registryEntry))
.toList();
}

View file

@ -2,7 +2,7 @@ accessWidener v2 named
extendable class net/minecraft/recipe/Ingredient
accessible method net/minecraft/recipe/Ingredient <init> (Lnet/minecraft/registry/entry/RegistryEntryList;)V
accessible field net/minecraft/recipe/Ingredient matchingStacks Ljava/util/List;
accessible field net/minecraft/recipe/Ingredient matchingItems Ljava/util/List;
accessible field net/minecraft/network/ClientConnection channel Lio/netty/channel/Channel;

View file

@ -42,9 +42,9 @@ public class IngredientMatchTests {
public void testAllIngredient(TestContext context) {
Ingredient allIngredient = DefaultCustomIngredients.all(Ingredient.ofItems(Items.APPLE, Items.CARROT), Ingredient.ofItems(Items.STICK, Items.CARROT));
assertEquals(1, allIngredient.getMatchingStacks().size());
assertEquals(Items.CARROT, allIngredient.getMatchingStacks().getFirst().value());
assertEquals(false, allIngredient.getMatchingStacks().isEmpty());
assertEquals(1, allIngredient.getMatchingItems().size());
assertEquals(Items.CARROT, allIngredient.getMatchingItems().getFirst().value());
assertEquals(false, allIngredient.getMatchingItems().isEmpty());
assertEquals(false, allIngredient.test(new ItemStack(Items.APPLE)));
assertEquals(true, allIngredient.test(new ItemStack(Items.CARROT)));
@ -52,8 +52,8 @@ public class IngredientMatchTests {
Ingredient emptyAllIngredient = DefaultCustomIngredients.all(Ingredient.ofItems(Items.APPLE), Ingredient.ofItems(Items.STICK));
assertEquals(0, emptyAllIngredient.getMatchingStacks().size());
assertEquals(true, emptyAllIngredient.getMatchingStacks().isEmpty());
assertEquals(0, emptyAllIngredient.getMatchingItems().size());
assertEquals(true, emptyAllIngredient.getMatchingItems().isEmpty());
assertEquals(false, emptyAllIngredient.test(new ItemStack(Items.APPLE)));
assertEquals(false, emptyAllIngredient.test(new ItemStack(Items.STICK)));
@ -65,12 +65,12 @@ public class IngredientMatchTests {
public void testAnyIngredient(TestContext context) {
Ingredient anyIngredient = DefaultCustomIngredients.any(Ingredient.ofItems(Items.APPLE, Items.CARROT), Ingredient.ofItems(Items.STICK, Items.CARROT));
assertEquals(4, anyIngredient.getMatchingStacks().size());
assertEquals(Items.APPLE, anyIngredient.getMatchingStacks().getFirst().value());
assertEquals(Items.CARROT, anyIngredient.getMatchingStacks().get(1).value());
assertEquals(Items.STICK, anyIngredient.getMatchingStacks().get(2).value());
assertEquals(Items.CARROT, anyIngredient.getMatchingStacks().get(3).value());
assertEquals(false, anyIngredient.getMatchingStacks().isEmpty());
assertEquals(4, anyIngredient.getMatchingItems().size());
assertEquals(Items.APPLE, anyIngredient.getMatchingItems().getFirst().value());
assertEquals(Items.CARROT, anyIngredient.getMatchingItems().get(1).value());
assertEquals(Items.STICK, anyIngredient.getMatchingItems().get(2).value());
assertEquals(Items.CARROT, anyIngredient.getMatchingItems().get(3).value());
assertEquals(false, anyIngredient.getMatchingItems().isEmpty());
assertEquals(true, anyIngredient.test(new ItemStack(Items.APPLE)));
assertEquals(true, anyIngredient.test(new ItemStack(Items.CARROT)));
@ -83,9 +83,9 @@ public class IngredientMatchTests {
public void testDifferenceIngredient(TestContext context) {
Ingredient differenceIngredient = DefaultCustomIngredients.difference(Ingredient.ofItems(Items.APPLE, Items.CARROT), Ingredient.ofItems(Items.STICK, Items.CARROT));
assertEquals(1, differenceIngredient.getMatchingStacks().size());
assertEquals(Items.APPLE, differenceIngredient.getMatchingStacks().getFirst().value());
assertEquals(false, differenceIngredient.getMatchingStacks().isEmpty());
assertEquals(1, differenceIngredient.getMatchingItems().size());
assertEquals(Items.APPLE, differenceIngredient.getMatchingItems().getFirst().value());
assertEquals(false, differenceIngredient.getMatchingItems().isEmpty());
assertEquals(true, differenceIngredient.test(new ItemStack(Items.APPLE)));
assertEquals(false, differenceIngredient.test(new ItemStack(Items.CARROT)));
@ -113,15 +113,15 @@ public class IngredientMatchTests {
assertEquals(true, undamagedIngredient.test(renamedUndamagedDiamondPickaxe));
assertEquals(false, noNameUndamagedIngredient.test(renamedUndamagedDiamondPickaxe));
assertEquals(3, undamagedIngredient.getMatchingStacks().size());
ItemStack result0 = undamagedIngredient.getMatchingStacks().getFirst().value().getDefaultStack();
ItemStack result1 = undamagedIngredient.getMatchingStacks().get(1).value().getDefaultStack();
assertEquals(3, undamagedIngredient.getMatchingItems().size());
ItemStack result0 = undamagedIngredient.getMatchingItems().getFirst().value().getDefaultStack();
ItemStack result1 = undamagedIngredient.getMatchingItems().get(1).value().getDefaultStack();
assertEquals(Items.DIAMOND_PICKAXE, result0.getItem());
assertEquals(Items.NETHERITE_PICKAXE, result1.getItem());
assertEquals(ComponentChanges.EMPTY, result0.getComponentChanges());
assertEquals(ComponentChanges.EMPTY, result1.getComponentChanges());
assertEquals(false, undamagedIngredient.getMatchingStacks().isEmpty());
assertEquals(false, undamagedIngredient.getMatchingItems().isEmpty());
// Undamaged is fine
assertEquals(true, undamagedIngredient.test(new ItemStack(Items.DIAMOND_PICKAXE)));
@ -192,11 +192,11 @@ public class IngredientMatchTests {
stack.set(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(rejectedNbt2));
assertEquals(false, customDataIngredient.test(stack));
List<RegistryEntry<Item>> matchingStacks = customDataIngredient.getMatchingStacks();
assertEquals(1, matchingStacks.size());
assertEquals(Items.STICK, matchingStacks.getFirst().value());
List<RegistryEntry<Item>> matchingItems = customDataIngredient.getMatchingItems();
assertEquals(1, matchingItems.size());
assertEquals(Items.STICK, matchingItems.getFirst().value());
// Test disabled as the vanilla API no longer exposes the stack with data.
// assertEquals(NbtComponent.of(requiredNbt), matchingStacks.getFirst().value().getDefaultStack().get(DataComponentTypes.CUSTOM_DATA));
// assertEquals(NbtComponent.of(requiredNbt), matchingItems.getFirst().value().getDefaultStack().get(DataComponentTypes.CUSTOM_DATA));
context.complete();
}

View file

@ -266,7 +266,7 @@ transitive-accessible field net/minecraft/client/render/RenderPhase CUTOUT_PROGR
transitive-accessible field net/minecraft/client/render/RenderPhase TRANSLUCENT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase TRANSLUCENT_MOVING_BLOCK_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase ARMOR_CUTOUT_NO_CULL_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase field_54961 Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase ARMOR_TRANSLUCENT Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_SOLID_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_CUTOUT_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram;
transitive-accessible field net/minecraft/client/render/RenderPhase ENTITY_CUTOUT_NONULL_PROGRAM Lnet/minecraft/client/render/RenderPhase$ShaderProgram;

View file

@ -3,7 +3,7 @@ org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true
version=0.105.3
minecraft_version=1.21.2-pre2
minecraft_version=1.21.2-pre3
yarn_version=+build.1
loader_version=0.16.4
installer_version=1.0.1