Skip to content

Commit e69daab

Browse files
committed
port to 1.21.3, rework customSticky mixin
1 parent 6cbc537 commit e69daab

34 files changed

+116
-572
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
## Changelog
2-
- fix `releaseTarget`
2+
- port to 1.21.3
3+
- rework `customSticky` mixin

docs/scarpet/Full.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2954,7 +2954,7 @@ It returns a `map` with a report indicating how many chunks were affected, and h
29542954
29552955
Adds a chunk ticket at a position, which makes the game to keep the designated area centered around
29562956
`pos` with radius of `radius` loaded for a predefined amount of ticks, defined by `type`. Allowed types
2957-
are `portal`: 300 ticks, `teleport`: 40 ticks, and `unknown`: 1 tick. Radius can be from 1 to 32 ticks.
2957+
are `portal`: 300 ticks, `teleport`: 5 ticks, and `unknown`: 1 tick. Radius can be from 1 to 32 ticks.
29582958
29592959
This function is tentative - will likely change when chunk ticket API is properly fleshed out.
29602960

docs/scarpet/api/BlocksAndWorldAccess.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ It returns a `map` with a report indicating how many chunks were affected, and h
625625

626626
Adds a chunk ticket at a position, which makes the game to keep the designated area centered around
627627
`pos` with radius of `radius` loaded for a predefined amount of ticks, defined by `type`. Allowed types
628-
are `portal`: 300 ticks, `teleport`: 40 ticks, and `unknown`: 1 tick. Radius can be from 1 to 32 ticks.
628+
are `portal`: 300 ticks, `teleport`: 5 ticks, and `unknown`: 1 tick. Radius can be from 1 to 32 ticks.
629629

630630
This function is tentative - will likely change when chunk ticket API is properly fleshed out.
631631

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G
33
loom.platform = neoforge
44

55
# Mod Properties
6-
minecraft_version=1.21.4
7-
neoforge_version=21.4.112-beta
6+
minecraft_version=1.21.3
7+
neoforge_version=21.3.65
88
jsr305_version=3.0.2
9-
parchment_mappings=2025.01.19
9+
parchment_mappings=2024.12.07
1010

1111
# Mod Properties
12-
upstream_version = 1.4.147
13-
mod_version = 0.1.4
12+
upstream_version = 1.4.158
13+
mod_version = 0.1.5
1414
maven_group = org.thinkingstudio.bedsheet
1515
archives_base_name = bedsheet
1616

src/main/java/carpet/CarpetServer.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import carpet.utils.SpawnReporter;
3232
import com.mojang.brigadier.CommandDispatcher;
3333

34-
//import net.fabricmc.loader.api.FabricLoader;
3534
import net.minecraft.commands.CommandBuildContext;
3635
import net.minecraft.commands.CommandSourceStack;
3736
import net.minecraft.commands.Commands;
@@ -51,8 +50,7 @@ public class CarpetServer // static for now - easier to handle all around the co
5150

5251
/**
5352
* Registers a {@link CarpetExtension} to be managed by Carpet.<br>
54-
* Should be called before Carpet's startup.
55-
*
53+
* Should be called before Carpet's startup
5654
* @param extension The instance of a {@link CarpetExtension} to be registered
5755
*/
5856
public static void manageExtension(CarpetExtension extension)
@@ -68,8 +66,9 @@ public static void manageExtension(CarpetExtension extension)
6866
}
6967
}
7068

