Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "maven.modrinth:valkyrien-skies:1.20.1-fabric-2.3.0-beta.5"
modImplementation "maven.modrinth:eureka:1.20.1-fabric-1.5.1-beta.3"
modImplementation "maven.modrinth:valkyrien-sails:1.20.1-0.1.6-fabric"

modImplementation "maven.modrinth:vlib:1.20.1-0.0.11-alpha+fabric"
modImplementation "maven.modrinth:valkyrien-skies:1.20.1-fabric-2.4.11"
modImplementation "maven.modrinth:eureka:1.20.1-fabric-1.6.3"
modImplementation "maven.modrinth:vlib:1.20.1-0.1.1"
modImplementation "maven.modrinth:valkyrien-sails:1.20.1-0.1.7-fabric"
modCompileOnly "maven.modrinth:musket-mod:1.5.4"

modImplementation "maven.modrinth:architectury-api:9.2.14+fabric"

Expand Down
23 changes: 23 additions & 0 deletions gradle-compile-final.err.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
D:\Games\SKLaunchersVersions\ValkyrienPirateCodeWorskspace\pirates\src\main\java\ace\actually\pirates\blocks\entity\MotionInvokingBlockEntity.java:24: error: cannot find symbol
import org.valkyrienskies.mod.common.util.GameTickForceApplier;
^
symbol: class GameTickForceApplier
location: package org.valkyrienskies.mod.common.util
D:\Games\SKLaunchersVersions\ValkyrienPirateCodeWorskspace\pirates\src\main\java\ace\actually\pirates\blocks\entity\StableBlockEntity.java:14: error: cannot find symbol
import org.valkyrienskies.mod.common.util.GameTickForceApplier;
^
symbol: class GameTickForceApplier
location: package org.valkyrienskies.mod.common.util
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

BUILD FAILED in 2m 16s
30 changes: 30 additions & 0 deletions gradle-compile-final.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.7/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build

> Configure project :
Fabric Loom: 1.6.12
Refresh dependencies is in use, loom will be significantly slower.
"Lock for cache='C:\Users\Admin\.gradle\caches\fabric-loom', project=':'" is currently held by pid '2264'.
Run with --info or --debug to show arguments, may reveal sensitive info
- pid: 2264
- command: C:\Users\Admin\.jdks\ms-21.0.12\bin\java.exe
- started at: 2026-08-01T08:08:25.670Z
- user: ADMIN-PC\Admin
- parent:
- title: 'pirates � build.gradle (pirates)'
- pid: 21876
- command: D:\IntelliJ IDEA 2026.2.0.1\bin\idea64.exe
- started at: 2026-08-01T08:05:14.989Z
- user: ADMIN-PC\Admin
Waiting for lock to be released...
:remapping 60 mods from modImplementation (java-api)
:remapping 60 mods from modImplementation (java-runtime)
:remapping 1 mods from modCompileOnly (java-api)

> Task :checkKotlinGradlePluginConfigurationErrors
> Task :compileKotlin NO-SOURCE

> Task :compileJava

> Task :compileJava FAILED
2 actionable tasks: 2 executed
44 changes: 44 additions & 0 deletions gradle-compile.err.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring root project 'pirates'.
> Could not resolve all files for configuration ':modImplementation'.
> Could not find maven.modrinth:vlib:1.20.1-0.1.1+fabric.
Searched in the following locations:
- https://api.modrinth.com/maven/maven/modrinth/vlib/1.20.1-0.1.1+fabric/vlib-1.20.1-0.1.1+fabric.pom
Required by:
project :

* Try:
> If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@2dad279 of type BuildFlowService.Parameters
> A problem occurred configuring root project 'pirates'.
> Could not resolve all files for configuration ':modImplementation'.
> Could not find maven.modrinth:vlib:1.20.1-0.1.1+fabric.
Searched in the following locations:
- https://api.modrinth.com/maven/maven/modrinth/vlib/1.20.1-0.1.1+fabric/vlib-1.20.1-0.1.1+fabric.pom
Required by:
project :

