Skip to content

Commit

Permalink
improve bacteria format
Browse files Browse the repository at this point in the history
  • Loading branch information
Thepigcat76 committed Dec 16, 2024
1 parent 8c6efb5 commit a762635
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 269 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// 1.21.1 2024-12-15T19:56:36.86193986 Registries
11e8f3f3b45aef17b576f8e4300b9fae4cd6e280 data/nautec/nautec/bacteria/cyanobacteria.json
d4475a8b82f7770de97b81720473cecd8b4f2dbb data/nautec/nautec/bacteria/empty.json
bc60969c4b2a8b2f687868560505ee2c7ee85f06 data/nautec/nautec/bacteria/halobacteria.json
4322c5e7f092ccaf11c4339d235ec95a16127e0f data/nautec/nautec/bacteria/methanogens.json
e003902eea186523f2b67072664f3be16c394e45 data/nautec/nautec/bacteria/thermophiles.json
// 1.21.1 2024-12-16T23:03:28.632599872 Registries
81ae891c9f56e166f6748e3ee80edccaf52a3c73 data/nautec/nautec/bacteria/cyanobacteria.json
895816a71ba92ab2662725824d004e3c1a462196 data/nautec/nautec/bacteria/empty.json
ed5540fa74500b1db6f27d6c30eeac50ee4f8f9c data/nautec/nautec/bacteria/halobacteria.json
24a515c8c46fbb92431a9aad10ae4c8684ed142f data/nautec/nautec/bacteria/methanogens.json
5d152052e74ab6e5dc7a780c1e2af000469b6e6d data/nautec/nautec/bacteria/thermophiles.json
d3949aab832fc1b72c2512c35586c2682dea4d4d data/nautec/worldgen/configured_feature/prismarine_sand_beach.json
e9f0c0ce377bc6f731c3b36673e845152a53327d data/nautec/worldgen/configured_feature/prismarine_sand_ocean.json
685d14b2486e0da05c931e69fe78236dd9523cbf data/nautec/worldgen/placed_feature/prismarine_sand_beach.json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21.1 2024-12-16T16:09:32.183077884 Recipes
// 1.21.1 2024-12-16T22:58:24.975013206 Recipes
ebae64ded4bb31c5b0cf21d6f4a5df5c4bce9ab0 data/nautec/advancement/recipes/building_blocks/brown_polymer_block.json
056382c183d52a8f0d17b4992017b217f7444060 data/nautec/advancement/recipes/building_blocks/brown_polymer_from_block.json
e1102abc52970c4638811a9f3aed423c343b2976 data/nautec/advancement/recipes/building_blocks/chiseled_dark_prismarine.json
Expand Down Expand Up @@ -67,7 +67,7 @@ ba5f2ec03f05fc1f52d3c03f544988e459826d69 data/nautec/recipe/augmentation_station
1ed2e8bdcfab093c605a5a5f7c9fcd6c709be258 data/nautec/recipe/banner_from_brown_polymer.json
a9c53478ce9eefdcdd917217c32a19cc7fe8344c data/nautec/recipe/bed_from_brown_polymer.json
8ed31c62db2e3f744332a5027d264e3758d46c82 data/nautec/recipe/book_from_brown_polymer.json
b2cb1d73b9e1e2104af451250ff4464197c45531 data/nautec/recipe/brown_polymer.json
1414dd3fe07a9bcdb87c1dcda433476089f02a10 data/nautec/recipe/brown_polymer.json
6818283cb29f588a3b5c60460db0ac59ff0c287e data/nautec/recipe/brown_polymer_block.json
8234eaba36308abfceeda4158ae8975eb16e3c0b data/nautec/recipe/brown_polymer_from_block.json
5d8fdeabdc238a5b557a2a159a9ccb30e723703b data/nautec/recipe/cast_iron_ingot.json
Expand Down
219 changes: 0 additions & 219 deletions src/generated/resources/assets/nautec/models/block/laser_engraver.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"type": "nautec:simple",
"id": "nautec:cyanobacteria",
"stats": {
"type": "minecraft:iron_ingot",
"color": -13434881,
"growth_rate": 0.0,
"lifespan": 0,
"mutation_resistance": 0.0,
"production_rate": 0.0
"production_rate": 0.0,
"resource": "minecraft:iron_ingot"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"type": "nautec:simple",
"id": "nautec:empty",
"stats": {
"type": "minecraft:air",
"color": 0,
"growth_rate": 0.0,
"lifespan": 0,
"mutation_resistance": 0.0,
"production_rate": 0.0
"production_rate": 0.0,
"resource": "minecraft:air"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"type": "nautec:simple",
"id": "nautec:halobacteria",
"stats": {
"type": "minecraft:gold_ingot",
"color": -6912,
"growth_rate": 0.0,
"lifespan": 0,
"mutation_resistance": 0.0,
"production_rate": 0.0
"production_rate": 0.0,
"resource": "minecraft:gold_ingot"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"type": "nautec:simple",
"id": "nautec:methanogens",
"stats": {
"type": "minecraft:cooked_beef",
"color": -1328403,
"growth_rate": 0.0,
"lifespan": 0,
"mutation_resistance": 0.0,
"production_rate": 0.0
"production_rate": 0.0,
"resource": "minecraft:cooked_beef"
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"type": "nautec:simple",
"id": "nautec:thermophiles",
"stats": {
"type": "minecraft:lava_bucket",
"color": -65536,
"growth_rate": 0.0,
"lifespan": 0,
"mutation_resistance": 0.0,
"production_rate": 0.0
"production_rate": 0.0,
"resource": "minecraft:lava_bucket"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"result": {
"count": 1,
"count": 2,
"id": "nautec:brown_polymer"
}
}
27 changes: 15 additions & 12 deletions src/main/java/com/portingdeadmods/nautec/api/bacteria/Bacteria.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,31 @@
import com.portingdeadmods.nautec.NTRegistries;
import com.portingdeadmods.nautec.content.bacteria.BacteriaStats;
import com.portingdeadmods.nautec.content.bacteria.SimpleBacteria;
import io.netty.buffer.ByteBuf;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.ByteBufCodecs;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;

/**
Bacteria! We begin with only one!
Bacteria! Two's what we then become!
Bacteria! Each of us becomes two more!
Bacteria! We are stronger than before!
Bacteria! We keep growing at this rate!
Bacteria! No longer shall we wait!
Bacteria! The plan now unfolds!
Bacteria! We will take over the world!
*/
public interface Bacteria {
Codec<ResourceKey<Bacteria>> BACTERIA_TYPE_CODEC = ResourceKey.codec(NTRegistries.BACTERIA_KEY);
StreamCodec<ByteBuf, ResourceKey<Bacteria>> BACTERIA_TYPE_STREAM_CODEC = ResourceKey.streamCodec(NTRegistries.BACTERIA_KEY);

Codec<Bacteria> CODEC = NTRegistries.BACTERIA_SERIALIZER.byNameCodec().dispatch(Bacteria::getSerializer, BacteriaSerializer::mapCodec);
StreamCodec<RegistryFriendlyByteBuf, Bacteria> STREAM_CODEC = ByteBufCodecs.registry(NTRegistries.BACTERIA_SERIALIZER_KEY).dispatch(Bacteria::getSerializer, BacteriaSerializer::streamCodec);

/*
Bacteria! We begin with only one!
Bacteria! Two's what we then become!
Bacteria! Each of us becomes two more!
Bacteria! We are stronger than before!
Bacteria! We keep growing at this rate!
Bacteria! No longer shall we wait!
Bacteria! The plan now unfolds!
Bacteria! We will take over the world!
*/
ResourceLocation id();

BaseBacteriaStats stats();

BacteriaSerializer<?> getSerializer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public record BacteriaStats(Item resource,
int color) implements BaseBacteriaStats {
public static final Codec<BacteriaStats> CODEC = RecordCodecBuilder.create(
instance -> instance.group(
CodecUtils.ITEM_CODEC.fieldOf("type").forGetter(BacteriaStats::resource),
CodecUtils.ITEM_CODEC.fieldOf("resource").forGetter(BacteriaStats::resource),
Codec.FLOAT.fieldOf("growth_rate").forGetter(BacteriaStats::growthRate),
Codec.FLOAT.fieldOf("mutation_resistance").forGetter(BacteriaStats::mutationResistance),
Codec.FLOAT.fieldOf("production_rate").forGetter(BacteriaStats::productionRate),
Expand Down
Loading

0 comments on commit a762635

Please sign in to comment.