Skip to content

Commit 31df9be

Browse files
committed
Update to 26.1
1 parent 782d541 commit 31df9be

63 files changed

Lines changed: 468 additions & 401 deletions

File tree

Some content is hidden

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

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
matrix:
1616
# Use these Java versions
1717
java: [
18-
21 # Latest version
18+
25 # Latest version
1919
]
2020
# and run on both Linux and Windows
2121
os: [ubuntu-latest]
@@ -35,7 +35,7 @@ jobs:
3535
- name: build
3636
run: ./gradlew build
3737
- name: capture build artifacts
38-
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from LTS java on one OS
38+
if: ${{ runner.os == 'Linux' }} # Only upload artifacts built from LTS java on one OS
3939
uses: actions/upload-artifact@v4
4040
with:
4141
name: Artifacts

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up JDK
2525
uses: actions/setup-java@v1
2626
with:
27-
java-version: 21
27+
java-version: 25
2828

2929
- name: Grant execute permission for gradlew
3030
run: chmod +x gradlew

build.gradle

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
plugins {
2-
id 'fabric-loom' version '1.13.+'
2+
id 'net.fabricmc.fabric-loom' version '1.15.+'
33
id "com.modrinth.minotaur" version "2.+"
44
id 'maven-publish'
55
}
66

7-
8-
sourceCompatibility = JavaVersion.VERSION_21
9-
targetCompatibility = JavaVersion.VERSION_21
10-
11-
archivesBaseName = project.archives_base_name
7+
base {
8+
archivesName = project.archives_base_name
9+
}
1210
group = project.maven_group
1311