* Try:
> If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================

BUILD FAILED in 47s
8 changes: 8 additions & 0 deletions gradle-compile.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.7/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build

> Configure project :
Fabric Loom: 1.6.12
Refresh dependencies is in use, loom will be significantly slower.
Previous process has disowned the lock due to abrupt termination.
Found existing cache lock file (ACQUIRED_PREVIOUS_OWNER_DISOWNED), rebuilding loom cache. This may have been caused by a failed or canceled build.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fabric_kotlin_version=1.10.19+kotlin.1.9.23
# Mod Properties
mod_version=1.8.6
maven_group=ace.actually.pirates
archives_base_name=ValkyrienPirates
archives_base_name=DinBrosValkyrienPirates

# Dependencies
fabric_version=0.92.1+1.20.1
33 changes: 32 additions & 1 deletion src/main/java/ace/actually/pirates/ClientPirates.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,37 @@ public void onInitializeClient() {

//EntityModelLayerRegistry.registerModelLayer(SKELETON_PIRATE, SkeletonPirateModel::getTexturedModelData);

}

net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking.registerGlobalReceiver(
Pirates.CANNON_SMOKE_PACKET_ID,
(client, handler, buf, sender) -> {
double x = buf.readDouble();
double y = buf.readDouble();
double z = buf.readDouble();
int dirId = buf.readInt();

client.execute(() -> {
var world = client.world;
if (world == null) return;

var direction = net.minecraft.util.math.Direction.byId(dirId);
for (int i = 0; i < 40; ++i) {
world.addParticle(net.minecraft.particle.ParticleTypes.FLAME,
x + direction.getOffsetX() * (0.5 + world.random.nextDouble() * 1.5),
y + direction.getOffsetY() + (world.random.nextDouble() * 1.0) - 0.5,
z + direction.getOffsetZ() * (0.5 + world.random.nextDouble() * 1.5),
(world.random.nextDouble() * 0.3) - 0.15,
(world.random.nextDouble() * 0.1) - 0.05,
(world.random.nextDouble() * 0.3) - 0.15);

world.addParticle(net.minecraft.particle.ParticleTypes.CLOUD,
x + direction.getOffsetX() * (3.5 + world.random.nextDouble() * 2) + (4 * world.random.nextDouble()) - 2,
y + (world.random.nextDouble() * 3.0) - 1.0,
z + direction.getOffsetZ() * (3.5 + world.random.nextDouble() * 2) + (4 * world.random.nextDouble()) - 2,
0.0, 0.0, 0.0);
}
});
}
);
}
}
21 changes: 19 additions & 2 deletions src/main/java/ace/actually/pirates/Pirates.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Pirates implements ModInitializer {
// That way, it's clear which mod wrote info, warnings, and errors.
public static final String MOD_ID = "pirates";
public static final Logger LOGGER = LoggerFactory.getLogger("pirates");

public static final Identifier CANNON_SMOKE_PACKET_ID = new Identifier(MOD_ID, "cannon_smoke");
public static final GameRules.Key<GameRules.BooleanRule> PIRATES_IS_LIVE_WORLD =
GameRuleRegistry.register("piratesIsLive", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));

