Jump to content

Tenth

Members
  • Posts

    8
  • Joined

  • Last visited

Tenth's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Also here is the texture, forgot to include that mb:
  2. 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.
  3. I have a Jade Plugin for my mod using this component provider that should get my block entity's "progress" and display a % based on that. Only problem is, SteamBenderEntity#getProgress() always returns 0. My best guess is that I need packets but I don't know how to return a value from them. Any help would be amazing, thank you.
  4. I'm embarrassed it was something so obvious, thanks for the help.
  5. I'm making a tech mod which will have several machines with a circuit slot (like GregTech) which is controlled by an int called circuitNumber which is apart of a ContainerData variable in the BlockEntity. This int will control the amount of an ItemStack in a slot of my custom circuit item. I tried modifying the data through the passed-in blockEntity in the menu class. (The #setCircuit and #getCircuit functions just used ContainerData#set and ContainerData#get using the passed-in ContainerData in the menu class) No dice, the data never gets changed. I then tried to make a packed called CircuitSyncC2SPacket which would tell the server to modify the data using a function in the BlockEntity class. Zilch, no effect whatsoever. I couldn't find anything when searching for this online, and the one I did was from 2013 that said to use Packets. If this is the solution, then I must be doing something wrong. Any help would be appreciated, thank you. The project's GitHub.
  6. I put breakpoints everywhere and couldn't discern the issue. Then... I realized that I used the wrong #getCapability method in both BlockEntity classes. 🤦‍♂️Never realized there were two of them, but yeah I needed to use the one accepting a Capability and Direction and not the one only accepting a Capability. Thanks for the help.
  7. Both blocks are using #newBlockEntity and pointing to their respective block entity classes, so I'm a little confused as to why that would be.
  8. I have two BlockEntities, SteamBoiler and SlightlyBiggerChest SteamBoiler should be able to have Steam piped in and out. SlightlyBiggerChest is a Beta styled chest that should be able to have items inputted and extracted. Problem is, Hoppers aren't interfacing with SlightlyBiggerChest, and pipes (from Mekanism) aren't interfacing with SteamBoiler. Entity Classes: SlightlyBiggerChestEntity, SteamBoilerEntity. GitHub: Factory Any help is appreciated. Thank you.
×
×
  • Create New...

Important Information

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