diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index a943e49..eb1cbd5 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Gradle uses: actions/gradle/setup-gradle@v4 with: - gradle-version: '8.11' + gradle-version: '8.12' - name: Build with Gradle run: gradle -Pversion=${{ github.run_number }} build diff --git a/.gitignore b/.gitignore index 453250b..903fe1f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # User-specific stuff .idea/ +!.idea/fileTemplates/ *.iml *.ipr diff --git a/.idea/fileTemplates/internal/AnnotationType.java b/.idea/fileTemplates/internal/AnnotationType.java new file mode 100644 index 0000000..5813a3c --- /dev/null +++ b/.idea/fileTemplates/internal/AnnotationType.java @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end +#parse("File Header.java") +public @interface ${NAME} { +} diff --git a/.idea/fileTemplates/internal/Class.java b/.idea/fileTemplates/internal/Class.java new file mode 100644 index 0000000..660e0c2 --- /dev/null +++ b/.idea/fileTemplates/internal/Class.java @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end +#parse("File Header.java") +public class ${NAME} { +} diff --git a/.idea/fileTemplates/internal/Enum.java b/.idea/fileTemplates/internal/Enum.java new file mode 100644 index 0000000..5cc83c3 --- /dev/null +++ b/.idea/fileTemplates/internal/Enum.java @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end +#parse("File Header.java") +public enum ${NAME} { +} diff --git a/.idea/fileTemplates/internal/Interface.java b/.idea/fileTemplates/internal/Interface.java new file mode 100644 index 0000000..6514663 --- /dev/null +++ b/.idea/fileTemplates/internal/Interface.java @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end +#parse("File Header.java") +public interface ${NAME} { +} diff --git a/.idea/fileTemplates/internal/Record.java b/.idea/fileTemplates/internal/Record.java new file mode 100644 index 0000000..5e804b1 --- /dev/null +++ b/.idea/fileTemplates/internal/Record.java @@ -0,0 +1,19 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end +#parse("File Header.java") +public record ${NAME}() { +} diff --git a/.idea/fileTemplates/internal/module-info.java b/.idea/fileTemplates/internal/module-info.java new file mode 100644 index 0000000..b23be05 --- /dev/null +++ b/.idea/fileTemplates/internal/module-info.java @@ -0,0 +1,18 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#parse("File Header.java") +module #[[$MODULE_NAME$]]# { +} \ No newline at end of file diff --git a/.idea/fileTemplates/internal/package-info.java b/.idea/fileTemplates/internal/package-info.java new file mode 100644 index 0000000..b428fc3 --- /dev/null +++ b/.idea/fileTemplates/internal/package-info.java @@ -0,0 +1,17 @@ +/* + * Copyright 2025 The Blazing Games Maintainers + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#parse("File Header.java") +#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end \ No newline at end of file diff --git a/build.gradle b/build.gradle index 13a6b52..b5ffd50 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java' - id("io.papermc.paperweight.userdev") version "1.7.1" + id("io.papermc.paperweight.userdev") version "2.0.0-beta.14" } group = 'de.blazemcworld' @@ -21,8 +21,8 @@ repositories { dependencies { // IMPORTANT IF YOU"RE ADDING OR UPDATING DEPENDENCIES!!!!!!!!! // add them in plugin.yml too so that they are loaded when running on a server - paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT") - compileOnly "io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT" + paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT") + compileOnly "io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT" // ULID implementation 'io.azam.ulidj:ulidj:1.0.4' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23..cea7a79 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/de/blazemcworld/blazinggames/events/BlockPlaceEventListener.java b/src/main/java/de/blazemcworld/blazinggames/events/BlockPlaceEventListener.java index ecd6c1b..190bdf0 100644 --- a/src/main/java/de/blazemcworld/blazinggames/events/BlockPlaceEventListener.java +++ b/src/main/java/de/blazemcworld/blazinggames/events/BlockPlaceEventListener.java @@ -48,15 +48,14 @@ import org.bukkit.util.Vector; import org.joml.Quaternionf; import org.joml.Vector3f; -import java.io.IOException; import java.util.Objects; import java.util.UUID; public class BlockPlaceEventListener implements Listener { @EventHandler - public void onBlockPlace(BlockPlaceEvent event) throws IOException { - if (event.getItemInHand() != null && (CustomItems.SKELETON_KEY.matchItem(event.getItemInHand()) || CrateManager.getKeyULID(event.getItemInHand()) != null)) { + public void onBlockPlace(BlockPlaceEvent event) { + if (CustomItems.SKELETON_KEY.matchItem(event.getItemInHand()) || CrateManager.getKeyULID(event.getItemInHand()) != null) { event.setCancelled(true); return; } @@ -175,7 +174,7 @@ public class BlockPlaceEventListener implements Listener { } else { event.getPlayer().getInventory().setItem(event.getHand(), new ItemStack(Material.AIR)); } - if ("".equals(computerId)) { + if (computerId.isEmpty()) { ComputerRegistry.placeNewComputer( placeLocation, computerTypes, @@ -241,7 +240,7 @@ public class BlockPlaceEventListener implements Listener { shulker.setSilent(true); shulker.getPersistentDataContainer().set(BlazingGames.get().key("slab_type"), PersistentDataType.STRING, slab); shulker.getPersistentDataContainer().set(BlazingGames.get().key("slab"), PersistentDataType.STRING, uuid.toString()); - Objects.requireNonNull(shulker.getAttribute(Attribute.GENERIC_SCALE)).setBaseValue(0.5); + Objects.requireNonNull(shulker.getAttribute(Attribute.SCALE)).setBaseValue(0.5); ArmorStand armorStand = (ArmorStand) loc.getWorld().spawnEntity(loc, EntityType.ARMOR_STAND); armorStand.setInvisible(true); @@ -250,7 +249,7 @@ public class BlockPlaceEventListener implements Listener { armorStand.setMarker(true); armorStand.setGravity(false); armorStand.setSmall(true); - Objects.requireNonNull(armorStand.getAttribute(Attribute.GENERIC_SCALE)).setBaseValue(0.00001); + Objects.requireNonNull(armorStand.getAttribute(Attribute.SCALE)).setBaseValue(0.00001); armorStand.addPassenger(shulker); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 84beb62..e27ecec 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: blazinggames version: '${version}' main: de.blazemcworld.blazinggames.BlazingGames -api-version: '1.21' +api-version: '1.21.4' prefix: BlazingGames authors: [BlazeMCworld, sbot50, 'Ivy Collective (ivyc.)', XTerPL] description: funny block game javascript computers