Expand Down Expand Up @@ -133,7 +133,7 @@ public void onInitialize() {

ConfigUtils.checkConfigs();
baseShotPower = Float.parseFloat(ConfigUtils.config.getOrDefault("base-shot-power","2.2"));
cannonRange = Float.parseFloat(ConfigUtils.config.getOrDefault("cannon-range","1.7"));
cannonRange = Float.parseFloat(ConfigUtils.config.getOrDefault("cannon-range","3.2"));
pursuitDistance = Integer.parseInt(ConfigUtils.config.getOrDefault("pursuit-distance","10000"));
shouldEnableFlyingPirates = ConfigUtils.config.getOrDefault("should-enable-flying-pirates","false").equals("true");

Expand Down Expand Up @@ -193,6 +193,18 @@ private void registerEntityThings()
public static final StableBlock STABLE_BLOCK = new StableBlock(AbstractBlock.Settings.create());
public static final ShipIdBlock SHIP_ID_BLOCK = new ShipIdBlock(AbstractBlock.Settings.create());
public static final Block HEAVY_BLOCK = new Block(AbstractBlock.Settings.copy(Blocks.OBSIDIAN));
public static final DamagedHullBlock DAMAGED_HULL_BLOCK = new DamagedHullBlock(
AbstractBlock.Settings.copy(Blocks.NETHERITE_BLOCK)
.strength(0.5f, 1200.0f)
.noBlockBreakParticles()
.noCollision()
.dropsNothing()
);
public static final BlockEntityType<DamagedHullBlockEntity> DAMAGED_HULL_BLOCK_ENTITY = Registry.register(
Registries.BLOCK_ENTITY_TYPE,
new Identifier("pirates", "damaged_hull_block_entity"),
FabricBlockEntityTypeBuilder.create(DamagedHullBlockEntity::new, DAMAGED_HULL_BLOCK).build()
);
private void registerBlocks()
{
Registry.register(Registries.BLOCK,new Identifier("pirates","cannon_priming_block"),CANNON_PRIMING_BLOCK);
Expand All @@ -203,6 +215,8 @@ private void registerBlocks()
Registry.register(Registries.BLOCK,new Identifier("pirates","ship_id_block"),SHIP_ID_BLOCK);
Registry.register(Registries.BLOCK,new Identifier("pirates","heavy_block"),HEAVY_BLOCK);

// my custom blocks
Registry.register(Registries.BLOCK, new Identifier("pirates", "damaged_hull_block"), DAMAGED_HULL_BLOCK);
}


Expand Down Expand Up @@ -236,6 +250,9 @@ private void registerItems()
Registry.register(Registries.ITEM,new Identifier("pirates","crew_spawner_block"),new BlockItem(CREW_SPAWNER_BLOCK,new Item.Settings()));
Registry.register(Registries.ITEM,new Identifier("pirates","ship_id_block"),new BlockItem(SHIP_ID_BLOCK,new Item.Settings()));

// my custom blocks
Registry.register(Registries.ITEM, new Identifier("pirates", "damaged_hull_block"),
new BlockItem(DAMAGED_HULL_BLOCK, new Item.Settings()));
}


Expand Down
34 changes: 34 additions & 0 deletions src/main/java/ace/actually/pirates/blocks/DamagedHullBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package ace.actually.pirates.blocks;
import ace.actually.pirates.Pirates;
import ace.actually.pirates.blocks.entity.DamagedHullBlockEntity;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class DamagedHullBlock extends BlockWithEntity {

public DamagedHullBlock(Settings settings) {
super(settings);
}

@Override
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return new DamagedHullBlockEntity(pos, state);
}

@Override
public BlockRenderType getRenderType(BlockState state) {
return BlockRenderType.INVISIBLE;
}

