Skip to content

Commit 9b7774c

Browse files
committed
1.21.3
2 parents 47cf177 + aea9144 commit 9b7774c

File tree

65 files changed

+529
-878
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+529
-878
lines changed

docs/scarpet/Full.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -4301,19 +4301,15 @@ Recipe type can take one of the following options:
43014301
* `'smithing'` - smithing table (1.16+)
43024302

43034303
The return value is a list of available recipes (even if there is only one recipe available). Each recipe contains of
4304-
an item triple of the crafting result, list of ingredients, each containing a list of possible variants of the
4305-
ingredients in this slot, as item triples, or `null` if its a shaped recipe and a given slot in the patterns is left
4304+
an item triple of the crafting results as a list of item stacks, list of ingredients, each containing a list of possible variants of the
4305+
ingredients in this slot, as item ids, or `null` if it is a shaped recipe and a given slot in the patterns is left
43064306
empty, and recipe specification as another list. Possible recipe specs is:
43074307
* `['shaped', width, height]` - shaped crafting. `width` and `height` can be 1, 2 or 3.
43084308
* `['shapeless']` - shapeless crafting
43094309
* `['smelting', duration, xp]` - smelting/cooking recipes
43104310
* `['cutting']` - stonecutter recipe
43114311
* `['special']` - special crafting recipe, typically not present in the crafting menu
43124312
* `['custom']` - other recipe types
4313-
4314-
Note that ingredients are specified as tripes, with count and nbt information. Currently all recipes require always one
4315-
of the ingredients, and for some recipes, even if the nbt data for the ingredient is specified (e.g. `dispenser`), it
4316-
can accept items of any tags.
43174313

43184314
Also note that some recipes leave some products in the crafting window, and these can be determined using
43194315
`crafting_remaining_item()` function
@@ -4328,7 +4324,7 @@ Also note that some recipes leave some products in the crafting window, and thes
43284324
### `crafting_remaining_item(item)`
43294325

43304326
returns `null` if the item has no remaining item in the crafting window when used as a crafting ingredient, or an
4331-
item name that serves as a replacement after crafting is done. Currently it can only be buckets and glass bottles.
4327+
item tuple that serves as a replacement after crafting is done. Currently, it can only be buckets and glass bottles.
43324328

43334329
### `inventory_size(inventory)`
43344330

docs/scarpet/api/Inventories.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,15 @@ Recipe type can take one of the following options:
7070
* `'smithing'` - smithing table (1.16+)
7171

7272
The return value is a list of available recipes (even if there is only one recipe available). Each recipe contains of
73-
an item triple of the crafting result, list of ingredients, each containing a list of possible variants of the
74-
ingredients in this slot, as item triples, or `null` if its a shaped recipe and a given slot in the patterns is left
73+
an item triple of the crafting results as a list of item stacks, list of ingredients, each containing a list of possible variants of the
74+
ingredients in this slot, as item ids, or `null` if it is a shaped recipe and a given slot in the patterns is left
7575
empty, and recipe specification as another list. Possible recipe specs is:
7676
* `['shaped', width, height]` - shaped crafting. `width` and `height` can be 1, 2 or 3.
7777
* `['shapeless']` - shapeless crafting
7878
* `['smelting', duration, xp]` - smelting/cooking recipes
7979
* `['cutting']` - stonecutter recipe
8080
* `['special']` - special crafting recipe, typically not present in the crafting menu
8181
* `['custom']` - other recipe types
82-
83-
Note that ingredients are specified as tripes, with count and nbt information. Currently all recipes require always one
84-
of the ingredients, and for some recipes, even if the nbt data for the ingredient is specified (e.g. `dispenser`), it
85-
can accept items of any tags.
8682

8783
Also note that some recipes leave some products in the crafting window, and these can be determined using
8884
`crafting_remaining_item()` function
@@ -97,7 +93,7 @@ Also note that some recipes leave some products in the crafting window, and thes
9793
### `crafting_remaining_item(item)`
9894

9995
returns `null` if the item has no remaining item in the crafting window when used as a crafting ingredient, or an
100-
item name that serves as a replacement after crafting is done. Currently it can only be buckets and glass bottles.
96+
item tuple that serves as a replacement after crafting is done. Currently, it can only be buckets and glass bottles.
10197

10298
### `inventory_size(inventory)`
10399

gradle.properties

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check https://fabricmc.net/develop/
6-
minecraft_version=1.21
7-
loader_version=0.15.11
6+
minecraft_version=1.21.2
7+
loader_version=0.16.7
88
jsr305_version=3.0.2
9-
fabric_version=0.99.2+1.21
9+
fabric_version=0.106.0+1.21.2
1010

1111
# Mod Properties
12-
mod_version = 1.4.147
12+
mod_version = 1.4.158
1313
maven_group = carpet
1414
archives_base_name = fabric-carpet
1515

