- CycleBehavior fix.
- Jade progress literal fix. - SolidRendererFluid
This commit is contained in:
@@ -14,7 +14,7 @@ parchment_version = 2024.11.17
|
||||
mod_id=mechanicals
|
||||
mod_name=Mechanicals Lib
|
||||
mod_license=LGPL3
|
||||
mod_version=0.1.19
|
||||
mod_version=0.1.23
|
||||
mod_group_id=com.oierbravo
|
||||
mod_author=oierbravo
|
||||
mod_description=Utility Library for Create Addons.
|
||||
|
||||
@@ -124,11 +124,11 @@ public class CycleBehavior extends BlockEntityBehaviour {
|
||||
|
||||
prevRunningTicks = runningTicks;
|
||||
runningTicks += getRunningTickSpeed();
|
||||
if (prevRunningTicks < cycleTime / 2 && runningTicks >= cycleTime / cycleDivider) {
|
||||
runningTicks = cycleTime / 2;
|
||||
if (prevRunningTicks < cycleTime / cycleDivider && runningTicks >= cycleTime / cycleDivider) {
|
||||
runningTicks = cycleTime / cycleDivider;
|
||||
// Pause the ticks until a packet is received
|
||||
if (level.isClientSide && !blockEntity.isVirtual())
|
||||
runningTicks = -(cycleTime / 2);
|
||||
runningTicks = -(cycleTime / cycleDivider);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,9 @@ public abstract class AbstractMechanicalRecipe<T extends RecipeInput, P extends
|
||||
recipeRequirements = params.recipeRequirements;
|
||||
conditions = params.conditions;
|
||||
}
|
||||
|
||||
public ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
public List<ICondition> getConditions(){
|
||||
return conditions;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class MechanicalProgressComponentProvider implements IBlockComponentProvi
|
||||
if(progress > 0){
|
||||
IElementHelper helper = IElementHelper.get();
|
||||
ProgressStyle progressStyle = helper.progressStyle().textColor(1);
|
||||
tooltip.add(helper.progress((float)progress / 100, LibLang.translate("progress", progress).component().withColor(java.awt.Color.GRAY.getRGB()), progressStyle.color(java.awt.Color.YELLOW.getRGB()), BoxStyle.getTransparent(), false));
|
||||
tooltip.add(helper.progress((float)progress / 100, LibLang.translate("ui.progress", progress).component().withColor(java.awt.Color.GRAY.getRGB()), progressStyle.color(java.awt.Color.YELLOW.getRGB()), BoxStyle.getTransparent(), false));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.oierbravo.mechanicals.register.fluid;
|
||||
|
||||
import com.simibubi.create.AllFluids;
|
||||
import com.tterrag.registrate.builders.FluidBuilder;
|
||||
import net.createmod.catnip.theme.Color;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.BlockAndTintGetter;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.neoforged.neoforge.fluids.FluidStack;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class MechanicalSolidRenderedPlaceableFluidType extends AllFluids.TintedFluidType {
|
||||
|
||||
private Vector3f fogColor;
|
||||
private Supplier<Float> fogDistance;
|
||||
|
||||
public static FluidBuilder.FluidTypeFactory create(int fogColor, Supplier<Float> fogDistance) {
|
||||
return (p, s, f) -> {
|
||||
MechanicalSolidRenderedPlaceableFluidType fluidType = new MechanicalSolidRenderedPlaceableFluidType(p, s, f);
|
||||
fluidType.fogColor = new Color(fogColor, false).asVectorF();
|
||||
fluidType.fogDistance = fogDistance;
|
||||
return fluidType;
|
||||
};
|
||||
}
|
||||
|
||||
private MechanicalSolidRenderedPlaceableFluidType(Properties properties, ResourceLocation stillTexture,
|
||||
ResourceLocation flowingTexture) {
|
||||
super(properties, stillTexture, flowingTexture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getTintColor(FluidStack stack) {
|
||||
return NO_TINT;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removing alpha from tint prevents optifine from forcibly applying biome
|
||||
* colors to modded fluids (this workaround only works for fluids in the solid
|
||||
* render layer)
|
||||
*/
|
||||
@Override
|
||||
public int getTintColor(FluidState state, BlockAndTintGetter world, BlockPos pos) {
|
||||
return 0x00ffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Vector3f getCustomFogColor() {
|
||||
return fogColor;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getFogDistanceModifier() {
|
||||
return fogDistance.get();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user