@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, BlockState state, BlockEntityType<T> type) {
return checkType(type, Pirates.DAMAGED_HULL_BLOCK_ENTITY, DamagedHullBlockEntity::tick);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
import net.minecraft.state.property.Properties;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Position;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
Expand Down Expand Up @@ -86,5 +83,4 @@ public void neighborUpdate(BlockState state, World world, BlockPos pos, Block so
public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
return new ItemStack(Items.DISPENSER);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ private static boolean checkShouldFire(ServerWorld world, BlockPos pos, BlockSta
return false;
}

// original is (2;32)
RaycastContext context = new RaycastContext(
VSGameUtilsKt.toWorldCoordinates(world, Vec3d.ofCenter(pos.add(raycastStart.multiply(2)))),
VSGameUtilsKt.toWorldCoordinates(world, Vec3d.ofCenter(pos.add(raycastStart.multiply(32)))),
VSGameUtilsKt.toWorldCoordinates(world, Vec3d.ofCenter(pos.add(raycastStart.multiply(30)))),
VSGameUtilsKt.toWorldCoordinates(world, Vec3d.ofCenter(pos.add(raycastStart.multiply(80)))),
RaycastContext.ShapeType.COLLIDER,
RaycastContext.FluidHandling.NONE,
null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package ace.actually.pirates.blocks.entity;

import ace.actually.pirates.Pirates;
import ace.actually.pirates.blocks.CannonPrimingBlock;
import ace.actually.pirates.entities.pirate_abstract.AbstractPirateEntity;
import ace.actually.pirates.entities.pirate_default.PirateEntity;
import ace.actually.pirates.events.IPirateSpawns;
import ace.actually.pirates.entities.CrewTypes;
import ace.actually.pirates.util.ConfigUtils;
import ace.actually.pirates.compat.MusketModCompat;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.enchantment.Enchantments;
Expand All @@ -15,7 +17,9 @@
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
//import net.minecraft.item.Items;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.network.EntityTrackerEntry;
import net.minecraft.registry.Registries;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.property.Properties;
Expand All @@ -27,6 +31,10 @@
import org.jetbrains.annotations.Nullable;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import net.minecraft.world.EntityList;

import java.util.Optional;


public class CrewSpawnerBlockEntity extends BlockEntity {

Expand Down Expand Up @@ -108,19 +116,21 @@ private static BlockPos checkForBlocksToCrew (World world, BlockPos origin) {

private static Entity getEntityFromState(World world, BlockEntity be) {
Entity crew = null;

switch (be.getCachedState().get(CrewTypes.CREW_SPAWN_TYPE))
{
case PIRATE ->
{
crew = new PirateEntity(world, checkForBlocksToCrew(world, be.getPos()));
crew.equipStack(EquipmentSlot.MAINHAND, new ItemStack(Items.BOW));
MusketModCompat.equipRandomGunOrBow((AbstractPirateEntity) crew, world.random);
}
case VILLAGER -> crew = new VillagerEntity(EntityType.VILLAGER, world, VillagerType.forBiome(world.getBiome(be.getPos())));
case SKELETON_PIRATE ->
{
BlockPos blockToCrew = checkForBlocksToCrew(world, be.getPos());
crew = new PirateEntity(world, blockToCrew);
ItemStack itemStack = new ItemStack(Items.BOW);
Item randomGun = MusketModCompat.randomGun(world.random);
ItemStack itemStack = new ItemStack(randomGun == null ? net.minecraft.item.Items.BOW : randomGun);
if (world.getBlockState(blockToCrew).isOf(Pirates.MOTION_INVOKING_BLOCK)) {
itemStack.addEnchantment(Enchantments.POWER, 2);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package ace.actually.pirates.blocks.entity;

import ace.actually.pirates.Pirates;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.valkyrienskies.core.api.ships.Ship;
import org.valkyrienskies.mod.common.VSGameUtilsKt;

public class DamagedHullBlockEntity extends BlockEntity {

private double currentMass = 1000.0; // Starts light → increases over time

public DamagedHullBlockEntity(BlockPos pos, BlockState state) {
super(Pirates.DAMAGED_HULL_BLOCK_ENTITY, pos, state);
}

public static void tick(World world, BlockPos pos, BlockState state, DamagedHullBlockEntity blockEntity) {
if (world.isClient) return;

// Simulate water flooding
blockEntity.currentMass += 100.0; // Increase mass per tick (tune this!)
if (blockEntity.currentMass > 10000.0) {
blockEntity.currentMass = 10000.0; // Cap at max mass (e.g. Netherite mass)
}
}

public double getCurrentMass() {
return currentMass;
}
}
Loading