Skip to content

Commit

Permalink
fix: disable preview features
Browse files Browse the repository at this point in the history
  • Loading branch information
sylv256 committed Aug 11, 2024
1 parent d429da5 commit 30c972c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# JDK Incompatibility Hotfix (`0.1.1+1.21`)
## Fixes
- Disabled JDK preview features which caused issues with production JVMs.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
// Minecraft 1.21 upwards uses Java 21.
options.release.set(21)
options.compilerArgs.add("--enable-preview")
}

loom {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx1G

# Mod Properties
modVersion = 0.1.0+1.21
modVersion = 0.1.1+1.21
mavenGroup = gay.sylv
modId = weird-wares
2 changes: 1 addition & 1 deletion src/main/java/gay/sylv/weird_wares/impl/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onInitialize() {
return InteractionResult.PASS;
});

PlayerBlockBreakEvents.AFTER.register((level, _, pos, _, _) -> {
PlayerBlockBreakEvents.AFTER.register((level, player, pos, blockState, blockEntity) -> {
ChunkAccess chunk = level.getChunk(pos);
Set<BlockPos> glints = new HashSet<>(DataAttachments.getGlint(chunk));
if (glints.contains(pos)) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/gay/sylv/weird_wares/impl/block/Blocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void initialize() {
"unknown",
new Block(
BlockBehaviour.Properties.of()
.isValidSpawn((_, _, _, _) -> true)
.isValidSpawn((blockState, blockGetter, blockPos, entityType) -> true)
.instabreak()
.mapColor(MapColor.DIRT)
.friction(0.98f)
Expand All @@ -61,7 +61,7 @@ public void initialize() {
new Block(
BlockBehaviour.Properties.of()
.sound(SoundType.GRAVEL)
.isValidSpawn((_, _, _, _) -> true)
.isValidSpawn((blockState, blockGetter, blockPos, entityType) -> true)
.strength(0.0f, Constants.INFINITE_BLAST_RESISTANCE)
.mapColor(MapColor.COLOR_LIGHT_GREEN)
)
Expand All @@ -76,8 +76,8 @@ public void initialize() {
"glowing_obsidian",
new Block(
BlockBehaviour.Properties.ofFullCopy(net.minecraft.world.level.block.Blocks.OBSIDIAN)
.emissiveRendering((_, _, _) -> true)
.lightLevel(_ -> 12)
.emissiveRendering((blockState, blockGetter, blockPos) -> true)
.lightLevel(blockState -> 12)
)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public void onInitializeClient() {
Rendering.INSTANCE.initialize();
ClientPackets.INSTANCE.initialize();

ClientChunkEvents.CHUNK_LOAD.register((_, chunk) -> ClientPlayNetworking.send(new RequestGlintSyncPayload(chunk.getPos())));
ClientChunkEvents.CHUNK_LOAD.register((clientLevel, chunk) -> ClientPlayNetworking.send(new RequestGlintSyncPayload(chunk.getPos())));

ClientPlayerBlockBreakEvents.AFTER.register((level, _, pos, _) -> {
ClientPlayerBlockBreakEvents.AFTER.register((level, localPlayer, pos, blockState) -> {
ChunkAccess chunk = level.getChunk(pos);
Set<BlockPos> glints = DataAttachments.getGlint(chunk);
if (glints.contains(pos)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void initialize() {
GLINT_FORMAT = TERRAIN_GLINT.format();
GLINT_MODE = TERRAIN_GLINT.mode();
});
ClientChunkEvents.CHUNK_UNLOAD.register((_, chunk) -> {
ClientChunkEvents.CHUNK_UNLOAD.register((clientLevel, chunk) -> {
var glint = DataAttachments.getGlint(chunk);
glint.forEach(pos -> {
SectionPos sectionPos = SectionPos.of(pos);
Expand Down

0 comments on commit 30c972c

Please sign in to comment.