1616
# Release Action properties for Curseforge and Snapshots
1717
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5)
1818
# This is needed because CF uses too vague names for prereleases and release candidates
1919
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
20-
release-curse-versions = Minecraft 1.21:1.21
20+
release-curse-versions = Minecraft 1.21:1.21.2
2121
# Whether or not to build another branch on release
2222
release-extra-branch = false
2323
# The name of the second branch to release
2424
release-extra-branch-name = 1.20.4
2525
# The "name" or id of the Curseforge version for the secondary branch
2626
# This is needed because CF uses too vague names for snapshots
2727
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
28-
release-extra-curse-version = Minecraft 1.20:1.20.4-Snapshot
28+
release-extra-curse-version = Minecraft 1.20:1.20.4-Snapshot

src/main/java/carpet/CarpetSettings.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ public static class StructureBlockIgnoredValidator extends Validator<String> {
807807
@Override
808808
public String validate(CommandSourceStack source, CarpetRule<String> currentRule, String newValue, String string) {
809809
if (source == null) return newValue; // closing or sync
810-
Optional<Block> ignoredBlock = source.registryAccess().registryOrThrow(Registries.BLOCK).getOptional(ResourceLocation.tryParse(newValue));
810+
Optional<Block> ignoredBlock = source.registryAccess().lookupOrThrow(Registries.BLOCK).getOptional(ResourceLocation.tryParse(newValue));
811811
if (!ignoredBlock.isPresent()) {
812812
Messenger.m(source, "r Unknown block '" + newValue + "'.");
813813
return null;

src/main/java/carpet/api/settings/SettingsManager.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public void detachServer()
290290
/**
291291
* Calling this method is not supported.
292292
*/
293-
public void inspectClientsideCommand(CommandSourceStack source, String string)
293+
public void inspectClientsideCommand(String string)
294294
{
295295
if (string.startsWith("/" + identifier + " "))
296296
{
@@ -302,9 +302,9 @@ public void inspectClientsideCommand(CommandSourceStack source, String string)
302302
if (rules.containsKey(rule) && rules.get(rule).canBeToggledClientSide())
303303
{
304304
try {
305-
rules.get(rule).set(source, strOption);
305+
rules.get(rule).set(null, strOption);
306306
} catch (InvalidRuleValueException e) {
307-
e.notifySource(rule, source);
307+
//e.notifySource(rule, source);
308308
}
309309
}
310310
}

src/main/java/carpet/commands/PerimeterInfoCommand.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.minecraft.core.registries.Registries;
1515
import net.minecraft.nbt.CompoundTag;
1616
import net.minecraft.world.entity.Entity;
17+
import net.minecraft.world.entity.EntitySpawnReason;
1718
import net.minecraft.world.entity.EntityType;
1819
import net.minecraft.world.entity.Mob;
1920

@@ -54,8 +55,8 @@ private static int perimeterDiagnose(CommandSourceStack source, BlockPos pos, St
5455
if (mobId != null)
5556
{
5657
nbttagcompound.putString("id", mobId);
57-
Entity baseEntity = EntityType.loadEntityRecursive(nbttagcompound, source.getLevel(), (entity_1x) -> {
58-
entity_1x.moveTo(new BlockPos(pos.getX(), source.getLevel().getMinBuildHeight()-10, pos.getZ()), entity_1x.getYRot(), entity_1x. getXRot());
58+
Entity baseEntity = EntityType.loadEntityRecursive(nbttagcompound, source.getLevel(), EntitySpawnReason.COMMAND, (entity_1x) -> {
59+
entity_1x.moveTo(new BlockPos(pos.getX(), source.getLevel().getMinY()-10, pos.getZ()), entity_1x.getYRot(), entity_1x. getXRot());
5960
return !source.getLevel().addWithUUID(entity_1x) ? null : entity_1x;
6061
});
6162
if (!(baseEntity instanceof Mob))

src/main/java/carpet/commands/PlayerCommand.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ private static boolean cantSpawn(CommandContext<CommandSourceStack> context)
223223
private static int kill(CommandContext<CommandSourceStack> context)
224224
{
225225
if (cantReMove(context)) return 0;
226-
getPlayer(context).kill();
226+
ServerPlayer player = getPlayer(context);
227+
player.kill(player.serverLevel());
227228
return 1;
228229
}
229230

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package carpet.fakes;
2+
3+
import net.minecraft.core.BlockPos;
4+
import net.minecraft.world.level.Level;
5+
6+
7+
public interface DefaultRedstoneWireEvaluatorInferface
8+
{
9+
int calculateTargetStrengthCM(final Level level, final BlockPos pos);
10+
}

src/main/java/carpet/fakes/RecipeManagerInterface.java

-17
This file was deleted.

src/main/java/carpet/fakes/RedstoneWireBlockInterface.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
public interface RedstoneWireBlockInterface {
88
BlockState updateLogicPublic(Level world_1, BlockPos blockPos_1, BlockState blockState_1);
99
void setWiresGivePower(boolean wiresGivePower);
10-
}
10+
boolean getWiresGivePower();
11+
}

src/main/java/carpet/helpers/BlockRotator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ else if (block == Blocks.HOPPER)
100100
}
101101
}
102102
// Send block update to the block that just have been rotated.
103-
world.neighborChanged(blockpos, block, source.pos());
103+
world.neighborChanged(blockpos, block, null);
104104

105105
return stack;
106106
}

src/main/java/carpet/helpers/EntityPlayerActionPack.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import net.minecraft.commands.arguments.EntityAnchorArgument;
1212
import net.minecraft.core.BlockPos;
1313
import net.minecraft.core.Direction;
14-
import net.minecraft.network.protocol.game.ClientboundSetCarriedItemPacket;
14+
import net.minecraft.network.protocol.game.ClientboundSetHeldSlotPacket;
1515
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
1616
import net.minecraft.server.level.ServerLevel;
1717
import net.minecraft.server.level.ServerPlayer;
@@ -282,7 +282,7 @@ public void drop(int selectedSlot, boolean dropAll)
282282
public void setSlot(int slot)
283283
{
284284
player.getInventory().selected = slot-1;
285-
player.connection.send(new ClientboundSetCarriedItemPacket(slot-1));
285+
player.connection.send(new ClientboundSetHeldSlotPacket(slot-1));
286286
}
287287

288288
public enum ActionType
@@ -314,12 +314,12 @@ boolean execute(ServerPlayer player, Action action)
314314
BlockHitResult blockHit = (BlockHitResult) hit;
315315
BlockPos pos = blockHit.getBlockPos();
316316
Direction side = blockHit.getDirection();
317-
if (pos.getY() < player.level().getMaxBuildHeight() - (side == Direction.UP ? 1 : 0) && world.mayInteract(player, pos))
317+
if (pos.getY() < player.level().getMaxY() - (side == Direction.UP ? 1 : 0) && world.mayInteract(player, pos))
318318
{
319319
InteractionResult result = player.gameMode.useItemOn(player, world, player.getItemInHand(hand), hand, blockHit);
320-
if (result.consumesAction())
320+
if (result instanceof InteractionResult.Success success)
321321
{
322-
if (result.shouldSwing()) player.swing(hand);
322+
if (success.swingSource() == InteractionResult.SwingSource.SERVER) player.swing(hand);
323323
ap.itemUseCooldown = 3;
324324
return true;
325325
}
@@ -402,17 +402,17 @@ boolean execute(ServerPlayer player, Action action) {
402402
boolean blockBroken = false;
403403
if (player.gameMode.getGameModeForPlayer().isCreative())
404404
{
405-
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
405+
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
406406
ap.blockHitDelay = 5;
407407
blockBroken = true;
408408
}
409409
else if (ap.currentBlock == null || !ap.currentBlock.equals(pos))
410410
{
411411
if (ap.currentBlock != null)
412412
{
413-
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
413+
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
414414
}
415-
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
415+
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
416416
boolean notAir = !state.isAir();
417417
if (notAir && ap.curBlockDamageMP == 0)
418418
{
@@ -435,7 +435,7 @@ else if (ap.currentBlock == null || !ap.currentBlock.equals(pos))
435435
ap.curBlockDamageMP += state.getDestroyProgress(player, player.level(), pos);
436436
if (ap.curBlockDamageMP >= 1)
437437
{
438-
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK, side, player.level().getMaxBuildHeight(), -1);
438+
player.gameMode.handleBlockBreakAction(pos, ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK, side, player.level().getMaxY(), -1);
439439
ap.currentBlock = null;
440440
ap.blockHitDelay = 5;
441441
blockBroken = true;
@@ -457,7 +457,7 @@ void inactiveTick(ServerPlayer player, Action action)
457457
EntityPlayerActionPack ap = ((ServerPlayerInterface) player).getActionPack();
458458
if (ap.currentBlock == null) return;
459459
player.level().destroyBlockProgress(-1, ap.currentBlock, -1);
460-
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.level().getMaxBuildHeight(), -1);
460+
player.gameMode.handleBlockBreakAction(ap.currentBlock, ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, Direction.DOWN, player.level().getMaxY(), -1);
461461
ap.currentBlock = null;
462462
}
463463
},

src/main/java/carpet/helpers/FertilizableCoral.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public default void performBonemeal(ServerLevel worldIn, RandomSource random, Bl
5858

5959
MapColor color = blockUnder.getMapColor(worldIn, pos);
6060
BlockState properBlock = blockUnder;
61-
HolderSet.Named<Block> coralBlocks = worldIn.registryAccess().registryOrThrow(Registries.BLOCK).getTag(BlockTags.CORAL_BLOCKS).orElseThrow();
61+
HolderSet.Named<Block> coralBlocks = worldIn.registryAccess().lookupOrThrow(Registries.BLOCK).get(BlockTags.CORAL_BLOCKS).orElseThrow();
6262
for (Holder<Block> block: coralBlocks)
6363
{
6464
properBlock = block.value().defaultBlockState();

0 commit comments

Comments
 (0)