Skip to content

Commit f111d80

Browse files
committed
Partial port to 1.21.10
1 parent f53571c commit f111d80

27 files changed

+70
-57
lines changed

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ dependencies {
4343
modLocalRuntime libs.modmenu
4444
}
4545

46+
jar {
47+
sourceSets {
48+
main {
49+
java {
50+
exclude 'dev/hephaestus/glowcase/client/**'
51+
exclude 'dev/hephaestus/glowcase/mixin/client/**'
52+
}
53+
}
54+
}
55+
}
56+
4657
loom {
4758
accessWidenerPath.set(file("src/main/resources/glowcase.accesswidener"))
4859

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ license=CC0-1.0
1919
# Mod Version
2020
baseVersion=2.3.4
2121
# Branch Metadata
22-
branch=1.21.7
23-
tagBranch=1.21.7
24-
compatibleVersions=1.21.7, 1.21.8
22+
branch=1.21.10
23+
tagBranch=1.21.10
24+
compatibleVersions=1.21.10
2525
compatibleLoaders=fabric

libs.versions.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ minotaur = "2.+"
44

55
kaleidoConfig = "0.3.3+1.3.2"
66

7-
mc = "1.21.7"
8-
fl = "0.16.14"
9-
yarn = "1.21.7+build.2"
10-
fapi = "0.128.2+1.21.7"
7+
mc = "1.21.10"
8+
fl = "0.17.3"
9+
yarn = "1.21.10+build.1"
10+
fapi = "0.138.3+1.21.10"
1111

12-
placeholder = "2.4.0+1.21"
12+
placeholder = "2.8.1+1.21.10"
1313
polydex = "1.6.0+1.21.6"
1414
# emi = "1.1.19+1.21.1"
1515
modmenu = "15.0.0-beta.3"

src/main/java/dev/hephaestus/glowcase/block/ConfigLinkBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
5858
@Override
5959
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
6060
if (!(world.getBlockEntity(pos) instanceof ConfigLinkBlockEntity be)) return ActionResult.CONSUME;
61-
if (world.isClient) {
61+
if (world.isClient()) {
6262
Glowcase.proxy.openConfigScreen(be.getUrl());
6363
}
6464
return ActionResult.SUCCESS;

src/main/java/dev/hephaestus/glowcase/block/EntityDisplayBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected boolean openEditScreen(BlockPos pos) {
5555

5656
@Override
5757
boolean canTarget(PlayerEntity player, BlockPos pos) {
58-
if (!(player.getWorld().getBlockEntity(pos) instanceof StackInteractable be)) return false;
58+
if (!(player.getEntityWorld().getBlockEntity(pos) instanceof StackInteractable be)) return false;
5959
return canEditGlowcase(player, pos) && ((be.matchesStack(ItemStack.EMPTY) && player.getMainHandStack().getItem() instanceof SpawnEggItem) || be.matchesStack(player.getMainHandStack()) || player.getMainHandStack().isIn(Glowcase.ITEM_TAG));
6060
}
6161

src/main/java/dev/hephaestus/glowcase/block/GlowcaseBlock.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ protected VoxelShape targetedOutlineShape(BlockState state, BlockView world, Blo
5050
abstract protected boolean openEditScreen(BlockPos pos);
5151

5252
protected void loadClientSideNBT(World world, BlockPos pos, LivingEntity placer, ItemStack stack) {
53-
if (world.isClient && placer instanceof PlayerEntity player && canEditGlowcase(player, pos)) {
54-
NbtComponent blockEntityTag = stack.get(DataComponentTypes.BLOCK_ENTITY_DATA);
53+
if (world.isClient() && placer instanceof PlayerEntity player && canEditGlowcase(player, pos)) {
54+
var blockEntityTag = stack.get(DataComponentTypes.BLOCK_ENTITY_DATA);
5555
if (blockEntityTag != null && world.getBlockEntity(pos) instanceof BlockEntity be) {
5656
blockEntityTag.applyToBlockEntity(be, world.getRegistryManager());
5757
}
@@ -62,7 +62,7 @@ protected void loadClientSideNBT(World world, BlockPos pos, LivingEntity placer,
6262
@Override
6363
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
6464
loadClientSideNBT(world, pos, placer, stack);
65-
if (world.isClient && placer instanceof PlayerEntity player && canEditGlowcase(player, pos)) {
65+
if (world.isClient() && placer instanceof PlayerEntity player && canEditGlowcase(player, pos)) {
6666
openEditScreen(pos);
6767
}
6868
}
@@ -74,7 +74,7 @@ protected ActionResult onUseWithItem(ItemStack stack, BlockState state, World wo
7474
}
7575

7676
if (player.getStackInHand(hand).isIn(Glowcase.ITEM_TAG) && canEditGlowcase(player, pos)) {
77-
if (world.isClient) {
77+
if (world.isClient()) {
7878
openEditScreen(pos);
7979
}
8080

@@ -109,7 +109,7 @@ public static boolean canEditGlowcase(@Nullable LivingEntity entity, BlockPos po
109109
if (entity == null) return false;
110110

111111
if (entity instanceof PlayerEntity player) {
112-
if (player.getWorld() instanceof ServerWorld serverWorld) {
112+
if (player.getEntityWorld() instanceof ServerWorld serverWorld) {
113113
return player.isCreative() && player.canModifyAt(serverWorld, pos);
114114
}
115115

src/main/java/dev/hephaestus/glowcase/block/HyperlinkBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
5656
@Override
5757
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
5858
if (!(world.getBlockEntity(pos) instanceof HyperlinkBlockEntity be)) return ActionResult.CONSUME;
59-
if (world.isClient && !be.getUrl().isBlank()) {
59+
if (world.isClient() && !be.getUrl().isBlank()) {
6060
Glowcase.proxy.openUrlWithConfirmation(be.getUrl());
6161
}
6262
return ActionResult.SUCCESS;

src/main/java/dev/hephaestus/glowcase/block/ItemAcceptorBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected boolean openEditScreen(BlockPos pos) {
8080
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
8181
if (!(world.getBlockEntity(pos) instanceof ItemAcceptorBlockEntity be)) return ActionResult.CONSUME;
8282
if (canEditGlowcase(player, pos)) {
83-
if (world.isClient) {
83+
if (world.isClient()) {
8484
openEditScreen(pos);
8585
}
8686
return ActionResult.SUCCESS;

src/main/java/dev/hephaestus/glowcase/block/ItemProviderBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected void appendProperties(StateManager.Builder<Block, BlockState> builder)
4949
}
5050

5151
public boolean canPickup(PlayerEntity player, BlockPos pos) {
52-
return ((player.getWorld().getBlockEntity(pos) instanceof ItemProviderBlockEntity be && be.canGiveTo(player) && !player.isCreative() && be.canGiveTo(player) && (player.getMainHandStack().isEmpty() || (be.matchesStack(player.getMainHandStack()) && player.getMainHandStack().getCount() < player.getMainHandStack().getMaxCount()))));
52+
return ((player.getEntityWorld().getBlockEntity(pos) instanceof ItemProviderBlockEntity be && be.canGiveTo(player) && !player.isCreative() && be.canGiveTo(player) && (player.getMainHandStack().isEmpty() || (be.matchesStack(player.getMainHandStack()) && player.getMainHandStack().getCount() < player.getMainHandStack().getMaxCount()))));
5353
}
5454

5555
@Override
@@ -62,7 +62,7 @@ protected ActionResult onUse(BlockState state, World world, BlockPos pos, Player
6262
if (!(world.getBlockEntity(pos) instanceof ItemProviderBlockEntity be)) return ActionResult.CONSUME;
6363

6464
if (be.canGiveTo(player)) {
65-
if (!world.isClient) be.giveTo(player);
65+
if (!world.isClient()) be.giveTo(player);
6666
return ActionResult.SUCCESS;
6767
}
6868

src/main/java/dev/hephaestus/glowcase/block/PopupBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
5757
@Override
5858
protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
5959
if (!(world.getBlockEntity(pos) instanceof PopupBlockEntity be)) return ActionResult.CONSUME;
60-
if (world.isClient && !(be.lines.size() == 1 && be.lines.getFirst().getContent().equals(PlainTextContent.EMPTY))) {
60+
if (world.isClient() && !(be.lines.size() == 1 && be.lines.getFirst().getContent().equals(PlainTextContent.EMPTY))) {
6161
Glowcase.proxy.openPopupBlockViewScreen(pos);
6262
}
6363
return ActionResult.SUCCESS;

0 commit comments

Comments
 (0)