Fluids... how do they even work...

This commit is contained in:
Flanks255 2022-01-05 11:31:40 -06:00
parent 14c42e6d57
commit ebb9200957
34 changed files with 166 additions and 17 deletions

View file

@ -269,6 +269,7 @@ bbf723238f6536295339f0b0b5b052cf89b92d5b assets/actuallyadditions/models/item/co
1e7e61701473dbf3dfc18bb5b9fa7be91b443dd8 assets/actuallyadditions/models/item/crusher.json
aeacd7ca465c19d6cbcef25e61023397c4472ab3 assets/actuallyadditions/models/item/crusher_double.json
3a9cfcb0a3bec43f6556b3bdab09731758a36cc2 assets/actuallyadditions/models/item/crystallized_canola_seed.json
326668d58f3ba7ba650f0ebb604c6994356972a8 assets/actuallyadditions/models/item/crystallized_oil_bucket.json
ec0cdeb022c4e0bc43c0fd5d3e3e758361f7ebe2 assets/actuallyadditions/models/item/diamatine_aiot.json
9e7e70f1efd1fdc83d78d0526657c229acf7293d assets/actuallyadditions/models/item/diamatine_axe.json
04cc1e040d286dbf4e8b828b52a76829ed51e14a assets/actuallyadditions/models/item/diamatine_boots.json
@ -335,6 +336,7 @@ d7948c3ad4bf22f0efa6e669de7a559c27b52aae assets/actuallyadditions/models/item/em
cfabdb67ce0ccaaea437cfbbac68f0e0c8e7d890 assets/actuallyadditions/models/item/empowered_emeradic_crystal_block.json
3a339996daf88347e2abf829eb9f7d0e1915ed32 assets/actuallyadditions/models/item/empowered_enori_crystal.json
42bfc556aa4e9f0861855b4eee58397b75bd85f8 assets/actuallyadditions/models/item/empowered_enori_crystal_block.json
31ecbb82c3d2fb06d1da4dcbd229a689e0b6f251 assets/actuallyadditions/models/item/empowered_oil_bucket.json
0670cc4d0a2ab1561ea68603a078cf50f5cf2431 assets/actuallyadditions/models/item/empowered_palis_crystal.json
d019c764e87de9f1856dc8d12b880d874e215fac assets/actuallyadditions/models/item/empowered_palis_crystal_block.json
7155b098b6f6bf5fe03f6546dd00217d8fa02721 assets/actuallyadditions/models/item/empowered_restonia_crystal.json
@ -471,6 +473,7 @@ af0512cfb813e6fb43bb920db3eb1f1c2976ace6 assets/actuallyadditions/models/item/qu
bb0fbcacce026c672b8d98db22694fd2b6eefb20 assets/actuallyadditions/models/item/quartz_sword.json
7f7a44a1afcbfbe63bc55be016a81dc265515b24 assets/actuallyadditions/models/item/quintuple_battery.json
d8cf56e92afa1ea98eead8af208cc6281c815ede assets/actuallyadditions/models/item/ranged_collector.json
fb9960a7f3f2488166e8e82ea664fdf08e3a9456 assets/actuallyadditions/models/item/refined_canola_oil_bucket.json
a607d6e415c04d4aa4128446c3dbb40b9aafc5d5 assets/actuallyadditions/models/item/resonant_rice.json
68d8873d46bfbe65112f29bc4b1159e586d6705f assets/actuallyadditions/models/item/restonia_aiot.json
5300d3a0ece8b26a0bc0631df9151bebaef8a1b9 assets/actuallyadditions/models/item/restonia_axe.json

View file

@ -0,0 +1,5 @@
{
"parent": "forge:item/bucket",
"loader": "forge:bucket",
"fluid": "actuallyadditions:canola_oil"
}

View file

@ -0,0 +1,5 @@
{
"parent": "forge:item/bucket",
"loader": "forge:bucket",
"fluid": "actuallyadditions:crystallized_oil"
}

