Jump to content

Recommended Posts

Posted

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:

spacer.png

Any help is more than appreciated.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I know this is a forge only place, but just to be clear, my error is in Fabric I was actually super frustrated while trying to fix this, like this mod does work when I play it by launching it in minecraft, but when I was trying to install it onto the server it just kept crashing so I decided to delete every mod I've got but kept the bewitchment mod and the necessary mod it needs to function and I tried to run the server... But it somehow still crashed, and the thing is that I really do want the bewitchment mod to be in the SMP so it'll be SUPER helpful if anyone can figure out on how to fix this: It didn't give me any "crash-reports" so I'll be sending the logs and what the console said: Console: [18:51:46] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/container/libraries/net/fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/sponge-mixin-0.13.3+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER [18:51:46] [main/WARN]: Error loading class: io/github/apace100/origins/power/PreventItemUsePower (java.lang.ClassNotFoundException: io/github/apace100/origins/power/PreventItemUsePower) [18:51:46] [main/WARN]: @Mixin target io.github.apace100.origins.power.PreventItemUsePower was not found bewitchment.mixins.json:integration.origins.PreventItemUsePowerMixin from mod bewitchment [18:51:47] [main/INFO]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5). [18:51:52] [main/FATAL]: Failed to start the minecraft server java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'bewitchment'! at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) ~[fabric-loader-0.15.11.jar:?] at net.minecraft.server.Main.main(Main.java:92) [server-intermediary.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.15.11.jar:?] at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) [server.jar:1.0.1] Caused by: java.lang.NoSuchFieldError: TEXTURE at moriyashiine.bewitchment.common.item.SpecterBangleItem.<clinit>(SpecterBangleItem.java:28) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.registry.BWObjects.<clinit>(BWObjects.java:272) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.Bewitchment.onInitialize(Bewitchment.java:221) ~[bewitchment-1.16.5-18.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ~[fabric-loader-0.15.11.jar:?] ... 7 more Logs: https://mclo.gs/wSsqMfn
    • I know this is a forge only place, but just so you know my error is in Fabric I was actually super frustrated while trying to fix this, like this mod does work when I play it by launching it in minecraft, but when I was trying to install it onto the server it just kept crashing so I decided to delete every mod I've got but kept the bewitchment mod and the necessary mod it needs to function and I tried to run the server... But it somehow still crashed, and the thing is that I really do want the bewitchment mod to be in the SMP so it'll be SUPER helpful if anyone can figure out on how to fix this: It didn't give me any "crash-reports" so I'll be sending the logs and what the console said: Console: [18:51:46] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/home/container/libraries/net/fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/sponge-mixin-0.13.3+mixin.0.8.5.jar Service=Knot/Fabric Env=SERVER [18:51:46] [main/WARN]: Error loading class: io/github/apace100/origins/power/PreventItemUsePower (java.lang.ClassNotFoundException: io/github/apace100/origins/power/PreventItemUsePower) [18:51:46] [main/WARN]: @Mixin target io.github.apace100.origins.power.PreventItemUsePower was not found bewitchment.mixins.json:integration.origins.PreventItemUsePowerMixin from mod bewitchment [18:51:47] [main/INFO]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.5). [18:51:52] [main/FATAL]: Failed to start the minecraft server java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'bewitchment'! at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) ~[fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:63) ~[fabric-loader-0.15.11.jar:?] at net.minecraft.server.Main.main(Main.java:92) [server-intermediary.jar:?] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.15.11.jar:?] at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.15.11.jar:?] at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) [server.jar:1.0.1] Caused by: java.lang.NoSuchFieldError: TEXTURE at moriyashiine.bewitchment.common.item.SpecterBangleItem.<clinit>(SpecterBangleItem.java:28) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.registry.BWObjects.<clinit>(BWObjects.java:272) ~[bewitchment-1.16.5-18.jar:?] at moriyashiine.bewitchment.common.Bewitchment.onInitialize(Bewitchment.java:221) ~[bewitchment-1.16.5-18.jar:?] at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ~[fabric-loader-0.15.11.jar:?] ... 7 more Logs: https://mclo.gs/wSsqMfn
    • Open the Task Manager and check the Performance Tab At GPU the GPU is mentioned above the Graph
    • how? and how do i find what graphics card i have
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.