-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1a58b0
commit 573a5fd
Showing
11 changed files
with
82 additions
and
245 deletions.
There are no files selected for viewing
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
src/generated/resources/assets/anvilcraft/models/block/oil.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"textures": { | ||
"particle": "anvilcraft:block/oil" | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
src/generated/resources/data/anvilcraft/loot_table/blocks/oil.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
src/main/java/dev/dubhe/anvilcraft/fluid/ClientFluidTypeExtensionImpl.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,75 @@ | ||
package dev.dubhe.anvilcraft.init; | ||
|
||
import dev.dubhe.anvilcraft.AnvilCraft; | ||
import dev.dubhe.anvilcraft.fluid.OilFluid; | ||
import net.minecraft.MethodsReturnNonnullByDefault; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.sounds.SoundEvents; | ||
import net.minecraft.world.level.material.Fluid; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.neoforge.client.extensions.common.IClientFluidTypeExtensions; | ||
import net.neoforged.neoforge.common.SoundActions; | ||
import net.neoforged.neoforge.fluids.BaseFlowingFluid; | ||
import net.neoforged.neoforge.fluids.FluidType; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
import net.neoforged.neoforge.registries.NeoForgeRegistries; | ||
|
||
import javax.annotation.ParametersAreNonnullByDefault; | ||
import java.util.function.Consumer; | ||
|
||
@SuppressWarnings("removal") | ||
@MethodsReturnNonnullByDefault | ||
@ParametersAreNonnullByDefault | ||
public class ModFluids { | ||
|
||
public static final DeferredRegister<Fluid> REGISTER = DeferredRegister.create( | ||
Registries.FLUID, | ||
AnvilCraft.MOD_ID | ||
); | ||
public static final DeferredRegister<FluidType> FLUID_TYPES = DeferredRegister.create(NeoForgeRegistries.FLUID_TYPES, AnvilCraft.MOD_ID); | ||
public static final DeferredRegister<Fluid> FLUIDS = DeferredRegister.create(Registries.FLUID, AnvilCraft.MOD_ID); | ||
|
||
public static final DeferredHolder<Fluid, OilFluid.Source> OIL = REGISTER | ||
public static final DeferredHolder<FluidType, FluidType> OIL_TYPE = FLUID_TYPES.register( | ||
"oil", | ||
() -> new FluidType(FluidType.Properties.create() | ||
.density(2000) | ||
.viscosity(4000) | ||
.fallDistanceModifier(0F) | ||
.motionScale(0.007) | ||
.supportsBoating(true) | ||
.sound(SoundActions.BUCKET_FILL, SoundEvents.BUCKET_FILL) | ||
.sound(SoundActions.BUCKET_EMPTY, SoundEvents.BUCKET_EMPTY) | ||
.sound(SoundActions.FLUID_VAPORIZE, SoundEvents.FIRE_EXTINGUISH) | ||
) { | ||
@Override | ||
public void initializeClient(Consumer<IClientFluidTypeExtensions> consumer) { | ||
consumer.accept(new IClientFluidTypeExtensions() { | ||
@Override | ||
public ResourceLocation getStillTexture() { | ||
return AnvilCraft.of("block/oil"); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getFlowingTexture() { | ||
return AnvilCraft.of("block/oil"); | ||
} | ||
}); | ||
} | ||
} | ||
); | ||
public static final DeferredHolder<Fluid, BaseFlowingFluid> OIL = FLUIDS | ||
.register( | ||
"oil", | ||
OilFluid.Source::new | ||
() -> new BaseFlowingFluid.Source(ModFluids.OIL_PROPERTIES) | ||
); | ||
|
||
public static final DeferredHolder<Fluid, OilFluid.Flowing> FLOWING_OIL = REGISTER | ||
public static final DeferredHolder<Fluid, BaseFlowingFluid> FLOWING_OIL = FLUIDS | ||
.register( | ||
"flowing_oil", | ||
OilFluid.Flowing::new | ||
() -> new BaseFlowingFluid.Flowing(ModFluids.OIL_PROPERTIES) | ||
); | ||
public static final BaseFlowingFluid.Properties OIL_PROPERTIES = new BaseFlowingFluid.Properties(OIL_TYPE, OIL, FLOWING_OIL) | ||
.bucket(ModItems.OIL_BUCKET).block(ModBlocks.OIL).tickRate(10).slopeFindDistance(3).explosionResistance(100); | ||
|
||
public static void register(IEventBus eventBus){ | ||
REGISTER.register(eventBus); | ||
public static void register(IEventBus eventBus) { | ||
FLUID_TYPES.register(eventBus); | ||
FLUIDS.register(eventBus); | ||
} | ||
} |
Oops, something went wrong.