26.1-snap-5

This commit is contained in:
gnembon committed 2026-01-27 22:22:46 +01:00
1 parent 9820fbf1d1
commit 85e75c4cab
5 files changed
+8 -7

No files matched your search

@@ -9,6 +9,7 @@ import net.minecraft.ChatFormatting;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.component.DataComponents;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
@@ -365,7 +366,7 @@ public class HopperCounter
}
if (item instanceof DyeItem dye)
{
return TextColor.fromRgb(appropriateColor(dye.getDyeColor().getMapColor().col));
return TextColor.fromRgb(appropriateColor(Optional.ofNullable(dye.getDefaultInstance().get(DataComponents.DYE)).orElse(DyeColor.WHITE).getMapColor().col));
}
Block block = null;
final Registry<Item> itemRegistry = registryAccess.lookupOrThrow(Registries.ITEM);
@@ -54,7 +54,7 @@ public class ServerPlayerGameMode_scarpetEventsMixin implements ServerPlayerInte
@Inject(method = "useItemOn", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/advancements/criterion/ItemUsedOnLocationTrigger;trigger(Lnet/minecraft/server/level/ServerPlayer;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/item/ItemStack;)V",
target = "Lnet/minecraft/advancements/criterion/ItemUsedOnLocationTrigger;trigger(Lnet/minecraft/server/level/ServerPlayer;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/item/ItemInstance;)V",
shift = At.Shift.BEFORE
))
private void onBlockActivated(ServerPlayer serverPlayerEntity, Level world, ItemStack stack, InteractionHand hand, BlockHitResult hitResult, CallbackInfoReturnable<InteractionResult> cir)
@@ -179,7 +179,7 @@ public abstract class CommandArgument
// item_predicate ?? //same as item but accepts tags, not sure right now
new SlotArgument(),
new VanillaUnconfigurableArgument("item", ItemArgument::item,
(c, p) -> ValueConversions.of(ItemArgument.getItem(c, p).createItemStack(1, false), c.getSource().registryAccess()),
(c, p) -> ValueConversions.of(ItemArgument.getItem(c, p).createItemStack(1), c.getSource().registryAccess()),
param -> (ctx, builder) -> ctx.getArgument(param, ItemArgument.class).listSuggestions(ctx, builder)
),
new VanillaUnconfigurableArgument("message", MessageArgument::message,
@@ -354,9 +354,9 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
ItemInput res = itemCache.get(itemString); // [SCARY SHIT] persistent caches over server reloads
if (res != null)
{
return res.createItemStack(1, false);
return res.createItemStack(1);
}
ItemParser.ItemResult parser = (new ItemParser(regs)).parse(new StringReader(itemString));
ItemInput parser = (new ItemParser(regs)).parse(new StringReader(itemString));
res = new ItemInput(parser.item(), parser.components());
itemCache.put(itemString, res);
@@ -364,7 +364,7 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa
{
itemCache.clear();
}
return res.createItemStack(1, false);
return res.createItemStack(1);
}
catch (CommandSyntaxException e)
{