Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/main/java/com/altnoir/poopsky/PoopSky.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.bus.api.SubscribeEvent;
Expand All @@ -33,9 +34,12 @@
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;
import net.neoforged.neoforge.client.event.RegisterColorHandlersEvent;
import net.neoforged.neoforge.client.event.RegisterParticleProvidersEvent;
import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions;
import net.neoforged.neoforge.client.extensions.common.RegisterClientExtensionsEvent;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.event.server.ServerStartingEvent;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;

@Mod(PoopSky.MOD_ID)
Expand Down Expand Up @@ -124,5 +128,25 @@ public static void onRegisterBlockColors(RegisterColorHandlersEvent.Block event)
public static void onRegisterFluidRenderTypes(net.neoforged.neoforge.client.event.RegisterRenderBuffersEvent event) {
event.registerRenderBuffer(RenderType.translucent());
}

@SubscribeEvent
public static void registerClientExtensions(RegisterClientExtensionsEvent event) {
event.registerFluidType(new IClientFluidTypeExtensions() {
@Override
public @NotNull ResourceLocation getStillTexture() {
return PSFluidTypes.POOP_STILL_TEXTURE;
}

@Override
public @NotNull ResourceLocation getFlowingTexture() {
return PSFluidTypes.POOP_FLOWING_TEXTURE;
}

@Override
public ResourceLocation getOverlayTexture() {
return PSFluidTypes.POOP_OVERLAY_TEXTURE;
}
}, PSFluidTypes.POOP_FLUID_TYPE.get());
}
}
}
39 changes: 18 additions & 21 deletions src/main/java/com/altnoir/poopsky/fluid/PSFluidTypes.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.altnoir.poopsky.fluid;

import com.altnoir.poopsky.PoopSky;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.neoforged.neoforge.common.SoundActions;
import net.neoforged.neoforge.fluids.FluidType;
Expand All @@ -9,28 +10,24 @@

import java.util.function.Supplier;

public class PSFluidTypes extends FluidType {
public class PSFluidTypes {
public static final DeferredRegister<FluidType> FLUID_TYPES = DeferredRegister.create(NeoForgeRegistries.Keys.FLUID_TYPES, PoopSky.MOD_ID);

public static final Supplier<FluidType> POOP_FLUID_TYPE = FLUID_TYPES.register("poop", () -> new FluidType(FluidType.Properties.create()
.descriptionId("block.poopsky.poop_liquid")
.fallDistanceModifier(0F)
.canExtinguish(true)
.canConvertToSource(true)
.supportsBoating(true)
.sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL_LAVA)
.sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY_LAVA)
.density(3000)
.viscosity(6000)
.lightLevel(1)
));
public static final ResourceLocation POOP_STILL_TEXTURE = ResourceLocation.fromNamespaceAndPath(PoopSky.MOD_ID, "block/poop_liquid");
public static final ResourceLocation POOP_FLOWING_TEXTURE = ResourceLocation.fromNamespaceAndPath(PoopSky.MOD_ID, "block/poop_liquid_flowing");
public static final ResourceLocation POOP_OVERLAY_TEXTURE = ResourceLocation.fromNamespaceAndPath(PoopSky.MOD_ID, "block/poop_liquid");

/**
* Default constructor.
*
* @param properties the general properties of the fluid type
*/
public PSFluidTypes(Properties properties) {
super(properties);
}
public static final Supplier<FluidType> POOP_FLUID_TYPE = FLUID_TYPES.register("poop",
() -> new FluidType(FluidType.Properties.create()
.descriptionId("block.poopsky.poop_liquid")
.fallDistanceModifier(0F)
.canExtinguish(true)
.canConvertToSource(true)
.supportsBoating(true)
.sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL_LAVA)
.sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY_LAVA)
.density(3000)
.viscosity(6000)
.lightLevel(1)
));
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"animation":
{
"height": 16,
"width": 16,
"frametime": 4,
"frames":
[
0,1,2,3,4,5,6
]
}
}