View file

@ -0,0 +1,5 @@
{
"parent": "forge:item/bucket",
"loader": "forge:bucket",
"fluid": "actuallyadditions:empowered_oil"
}

View file

@ -0,0 +1,5 @@
{
"parent": "forge:item/bucket",
"loader": "forge:bucket",
"fluid": "actuallyadditions:refined_canola_oil"
}

View file

@ -0,0 +1,8 @@
{
"type": "actuallyadditions:solid_fuel",
"item": {
"item": "actuallyadditions:charcoal_block"
},
"total_energy": 480000,
"burn_time": 16000
}

View file

@ -0,0 +1,8 @@
{
"type": "actuallyadditions:solid_fuel",
"item": {
"item": "minecraft:coal_block"
},
"total_energy": 480000,
"burn_time": 16000
}

View file

@ -0,0 +1,8 @@
{
"type": "actuallyadditions:solid_fuel",
"item": {
"item": "minecraft:lava_bucket"
},
"total_energy": 600000,
"burn_time": 20000
}

View file

@ -0,0 +1,8 @@
{
"type": "actuallyadditions:solid_fuel",
"item": {
"item": "minecraft:stick"
},
"total_energy": 3000,
"burn_time": 100
}

View file

@ -0,0 +1,8 @@
{
"type": "actuallyadditions:solid_fuel",
"item": {
"tag": "actuallyadditions:tiny_coals"
},
"total_energy": 6000,
"burn_time": 200
}

View file