1412
if (System.getenv("CI") != null) {
@@ -30,7 +28,7 @@ loom {
3028
name = "Data Generation"
3129
runDir = "build/datagen"
3230
vmArg("-Dfabric-api.datagen")
33-
vmArg("-Dfabric-api.datagen.modid=polydecorations")
31+
vmArg("-Dfabric-api.datagen.id=polydecorations")
3432
vmArg("-Dfabric-api.datagen.output-dir=${file("src/main/generated")}")
3533
}
3634
}
@@ -68,34 +66,33 @@ repositories {
6866
dependencies {
6967
// To change the versions see the gradle.properties file
7068
minecraft "com.mojang:minecraft:${project.minecraft_version}"
71-
mappings loom.officialMojangMappings()
72-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
69+
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
7370

7471
// Fabric API. This is technically optional, but you probably want it anyway.
75-
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
76-
77-
modImplementation 'eu.pb4:polymer-core:0.15.1+1.21.11'
78-
modImplementation 'eu.pb4:polymer-blocks:0.15.1+1.21.11'
79-
modImplementation 'eu.pb4:polymer-resource-pack:0.15.1+1.21.11'
80-
modImplementation 'eu.pb4:polymer-resource-pack-extras:0.15.1+1.21.11'
81-
modImplementation 'eu.pb4:polymer-autohost:0.15.1+1.21.11'
82-
modImplementation 'eu.pb4:polymer-virtual-entity:0.15.1+1.21.11'
83-
modImplementation include('eu.pb4:common-protection-api:1.0.0')
84-
modImplementation include('eu.pb4:sgui:1.12.0+1.21.11')
85-
modImplementation include('eu.pb4:map-canvas-api:0.7.0+1.21.11')
86-
modImplementation include('eu.pb4:factorytools:0.9.3+1.21.11')
87-
modImplementation include('nl.theepicblock:resource-locator-api:0.6.3-drex+1.21.11')
72+
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
73+
74+
implementation 'eu.pb4:polymer-core:0.16.0-pre.4+26.1'
75+
implementation 'eu.pb4:polymer-blocks:0.16.0-pre.4+26.1'
76+
implementation 'eu.pb4:polymer-resource-pack:0.16.0-pre.4+26.1'
77+
implementation 'eu.pb4:polymer-resource-pack-extras:0.16.0-pre.4+26.1'
78+
implementation 'eu.pb4:polymer-autohost:0.16.0-pre.4+26.1'
79+
implementation 'eu.pb4:polymer-virtual-entity:0.16.0-pre.4+26.1'
80+
implementation include('eu.pb4:common-protection-api:2.0.0')
81+
implementation include('eu.pb4:sgui:2.0.0+26.1')
82+
implementation include('eu.pb4:map-canvas-api:0.8.0+26.1')
83+
implementation include('eu.pb4:factorytools:0.10.0-pre.2+26.1')
84+
implementation include('nl.theepicblock:resource-locator-api:0.7.0-patbox+26.1')
8885

8986
// Temp hack to allow development
90-
//modImplementation include('com.kneelawk:graphlib:1.99.99+1.20.local')
91-
//modImplementation include('alexiil.mc.lib:libnetworkstack-base:0.11.0-aaa.patbox')
87+
//implementation include('com.kneelawk:graphlib:1.99.99+1.20.local')
88+
//implementation include('alexiil.mc.lib:libnetworkstack-base:0.11.0-aaa.patbox')
9289

93-
modCompileOnly 'maven.modrinth:polydex:1.3.0+1.21.2'
90+
compileOnly 'eu.pb4:polydex:1.9.2+26.1-rc-3'
9491

9592
// Uncomment the following line to enable the deprecated Fabric API modules.
9693
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
9794

98-
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
95+
// implementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
9996
}
10097

10198
processResources {
@@ -108,7 +105,7 @@ processResources {
108105

109106
tasks.withType(JavaCompile).configureEach {
110107
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
111-
it.options.release = 21
108+
it.options.release = 25
112109
}
113110

114111
java {
@@ -120,7 +117,7 @@ java {
120117

121118
jar {
122119
from("LICENSE") {
123-
rename { "${it}_${project.archivesBaseName}"}
120+
rename { "${it}_${project.archives_base_name}"}
124121
}
125122
}
126123

@@ -147,18 +144,18 @@ if (System.getenv("MODRINTH")) {
147144
projectId = '5710VC7f'// The ID of your modrinth project, slugs will not work.
148145
versionNumber = "" + version // The version of the mod to upload.
149146
versionType = "release"
150-
uploadFile = remapJar // This links to a task that builds your mod jar and sets "uploadFile" to the mod jar.
147+
uploadFile = jar // This links to a task that builds your mod jar and sets "uploadFile" to the mod jar.
151148
gameVersions = [((String) project.minecraft_version)]
152149
changelog = System.getenv("CHANGELOG")
153-
loaders = ["fabric"/*, "quilt"*/]
150+
loaders = ["fabric"]
154151

155152
dependencies {
156153
required.project "polymer"
157154
optional.project "armorstandeditor"
158155
}
159156
}
160157

161-
remapJar {
158+
jar {
162159
finalizedBy project.tasks.modrinth
163160
}
164161
}

gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.11
8-
yarn_mappings=1.21.11+build.1
9-
loader_version=0.18.2
10-
loom_version=1.10-SNAPSHOT
7+
8+
minecraft_version=26.1
9+
loader_version=0.18.5
10+
loom_version=1.15-SNAPSHOT
1111

1212
# Fabric API
13-
fabric_version=0.139.5+1.21.11
13+
fabric_api_version=0.144.3+26.1
1414

1515
# Mod Properties
16-
mod_version = 0.10.4
16+
mod_version = 0.11.0
1717
maven_group = eu.pb4
1818
archives_base_name = polydecorations
1919

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/main/java/eu/pb4/polydecorations/block/SimpleParticleBlock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.minecraft.core.particles.ParticleOptions;
66
import net.minecraft.core.particles.ParticleTypes;
77
import net.minecraft.world.item.ItemStack;
8+
import net.minecraft.world.item.ItemStackTemplate;
89
import net.minecraft.world.level.block.Block;
910
import net.minecraft.world.level.block.state.BlockState;
1011

@@ -20,6 +21,6 @@ default ParticleOptions getBreakingParticle(BlockState blockState) {
2021
}
2122

2223
default ParticleOptions computeParticle(Block block) {
23-
return new ItemParticleOption(ParticleTypes.ITEM, new ItemStack(block.asItem()));
24+
return new ItemParticleOption(ParticleTypes.ITEM, new ItemStackTemplate(block.asItem()));
2425
}
2526
}

src/main/java/eu/pb4/polydecorations/block/extension/AttachedSignPostBlock.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import net.minecraft.world.phys.BlockHitResult;
4040
import org.jetbrains.annotations.Nullable;
4141
import org.joml.Vector3f;
42-
import xyz.nucleoid.packettweaker.PacketContext;
42+
import net.fabricmc.fabric.api.networking.v1.context.PacketContext;
4343

4444
import java.util.Map;
4545

@@ -55,7 +55,7 @@ public AttachedSignPostBlock(BlockBehaviour.Properties settings, Block block, in
5555
this.radius = pixelSideLength / 16f / 2f;
5656
MAP.put(block, this);
5757
this.registerDefaultState(this.defaultBlockState().setValue(WATERLOGGED, false));
58-
ModInit.LATE_INIT.add(() -> DecorationsBlockEntities.SIGN_POST.addSupportedBlock(this));
58+
ModInit.LATE_INIT.add(() -> DecorationsBlockEntities.SIGN_POST.addValidBlock(this));
5959
}
6060

6161
@Override
@@ -181,7 +181,7 @@ public void updateUpper(SignPostBlockEntity.Sign upperText) {
181181
this.upperBack.setTeleportDuration(0);
182182
this.upperBack.setYaw(upperText.flip() ? 180 + upperText.yaw() : upperText.yaw());
183183
this.upperBack.setTranslation(new Vector3f(0, 4 / 16f, zOffset));
184-
this.upperBack.setItem(ItemDisplayElementUtil.getSolidModel(upperText.item()));
184+
this.upperBack.setItem(ItemDisplayElementUtil.getModel(upperText.item()).get());
185185
this.upperBack.tick();
186186
this.upperBack.setTeleportDuration(1);
187187
this.upperBack.tick();
@@ -205,7 +205,7 @@ public void updateLower(SignPostBlockEntity.Sign lowerText) {
205205
this.lowerBack.setTeleportDuration(0);
206206
this.lowerBack.setYaw(lowerText.flip() ? 180 + lowerText.yaw() : lowerText.yaw());
207207
this.lowerBack.setTranslation(new Vector3f(0, -4 / 16f, zOffset));
208-
this.lowerBack.setItem(ItemDisplayElementUtil.getSolidModel(lowerText.item()));
208+
this.lowerBack.setItem(ItemDisplayElementUtil.getModel(lowerText.item()).get());
209209
this.lowerBack.tick();
210210
this.lowerBack.setTeleportDuration(1);
211211
this.lowerBack.tick();

src/main/java/eu/pb4/polydecorations/block/extension/SignPostBlockEntity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ public InteractionResult onUse(Player player, boolean upper, BlockHitResult hit)
166166
}
167167

168168
if (player.getMainHandItem().getItem() instanceof SignApplicator item) {
169-
if (item.canApplyToSign(getText(upper).text, player)) {
169+
if (item.canApplyToSign(getText(upper).text, player.getMainHandItem(), player)) {
170170
var fake = Fake.INSTANCE;
171171
fake.setText(getText(upper).text, false);
172172
fake.setWaxed(getText(upper).waxed);
173173
try {
174-
if (item.tryApplyToSign(level, fake, false, player)) {
174+
if (item.tryApplyToSign(level, fake, false, player.getMainHandItem(), player)) {
175175
if (!player.isCreative()) {
176176
player.getMainHandItem().shrink(1);
177177
}
@@ -308,9 +308,9 @@ public Gui(ServerPlayer player, Supplier<Sign> getter, Consumer<Sign> setter) {
308308
}
309309

310310
@Override
311-
public void onClose() {
311+
public void onManualClose() {
312312
setter.accept(getter.get().withText(getter.get().text.setMessage(0, this.getLine(0))));
313-
super.onClose();
313+
super.onManualClose();
314314
}
315315

316316
@Override

src/main/java/eu/pb4/polydecorations/block/extension/WallAttachedLanternBlock.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package eu.pb4.polydecorations.block.extension;
22

33
import eu.pb4.factorytools.api.block.QuickWaterloggable;
4+
import eu.pb4.factorytools.api.util.LazyItemStack;
45
import eu.pb4.factorytools.api.virtualentity.BlockModel;
56
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
67
import eu.pb4.polydecorations.block.DecorationsBlockTags;
@@ -11,6 +12,7 @@
1112
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
1213
import eu.pb4.polymer.virtualentity.api.elements.ItemDisplayElement;
1314
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
15+
import net.fabricmc.fabric.api.networking.v1.context.PacketContext;
1416
import net.minecraft.core.BlockPos;
1517
import net.minecraft.core.Direction;
1618
import net.minecraft.network.chat.MutableComponent;
@@ -38,7 +40,6 @@
3840
import net.minecraft.world.phys.shapes.BooleanOp;
3941
import net.minecraft.world.phys.shapes.Shapes;
4042
import org.jetbrains.annotations.Nullable;
41-
import xyz.nucleoid.packettweaker.PacketContext;
4243

4344
import java.util.Arrays;
4445
import java.util.Locale;
@@ -128,9 +129,9 @@ public boolean canPathfindThrough(BlockState state, BlockGetter world, BlockPos
128129
}
129130

130131
public static final class Model extends BlockModel {
131-
public static final ItemStack MODEL[] = Arrays.stream(Attached.values())
132-
.map(x -> ItemDisplayElementUtil.getSolidModel(id("block/lantern_support/" + x.ordinal())))
133-
.toArray(ItemStack[]::new);
132+
public static final LazyItemStack MODEL[] = Arrays.stream(Attached.values())
133+
.map(x -> ItemDisplayElementUtil.getModel(id("block/lantern_support/" + x.ordinal())))
134+
.toArray(LazyItemStack[]::new);
134135
private final ItemDisplayElement main;
135136

136137
private Model(BlockState state) {
@@ -141,7 +142,7 @@ private Model(BlockState state) {
141142
}
142143

143144
private ItemStack model(BlockState state) {
144-
return MODEL[state.getValue(ATTACHED).ordinal()];
145+
return MODEL[state.getValue(ATTACHED).ordinal()].get();
145146
}
146147

147148
@Override

src/main/java/eu/pb4/polydecorations/block/extension/WallAttachedOxidizableLanternBlock.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,12 @@
11
package eu.pb4.polydecorations.block.extension;
22

3-
import eu.pb4.factorytools.api.block.QuickWaterloggable;
4-
import eu.pb4.factorytools.api.virtualentity.BlockModel;
5-
import eu.pb4.factorytools.api.virtualentity.ItemDisplayElementUtil;
6-
import eu.pb4.polymer.core.api.block.PolymerBlock;
7-
import eu.pb4.polymer.virtualentity.api.BlockWithElementHolder;
8-
import eu.pb4.polymer.virtualentity.api.ElementHolder;
9-
import eu.pb4.polymer.virtualentity.api.attachment.BlockAwareAttachment;
10-
import eu.pb4.polymer.virtualentity.api.attachment.HolderAttachment;
11-
import eu.pb4.polymer.virtualentity.api.elements.ItemDisplayElement;
12-
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
3+
134
import net.minecraft.core.BlockPos;
145
import net.minecraft.server.level.ServerLevel;
156
import net.minecraft.util.RandomSource;
167
import net.minecraft.world.level.block.WeatheringCopper;
178
import net.minecraft.world.level.block.WeatheringLanternBlock;
189
import net.minecraft.world.level.block.state.BlockState;
19-
import org.jetbrains.annotations.Nullable;
20-
import xyz.nucleoid.packettweaker.PacketContext;
2110

2211
import java.util.Locale;
2312
import java.util.Map;

0 commit comments

Comments
 (0)