generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6358ee
commit e76feff
Showing
32 changed files
with
536 additions
and
310 deletions.
There are no files selected for viewing
12 changes: 6 additions & 6 deletions
12
src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/generated/resources/assets/nautec/models/item/bio_reactor_part.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"parent": "nautec:block/bio_reactor_part" | ||
} |
6 changes: 3 additions & 3 deletions
6
src/generated/resources/data/nautec/nautec/bacteria/cyanobacteria.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"type": "nautec:simple", | ||
"resource": "minecraft:iron_ingot", | ||
"stats": { | ||
"colony_size": 0.0, | ||
"type": "nautec:simple", | ||
"color": -13434881, | ||
"growth_rate": 0.0, | ||
"lifespan": 0, | ||
"mutation_resistance": 0.0, | ||
"production_rate": 0.0, | ||
"resource": "minecraft:iron_ingot" | ||
"production_rate": 0.0 | ||
} | ||
} |
11 changes: 1 addition & 10 deletions
11
src/generated/resources/data/nautec/nautec/bacteria/empty.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
{ | ||
"type": "nautec:simple", | ||
"stats": { | ||
"colony_size": 0.0, | ||
"color": 0, | ||
"growth_rate": 0.0, | ||
"lifespan": 0, | ||
"mutation_resistance": 0.0, | ||
"production_rate": 0.0, | ||
"resource": "minecraft:air" | ||
} | ||
"type": "nautec:empty" | ||
} |
6 changes: 3 additions & 3 deletions
6
src/generated/resources/data/nautec/nautec/bacteria/halobacteria.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"type": "nautec:simple", | ||
"resource": "minecraft:gold_ingot", | ||
"stats": { | ||
"colony_size": 0.0, | ||
"type": "nautec:simple", | ||
"color": -6912, | ||
"growth_rate": 0.0, | ||
"lifespan": 0, | ||
"mutation_resistance": 0.0, | ||
"production_rate": 0.0, | ||
"resource": "minecraft:gold_ingot" | ||
"production_rate": 0.0 | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
src/generated/resources/data/nautec/nautec/bacteria/methanogens.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"type": "nautec:simple", | ||
"resource": "minecraft:cooked_beef", | ||
"stats": { | ||
"colony_size": 0.0, | ||
"type": "nautec:simple", | ||
"color": -1328403, | ||
"growth_rate": 0.0, | ||
"lifespan": 0, | ||
"mutation_resistance": 0.0, | ||
"production_rate": 0.0, | ||
"resource": "minecraft:cooked_beef" | ||
"production_rate": 0.0 | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
src/generated/resources/data/nautec/nautec/bacteria/thermophiles.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"type": "nautec:simple", | ||
"resource": "minecraft:lava_bucket", | ||
"stats": { | ||
"colony_size": 0.0, | ||
"type": "nautec:simple", | ||
"color": -65536, | ||
"growth_rate": 0.0, | ||
"lifespan": 0, | ||
"mutation_resistance": 0.0, | ||
"production_rate": 0.0, | ||
"resource": "minecraft:lava_bucket" | ||
"production_rate": 0.0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/main/java/com/portingdeadmods/nautec/api/bacteria/BacteriaInstance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.portingdeadmods.nautec.api.bacteria; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import com.portingdeadmods.nautec.content.bacteria.SimpleBacteriaStats; | ||
import com.portingdeadmods.nautec.registries.NTBacterias; | ||
import com.portingdeadmods.nautec.utils.BacteriaHelper; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import net.minecraft.network.codec.ByteBufCodecs; | ||
import net.minecraft.network.codec.StreamCodec; | ||
import net.minecraft.resources.ResourceKey; | ||
|
||
public final class BacteriaInstance { | ||
public static final BacteriaInstance EMPTY = new BacteriaInstance(NTBacterias.EMPTY, SimpleBacteriaStats.EMPTY); | ||
public static final Codec<BacteriaInstance> CODEC = RecordCodecBuilder.create(instance -> instance.group( | ||
Bacteria.BACTERIA_TYPE_CODEC.fieldOf("bacteria").forGetter(BacteriaInstance::getBacteria), | ||
Codec.LONG.fieldOf("amount").forGetter(BacteriaInstance::getAmount), | ||
BacteriaStats.CODEC.fieldOf("stats").forGetter(BacteriaInstance::getStats) | ||
).apply(instance, BacteriaInstance::new)); | ||
public static final StreamCodec<RegistryFriendlyByteBuf, BacteriaInstance> STREAM_CODEC = StreamCodec.composite( | ||
Bacteria.BACTERIA_TYPE_STREAM_CODEC, | ||
BacteriaInstance::getBacteria, | ||
ByteBufCodecs.VAR_LONG, | ||
BacteriaInstance::getAmount, | ||
BacteriaStats.STREAM_CODEC, | ||
BacteriaInstance::getStats, | ||
BacteriaInstance::new | ||
); | ||
|
||
private final ResourceKey<Bacteria> bacteria; | ||
private long amount; | ||
private BacteriaStats stats; | ||
|
||
public BacteriaInstance(ResourceKey<Bacteria> bacteria, HolderLookup.Provider lookup) { | ||
this(bacteria, 1, BacteriaHelper.getBacteria(lookup, bacteria).initialStats()); | ||
} | ||
|
||
public BacteriaInstance(ResourceKey<Bacteria> bacteria, BacteriaStats stats) { | ||
this(bacteria, 1, stats); | ||
} | ||
|
||
public BacteriaInstance(ResourceKey<Bacteria> bacteria, long amount, BacteriaStats stats) { | ||
this.bacteria = bacteria; | ||
this.amount = amount; | ||
this.stats = stats; | ||
} | ||
|
||
public void setAmount(long amount) { | ||
this.amount = amount; | ||
} | ||
|
||
public long getAmount() { | ||
return this.amount; | ||
} | ||
|
||
public ResourceKey<Bacteria> getBacteria() { | ||
return bacteria; | ||
} | ||
|
||
public void setStats(BacteriaStats stats) { | ||
this.stats = stats; | ||
} | ||
|
||
public BacteriaStats getStats() { | ||
return this.stats; | ||
} | ||
|
||
public BacteriaInstance copy() { | ||
return new BacteriaInstance(this.bacteria, amount, this.stats.copy()); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/main/java/com/portingdeadmods/nautec/api/bacteria/BacteriaStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.portingdeadmods.nautec.api.bacteria; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.portingdeadmods.nautec.NTRegistries; | ||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.codec.ByteBufCodecs; | ||
import net.minecraft.network.codec.StreamCodec; | ||
|
||
import java.util.List; | ||
|
||
public interface BacteriaStats { | ||
Codec<BacteriaStats> CODEC = | ||
NTRegistries.BACTERIA_STATS_SERIALIZER.byNameCodec().dispatch(BacteriaStats::getSerializer, BacteriaStatsSerializer::mapCodec); | ||
StreamCodec<RegistryFriendlyByteBuf, BacteriaStats> STREAM_CODEC = | ||
ByteBufCodecs.registry(NTRegistries.BACTERIA_STATS_SERIALIZER_KEY).dispatch(BacteriaStats::getSerializer, BacteriaStatsSerializer::streamCodec); | ||
|
||
|
||
float growthRate(); | ||
|
||
float mutationResistance(); | ||
|
||
float productionRate(); | ||
|
||
int lifespan(); | ||
|
||
int color(); | ||
|
||
BacteriaStats copy(); | ||
|
||
List<Component> statsTooltip(); | ||
|
||
BacteriaStatsSerializer<?> getSerializer(); | ||
|
||
// Mutator | ||
BacteriaStats rollGrowthRate(); | ||
BacteriaStats rollMutationResistance(); | ||
BacteriaStats rollProductionRate(); | ||
BacteriaStats rollLifespan(); | ||
BacteriaStats rollStats(); | ||
|
||
// Incubator | ||
BacteriaStats grow(); | ||
BacteriaStats shrink(); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/portingdeadmods/nautec/api/bacteria/BacteriaStatsSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.portingdeadmods.nautec.api.bacteria; | ||
|
||
import com.mojang.serialization.MapCodec; | ||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import net.minecraft.network.codec.StreamCodec; | ||
|
||
public interface BacteriaStatsSerializer<T extends BacteriaStats> { | ||
MapCodec<T> mapCodec(); | ||
|
||
StreamCodec<RegistryFriendlyByteBuf, T> streamCodec(); | ||
} |
Oops, something went wrong.