Skip to content
Merged
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
23 changes: 23 additions & 0 deletions src/main/java/ace/actually/pirates/Pirates.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.BlockEntityType;
Expand All @@ -34,6 +38,8 @@
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.resource.ResourceType;
import net.minecraft.server.MinecraftServer;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.Text;
Expand All @@ -43,6 +49,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Supplier;

Expand Down Expand Up @@ -70,6 +77,22 @@ public class Pirates implements ModInitializer {
@Override
public void onInitialize() {

Optional<ModContainer> container = FabricLoader.getInstance().getModContainer(Pirates.MOD_ID);

if (container.isPresent()) {
if(ResourceManagerHelper.registerBuiltinResourcePack(
new Identifier("flying_ships"),
container.get(),
ResourcePackActivationType.NORMAL
)) {
LOGGER.info("Registered flying ships data pack");
} else {
LOGGER.warn("didn't work");
}
} else {
LOGGER.warn("Failed to register flying ships data pack");
}

ConfigUtils.checkConfigs();
baseShotPower = Float.parseFloat(ConfigUtils.config.getOrDefault("base-shot-power","2.2"));
pursuitDistance = Integer.parseInt(ConfigUtils.config.getOrDefault("pursuit-distance","10000"));
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:jigsaw",
"biomes": "#minecraft:is_overworld",
"spawn_overrides": {},
"terrain_adaptation": "none",
"start_pool": "pirates_sky:ship",
"size": 1,
"step": "surface_structures",
"start_height": {
"absolute": 50
},
"project_start_to_heightmap": "WORLD_SURFACE_WG",
"max_distance_from_center": 128,
"use_expansion_hack": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"structures": [
{
"structure": "pirates_sky:ship",
"weight": 1
}
],
"placement": {
"type": "random_spread",
"spacing": 26,
"separation": 8,
"salt": 367452547
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "pirates_sky:ships",
"fallback": "minecraft:empty",
"elements": [
{
"weight": 3,
"element": {
"element_type": "minecraft:single_pool_element",
"projection": "rigid",
"location": "pirates_sky:ship/wreckerideal",
"processors": "minecraft:empty"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"folder": "ship/",
"rename": "false",
"static": "true"
}
6 changes: 6 additions & 0 deletions src/main/resources/resourcepacks/flying_ships/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 15,
"description": "Adds flying ships."
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.