71-
// Separate from onServerLoaded, as it is possible to load the server multiple times in a single player game.
72-
// Called by NeoForge from the mod constructor to allow extensions to register in the mod constructor before this call.
69+
// Separate from onServerLoaded, because a server can be loaded multiple times in singleplayer
70+
// Gets called by Fabric Loader from a ServerModInitializer and a ClientModInitializer, in both to allow extensions
71+
// to register before this call in a ModInitializer (declared in fabric.mod.json)
7372
public static void onGameStarted()
7473
{
7574
settingsManager = new carpet.settings.SettingsManager(CarpetSettings.carpetVersion, "carpet", "Carpet Mod");

src/main/java/carpet/CarpetSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
import org.slf4j.Logger;
3030
import org.slf4j.LoggerFactory;
31-
import org.thinkingstudio.bedsheet.util.NeoHooks;
3231
import org.thinkingstudio.bedsheet.BedSheetModReference;
32+
import org.thinkingstudio.bedsheet.util.NeoHooks;
3333

3434
import java.util.Optional;
3535

@@ -73,7 +73,7 @@ private static class LanguageValidator extends Validator<String> {
7373
@Rule(
7474
desc = "Sets the language for Carpet",
7575
category = FEATURE,
76-
options = {"en_us", "fr_fr", "es_ar","pt_br", "zh_cn", "zh_tw"},
76+
options = {"en_us", "fr_fr", "pt_br", "zh_cn", "zh_tw"},
7777
strict = true, // the current system doesn't handle fallbacks and other, not defined languages would make unreadable mess. Change later
7878
validate = LanguageValidator.class
7979
)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@
4545
import carpet.utils.Messenger;
4646
import carpet.utils.TranslationKeys;
4747
import carpet.utils.Translations;
48-
//import net.fabricmc.api.EnvType;
49-
//import net.fabricmc.loader.api.FabricLoader;
5048
import net.minecraft.commands.CommandBuildContext;
5149
import net.minecraft.commands.CommandSourceStack;
5250
import net.minecraft.commands.SharedSuggestionProvider;

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,6 @@ private static boolean cantSpawn(CommandContext<CommandSourceStack> context)
190190
MinecraftServer server = context.getSource().getServer();
191191
PlayerList manager = server.getPlayerList();
192192

193-
if (EntityPlayerMPFake.isSpawningPlayer(playerName))
194-
{
195-
Messenger.m(context.getSource(), "r Player ", "rb " + playerName, "r is currently logging on");
196-
return true;
197-
}
198193
if (manager.getPlayerByName(playerName) != null)
199194
{
200195
Messenger.m(context.getSource(), "r Player ", "rb " + playerName, "r is already logged on");

src/main/java/carpet/helpers/HopperCounter.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.util.List;
3838
import java.util.Locale;
3939
import java.util.Map;
40-
import java.util.Optional;
4140
import java.util.stream.Collectors;
4241

4342
import static java.util.Map.entry;
@@ -421,10 +420,13 @@ public static TextColor guessColor(Item item, Level level)
421420
{
422421
for (Ingredient ingredient : r.placementInfo().ingredients())
423422
{
424-
Optional<Holder<Item>> match = ingredient.items().filter(stack -> fromItem(stack.value(), registryAccess) != null).findFirst();
425-
if (match.isPresent())
423+
for (Holder<Item> stack : ingredient.items())
426424
{
427-
return fromItem(match.get().value(), registryAccess);
425+
TextColor cand = fromItem(stack.value(), registryAccess);
426+
if (cand != null)
427+
{
428+
return cand;
429+
}
428430
}
429431
}
430432
}

src/main/java/carpet/helpers/ParticleDisplay.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static void drawParticleLine(ServerPlayer player, Vec3 from, Vec3 to, Str
1818
if (accentParticle != null) player.serverLevel().sendParticles(
1919
player,
2020
accentParticle,
21-
true, true,
21+
true,
2222
to.x, to.y, to.z, count,
2323
spread, spread, spread, 0.0);
2424

@@ -33,7 +33,7 @@ public static void drawParticleLine(ServerPlayer player, Vec3 from, Vec3 to, Str
3333
player.serverLevel().sendParticles(
3434
player,
3535
mainParticle,
36-
true, true,
36+
true,
3737
delta.x+from.x, delta.y+from.y, delta.z+from.z, 1,
3838
0.0, 0.0, 0.0, 0.0);
3939
}

0 commit comments

Comments
 (0)