mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Honey, I'm blue!
- Evade fluid tinting issues with optifine
This commit is contained in:
parent
9e4b92babf
commit
3301f8ff01
6 changed files with 41 additions and 17 deletions
|
@ -753,7 +753,7 @@ a68cd40ffb769b195437107f4a2c2188b222b74a assets/create/models/block/gray_sail.js
|
||||||
17b651233c62b928f0228562a7f6e7a2b7b2d6b7 assets/create/models/block/green_sail.json
|
17b651233c62b928f0228562a7f6e7a2b7b2d6b7 assets/create/models/block/green_sail.json
|
||||||
1438b8ce54ac5557b8f10dcef94f3525eae19461 assets/create/models/block/green_seat.json
|
1438b8ce54ac5557b8f10dcef94f3525eae19461 assets/create/models/block/green_seat.json
|
||||||
cc7ce9b6bc687ad5027a67c3bf22bdf5bcd71674 assets/create/models/block/green_valve_handle.json
|
cc7ce9b6bc687ad5027a67c3bf22bdf5bcd71674 assets/create/models/block/green_valve_handle.json
|
||||||
5bbe7e5322020d205d2c60bc14e4b45b317a193c assets/create/models/block/honey.json
|
5163171ed77af879fa06f290bf24b1bb99735c94 assets/create/models/block/honey.json
|
||||||
9730fcb02f679087e81e24c836751e625be6a298 assets/create/models/block/horizontal_framed_glass.json
|
9730fcb02f679087e81e24c836751e625be6a298 assets/create/models/block/horizontal_framed_glass.json
|
||||||
d13df8a5920c5778d98081fb0e97f045e2fd46a2 assets/create/models/block/horizontal_framed_glass_pane_noside.json
|
d13df8a5920c5778d98081fb0e97f045e2fd46a2 assets/create/models/block/horizontal_framed_glass_pane_noside.json
|
||||||
3e975bec02e2670ce2b1868cebcbd780a5ebf3f8 assets/create/models/block/horizontal_framed_glass_pane_noside_alt.json
|
3e975bec02e2670ce2b1868cebcbd780a5ebf3f8 assets/create/models/block/horizontal_framed_glass_pane_noside_alt.json
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"textures": {
|
"textures": {
|
||||||
"particle": "block/honey_block_top"
|
"particle": "create:fluid/honey_still"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,14 +10,15 @@ import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||||
import com.tterrag.registrate.util.entry.RegistryEntry;
|
import com.tterrag.registrate.util.entry.RegistryEntry;
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.client.renderer.RenderTypeLookup;
|
import net.minecraft.client.renderer.RenderTypeLookup;
|
||||||
import net.minecraft.fluid.Fluid;
|
import net.minecraft.fluid.Fluid;
|
||||||
import net.minecraft.fluid.IFluidState;
|
import net.minecraft.fluid.IFluidState;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.ILightReader;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
import net.minecraftforge.fluids.FluidAttributes;
|
||||||
import net.minecraftforge.fluids.ForgeFlowingFluid;
|
import net.minecraftforge.fluids.ForgeFlowingFluid;
|
||||||
|
|
||||||
public class AllFluids {
|
public class AllFluids {
|
||||||
|
@ -39,7 +40,7 @@ public class AllFluids {
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static RegistryEntry<ForgeFlowingFluid.Flowing> HONEY =
|
public static RegistryEntry<ForgeFlowingFluid.Flowing> HONEY =
|
||||||
REGISTRATE.fluid("honey", new ResourceLocation("block/honey_block_top"), Create.asResource("fluid/honey_flow"))
|
REGISTRATE.standardFluid("honey", NoColorFluidAttributes::new)
|
||||||
.lang(f -> "fluid.create.honey", "Honey")
|
.lang(f -> "fluid.create.honey", "Honey")
|
||||||
.attributes(b -> b.viscosity(500)
|
.attributes(b -> b.viscosity(500)
|
||||||
.density(1400))
|
.density(1400))
|
||||||
|
@ -50,24 +51,23 @@ public class AllFluids {
|
||||||
.tag(AllTags.forgeFluidTag("honey"))
|
.tag(AllTags.forgeFluidTag("honey"))
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static RegistryEntry<ForgeFlowingFluid.Flowing> CHOCOLATE = REGISTRATE.standardFluid("chocolate")
|
public static RegistryEntry<ForgeFlowingFluid.Flowing> CHOCOLATE =
|
||||||
.lang(f -> "fluid.create.chocolate", "Chocolate")
|
REGISTRATE.standardFluid("chocolate", NoColorFluidAttributes::new)
|
||||||
.attributes(b -> b.viscosity(500)
|
.lang(f -> "fluid.create.chocolate", "Chocolate")
|
||||||
.density(1400))
|
.attributes(b -> b.viscosity(500)
|
||||||
.properties(p -> p.levelDecreasePerBlock(2)
|
.density(1400))
|
||||||
.tickRate(25)
|
.properties(p -> p.levelDecreasePerBlock(2)
|
||||||
.slopeFindDistance(3)
|
.tickRate(25)
|
||||||
.explosionResistance(100f))
|
.slopeFindDistance(3)
|
||||||
.register();
|
.explosionResistance(100f))
|
||||||
|
.register();
|
||||||
|
|
||||||
// Load this class
|
// Load this class
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static void assignRenderLayers() {
|
public static void assignRenderLayers() {}
|
||||||
makeTranslucent(HONEY);
|
|
||||||
}
|
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
private static void makeTranslucent(RegistryEntry<? extends ForgeFlowingFluid> entry) {
|
private static void makeTranslucent(RegistryEntry<? extends ForgeFlowingFluid> entry) {
|
||||||
|
@ -90,4 +90,21 @@ public class AllFluids {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removing alpha from tint prevents optifine from forcibly applying biome
|
||||||
|
* colors to modded fluids (Makes translucent fluids disappear)
|
||||||
|
*/
|
||||||
|
private static class NoColorFluidAttributes extends FluidAttributes {
|
||||||
|
|
||||||
|
protected NoColorFluidAttributes(Builder builder, Fluid fluid) {
|
||||||
|
super(builder, fluid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getColor(ILightReader world, BlockPos pos) {
|
||||||
|
return 0x00ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.tterrag.registrate.builders.FluidBuilder;
|
||||||
import com.tterrag.registrate.builders.ItemBuilder;
|
import com.tterrag.registrate.builders.ItemBuilder;
|
||||||
import com.tterrag.registrate.util.NonNullLazyValue;
|
import com.tterrag.registrate.util.NonNullLazyValue;
|
||||||
import com.tterrag.registrate.util.entry.RegistryEntry;
|
import com.tterrag.registrate.util.entry.RegistryEntry;
|
||||||
|
import com.tterrag.registrate.util.nullness.NonNullBiFunction;
|
||||||
import com.tterrag.registrate.util.nullness.NonNullConsumer;
|
import com.tterrag.registrate.util.nullness.NonNullConsumer;
|
||||||
import com.tterrag.registrate.util.nullness.NonNullFunction;
|
import com.tterrag.registrate.util.nullness.NonNullFunction;
|
||||||
import com.tterrag.registrate.util.nullness.NonNullSupplier;
|
import com.tterrag.registrate.util.nullness.NonNullSupplier;
|
||||||
|
@ -143,6 +144,12 @@ public class CreateRegistrate extends AbstractRegistrate<CreateRegistrate> {
|
||||||
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"));
|
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> standardFluid(String name,
|
||||||
|
NonNullBiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory) {
|
||||||
|
return fluid(name, Create.asResource("fluid/" + name + "_still"), Create.asResource("fluid/" + name + "_flow"),
|
||||||
|
attributesFactory);
|
||||||
|
}
|
||||||
|
|
||||||
/* Util */
|
/* Util */
|
||||||
|
|
||||||
public static <T extends Block> NonNullConsumer<? super T> connectedTextures(ConnectedTextureBehaviour behavior) {
|
public static <T extends Block> NonNullConsumer<? super T> connectedTextures(ConnectedTextureBehaviour behavior) {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 3.5 KiB |
BIN
src/main/resources/assets/create/textures/fluid/honey_still.png
Normal file
BIN
src/main/resources/assets/create/textures/fluid/honey_still.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 247 B |
Loading…
Reference in a new issue