@ -2,11 +2,13 @@ package de.ellpeck.actuallyadditions.data;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.fluids.FluidAA;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import net.minecraft.block.Block;
import net.minecraft.block.WallBlock;
import net.minecraft.data.DataGenerator;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.ItemModelProvider;
@ -40,8 +42,15 @@ public class ItemModelGenerator extends ItemModelProvider {
// Blocks
ActuallyBlocks.BLOCKS.getEntries().stream().filter(b -> !b.get().getRegistryName().getPath().contains("oil")).forEach(this::registerBlockModel);
withExistingParent(InitFluids.CANOLA_OIL.getBucket().getRegistryName().getPath(), "forge:item/bucket")
.customLoader((builder, template) -> DynamicBucketModelBuilder.begin(builder, template).fluid(InitFluids.CANOLA_OIL.get()));
generateBucket(InitFluids.CANOLA_OIL);
generateBucket(InitFluids.REFINED_CANOLA_OIL);
generateBucket(InitFluids.CRYSTALIZED_OIL);
generateBucket(InitFluids.EMPOWERED_OIL);
}
private void generateBucket(FluidAA fluidSupplier) {
withExistingParent(fluidSupplier.getBucket().getRegistryName().getPath(), "forge:item/bucket")
.customLoader((builder, template) -> DynamicBucketModelBuilder.begin(builder, template).fluid(fluidSupplier.get()));
}
private void registerBlockModel(RegistryObject<Block> block) {

View file

@ -15,12 +15,15 @@ import de.ellpeck.actuallyadditions.mod.blocks.render.*;
import de.ellpeck.actuallyadditions.mod.entity.InitEntities;
import de.ellpeck.actuallyadditions.mod.entity.RenderWorm;
import de.ellpeck.actuallyadditions.mod.event.ClientEvents;
import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
import de.ellpeck.actuallyadditions.mod.inventory.ActuallyContainers;
import de.ellpeck.actuallyadditions.mod.inventory.gui.*;
import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScreenManager;
import net.minecraft.client.network.play.ClientPlayNetHandler;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeLookup;
import net.minecraft.network.play.client.CPlayerDiggingPacket;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
@ -64,6 +67,18 @@ public class ActuallyAdditionsClient {
setupSpecialRenders();
RenderWorm.fixItemStack();// todo: remove
setupRenderLayers();
}
private static void setupRenderLayers() {
RenderTypeLookup.setRenderLayer(InitFluids.CANOLA_OIL.get(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.CANOLA_OIL.getFlowing(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.REFINED_CANOLA_OIL.get(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.REFINED_CANOLA_OIL.getFlowing(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.CRYSTALIZED_OIL.get(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.CRYSTALIZED_OIL.getFlowing(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.EMPOWERED_OIL.get(), RenderType.translucent());
RenderTypeLookup.setRenderLayer(InitFluids.EMPOWERED_OIL.getFlowing(), RenderType.translucent());
}
private static void setupSpecialRenders() {

View file

@ -42,7 +42,7 @@ public class FluidAA implements Supplier<Fluid> {
public FluidAA(String fluidName, String textureName) {
name = fluidName;
ForgeFlowingFluid.Properties props = makeProperties(textureName, fluidBlock, source, flowing, bucket);
ForgeFlowingFluid.Properties props = makeProperties(textureName, () -> fluidBlock.get(), () -> source.get(), () -> flowing.get(), () -> bucket.get());
source = InitFluids.FLUIDS.register(name, () -> new ForgeFlowingFluid.Source(props));
flowing = InitFluids.FLUIDS.register(name + "_flowing", () -> new ForgeFlowingFluid.Flowing(props));
fluidBlock = ActuallyBlocks.BLOCKS.register(name, () -> new FlowingFluidBlock(source, AbstractBlock.Properties.of(Material.WATER)));
@ -50,7 +50,7 @@ public class FluidAA implements Supplier<Fluid> {
}
public static ForgeFlowingFluid.Properties makeProperties(String texture, Supplier<FlowingFluidBlock> blockSupplier, Supplier<ForgeFlowingFluid> stillSupplier, Supplier<ForgeFlowingFluid> flowingSupplier, Supplier<Item> bucketSupplier) {
return new ForgeFlowingFluid.Properties(stillSupplier, flowingSupplier, FluidAttributes.builder(new ResourceLocation(ActuallyAdditions.MODID,texture), new ResourceLocation(ActuallyAdditions.MODID, texture))).bucket(bucketSupplier).block(blockSupplier);
return new ForgeFlowingFluid.Properties(stillSupplier, flowingSupplier, FluidAttributes.builder(new ResourceLocation(ActuallyAdditions.MODID,texture + "_still"), new ResourceLocation(ActuallyAdditions.MODID, texture + "_flowing"))).bucket(bucketSupplier).block(blockSupplier);
}
@Override

View file

@ -21,10 +21,10 @@ public final class InitFluids {
public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, ActuallyAdditions.MODID);
public static final DeferredRegister<Block> FLUID_BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, ActuallyAdditions.MODID);
public static final FluidAA CANOLA_OIL = new FluidAA("canola_oil", "canola_oil");
public static final FluidAA REFINED_CANOLA_OIL = new FluidAA("refined_canola_oil", "refined_canola_oil");
public static final FluidAA CRYSTALIZED_OIL = new FluidAA("crystal_oil", "crystal_oil");
public static final FluidAA EMPOWERED_OIL = new FluidAA("empowered_oil", "empowered_oil");
public static final FluidAA CANOLA_OIL = new FluidAA("canola_oil", "fluid/canola_oil");
public static final FluidAA REFINED_CANOLA_OIL = new FluidAA("refined_canola_oil", "fluid/refined_canola_oil");
public static final FluidAA CRYSTALIZED_OIL = new FluidAA("crystallized_oil", "fluid/crystallized_oil");
public static final FluidAA EMPOWERED_OIL = new FluidAA("empowered_oil", "fluid/empowered_oil");
public static void init(IEventBus bus) {

View file

@ -239,7 +239,7 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements
@Nonnull
@Override
public ITextComponent getDisplayName() {
return new TranslationTextComponent("container.actuallyadditions.furnaceDouble");
return new TranslationTextComponent("container.actuallyadditions.powered_furnace");
}
@Nullable

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "actuallyadditions:block/crystallized_oil"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "actuallyadditions:block/empowered_oil"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "actuallyadditions:block/refined_canola_oil"
}
}
}

View file

@ -15,10 +15,10 @@
"misc.actuallyadditions.power_name_long": "Crystal Flux",
"misc.actuallyadditions.power_name_short": "CF",
"_comment": "Fluids",
"fluid.actuallyadditions.refinedcanolaoil": "Refined Canola Oil",
"fluid.actuallyadditions.canolaoil": "Canola Oil",
"fluid.actuallyadditions.crystaloil": "Crystallized Oil",
"fluid.actuallyadditions.empoweredoil": "Empowered Oil",
"fluid.actuallyadditions.refined_canola_oil": "Refined Canola Oil",
"fluid.actuallyadditions.canola_oil": "Canola Oil",
"fluid.actuallyadditions.crystallized_oil": "Crystallized Oil",
"fluid.actuallyadditions.empowered_oil": "Empowered Oil",
"_comment": "Entities",
"entity.Villager.actuallyadditions.jammer": "Jam Guy",
"entity.Villager.actuallyadditions.crystallizer": "Crystallizer",
@ -164,7 +164,7 @@
"block.actuallyadditions.fermenting_barrel": "Fermenting Barrel",
"block.actuallyadditions.canola_oil": "Canola Oil",
"block.actuallyadditions.refined_canola_oil": "Refined Canola Oil",
"block.actuallyadditions.crystal_oil": "Crystallized Oil",
"block.actuallyadditions.crystallized_oil": "Crystallized Oil",
"block.actuallyadditions.empowered_oil": "Empowered Oil",
"block.actuallyadditions.misc_enderpearl": "Block of Enderpearl",
"block.actuallyadditions.oil_generator": "Oil Generator",
@ -276,8 +276,10 @@
"item.actuallyadditions.growth_ring": "Ring of Growth",
"item.actuallyadditions.water_removal_ring": "Ring of Liquid Banning",
"item.actuallyadditions.suction_ring": "Ring of Magnetizing",
"item.actuallyadditions.bucket_canola_oil": "Canola Oil Bucket",
"item.actuallyadditions.bucket_oil": "Oil Bucket",
"item.actuallyadditions.canola_oil_bucket": "Canola Oil Bucket",
"item.actuallyadditions.refined_canola_oil_bucket": "Refined Canola Oil Bucket",
"item.actuallyadditions.crystallized_oil_bucket": "Crystallized Oil Bucket",
"item.actuallyadditions.empowered_oil_bucket": "Empowered Oil Bucket",
"item.actuallyadditions.wings_of_the_bats": "Wings Of The Bats",
"item.actuallyadditions.misc_bat_wing": "Bat's Wing",
"item.actuallyadditions.wooden_paxel": "Wooden AIOT",
@ -628,7 +630,7 @@
"container.actuallyadditions.inputterAdvanced": "Advanced ESD",
"container.actuallyadditions.crusher": "Crusher",
"container.actuallyadditions.double_crusher": "Double Crusher",
"container.actuallyadditions.furnaceDouble": "Powered Furnace",
"container.actuallyadditions.powered_furnace": "Powered Furnace",
"container.actuallyadditions.feeder": "Feeder",
"container.actuallyadditions.giantChest": "Small Storage Crate",
"container.actuallyadditions.giantChest.desc": "'Small'",

View file

@ -0,0 +1,5 @@
{
"textures": {
"particle": "actuallyadditions:fluid/crystallized_oil_still"
}
}

View file

@ -0,0 +1,5 @@
{
"textures": {
"particle": "actuallyadditions:fluid/empowered_oil_still"
}
}

View file

@ -0,0 +1,5 @@
{
"textures": {
"particle": "actuallyadditions:fluid/refined_canola_oil_still"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View file

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,3 @@
{
"animation": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}