Search the Community
Showing results for tags 'fluids'.
-
Basically I have the fluid working but the flowing texture isn't the right size. This is what I have in the mcmeta file for the texture: { "animation": { "interpolate": true, "width": 16, "height": 16 } } This is what my FluidTypes class looks like: package net.tenth.factory.fluid; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvents; import net.minecraftforge.common.SoundAction; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fluids.FluidType; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import net.tenth.factory.Factory; import org.joml.Vector3f; public class FactoryFluidTypes { public static final ResourceLocation SLIME_STILL_RL = new ResourceLocation(Factory.MOD_ID,"block/slime_still"); public static final ResourceLocation SLIME_FLOWING_RL = new ResourceLocation(Factory.MOD_ID ,"block/slime_flowing"); public static final ResourceLocation SLIME_OVERLAY_RL = new ResourceLocation(Factory.MOD_ID, "misc/in_slime"); public static final DeferredRegister<FluidType> FLUID_TYPES = DeferredRegister.create(ForgeRegistries.FLUID_TYPES, Factory.MOD_ID); private static RegistryObject<FluidType> register(String name, FluidType.Properties properties, int tintColor, Vector3f fogColor) { return FLUID_TYPES.register(name, () -> new BaseFluidType(SLIME_STILL_RL, SLIME_FLOWING_RL, SLIME_OVERLAY_RL, tintColor, fogColor, properties)); } public static void register(IEventBus eventBus) { FLUID_TYPES.register(eventBus); } public static final RegistryObject<FluidType> SLIME_FLUID_TYPE = register("slime", FluidType.Properties.create().density(100).viscosity(100).sound(SoundAction.get("splash"), SoundEvents.SLIME_BLOCK_STEP), 0xFFFFFFFF, new Vector3f(69f / 255f, 245f / 255f, 66f / 255f)); The BaseFluidType class: package net.tenth.factory.fluid; import com.mojang.blaze3d.shaders.FogShape; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Camera; import net.minecraft.client.multiplayer.ClientLevel; import net.minecraft.client.renderer.FogRenderer; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.extensions.common.IClientFluidTypeExtensions; import net.minecraftforge.fluids.FluidType; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.joml.Vector3f; import java.util.function.Consumer; public class BaseFluidType extends FluidType { private final ResourceLocation stillTexture; private final ResourceLocation flowingTexture; private final ResourceLocation overlayTexture; private final int tintColor; private final Vector3f fogColor; public BaseFluidType(final ResourceLocation stillTexture, final ResourceLocation flowingTexture, final ResourceLocation overlayTexture, final int tintColor, final Vector3f fogColor, final Properties properties) { super(properties); this.stillTexture = stillTexture; this.flowingTexture = flowingTexture; this.overlayTexture = overlayTexture; this.tintColor = tintColor; this.fogColor = fogColor; } public ResourceLocation getStillTexture() { return stillTexture; } public ResourceLocation getFlowingTexture() { return flowingTexture; } public ResourceLocation getOverlayTexture() { return overlayTexture; } public int getTintColor() { return tintColor; } public Vector3f getFogColor() { return fogColor; } @Override public void initializeClient(Consumer<IClientFluidTypeExtensions> consumer) { consumer.accept(new IClientFluidTypeExtensions() { @Override public ResourceLocation getStillTexture() { return stillTexture; } @Override public ResourceLocation getFlowingTexture() { return flowingTexture; } @Override public @Nullable ResourceLocation getOverlayTexture() { return overlayTexture; } @Override public int getTintColor() { return tintColor; } @Override public @NotNull Vector3f modifyFogColor(Camera camera, float partialTick, ClientLevel level, int renderDistance, float darkenWorldAmount, Vector3f fluidFogColor) { return fogColor; } @Override public void modifyFogRender(Camera camera, FogRenderer.FogMode mode, float renderDistance, float partialTick, float nearDistance, float farDistance, FogShape shape) { RenderSystem.setShaderFogStart(0.5f); RenderSystem.setShaderFogEnd(6f); } }); } } And finally the screenshot presenting the issue: Any help is more than appreciated.
-
I made a custom fluid by following guide of Kaupenjoe on YT, but I'm unable to assign it property of waterlogging any non solid blocks, such as slabs, stairc, walls etc. as well as I can't find any sources or guides on how to do it. Here is link to my .github repository, any help is appreciated. https://github.com/AlexOja/Forge_Mod_1.19.2_nikorloss
-
I am trying to spawn fluid, but Intellij says " Cannot resolve method 'setBlock(BlockPos, RegistryObject<LiquidBlock>)' " package net.svisvi.jigsawpp.effect; import net.minecraft.core.BlockPos; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectCategory; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.level.Level; import static net.svisvi.jigsawpp.init.JigsawPpModBlocks.PONOS_WATER_BLOCK; public class purgenEffect extends MobEffect { public purgenEffect(MobEffectCategory mobEffectCategory, int color) { super(mobEffectCategory, color); } public void applyEffectTick(LivingEntity pLivingEntity, Level worldin, BlockPos pos) { if (pLivingEntity.level().isClientSide()) { worldin.setBlock(pos, PONOS_WATER_BLOCK); } } }
-
Topic for making tags
-
- 1.10.2
- 1.11.2
-
(and 81 more)
Tagged with:
- 1.10.2
- 1.11.2
- 1.12.2
- 1.13.2
- 1.14.4
- 1.15.2
- 1.16.5
- 1.17.1
- 1.18.2
- 1.19.0
- 1.19.1
- 1.19.2
- 1.19.3
- 1.19.4
- 1.2.5
- 1.20.0
- 1.3.2
- 1.4.7
- 1.5.2
- 1.6.4
- 1.7.10
- 1.8.9
- 1.9.4
- armour
- bad jvm args
- biomes
- blocks
- broken mod
- bug
- capabilities
- client
- client-only mods on server
- codecs
- commands
- dimensions
- effects
- enchantments
- entities
- events
- feature request
- fluids
- food
- gradle
- groovy
- guis
- ide
- installer
- items
- java
- kotlin
- launcher
- libraries
- loot
- metadata
- missing jar association
- missing java
- missing mods
- mixin
- needs more info
- networking
- news
- optifine
- ores
- out of memory
- outdated drivers
- particles
- performance
- porting
- potions
- recipes
- registries
- rendering
- scala
- server
- solved
- sounds
- textures
- tools
- tutorial
- weapons
- worldgen
- wrong java version
- wrong mod version