Renaming and getters

- Rename AllBlockPartials -> AllPartialModels
- Make AllPackets.channel private and use getter method instead
- Make config fields in AllConfigs private and use getter methods
instead
- Optimize SyncedBlockEntity#sendData
This commit is contained in:
PepperCode1 2023-02-23 16:05:22 -08:00
parent 6265b6d295
commit 783cd126f7
283 changed files with 737 additions and 726 deletions

View file

@ -14,7 +14,7 @@ import com.simibubi.create.foundation.utility.Lang;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.DyeColor;
public class AllBlockPartials { public class AllPartialModels {
public static final PartialModel public static final PartialModel

View file

@ -84,7 +84,7 @@ public class CreateClient {
BUFFER_CACHE.registerCompartment(WorldSectionElement.DOC_WORLD_SECTION, 20); BUFFER_CACHE.registerCompartment(WorldSectionElement.DOC_WORLD_SECTION, 20);
AllKeys.register(); AllKeys.register();
AllBlockPartials.init(); AllPartialModels.init();
AllStitchedTextures.init(); AllStitchedTextures.init();
PonderIndex.register(); PonderIndex.register();
@ -121,7 +121,7 @@ public class CreateClient {
if (mc.options.graphicsMode != GraphicsStatus.FABULOUS) if (mc.options.graphicsMode != GraphicsStatus.FABULOUS)
return; return;
if (AllConfigs.CLIENT.ignoreFabulousWarning.get()) if (AllConfigs.client().ignoreFabulousWarning.get())
return; return;
MutableComponent text = ComponentUtils.wrapInSquareBrackets(Components.literal("WARN")) MutableComponent text = ComponentUtils.wrapInSquareBrackets(Components.literal("WARN"))

View file

@ -34,7 +34,7 @@ public class BlueprintTransferHandler implements IRecipeTransferHandler<Blueprin
if (!doTransfer) if (!doTransfer)
return null; return null;
AllPackets.channel.sendToServer(new BlueprintAssignCompleteRecipePacket(craftingRecipe.getId())); AllPackets.getChannel().sendToServer(new BlueprintAssignCompleteRecipePacket(craftingRecipe.getId()));
return null; return null;
} }

View file

@ -503,7 +503,7 @@ public class CreateJEI implements IModPlugin {
public CreateRecipeCategory<T> build(String name, CreateRecipeCategory.Factory<T> factory) { public CreateRecipeCategory<T> build(String name, CreateRecipeCategory.Factory<T> factory) {
Supplier<List<T>> recipesSupplier; Supplier<List<T>> recipesSupplier;
if (predicate.test(AllConfigs.SERVER.recipes)) { if (predicate.test(AllConfigs.server().recipes)) {
recipesSupplier = () -> { recipesSupplier = () -> {
List<T> recipes = new ArrayList<>(); List<T> recipes = new ArrayList<>();
for (Consumer<List<T>> consumer : recipeListConsumers) for (Consumer<List<T>> consumer : recipeListConsumers)

View file

@ -82,7 +82,7 @@ public class GhostIngredientHandler<T extends GhostItemMenu<?>>
return; return;
// sync new filter contents with server // sync new filter contents with server
AllPackets.channel.sendToServer(new GhostItemSubmitPacket(stack, slotIndex)); AllPackets.getChannel().sendToServer(new GhostItemSubmitPacket(stack, slotIndex));
} }
} }
} }

View file

@ -7,8 +7,8 @@ import javax.annotation.ParametersAreNonnullByDefault;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics; import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
@ -57,7 +57,7 @@ public abstract class ProcessingViaFanCategory<T extends Recipe<?>> extends Crea
matrixStack.mulPose(Vector3f.XP.rotationDegrees(-12.5f)); matrixStack.mulPose(Vector3f.XP.rotationDegrees(-12.5f));
matrixStack.mulPose(Vector3f.YP.rotationDegrees(22.5f)); matrixStack.mulPose(Vector3f.YP.rotationDegrees(22.5f));
AnimatedKinetics.defaultBlockElement(AllBlockPartials.ENCASED_FAN_INNER) AnimatedKinetics.defaultBlockElement(AllPartialModels.ENCASED_FAN_INNER)
.rotateBlock(180, 0, AnimatedKinetics.getCurrentAngle() * 16) .rotateBlock(180, 0, AnimatedKinetics.getCurrentAngle() * 16)
.scale(SCALE) .scale(SCALE)
.render(matrixStack); .render(matrixStack);

View file

@ -4,8 +4,8 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.AllSpriteShifts; import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
import com.simibubi.create.foundation.block.render.SpriteShiftEntry; import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
@ -42,9 +42,9 @@ public class AnimatedBlazeBurner extends AnimatedKinetics {
.render(matrixStack); .render(matrixStack);
PartialModel blaze = PartialModel blaze =
heatLevel == HeatLevel.SEETHING ? AllBlockPartials.BLAZE_SUPER : AllBlockPartials.BLAZE_ACTIVE; heatLevel == HeatLevel.SEETHING ? AllPartialModels.BLAZE_SUPER : AllPartialModels.BLAZE_ACTIVE;
PartialModel rods2 = heatLevel == HeatLevel.SEETHING ? AllBlockPartials.BLAZE_BURNER_SUPER_RODS_2 PartialModel rods2 = heatLevel == HeatLevel.SEETHING ? AllPartialModels.BLAZE_BURNER_SUPER_RODS_2
: AllBlockPartials.BLAZE_BURNER_RODS_2; : AllPartialModels.BLAZE_BURNER_RODS_2;
blockElement(blaze).atLocal(1, 1.8, 1) blockElement(blaze).atLocal(1, 1.8, 1)
.rotate(0, 180, 0) .rotate(0, 180, 0)
@ -86,7 +86,7 @@ public class AnimatedBlazeBurner extends AnimatedKinetics {
MultiBufferSource.BufferSource buffer = mc.renderBuffers() MultiBufferSource.BufferSource buffer = mc.renderBuffers()
.bufferSource(); .bufferSource();
VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped()); VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped());
CachedBufferer.partial(AllBlockPartials.BLAZE_BURNER_FLAME, Blocks.AIR.defaultBlockState()) CachedBufferer.partial(AllPartialModels.BLAZE_BURNER_FLAME, Blocks.AIR.defaultBlockState())
.shiftUVScrolling(spriteShift, (float) uScroll, (float) vScroll) .shiftUVScrolling(spriteShift, (float) uScroll, (float) vScroll)
.light(LightTexture.FULL_BRIGHT) .light(LightTexture.FULL_BRIGHT)
.renderInto(matrixStack, vb); .renderInto(matrixStack, vb);

View file

@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.deployer.DeployerBlock; import com.simibubi.create.content.contraptions.components.deployer.DeployerBlock;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -37,11 +37,11 @@ public class AnimatedDeployer extends AnimatedKinetics {
matrixStack.pushPose(); matrixStack.pushPose();
matrixStack.translate(0, offset * 17, 0); matrixStack.translate(0, offset * 17, 0);
blockElement(AllBlockPartials.DEPLOYER_POLE) blockElement(AllPartialModels.DEPLOYER_POLE)
.rotateBlock(90, 0, 0) .rotateBlock(90, 0, 0)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
blockElement(AllBlockPartials.DEPLOYER_HAND_HOLDING) blockElement(AllPartialModels.DEPLOYER_HAND_HOLDING)
.rotateBlock(90, 0, 0) .rotateBlock(90, 0, 0)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);

View file

@ -1,8 +1,8 @@
package com.simibubi.create.compat.jei.category.animations; package com.simibubi.create.compat.jei.category.animations;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.gui.CustomLightingSettings; import com.simibubi.create.foundation.gui.CustomLightingSettings;
import com.simibubi.create.foundation.gui.ILightingSettings; import com.simibubi.create.foundation.gui.ILightingSettings;
import com.simibubi.create.foundation.gui.element.GuiGameElement; import com.simibubi.create.foundation.gui.element.GuiGameElement;
@ -49,7 +49,7 @@ public abstract class AnimatedKinetics implements IDrawable {
} }
protected PartialModel cogwheel() { protected PartialModel cogwheel() {
return AllBlockPartials.SHAFTLESS_COGWHEEL; return AllPartialModels.SHAFTLESS_COGWHEEL;
} }
protected GuiGameElement.GuiRenderBuilder blockElement(BlockState state) { protected GuiGameElement.GuiRenderBuilder blockElement(BlockState state) {

View file

@ -1,8 +1,8 @@
package com.simibubi.create.compat.jei.category.animations; package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllGuiTextures;
public class AnimatedMillstone extends AnimatedKinetics { public class AnimatedMillstone extends AnimatedKinetics {
@ -15,7 +15,7 @@ public class AnimatedMillstone extends AnimatedKinetics {
matrixStack.translate(-2, 18, 0); matrixStack.translate(-2, 18, 0);
int scale = 22; int scale = 22;
blockElement(AllBlockPartials.MILLSTONE_COG) blockElement(AllPartialModels.MILLSTONE_COG)
.rotateBlock(22.5, getCurrentAngle() * 2, 0) .rotateBlock(22.5, getCurrentAngle() * 2, 0)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);

View file

@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
@ -31,12 +31,12 @@ public class AnimatedMixer extends AnimatedKinetics {
float animation = ((Mth.sin(AnimationTickHolder.getRenderTime() / 32f) + 1) / 5) + .5f; float animation = ((Mth.sin(AnimationTickHolder.getRenderTime() / 32f) + 1) / 5) + .5f;
blockElement(AllBlockPartials.MECHANICAL_MIXER_POLE) blockElement(AllPartialModels.MECHANICAL_MIXER_POLE)
.atLocal(0, animation, 0) .atLocal(0, animation, 0)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
blockElement(AllBlockPartials.MECHANICAL_MIXER_HEAD) blockElement(AllPartialModels.MECHANICAL_MIXER_HEAD)
.rotateBlock(0, getCurrentAngle() * 4, 0) .rotateBlock(0, getCurrentAngle() * 4, 0)
.atLocal(0, animation, 0) .atLocal(0, animation, 0)
.scale(scale) .scale(scale)

View file

@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
import net.minecraft.core.Direction.Axis; import net.minecraft.core.Direction.Axis;
@ -33,7 +33,7 @@ public class AnimatedPress extends AnimatedKinetics {
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
blockElement(AllBlockPartials.MECHANICAL_PRESS_HEAD) blockElement(AllPartialModels.MECHANICAL_PRESS_HEAD)
.atLocal(0, -getAnimatedHeadOffset(), 0) .atLocal(0, -getAnimatedHeadOffset(), 0)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);

View file

@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.saw.SawBlock; import com.simibubi.create.content.contraptions.components.saw.SawBlock;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@ -32,7 +32,7 @@ public class AnimatedSaw extends AnimatedKinetics {
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
blockElement(AllBlockPartials.SAW_BLADE_VERTICAL_ACTIVE) blockElement(AllPartialModels.SAW_BLADE_VERTICAL_ACTIVE)
.rotateBlock(0, -90, -90) .rotateBlock(0, -90, -90)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);

View file

@ -6,8 +6,8 @@ import com.mojang.blaze3d.platform.Lighting;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.Tesselator; import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.fluid.FluidRenderer; import com.simibubi.create.foundation.fluid.FluidRenderer;
import com.simibubi.create.foundation.gui.UIRenderHelper; import com.simibubi.create.foundation.gui.UIRenderHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -45,15 +45,15 @@ public class AnimatedSpout extends AnimatedKinetics {
matrixStack.pushPose(); matrixStack.pushPose();
blockElement(AllBlockPartials.SPOUT_TOP) blockElement(AllPartialModels.SPOUT_TOP)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
matrixStack.translate(0, -3 * squeeze / 32f, 0); matrixStack.translate(0, -3 * squeeze / 32f, 0);
blockElement(AllBlockPartials.SPOUT_MIDDLE) blockElement(AllPartialModels.SPOUT_MIDDLE)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
matrixStack.translate(0, -3 * squeeze / 32f, 0); matrixStack.translate(0, -3 * squeeze / 32f, 0);
blockElement(AllBlockPartials.SPOUT_BOTTOM) blockElement(AllPartialModels.SPOUT_BOTTOM)
.scale(scale) .scale(scale)
.render(matrixStack); .render(matrixStack);
matrixStack.translate(0, -3 * squeeze / 32f, 0); matrixStack.translate(0, -3 * squeeze / 32f, 0);

View file

@ -66,7 +66,7 @@ public class SpoutCasting extends BlockSpoutingBehaviour {
TICON_PRESENT = Mods.TCONSTRUCT.isLoaded(); TICON_PRESENT = Mods.TCONSTRUCT.isLoaded();
if (!TICON_PRESENT) if (!TICON_PRESENT)
return false; return false;
return AllConfigs.SERVER.recipes.allowCastingBySpout.get(); return AllConfigs.server().recipes.allowCastingBySpout.get();
} }
} }

View file

@ -61,7 +61,7 @@ public class KineticDebugger {
} }
public static boolean isActive() { public static boolean isActive() {
return isF3DebugModeActive() && AllConfigs.CLIENT.rainbowDebug.get(); return isF3DebugModeActive() && AllConfigs.client().rainbowDebug.get();
} }
public static boolean isF3DebugModeActive() { public static boolean isF3DebugModeActive() {

View file

@ -234,8 +234,8 @@ public class RotationPropagator {
boolean incompatible = boolean incompatible =
Math.signum(newSpeed) != Math.signum(speedOfNeighbour) && (newSpeed != 0 && speedOfNeighbour != 0); Math.signum(newSpeed) != Math.signum(speedOfNeighbour) && (newSpeed != 0 && speedOfNeighbour != 0);
boolean tooFast = Math.abs(newSpeed) > AllConfigs.SERVER.kinetics.maxRotationSpeed.get() boolean tooFast = Math.abs(newSpeed) > AllConfigs.server().kinetics.maxRotationSpeed.get()
|| Math.abs(oppositeSpeed) > AllConfigs.SERVER.kinetics.maxRotationSpeed.get(); || Math.abs(oppositeSpeed) > AllConfigs.server().kinetics.maxRotationSpeed.get();
// Check for both the new speed and the opposite speed, just in case // Check for both the new speed and the opposite speed, just in case
boolean speedChangedTooOften = currentTE.getFlickerScore() > MAX_FLICKER_SCORE; boolean speedChangedTooOften = currentTE.getFlickerScore() > MAX_FLICKER_SCORE;

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.base;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
@ -16,7 +16,7 @@ public class HalfShaftInstance<T extends KineticBlockEntity> extends SingleRotat
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
Direction dir = getShaftDirection(); Direction dir = getShaftDirection();
return getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, dir); return getRotatingMaterial().getModel(AllPartialModels.SHAFT_HALF, blockState, dir);
} }
protected Direction getShaftDirection() { protected Direction getShaftDirection() {

View file

@ -46,10 +46,10 @@ public interface IRotate extends IWrenchable {
public float getSpeedValue() { public float getSpeedValue() {
switch (this) { switch (this) {
case FAST: case FAST:
return AllConfigs.SERVER.kinetics.fastSpeed.get() return AllConfigs.server().kinetics.fastSpeed.get()
.floatValue(); .floatValue();
case MEDIUM: case MEDIUM:
return AllConfigs.SERVER.kinetics.mediumSpeed.get() return AllConfigs.server().kinetics.mediumSpeed.get()
.floatValue(); .floatValue();
case SLOW: case SLOW:
return 1; return 1;
@ -62,9 +62,9 @@ public interface IRotate extends IWrenchable {
public static SpeedLevel of(float speed) { public static SpeedLevel of(float speed) {
speed = Math.abs(speed); speed = Math.abs(speed);
if (speed >= AllConfigs.SERVER.kinetics.fastSpeed.get()) if (speed >= AllConfigs.server().kinetics.fastSpeed.get())
return FAST; return FAST;
if (speed >= AllConfigs.SERVER.kinetics.mediumSpeed.get()) if (speed >= AllConfigs.server().kinetics.mediumSpeed.get())
return MEDIUM; return MEDIUM;
if (speed >= 1) if (speed >= 1)
return SLOW; return SLOW;
@ -128,7 +128,7 @@ public interface IRotate extends IWrenchable {
} }
public static boolean isEnabled() { public static boolean isEnabled() {
return !AllConfigs.SERVER.kinetics.disableStress.get(); return !AllConfigs.server().kinetics.disableStress.get();
} }
public static LangBuilder getFormattedStressText(double stressPercent) { public static LangBuilder getFormattedStressText(double stressPercent) {

View file

@ -102,7 +102,7 @@ public class KineticBlockEntity extends SmartBlockEntity implements IHaveGoggleI
} }
if (validationCountdown-- <= 0) { if (validationCountdown-- <= 0) {
validationCountdown = AllConfigs.SERVER.kinetics.kineticValidationFrequency.get(); validationCountdown = AllConfigs.server().kinetics.kineticValidationFrequency.get();
validateKinetics(); validateKinetics();
} }
@ -392,7 +392,7 @@ public class KineticBlockEntity extends SmartBlockEntity implements IHaveGoggleI
public boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) { public boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
boolean notFastEnough = !isSpeedRequirementFulfilled() && getSpeed() != 0; boolean notFastEnough = !isSpeedRequirementFulfilled() && getSpeed() != 0;
if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) { if (overStressed && AllConfigs.client().enableOverstressedTooltip.get()) {
Lang.translate("gui.stressometer.overstressed") Lang.translate("gui.stressometer.overstressed")
.style(GOLD) .style(GOLD)
.forGoggles(tooltip); .forGoggles(tooltip);

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.actors.flwdata.ActorData; import com.simibubi.create.content.contraptions.components.actors.flwdata.ActorData;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
@ -39,7 +39,7 @@ public class DrillActorInstance extends ActorInstance {
else else
eulerY = facing.toYRot() + ((axis == Direction.Axis.X) ? 180 : 0); eulerY = facing.toYRot() + ((axis == Direction.Axis.X) ? 180 : 0);
drillHead = material.getModel(AllBlockPartials.DRILL_HEAD, state).createInstance(); drillHead = material.getModel(AllPartialModels.DRILL_HEAD, state).createInstance();
drillHead.setPosition(context.localPos) drillHead.setPosition(context.localPos)
.setBlockLight(localBlockLight()) .setBlockLight(localBlockLight())

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.actors;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -20,6 +20,6 @@ public class DrillInstance extends SingleRotatingInstance<DrillBlockEntity> {
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
BlockState referenceState = blockEntity.getBlockState(); BlockState referenceState = blockEntity.getBlockState();
Direction facing = referenceState.getValue(BlockStateProperties.FACING); Direction facing = referenceState.getValue(BlockStateProperties.FACING);
return getRotatingMaterial().getModel(AllBlockPartials.DRILL_HEAD, referenceState, facing); return getRotatingMaterial().getModel(AllPartialModels.DRILL_HEAD, referenceState, facing);
} }
} }

View file

@ -1,7 +1,7 @@
package com.simibubi.create.content.contraptions.components.actors; package com.simibubi.create.content.contraptions.components.actors;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
@ -26,13 +26,13 @@ public class DrillRenderer extends KineticBlockEntityRenderer<DrillBlockEntity>
@Override @Override
protected SuperByteBuffer getRotatedModel(DrillBlockEntity be, BlockState state) { protected SuperByteBuffer getRotatedModel(DrillBlockEntity be, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.DRILL_HEAD, state); return CachedBufferer.partialFacing(AllPartialModels.DRILL_HEAD, state);
} }
public static void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld, public static void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld,
ContraptionMatrices matrices, MultiBufferSource buffer) { ContraptionMatrices matrices, MultiBufferSource buffer) {
BlockState state = context.state; BlockState state = context.state;
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.DRILL_HEAD, state); SuperByteBuffer superBuffer = CachedBufferer.partial(AllPartialModels.DRILL_HEAD, state);
Direction facing = state.getValue(DrillBlock.FACING); Direction facing = state.getValue(DrillBlock.FACING);
float speed = (float) (context.contraption.stalled float speed = (float) (context.contraption.stalled

View file

@ -5,7 +5,7 @@ import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
@ -41,7 +41,7 @@ public class HarvesterActorInstance extends ActorInstance {
facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING); facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING);
harvester = material.getModel(AllBlockPartials.HARVESTER_BLADE, state).createInstance(); harvester = material.getModel(AllPartialModels.HARVESTER_BLADE, state).createInstance();
horizontalAngle = facing.toYRot() + ((facing.getAxis() == Direction.Axis.X) ? 180 : 0); horizontalAngle = facing.toYRot() + ((facing.getAxis() == Direction.Axis.X) ? 180 : 0);

View file

@ -97,7 +97,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour {
MutableBoolean seedSubtracted = new MutableBoolean(notCropButCuttable); MutableBoolean seedSubtracted = new MutableBoolean(notCropButCuttable);
BlockState state = stateVisited; BlockState state = stateVisited;
BlockHelper.destroyBlockAs(world, pos, null, item, effectChance, stack -> { BlockHelper.destroyBlockAs(world, pos, null, item, effectChance, stack -> {
if (AllConfigs.SERVER.kinetics.harvesterReplants.get() && !seedSubtracted.getValue() if (AllConfigs.server().kinetics.harvesterReplants.get() && !seedSubtracted.getValue()
&& stack.sameItem(new ItemStack(state.getBlock()))) { && stack.sameItem(new ItemStack(state.getBlock()))) {
stack.shrink(1); stack.shrink(1);
seedSubtracted.setTrue(); seedSubtracted.setTrue();
@ -110,8 +110,8 @@ public class HarvesterMovementBehaviour implements MovementBehaviour {
} }
public boolean isValidCrop(Level world, BlockPos pos, BlockState state) { public boolean isValidCrop(Level world, BlockPos pos, BlockState state) {
boolean harvestPartial = AllConfigs.SERVER.kinetics.harvestPartiallyGrown.get(); boolean harvestPartial = AllConfigs.server().kinetics.harvestPartiallyGrown.get();
boolean replant = AllConfigs.SERVER.kinetics.harvesterReplants.get(); boolean replant = AllConfigs.server().kinetics.harvesterReplants.get();
if (state.getBlock() instanceof CropBlock) { if (state.getBlock() instanceof CropBlock) {
CropBlock crop = (CropBlock) state.getBlock(); CropBlock crop = (CropBlock) state.getBlock();
@ -175,7 +175,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour {
} }
private BlockState cutCrop(Level world, BlockPos pos, BlockState state) { private BlockState cutCrop(Level world, BlockPos pos, BlockState state) {
if (!AllConfigs.SERVER.kinetics.harvesterReplants.get()) { if (!AllConfigs.server().kinetics.harvesterReplants.get()) {
if (state.getFluidState() if (state.getFluidState()
.isEmpty()) .isEmpty())
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();

View file

@ -4,7 +4,7 @@ import static net.minecraft.world.level.block.state.properties.BlockStatePropert
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
@ -33,7 +33,7 @@ public class HarvesterRenderer extends SafeBlockEntityRenderer<HarvesterBlockEnt
protected void renderSafe(HarvesterBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer, protected void renderSafe(HarvesterBlockEntity be, float partialTicks, PoseStack ms, MultiBufferSource buffer,
int light, int overlay) { int light, int overlay) {
BlockState blockState = be.getBlockState(); BlockState blockState = be.getBlockState();
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.HARVESTER_BLADE, blockState); SuperByteBuffer superBuffer = CachedBufferer.partial(AllPartialModels.HARVESTER_BLADE, blockState);
transform(be.getLevel(), blockState.getValue(HarvesterBlock.FACING), superBuffer, transform(be.getLevel(), blockState.getValue(HarvesterBlock.FACING), superBuffer,
be.getAnimatedSpeed()); be.getAnimatedSpeed());
superBuffer.light(light) superBuffer.light(light)
@ -44,7 +44,7 @@ public class HarvesterRenderer extends SafeBlockEntityRenderer<HarvesterBlockEnt
ContraptionMatrices matrices, MultiBufferSource buffers) { ContraptionMatrices matrices, MultiBufferSource buffers) {
BlockState blockState = context.state; BlockState blockState = context.state;
Direction facing = blockState.getValue(HORIZONTAL_FACING); Direction facing = blockState.getValue(HORIZONTAL_FACING);
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.HARVESTER_BLADE, blockState); SuperByteBuffer superBuffer = CachedBufferer.partial(AllPartialModels.HARVESTER_BLADE, blockState);
float speed = (float) (!VecHelper.isVecPointingTowards(context.relativeMotion, facing.getOpposite()) float speed = (float) (!VecHelper.isVecPointingTowards(context.relativeMotion, facing.getOpposite())
? context.getAnimationSpeed() ? context.getAnimationSpeed()
: 0); : 0);

View file

@ -191,7 +191,7 @@ public abstract class PortableStorageInterfaceBlockEntity extends SmartBlockEnti
} }
protected Integer getTransferTimeout() { protected Integer getTransferTimeout() {
return AllConfigs.SERVER.logistics.psiTimeout.get(); return AllConfigs.server().logistics.psiTimeout.get();
} }
@Override @Override

View file

@ -7,8 +7,8 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
@ -103,16 +103,16 @@ public class PortableStorageInterfaceRenderer extends SafeBlockEntityRenderer<Po
static PartialModel getMiddleForState(BlockState state, boolean lit) { static PartialModel getMiddleForState(BlockState state, boolean lit) {
if (AllBlocks.PORTABLE_FLUID_INTERFACE.has(state)) if (AllBlocks.PORTABLE_FLUID_INTERFACE.has(state))
return lit ? AllBlockPartials.PORTABLE_FLUID_INTERFACE_MIDDLE_POWERED return lit ? AllPartialModels.PORTABLE_FLUID_INTERFACE_MIDDLE_POWERED
: AllBlockPartials.PORTABLE_FLUID_INTERFACE_MIDDLE; : AllPartialModels.PORTABLE_FLUID_INTERFACE_MIDDLE;
return lit ? AllBlockPartials.PORTABLE_STORAGE_INTERFACE_MIDDLE_POWERED return lit ? AllPartialModels.PORTABLE_STORAGE_INTERFACE_MIDDLE_POWERED
: AllBlockPartials.PORTABLE_STORAGE_INTERFACE_MIDDLE; : AllPartialModels.PORTABLE_STORAGE_INTERFACE_MIDDLE;
} }
static PartialModel getTopForState(BlockState state) { static PartialModel getTopForState(BlockState state) {
if (AllBlocks.PORTABLE_FLUID_INTERFACE.has(state)) if (AllBlocks.PORTABLE_FLUID_INTERFACE.has(state))
return AllBlockPartials.PORTABLE_FLUID_INTERFACE_TOP; return AllPartialModels.PORTABLE_FLUID_INTERFACE_TOP;
return AllBlockPartials.PORTABLE_STORAGE_INTERFACE_TOP; return AllPartialModels.PORTABLE_STORAGE_INTERFACE_TOP;
} }
} }

View file

@ -101,7 +101,7 @@ public class ContraptionControlsMovingInteraction extends MovingInteractionBehav
} }
private void send(AbstractContraptionEntity contraptionEntity, ItemStack filter, boolean disable) { private void send(AbstractContraptionEntity contraptionEntity, ItemStack filter, boolean disable) {
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> contraptionEntity), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> contraptionEntity),
new ContraptionDisableActorPacket(contraptionEntity.getId(), filter, !disable)); new ContraptionDisableActorPacket(contraptionEntity.getId(), filter, !disable));
} }
@ -118,7 +118,7 @@ public class ContraptionControlsMovingInteraction extends MovingInteractionBehav
if (efs.currentTargetY == contraption.clientYTarget) if (efs.currentTargetY == contraption.clientYTarget)
return false; return false;
AllPackets.channel.sendToServer(new ElevatorTargetFloorPacket(contraptionEntity, efs.currentTargetY)); AllPackets.getChannel().sendToServer(new ElevatorTargetFloorPacket(contraptionEntity, efs.currentTargetY));
if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte) if (contraption.presentBlockEntities.get(ctx.localPos)instanceof ContraptionControlsBlockEntity cte)
cte.pressButton(); cte.pressButton();
return true; return true;

View file

@ -6,8 +6,8 @@ import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.actors.controls.ContraptionControlsMovement.ElevatorFloorSelection; import com.simibubi.create.content.contraptions.components.actors.controls.ContraptionControlsMovement.ElevatorFloorSelection;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
@ -55,14 +55,14 @@ public class ContraptionControlsRenderer extends SmartBlockEntityRenderer<Contra
super.renderSafe(blockEntity, pt, ms, buffer, light, overlay); super.renderSafe(blockEntity, pt, ms, buffer, light, overlay);
VertexConsumer vc = buffer.getBuffer(RenderType.solid()); VertexConsumer vc = buffer.getBuffer(RenderType.solid());
CachedBufferer.partialFacing(AllBlockPartials.CONTRAPTION_CONTROLS_BUTTON, blockState, facing) CachedBufferer.partialFacing(AllPartialModels.CONTRAPTION_CONTROLS_BUTTON, blockState, facing)
.light(light) .light(light)
.renderInto(ms, vc); .renderInto(ms, vc);
ms.popPose(); ms.popPose();
int i = (((int) blockEntity.indicator.getValue(pt) / 45) % 8) + 8; int i = (((int) blockEntity.indicator.getValue(pt) / 45) % 8) + 8;
CachedBufferer.partialFacing(AllBlockPartials.CONTRAPTION_CONTROLS_INDICATOR.get(i % 8), blockState, facing) CachedBufferer.partialFacing(AllPartialModels.CONTRAPTION_CONTROLS_INDICATOR.get(i % 8), blockState, facing)
.light(light) .light(light)
.renderInto(ms, vc); .renderInto(ms, vc);
} }

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.clock;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.components.clock.CuckooClockBlockEntity.Animation; import com.simibubi.create.content.contraptions.components.clock.CuckooClockBlockEntity.Animation;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
@ -36,8 +36,8 @@ public class CuckooClockRenderer extends KineticBlockEntityRenderer<CuckooClockB
VertexConsumer vb = buffer.getBuffer(RenderType.solid()); VertexConsumer vb = buffer.getBuffer(RenderType.solid());
// Render Hands // Render Hands
SuperByteBuffer hourHand = CachedBufferer.partial(AllBlockPartials.CUCKOO_HOUR_HAND, blockState); SuperByteBuffer hourHand = CachedBufferer.partial(AllPartialModels.CUCKOO_HOUR_HAND, blockState);
SuperByteBuffer minuteHand = CachedBufferer.partial(AllBlockPartials.CUCKOO_MINUTE_HAND, blockState); SuperByteBuffer minuteHand = CachedBufferer.partial(AllPartialModels.CUCKOO_MINUTE_HAND, blockState);
float hourAngle = be.hourHand.getValue(partialTicks); float hourAngle = be.hourHand.getValue(partialTicks);
float minuteAngle = be.minuteHand.getValue(partialTicks); float minuteAngle = be.minuteHand.getValue(partialTicks);
rotateHand(hourHand, hourAngle, direction).light(light) rotateHand(hourHand, hourAngle, direction).light(light)
@ -46,8 +46,8 @@ public class CuckooClockRenderer extends KineticBlockEntityRenderer<CuckooClockB
.renderInto(ms, vb); .renderInto(ms, vb);
// Doors // Doors
SuperByteBuffer leftDoor = CachedBufferer.partial(AllBlockPartials.CUCKOO_LEFT_DOOR, blockState); SuperByteBuffer leftDoor = CachedBufferer.partial(AllPartialModels.CUCKOO_LEFT_DOOR, blockState);
SuperByteBuffer rightDoor = CachedBufferer.partial(AllBlockPartials.CUCKOO_RIGHT_DOOR, blockState); SuperByteBuffer rightDoor = CachedBufferer.partial(AllPartialModels.CUCKOO_RIGHT_DOOR, blockState);
float angle = 0; float angle = 0;
float offset = 0; float offset = 0;
@ -76,7 +76,7 @@ public class CuckooClockRenderer extends KineticBlockEntityRenderer<CuckooClockB
// Figure // Figure
if (be.animationType != Animation.NONE) { if (be.animationType != Animation.NONE) {
offset = -(angle / 135) * 1 / 2f + 10 / 16f; offset = -(angle / 135) * 1 / 2f + 10 / 16f;
PartialModel partialModel = (be.animationType == Animation.PIG ? AllBlockPartials.CUCKOO_PIG : AllBlockPartials.CUCKOO_CREEPER); PartialModel partialModel = (be.animationType == Animation.PIG ? AllPartialModels.CUCKOO_PIG : AllPartialModels.CUCKOO_CREEPER);
SuperByteBuffer figure = SuperByteBuffer figure =
CachedBufferer.partial(partialModel, blockState); CachedBufferer.partial(partialModel, blockState);
figure.rotateCentered(Direction.UP, AngleHelper.rad(AngleHelper.horizontalAngle(direction.getCounterClockWise()))); figure.rotateCentered(Direction.UP, AngleHelper.rad(AngleHelper.horizontalAngle(direction.getCounterClockWise())));
@ -89,7 +89,7 @@ public class CuckooClockRenderer extends KineticBlockEntityRenderer<CuckooClockB
@Override @Override
protected SuperByteBuffer getRotatedModel(CuckooClockBlockEntity be, BlockState state) { protected SuperByteBuffer getRotatedModel(CuckooClockBlockEntity be, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, state, state return CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, state, state
.getValue(CuckooClockBlock.HORIZONTAL_FACING) .getValue(CuckooClockBlock.HORIZONTAL_FACING)
.getOpposite()); .getOpposite());
} }

View file

@ -9,7 +9,7 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.AllSpriteShifts; import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterBlockEntity.Phase; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterBlockEntity.Phase;
import com.simibubi.create.content.contraptions.components.crafter.RecipeGridHandler.GroupedItems; import com.simibubi.create.content.contraptions.components.crafter.RecipeGridHandler.GroupedItems;
@ -170,7 +170,7 @@ public class MechanicalCrafterRenderer extends SafeBlockEntityRenderer<Mechanica
VertexConsumer vb = buffer.getBuffer(RenderType.solid()); VertexConsumer vb = buffer.getBuffer(RenderType.solid());
if (!Backend.canUseInstancing(be.getLevel())) { if (!Backend.canUseInstancing(be.getLevel())) {
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState); SuperByteBuffer superBuffer = CachedBufferer.partial(AllPartialModels.SHAFTLESS_COGWHEEL, blockState);
standardKineticRotationTransform(superBuffer, be, light); standardKineticRotationTransform(superBuffer, be, light);
superBuffer.rotateCentered(Direction.UP, (float) (blockState.getValue(HORIZONTAL_FACING) superBuffer.rotateCentered(Direction.UP, (float) (blockState.getValue(HORIZONTAL_FACING)
.getAxis() != Direction.Axis.X ? 0 : Math.PI / 2)); .getAxis() != Direction.Axis.X ? 0 : Math.PI / 2));
@ -182,15 +182,15 @@ public class MechanicalCrafterRenderer extends SafeBlockEntityRenderer<Mechanica
BlockPos pos = be.getBlockPos(); BlockPos pos = be.getBlockPos();
if ((be.covered || be.phase != Phase.IDLE) && be.phase != Phase.CRAFTING && be.phase != Phase.INSERTING) { if ((be.covered || be.phase != Phase.IDLE) && be.phase != Phase.CRAFTING && be.phase != Phase.INSERTING) {
SuperByteBuffer lidBuffer = renderAndTransform(AllBlockPartials.MECHANICAL_CRAFTER_LID, blockState); SuperByteBuffer lidBuffer = renderAndTransform(AllPartialModels.MECHANICAL_CRAFTER_LID, blockState);
lidBuffer.light(light) lidBuffer.light(light)
.renderInto(ms, vb); .renderInto(ms, vb);
} }
if (MechanicalCrafterBlock.isValidTarget(be.getLevel(), pos.relative(targetDirection), blockState)) { if (MechanicalCrafterBlock.isValidTarget(be.getLevel(), pos.relative(targetDirection), blockState)) {
SuperByteBuffer beltBuffer = renderAndTransform(AllBlockPartials.MECHANICAL_CRAFTER_BELT, blockState); SuperByteBuffer beltBuffer = renderAndTransform(AllPartialModels.MECHANICAL_CRAFTER_BELT, blockState);
SuperByteBuffer beltFrameBuffer = SuperByteBuffer beltFrameBuffer =
renderAndTransform(AllBlockPartials.MECHANICAL_CRAFTER_BELT_FRAME, blockState); renderAndTransform(AllPartialModels.MECHANICAL_CRAFTER_BELT_FRAME, blockState);
if (be.phase == Phase.EXPORTING) { if (be.phase == Phase.EXPORTING) {
int textureIndex = (int) ((be.getCountDownSpeed() / 128f * AnimationTickHolder.getTicks())); int textureIndex = (int) ((be.getCountDownSpeed() / 128f * AnimationTickHolder.getTicks()));
@ -203,7 +203,7 @@ public class MechanicalCrafterRenderer extends SafeBlockEntityRenderer<Mechanica
.renderInto(ms, vb); .renderInto(ms, vb);
} else { } else {
SuperByteBuffer arrowBuffer = renderAndTransform(AllBlockPartials.MECHANICAL_CRAFTER_ARROW, blockState); SuperByteBuffer arrowBuffer = renderAndTransform(AllPartialModels.MECHANICAL_CRAFTER_ARROW, blockState);
arrowBuffer.light(light) arrowBuffer.light(light)
.renderInto(ms, vb); .renderInto(ms, vb);
} }

View file

@ -144,7 +144,7 @@ public class RecipeGridHandler {
items.calcStats(); items.calcStats();
CraftingContainer craftinginventory = new MechanicalCraftingInventory(items); CraftingContainer craftinginventory = new MechanicalCraftingInventory(items);
ItemStack result = null; ItemStack result = null;
if (AllConfigs.SERVER.recipes.allowRegularCraftingInCrafter.get()) if (AllConfigs.server().recipes.allowRegularCraftingInCrafter.get())
result = world.getRecipeManager() result = world.getRecipeManager()
.getRecipeFor(RecipeType.CRAFTING, craftinginventory, world) .getRecipeFor(RecipeType.CRAFTING, craftinginventory, world)
.filter(r -> isRecipeAllowed(r, craftinginventory)) .filter(r -> isRecipeAllowed(r, craftinginventory))
@ -165,7 +165,7 @@ public class RecipeGridHandler {
numItems++; numItems++;
} }
} }
if (numItems > AllConfigs.SERVER.recipes.maxFireworkIngredientsInCrafter.get()) { if (numItems > AllConfigs.server().recipes.maxFireworkIngredientsInCrafter.get()) {
return false; return false;
} }
} }

View file

@ -6,7 +6,7 @@ import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -23,7 +23,7 @@ public class ShaftlessCogwheelInstance extends SingleRotatingInstance<KineticBlo
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
Direction facing = blockState.getValue(MechanicalCrafterBlock.HORIZONTAL_FACING); Direction facing = blockState.getValue(MechanicalCrafterBlock.HORIZONTAL_FACING);
return getRotatingMaterial().getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState, facing, rotateToFace(facing)); return getRotatingMaterial().getModel(AllPartialModels.SHAFTLESS_COGWHEEL, blockState, facing, rotateToFace(facing));
} }
private Supplier<PoseStack> rotateToFace(Direction facing) { private Supplier<PoseStack> rotateToFace(Direction facing) {

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.crank;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockEntityTypes; import com.simibubi.create.AllBlockEntityTypes;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.AllShapes; import com.simibubi.create.AllShapes;
import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock; import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock;
import com.simibubi.create.foundation.advancement.AllAdvancements; import com.simibubi.create.foundation.advancement.AllAdvancements;
@ -55,7 +55,7 @@ public class HandCrankBlock extends DirectionalKineticBlock
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public PartialModel getRenderedHandle() { public PartialModel getRenderedHandle() {
return AllBlockPartials.HAND_CRANK_HANDLE; return AllPartialModels.HAND_CRANK_HANDLE;
} }
public int getRotationSpeed() { public int getRotationSpeed() {
@ -74,7 +74,7 @@ public class HandCrankBlock extends DirectionalKineticBlock
return InteractionResult.PASS; return InteractionResult.PASS;
withBlockEntityDo(worldIn, pos, be -> be.turn(player.isShiftKeyDown())); withBlockEntityDo(worldIn, pos, be -> be.turn(player.isShiftKeyDown()));
player.causeFoodExhaustion(getRotationSpeed() * AllConfigs.SERVER.kinetics.crankHungerMultiplier.getF()); player.causeFoodExhaustion(getRotationSpeed() * AllConfigs.server().kinetics.crankHungerMultiplier.getF());
if (player.getFoodData() if (player.getFoodData()
.getFoodLevel() == 0) .getFoodLevel() == 0)

View file

@ -218,7 +218,7 @@ public class CrushingWheelControllerBlockEntity extends SmartBlockEntity {
if (!(processingEntity instanceof ItemEntity)) { if (!(processingEntity instanceof ItemEntity)) {
Vec3 entityOutPos = outPos.add(facing.getAxis() == Axis.X ? .5f * offset : 0f, Vec3 entityOutPos = outPos.add(facing.getAxis() == Axis.X ? .5f * offset : 0f,
facing.getAxis() == Axis.Y ? .5f * offset : 0f, facing.getAxis() == Axis.Z ? .5f * offset : 0f); facing.getAxis() == Axis.Y ? .5f * offset : 0f, facing.getAxis() == Axis.Z ? .5f * offset : 0f);
int crusherDamage = AllConfigs.SERVER.kinetics.crushingDamage.get(); int crusherDamage = AllConfigs.server().kinetics.crushingDamage.get();
if (processingEntity instanceof LivingEntity) { if (processingEntity instanceof LivingEntity) {
if ((((LivingEntity) processingEntity).getHealth() - crusherDamage <= 0) // Takes LivingEntity instances if ((((LivingEntity) processingEntity).getHealth() - crusherDamage <= 0) // Takes LivingEntity instances

View file

@ -11,7 +11,7 @@ import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityInstance; import com.simibubi.create.content.contraptions.base.KineticBlockEntityInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -61,7 +61,7 @@ public class DeployerActorInstance extends ActorInstance {
xRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0; xRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0;
zRot = rotatePole ? 90 : 0; zRot = rotatePole ? 90 : 0;
pole = mat.getModel(AllBlockPartials.DEPLOYER_POLE, state).createInstance(); pole = mat.getModel(AllPartialModels.DEPLOYER_POLE, state).createInstance();
hand = mat.getModel(handPose, state).createInstance(); hand = mat.getModel(handPose, state).createInstance();
Direction.Axis axis = ((IRotate) state.getBlock()).getRotationAxis(state); Direction.Axis axis = ((IRotate) state.getBlock()).getRotationAxis(state);

View file

@ -9,8 +9,8 @@ import java.util.List;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.AllRecipeTypes;
import com.simibubi.create.content.contraptions.base.IRotate.StressImpact; import com.simibubi.create.content.contraptions.base.IRotate.StressImpact;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
@ -425,8 +425,8 @@ public class DeployerBlockEntity extends KineticBlockEntity {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
public PartialModel getHandPose() { public PartialModel getHandPose() {
return mode == Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING return mode == Mode.PUNCH ? AllPartialModels.DEPLOYER_HAND_PUNCHING
: heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING; : heldItem.isEmpty() ? AllPartialModels.DEPLOYER_HAND_POINTING : AllPartialModels.DEPLOYER_HAND_HOLDING;
} }
@Override @Override
@ -519,8 +519,8 @@ public class DeployerBlockEntity extends KineticBlockEntity {
} }
if (state == State.RETRACTING) if (state == State.RETRACTING)
progress = (timer - partialTicks * timerSpeed) / 1000f; progress = (timer - partialTicks * timerSpeed) / 1000f;
float handLength = handPose == AllBlockPartials.DEPLOYER_HAND_POINTING ? 0 float handLength = handPose == AllPartialModels.DEPLOYER_HAND_POINTING ? 0
: handPose == AllBlockPartials.DEPLOYER_HAND_HOLDING ? 4 / 16f : 3 / 16f; : handPose == AllPartialModels.DEPLOYER_HAND_HOLDING ? 4 / 16f : 3 / 16f;
float distance = Math.min(Mth.clamp(progress, 0, 1) * (reach + handLength), 21 / 16f); float distance = Math.min(Mth.clamp(progress, 0, 1) * (reach + handLength), 21 / 16f);
return distance; return distance;

View file

@ -141,7 +141,7 @@ public class DeployerFakePlayer extends FakePlayer {
return; return;
Mob mob = (Mob) entityLiving; Mob mob = (Mob) entityLiving;
CKinetics.DeployerAggroSetting setting = AllConfigs.SERVER.kinetics.ignoreDeployerAttacks.get(); CKinetics.DeployerAggroSetting setting = AllConfigs.server().kinetics.ignoreDeployerAttacks.get();
switch (setting) { switch (setting) {
case ALL: case ALL:

View file

@ -9,7 +9,7 @@ import com.jozufozu.flywheel.api.instance.TickableInstance;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance; import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -44,7 +44,7 @@ public class DeployerInstance extends ShaftInstance<DeployerBlockEntity> impleme
xRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0; xRot = facing == Direction.UP ? 270 : facing == Direction.DOWN ? 90 : 0;
zRot = rotatePole ? 90 : 0; zRot = rotatePole ? 90 : 0;
pole = getOrientedMaterial().getModel(AllBlockPartials.DEPLOYER_POLE, blockState).createInstance(); pole = getOrientedMaterial().getModel(AllPartialModels.DEPLOYER_POLE, blockState).createInstance();
currentHand = this.blockEntity.getHandPose(); currentHand = this.blockEntity.getHandPose();
@ -104,8 +104,8 @@ public class DeployerInstance extends ShaftInstance<DeployerBlockEntity> impleme
} }
private void updatePosition() { private void updatePosition() {
float handLength = currentHand == AllBlockPartials.DEPLOYER_HAND_POINTING ? 0 float handLength = currentHand == AllPartialModels.DEPLOYER_HAND_POINTING ? 0
: currentHand == AllBlockPartials.DEPLOYER_HAND_HOLDING ? 4 / 16f : 3 / 16f; : currentHand == AllPartialModels.DEPLOYER_HAND_HOLDING ? 4 / 16f : 3 / 16f;
float distance = Math.min(Mth.clamp(progress, 0, 1) * (blockEntity.reach + handLength), 21 / 16f); float distance = Math.min(Mth.clamp(progress, 0, 1) * (blockEntity.reach + handLength), 21 / 16f);
Vec3i facingVec = facing.getNormal(); Vec3i facingVec = facing.getNormal();
BlockPos blockPos = getInstancePosition(); BlockPos blockPos = getInstancePosition();

View file

@ -10,8 +10,8 @@ import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.IRotate;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
@ -120,7 +120,7 @@ public class DeployerRenderer extends SafeBlockEntityRenderer<DeployerBlockEntit
BlockState blockState = be.getBlockState(); BlockState blockState = be.getBlockState();
Vec3 offset = getHandOffset(be, partialTicks, blockState); Vec3 offset = getHandOffset(be, partialTicks, blockState);
SuperByteBuffer pole = CachedBufferer.partial(AllBlockPartials.DEPLOYER_POLE, blockState); SuperByteBuffer pole = CachedBufferer.partial(AllPartialModels.DEPLOYER_POLE, blockState);
SuperByteBuffer hand = CachedBufferer.partial(be.getHandPose(), blockState); SuperByteBuffer hand = CachedBufferer.partial(be.getHandPose(), blockState);
transform(pole.translate(offset.x, offset.y, offset.z), blockState, true) transform(pole.translate(offset.x, offset.y, offset.z), blockState, true)
@ -167,7 +167,7 @@ public class DeployerRenderer extends SafeBlockEntityRenderer<DeployerBlockEntit
speed = 0; speed = 0;
SuperByteBuffer shaft = CachedBufferer.block(AllBlocks.SHAFT.getDefaultState()); SuperByteBuffer shaft = CachedBufferer.block(AllBlocks.SHAFT.getDefaultState());
SuperByteBuffer pole = CachedBufferer.partial(AllBlockPartials.DEPLOYER_POLE, blockState); SuperByteBuffer pole = CachedBufferer.partial(AllPartialModels.DEPLOYER_POLE, blockState);
SuperByteBuffer hand = CachedBufferer.partial(handPose, blockState); SuperByteBuffer hand = CachedBufferer.partial(handPose, blockState);
double factor; double factor;
@ -225,7 +225,7 @@ public class DeployerRenderer extends SafeBlockEntityRenderer<DeployerBlockEntit
} }
static PartialModel getHandPose(DeployerBlockEntity.Mode mode) { static PartialModel getHandPose(DeployerBlockEntity.Mode mode) {
return mode == DeployerBlockEntity.Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING : AllBlockPartials.DEPLOYER_HAND_POINTING; return mode == DeployerBlockEntity.Mode.PUNCH ? AllPartialModels.DEPLOYER_HAND_PUNCHING : AllPartialModels.DEPLOYER_HAND_POINTING;
} }
} }

View file

@ -69,7 +69,7 @@ public class AirCurrent {
Vec3 pos = VecHelper.getCenterOf(source.getAirCurrentPos()) Vec3 pos = VecHelper.getCenterOf(source.getAirCurrentPos())
.add(Vec3.atLowerCornerOf(facing.getNormal()) .add(Vec3.atLowerCornerOf(facing.getNormal())
.scale(offset)); .scale(offset));
if (world.random.nextFloat() < AllConfigs.CLIENT.fanParticleDensity.get()) if (world.random.nextFloat() < AllConfigs.client().fanParticleDensity.get())
world.addParticle(new AirFlowParticleData(source.getAirCurrentPos()), pos.x, pos.y, pos.z, 0, 0, 0); world.addParticle(new AirFlowParticleData(source.getAirCurrentPos()), pos.x, pos.y, pos.z, 0, 0, 0);
} }

View file

@ -128,7 +128,7 @@ public class EncasedFanBlockEntity extends KineticBlockEntity implements IAirCur
boolean server = !level.isClientSide || isVirtual(); boolean server = !level.isClientSide || isVirtual();
if (server && airCurrentUpdateCooldown-- <= 0) { if (server && airCurrentUpdateCooldown-- <= 0) {
airCurrentUpdateCooldown = AllConfigs.SERVER.kinetics.fanBlockCheckRate.get(); airCurrentUpdateCooldown = AllConfigs.server().kinetics.fanBlockCheckRate.get();
updateAirFlow = true; updateAirFlow = true;
} }

View file

@ -5,7 +5,7 @@ import static net.minecraft.world.level.block.state.properties.BlockStatePropert
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -37,9 +37,9 @@ public class EncasedFanRenderer extends KineticBlockEntityRenderer<EncasedFanBlo
int lightInFront = LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().relative(direction)); int lightInFront = LevelRenderer.getLightColor(be.getLevel(), be.getBlockPos().relative(direction));
SuperByteBuffer shaftHalf = SuperByteBuffer shaftHalf =
CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, be.getBlockState(), direction.getOpposite()); CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, be.getBlockState(), direction.getOpposite());
SuperByteBuffer fanInner = SuperByteBuffer fanInner =
CachedBufferer.partialFacing(AllBlockPartials.ENCASED_FAN_INNER, be.getBlockState(), direction.getOpposite()); CachedBufferer.partialFacing(AllPartialModels.ENCASED_FAN_INNER, be.getBlockState(), direction.getOpposite());
float time = AnimationTickHolder.getRenderTime(be.getLevel()); float time = AnimationTickHolder.getRenderTime(be.getLevel());
float speed = be.getSpeed() * 5; float speed = be.getSpeed() * 5;

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.fan;
import static net.minecraft.world.level.block.state.properties.BlockStateProperties.FACING; import static net.minecraft.world.level.block.state.properties.BlockStateProperties.FACING;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityInstance; import com.simibubi.create.content.contraptions.base.KineticBlockEntityInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import com.simibubi.create.foundation.render.AllMaterialSpecs; import com.simibubi.create.foundation.render.AllMaterialSpecs;
@ -25,10 +25,10 @@ public class FanInstance extends KineticBlockEntityInstance<EncasedFanBlockEntit
direction = blockState.getValue(FACING); direction = blockState.getValue(FACING);
opposite = direction.getOpposite(); opposite = direction.getOpposite();
shaft = getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, opposite).createInstance(); shaft = getRotatingMaterial().getModel(AllPartialModels.SHAFT_HALF, blockState, opposite).createInstance();
fan = materialManager.defaultCutout() fan = materialManager.defaultCutout()
.material(AllMaterialSpecs.ROTATING) .material(AllMaterialSpecs.ROTATING)
.getModel(AllBlockPartials.ENCASED_FAN_INNER, blockState, opposite) .getModel(AllPartialModels.ENCASED_FAN_INNER, blockState, opposite)
.createInstance(); .createInstance();
setup(shaft); setup(shaft);

View file

@ -30,7 +30,7 @@ public interface IAirCurrentSource {
default float getMaxDistance() { default float getMaxDistance() {
float speed = Math.abs(this.getSpeed()); float speed = Math.abs(this.getSpeed());
CKinetics config = AllConfigs.SERVER.kinetics; CKinetics config = AllConfigs.server().kinetics;
float distanceFactor = Math.min(speed / config.fanRotationArgmax.get(), 1); float distanceFactor = Math.min(speed / config.fanRotationArgmax.get(), 1);
float pushDistance = Mth.lerp(distanceFactor, 3, config.fanPushDistance.get()); float pushDistance = Mth.lerp(distanceFactor, 3, config.fanPushDistance.get());
float pullDistance = Mth.lerp(distanceFactor, 3f, config.fanPullDistance.get()); float pullDistance = Mth.lerp(distanceFactor, 3f, config.fanPullDistance.get());

View file

@ -77,7 +77,7 @@ public class NozzleBlockEntity extends SmartBlockEntity {
Vec3 center = VecHelper.getCenterOf(worldPosition); Vec3 center = VecHelper.getCenterOf(worldPosition);
if (level.isClientSide && range != 0) { if (level.isClientSide && range != 0) {
if (level.random.nextInt( if (level.random.nextInt(
Mth.clamp((AllConfigs.SERVER.kinetics.fanPushDistance.get() - (int) range), 1, 10)) == 0) { Mth.clamp((AllConfigs.server().kinetics.fanPushDistance.get() - (int) range), 1, 10)) == 0) {
Vec3 start = VecHelper.offsetRandomly(center, level.random, pushing ? 1 : range / 2); Vec3 start = VecHelper.offsetRandomly(center, level.random, pushing ? 1 : range / 2);
Vec3 motion = center.subtract(start) Vec3 motion = center.subtract(start)
.normalize() .normalize()

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.millstone;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -14,6 +14,6 @@ public class MillstoneCogInstance extends SingleRotatingInstance<MillstoneBlockE
@Override @Override
protected Instancer<RotatingData> getModel() { protected Instancer<RotatingData> getModel() {
return getRotatingMaterial().getModel(AllBlockPartials.MILLSTONE_COG, blockEntity.getBlockState()); return getRotatingMaterial().getModel(AllPartialModels.MILLSTONE_COG, blockEntity.getBlockState());
} }
} }

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.contraptions.components.millstone; package com.simibubi.create.content.contraptions.components.millstone;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -16,7 +16,7 @@ public class MillstoneRenderer extends KineticBlockEntityRenderer<MillstoneBlock
@Override @Override
protected SuperByteBuffer getRotatedModel(MillstoneBlockEntity be, BlockState state) { protected SuperByteBuffer getRotatedModel(MillstoneBlockEntity be, BlockState state) {
return CachedBufferer.partial(AllBlockPartials.MILLSTONE_COG, state); return CachedBufferer.partial(AllPartialModels.MILLSTONE_COG, state);
} }
} }

View file

@ -218,7 +218,7 @@ public class MechanicalMixerBlockEntity extends BasinOperatingBlockEntity {
protected List<Recipe<?>> getMatchingRecipes() { protected List<Recipe<?>> getMatchingRecipes() {
List<Recipe<?>> matchingRecipes = super.getMatchingRecipes(); List<Recipe<?>> matchingRecipes = super.getMatchingRecipes();
if (!AllConfigs.SERVER.recipes.allowBrewingInMixer.get()) if (!AllConfigs.server().recipes.allowBrewingInMixer.get())
return matchingRecipes; return matchingRecipes;
Optional<BasinBlockEntity> basin = getBasin(); Optional<BasinBlockEntity> basin = getBasin();
@ -254,7 +254,7 @@ public class MechanicalMixerBlockEntity extends BasinOperatingBlockEntity {
@Override @Override
protected <C extends Container> boolean matchStaticFilters(Recipe<C> r) { protected <C extends Container> boolean matchStaticFilters(Recipe<C> r) {
return ((r instanceof CraftingRecipe && !(r instanceof IShapedRecipe<?>) return ((r instanceof CraftingRecipe && !(r instanceof IShapedRecipe<?>)
&& AllConfigs.SERVER.recipes.allowShapelessInMixer.get() && r.getIngredients() && AllConfigs.server().recipes.allowShapelessInMixer.get() && r.getIngredients()
.size() > 1 .size() > 1
&& !MechanicalPressBlockEntity.canCompress(r)) && !AllRecipeTypes.shouldIgnoreInAutomation(r) && !MechanicalPressBlockEntity.canCompress(r)) && !AllRecipeTypes.shouldIgnoreInAutomation(r)
|| r.getType() == AllRecipeTypes.MIXING.getType()); || r.getType() == AllRecipeTypes.MIXING.getType());

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.mixer;
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -36,7 +36,7 @@ public class MechanicalMixerRenderer extends KineticBlockEntityRenderer<Mechanic
VertexConsumer vb = buffer.getBuffer(RenderType.solid()); VertexConsumer vb = buffer.getBuffer(RenderType.solid());
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.SHAFTLESS_COGWHEEL, blockState); SuperByteBuffer superBuffer = CachedBufferer.partial(AllPartialModels.SHAFTLESS_COGWHEEL, blockState);
standardKineticRotationTransform(superBuffer, be, light).renderInto(ms, vb); standardKineticRotationTransform(superBuffer, be, light).renderInto(ms, vb);
float renderedHeadOffset = be.getRenderedHeadOffset(partialTicks); float renderedHeadOffset = be.getRenderedHeadOffset(partialTicks);
@ -44,12 +44,12 @@ public class MechanicalMixerRenderer extends KineticBlockEntityRenderer<Mechanic
float time = AnimationTickHolder.getRenderTime(be.getLevel()); float time = AnimationTickHolder.getRenderTime(be.getLevel());
float angle = ((time * speed * 6 / 10f) % 360) / 180 * (float) Math.PI; float angle = ((time * speed * 6 / 10f) % 360) / 180 * (float) Math.PI;
SuperByteBuffer poleRender = CachedBufferer.partial(AllBlockPartials.MECHANICAL_MIXER_POLE, blockState); SuperByteBuffer poleRender = CachedBufferer.partial(AllPartialModels.MECHANICAL_MIXER_POLE, blockState);
poleRender.translate(0, -renderedHeadOffset, 0) poleRender.translate(0, -renderedHeadOffset, 0)
.light(light) .light(light)
.renderInto(ms, vb); .renderInto(ms, vb);
SuperByteBuffer headRender = CachedBufferer.partial(AllBlockPartials.MECHANICAL_MIXER_HEAD, blockState); SuperByteBuffer headRender = CachedBufferer.partial(AllPartialModels.MECHANICAL_MIXER_HEAD, blockState);
headRender.rotateCentered(Direction.UP, angle) headRender.rotateCentered(Direction.UP, angle)
.translate(0, -renderedHeadOffset, 0) .translate(0, -renderedHeadOffset, 0)
.light(light) .light(light)

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import com.simibubi.create.content.contraptions.relays.encased.EncasedCogInstance; import com.simibubi.create.content.contraptions.relays.encased.EncasedCogInstance;
import com.simibubi.create.foundation.render.AllMaterialSpecs; import com.simibubi.create.foundation.render.AllMaterialSpecs;
@ -22,13 +22,13 @@ public class MixerInstance extends EncasedCogInstance implements DynamicInstance
super(materialManager, blockEntity, false); super(materialManager, blockEntity, false);
this.mixer = blockEntity; this.mixer = blockEntity;
mixerHead = getRotatingMaterial().getModel(AllBlockPartials.MECHANICAL_MIXER_HEAD, blockState) mixerHead = getRotatingMaterial().getModel(AllPartialModels.MECHANICAL_MIXER_HEAD, blockState)
.createInstance(); .createInstance();
mixerHead.setRotationAxis(Direction.Axis.Y); mixerHead.setRotationAxis(Direction.Axis.Y);
mixerPole = getOrientedMaterial() mixerPole = getOrientedMaterial()
.getModel(AllBlockPartials.MECHANICAL_MIXER_POLE, blockState) .getModel(AllPartialModels.MECHANICAL_MIXER_POLE, blockState)
.createInstance(); .createInstance();
@ -42,7 +42,7 @@ public class MixerInstance extends EncasedCogInstance implements DynamicInstance
protected Instancer<RotatingData> getCogModel() { protected Instancer<RotatingData> getCogModel() {
return materialManager.defaultSolid() return materialManager.defaultSolid()
.material(AllMaterialSpecs.ROTATING) .material(AllMaterialSpecs.ROTATING)
.getModel(AllBlockPartials.SHAFTLESS_COGWHEEL, blockEntity.getBlockState()); .getModel(AllPartialModels.SHAFTLESS_COGWHEEL, blockEntity.getBlockState());
} }
@Override @Override

View file

@ -27,7 +27,7 @@ public class CreativeMotorBlockEntity extends GeneratingKineticBlockEntity {
@Override @Override
public void addBehaviours(List<BlockEntityBehaviour> behaviours) { public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
super.addBehaviours(behaviours); super.addBehaviours(behaviours);
Integer max = AllConfigs.SERVER.kinetics.maxMotorSpeed.get(); Integer max = AllConfigs.server().kinetics.maxMotorSpeed.get();
CenteredSideValueBoxTransform slot = new CenteredSideValueBoxTransform( CenteredSideValueBoxTransform slot = new CenteredSideValueBoxTransform(
(motor, side) -> motor.getValue(CreativeMotorBlock.FACING) == side.getOpposite()); (motor, side) -> motor.getValue(CreativeMotorBlock.FACING) == side.getOpposite());

View file

@ -1,6 +1,6 @@
package com.simibubi.create.content.contraptions.components.motor; package com.simibubi.create.content.contraptions.components.motor;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -16,7 +16,7 @@ public class CreativeMotorRenderer extends KineticBlockEntityRenderer<CreativeMo
@Override @Override
protected SuperByteBuffer getRotatedModel(CreativeMotorBlockEntity be, BlockState state) { protected SuperByteBuffer getRotatedModel(CreativeMotorBlockEntity be, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, state); return CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, state);
} }
} }

View file

@ -192,7 +192,7 @@ public class MechanicalPressBlockEntity extends BasinOperatingBlockEntity implem
} }
public static <C extends Container> boolean canCompress(Recipe<C> recipe) { public static <C extends Container> boolean canCompress(Recipe<C> recipe) {
if (!(recipe instanceof CraftingRecipe) || !AllConfigs.SERVER.recipes.allowShapedSquareInPress.get()) if (!(recipe instanceof CraftingRecipe) || !AllConfigs.server().recipes.allowShapedSquareInPress.get())
return false; return false;
NonNullList<Ingredient> ingredients = recipe.getIngredients(); NonNullList<Ingredient> ingredients = recipe.getIngredients();
return (ingredients.size() == 4 || ingredients.size() == 9) && ItemHelper.matchAllIngredients(ingredients); return (ingredients.size() == 4 || ingredients.size() == 9) && ItemHelper.matchAllIngredients(ingredients);
@ -212,7 +212,7 @@ public class MechanicalPressBlockEntity extends BasinOperatingBlockEntity implem
@Override @Override
public boolean canProcessInBulk() { public boolean canProcessInBulk() {
return AllConfigs.SERVER.recipes.bulkPressing.get(); return AllConfigs.server().recipes.bulkPressing.get();
} }
@Override @Override

View file

@ -4,7 +4,7 @@ import static net.minecraft.world.level.block.state.properties.BlockStatePropert
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -38,7 +38,7 @@ public class MechanicalPressRenderer extends KineticBlockEntityRenderer<Mechanic
float renderedHeadOffset = float renderedHeadOffset =
pressingBehaviour.getRenderedHeadOffset(partialTicks) * pressingBehaviour.mode.headOffset; pressingBehaviour.getRenderedHeadOffset(partialTicks) * pressingBehaviour.mode.headOffset;
SuperByteBuffer headRender = CachedBufferer.partialFacing(AllBlockPartials.MECHANICAL_PRESS_HEAD, blockState, SuperByteBuffer headRender = CachedBufferer.partialFacing(AllPartialModels.MECHANICAL_PRESS_HEAD, blockState,
blockState.getValue(HORIZONTAL_FACING)); blockState.getValue(HORIZONTAL_FACING));
headRender.translate(0, -renderedHeadOffset, 0) headRender.translate(0, -renderedHeadOffset, 0)
.light(light) .light(light)

View file

@ -6,7 +6,7 @@ import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance; import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -20,7 +20,7 @@ public class PressInstance extends ShaftInstance<MechanicalPressBlockEntity> imp
pressHead = materialManager.defaultSolid() pressHead = materialManager.defaultSolid()
.material(Materials.ORIENTED) .material(Materials.ORIENTED)
.getModel(AllBlockPartials.MECHANICAL_PRESS_HEAD, blockState) .getModel(AllPartialModels.MECHANICAL_PRESS_HEAD, blockState)
.createInstance(); .createInstance();
Quaternion q = Vector3f.YP Quaternion q = Vector3f.YP

View file

@ -86,7 +86,7 @@ public class SawBlockEntity extends BlockBreakingKineticBlockEntity {
public SawBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) { public SawBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state); super(type, pos, state);
inventory = new ProcessingInventory(this::start).withSlotLimit(!AllConfigs.SERVER.recipes.bulkCutting.get()); inventory = new ProcessingInventory(this::start).withSlotLimit(!AllConfigs.server().recipes.bulkCutting.get());
inventory.remainingTime = -1; inventory.remainingTime = -1;
recipeIndex = 0; recipeIndex = 0;
invProvider = LazyOptional.of(() -> inventory); invProvider = LazyOptional.of(() -> inventory);
@ -366,8 +366,8 @@ public class SawBlockEntity extends BlockBreakingKineticBlockEntity {
return ImmutableList.of(assemblyRecipe.get()); return ImmutableList.of(assemblyRecipe.get());
Predicate<Recipe<?>> types = RecipeConditions.isOfType(AllRecipeTypes.CUTTING.getType(), Predicate<Recipe<?>> types = RecipeConditions.isOfType(AllRecipeTypes.CUTTING.getType(),
AllConfigs.SERVER.recipes.allowStonecuttingOnSaw.get() ? RecipeType.STONECUTTING : null, AllConfigs.server().recipes.allowStonecuttingOnSaw.get() ? RecipeType.STONECUTTING : null,
AllConfigs.SERVER.recipes.allowWoodcuttingOnSaw.get() ? woodcuttingRecipeType.get() : null); AllConfigs.server().recipes.allowWoodcuttingOnSaw.get() ? woodcuttingRecipeType.get() : null);
List<Recipe<?>> startedSearch = RecipeFinder.get(cuttingRecipesKey, level, types); List<Recipe<?>> startedSearch = RecipeFinder.get(cuttingRecipesKey, level, types);
return startedSearch.stream() return startedSearch.stream()

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.saw;
import com.jozufozu.flywheel.api.Instancer; import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -24,7 +24,7 @@ public class SawInstance extends SingleRotatingInstance<SawBlockEntity> {
.isHorizontal()) { .isHorizontal()) {
BlockState referenceState = blockState.rotate(blockEntity.getLevel(), blockEntity.getBlockPos(), Rotation.CLOCKWISE_180); BlockState referenceState = blockState.rotate(blockEntity.getLevel(), blockEntity.getBlockPos(), Rotation.CLOCKWISE_180);
Direction facing = referenceState.getValue(BlockStateProperties.FACING); Direction facing = referenceState.getValue(BlockStateProperties.FACING);
return getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, referenceState, facing); return getRotatingMaterial().getModel(AllPartialModels.SHAFT_HALF, referenceState, facing);
} else { } else {
return getRotatingMaterial().getModel(shaft()); return getRotatingMaterial().getModel(shaft());
} }

View file

@ -7,7 +7,7 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
@ -60,19 +60,19 @@ public class SawRenderer extends SafeBlockEntityRenderer<SawBlockEntity> {
if (SawBlock.isHorizontal(blockState)) { if (SawBlock.isHorizontal(blockState)) {
if (speed > 0) { if (speed > 0) {
partial = AllBlockPartials.SAW_BLADE_HORIZONTAL_ACTIVE; partial = AllPartialModels.SAW_BLADE_HORIZONTAL_ACTIVE;
} else if (speed < 0) { } else if (speed < 0) {
partial = AllBlockPartials.SAW_BLADE_HORIZONTAL_REVERSED; partial = AllPartialModels.SAW_BLADE_HORIZONTAL_REVERSED;
} else { } else {
partial = AllBlockPartials.SAW_BLADE_HORIZONTAL_INACTIVE; partial = AllPartialModels.SAW_BLADE_HORIZONTAL_INACTIVE;
} }
} else { } else {
if (be.getSpeed() > 0) { if (be.getSpeed() > 0) {
partial = AllBlockPartials.SAW_BLADE_VERTICAL_ACTIVE; partial = AllPartialModels.SAW_BLADE_VERTICAL_ACTIVE;
} else if (speed < 0) { } else if (speed < 0) {
partial = AllBlockPartials.SAW_BLADE_VERTICAL_REVERSED; partial = AllPartialModels.SAW_BLADE_VERTICAL_REVERSED;
} else { } else {
partial = AllBlockPartials.SAW_BLADE_VERTICAL_INACTIVE; partial = AllPartialModels.SAW_BLADE_VERTICAL_INACTIVE;
} }
if (blockState.getValue(SawBlock.AXIS_ALONG_FIRST_COORDINATE)) if (blockState.getValue(SawBlock.AXIS_ALONG_FIRST_COORDINATE))
@ -147,7 +147,7 @@ public class SawRenderer extends SafeBlockEntityRenderer<SawBlockEntity> {
if (state.getValue(FACING) if (state.getValue(FACING)
.getAxis() .getAxis()
.isHorizontal()) .isHorizontal())
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, return CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF,
state.rotate(be.getLevel(), be.getBlockPos(), Rotation.CLOCKWISE_180)); state.rotate(be.getLevel(), be.getBlockPos(), Rotation.CLOCKWISE_180));
return CachedBufferer.block(KineticBlockEntityRenderer.KINETIC_BLOCK, return CachedBufferer.block(KineticBlockEntityRenderer.KINETIC_BLOCK,
getRenderedBlockState(be)); getRenderedBlockState(be));
@ -178,14 +178,14 @@ public class SawRenderer extends SafeBlockEntityRenderer<SawBlockEntity> {
SuperByteBuffer superBuffer; SuperByteBuffer superBuffer;
if (SawBlock.isHorizontal(state)) { if (SawBlock.isHorizontal(state)) {
if (shouldAnimate) if (shouldAnimate)
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_HORIZONTAL_ACTIVE, state); superBuffer = CachedBufferer.partial(AllPartialModels.SAW_BLADE_HORIZONTAL_ACTIVE, state);
else else
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_HORIZONTAL_INACTIVE, state); superBuffer = CachedBufferer.partial(AllPartialModels.SAW_BLADE_HORIZONTAL_INACTIVE, state);
} else { } else {
if (shouldAnimate) if (shouldAnimate)
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_VERTICAL_ACTIVE, state); superBuffer = CachedBufferer.partial(AllPartialModels.SAW_BLADE_VERTICAL_ACTIVE, state);
else else
superBuffer = CachedBufferer.partial(AllBlockPartials.SAW_BLADE_VERTICAL_INACTIVE, state); superBuffer = CachedBufferer.partial(AllPartialModels.SAW_BLADE_VERTICAL_INACTIVE, state);
} }
superBuffer.transform(matrices.getModel()) superBuffer.transform(matrices.getModel())

View file

@ -5,7 +5,7 @@ import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
@ -24,15 +24,15 @@ public class SteamEngineInstance extends BlockEntityInstance<SteamEngineBlockEnt
piston = materialManager.defaultSolid() piston = materialManager.defaultSolid()
.material(Materials.TRANSFORMED) .material(Materials.TRANSFORMED)
.getModel(AllBlockPartials.ENGINE_PISTON, blockState) .getModel(AllPartialModels.ENGINE_PISTON, blockState)
.createInstance(); .createInstance();
linkage = materialManager.defaultSolid() linkage = materialManager.defaultSolid()
.material(Materials.TRANSFORMED) .material(Materials.TRANSFORMED)
.getModel(AllBlockPartials.ENGINE_LINKAGE, blockState) .getModel(AllPartialModels.ENGINE_LINKAGE, blockState)
.createInstance(); .createInstance();
connector = materialManager.defaultSolid() connector = materialManager.defaultSolid()
.material(Materials.TRANSFORMED) .material(Materials.TRANSFORMED)
.getModel(AllBlockPartials.ENGINE_CONNECTOR, blockState) .getModel(AllPartialModels.ENGINE_CONNECTOR, blockState)
.createInstance(); .createInstance();
} }

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer; import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
@ -49,12 +49,12 @@ public class SteamEngineRenderer extends SafeBlockEntityRenderer<SteamEngineBloc
VertexConsumer vb = buffer.getBuffer(RenderType.solid()); VertexConsumer vb = buffer.getBuffer(RenderType.solid());
transformed(AllBlockPartials.ENGINE_PISTON, blockState, facing, roll90) transformed(AllPartialModels.ENGINE_PISTON, blockState, facing, roll90)
.translate(0, piston, 0) .translate(0, piston, 0)
.light(light) .light(light)
.renderInto(ms, vb); .renderInto(ms, vb);
transformed(AllBlockPartials.ENGINE_LINKAGE, blockState, facing, roll90) transformed(AllPartialModels.ENGINE_LINKAGE, blockState, facing, roll90)
.centre() .centre()
.translate(0, 1, 0) .translate(0, 1, 0)
.unCentre() .unCentre()
@ -65,7 +65,7 @@ public class SteamEngineRenderer extends SafeBlockEntityRenderer<SteamEngineBloc
.light(light) .light(light)
.renderInto(ms, vb); .renderInto(ms, vb);
transformed(AllBlockPartials.ENGINE_CONNECTOR, blockState, facing, roll90) transformed(AllPartialModels.ENGINE_CONNECTOR, blockState, facing, roll90)
.translate(0, 2, 0) .translate(0, 2, 0)
.centre() .centre()
.rotateXRadians(-angle + Mth.HALF_PI) .rotateXRadians(-angle + Mth.HALF_PI)

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.steam.whistle;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize; import com.simibubi.create.content.contraptions.components.steam.whistle.WhistleBlock.WhistleSize;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer; import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
@ -30,8 +30,8 @@ public class WhistleRenderer extends SafeBlockEntityRenderer<WhistleBlockEntity>
Direction direction = blockState.getValue(WhistleBlock.FACING); Direction direction = blockState.getValue(WhistleBlock.FACING);
WhistleSize size = blockState.getValue(WhistleBlock.SIZE); WhistleSize size = blockState.getValue(WhistleBlock.SIZE);
PartialModel mouth = size == WhistleSize.LARGE ? AllBlockPartials.WHISTLE_MOUTH_LARGE PartialModel mouth = size == WhistleSize.LARGE ? AllPartialModels.WHISTLE_MOUTH_LARGE
: size == WhistleSize.MEDIUM ? AllBlockPartials.WHISTLE_MOUTH_MEDIUM : AllBlockPartials.WHISTLE_MOUTH_SMALL; : size == WhistleSize.MEDIUM ? AllPartialModels.WHISTLE_MOUTH_MEDIUM : AllPartialModels.WHISTLE_MOUTH_SMALL;
float offset = be.animation.getValue(partialTicks); float offset = be.animation.getValue(partialTicks);
if (be.animation.getChaseTarget() > 0 && be.animation.getValue() > 0.5f) { if (be.animation.getChaseTarget() > 0 && be.animation.getValue() > 0.5f) {

View file

@ -162,7 +162,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
return; return;
contraption.getSeatMapping() contraption.getSeatMapping()
.put(passenger.getUUID(), seatIndex); .put(passenger.getUUID(), seatIndex);
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> this),
new ContraptionSeatMappingPacket(getId(), contraption.getSeatMapping())); new ContraptionSeatMappingPacket(getId(), contraption.getSeatMapping()));
} }
@ -179,7 +179,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
.put("ContraptionDismountLocation", VecHelper.writeNBT(transformedVector)); .put("ContraptionDismountLocation", VecHelper.writeNBT(transformedVector));
contraption.getSeatMapping() contraption.getSeatMapping()
.remove(passenger.getUUID()); .remove(passenger.getUUID());
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> this),
new ContraptionSeatMappingPacket(getId(), contraption.getSeatMapping(), passenger.getId())); new ContraptionSeatMappingPacket(getId(), contraption.getSeatMapping(), passenger.getId()));
} }
@ -269,7 +269,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
public void stopControlling(BlockPos controlsLocalPos) { public void stopControlling(BlockPos controlsLocalPos) {
getControllingPlayer().map(level::getPlayerByUUID) getControllingPlayer().map(level::getPlayerByUUID)
.map(p -> (p instanceof ServerPlayer) ? ((ServerPlayer) p) : null) .map(p -> (p instanceof ServerPlayer) ? ((ServerPlayer) p) : null)
.ifPresent(p -> AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> p), .ifPresent(p -> AllPackets.getChannel().send(PacketDistributor.PLAYER.with(() -> p),
new ControlsStopControllingPacket())); new ControlsStopControllingPacket()));
setControllingPlayer(null); setControllingPlayer(null);
} }
@ -412,7 +412,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
public void setBlock(BlockPos localPos, StructureBlockInfo newInfo) { public void setBlock(BlockPos localPos, StructureBlockInfo newInfo) {
contraption.blocks.put(localPos, newInfo); contraption.blocks.put(localPos, newInfo);
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> this),
new ContraptionBlockChangedPacket(getId(), localPos, newInfo.state)); new ContraptionBlockChangedPacket(getId(), localPos, newInfo.state));
} }
@ -508,7 +508,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
} }
protected void onContraptionStalled() { protected void onContraptionStalled() {
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> this),
new ContraptionStallPacket(getId(), getX(), getY(), getZ(), getStalledAngle())); new ContraptionStallPacket(getId(), getX(), getY(), getZ(), getStalledAngle()));
} }
@ -649,7 +649,7 @@ public abstract class AbstractContraptionEntity extends Entity implements IEntit
StructureTransform transform = makeStructureTransform(); StructureTransform transform = makeStructureTransform();
contraption.stop(level); contraption.stop(level);
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> this),
new ContraptionDisassemblyPacket(this.getId(), transform)); new ContraptionDisassemblyPacket(this.getId(), transform));
contraption.addBlocksToWorld(level, transform); contraption.addBlocksToWorld(level, transform);

View file

@ -62,11 +62,11 @@ public class AssemblyException extends Exception {
} }
public static AssemblyException structureTooLarge() { public static AssemblyException structureTooLarge() {
return new AssemblyException("structureTooLarge", AllConfigs.SERVER.kinetics.maxBlocksMoved.get()); return new AssemblyException("structureTooLarge", AllConfigs.server().kinetics.maxBlocksMoved.get());
} }
public static AssemblyException tooManyPistonPoles() { public static AssemblyException tooManyPistonPoles() {
return new AssemblyException("tooManyPistonPoles", AllConfigs.SERVER.kinetics.maxPistonPoles.get()); return new AssemblyException("tooManyPistonPoles", AllConfigs.server().kinetics.maxPistonPoles.get());
} }
public static AssemblyException noPistonPoles() { public static AssemblyException noPistonPoles() {
@ -74,7 +74,7 @@ public class AssemblyException extends Exception {
} }
public static AssemblyException notEnoughSails(int sails) { public static AssemblyException notEnoughSails(int sails) {
return new AssemblyException("not_enough_sails", sails, AllConfigs.SERVER.kinetics.minimumWindmillSails.get()); return new AssemblyException("not_enough_sails", sails, AllConfigs.server().kinetics.minimumWindmillSails.get());
} }
public boolean hasPosition() { public boolean hasPosition() {

View file

@ -420,7 +420,7 @@ public abstract class Contraption {
} }
addBlock(pos, capture(world, pos)); addBlock(pos, capture(world, pos));
if (blocks.size() <= AllConfigs.SERVER.kinetics.maxBlocksMoved.get()) if (blocks.size() <= AllConfigs.server().kinetics.maxBlocksMoved.get())
return true; return true;
else else
throw AssemblyException.structureTooLarge(); throw AssemblyException.structureTooLarge();
@ -545,7 +545,7 @@ public abstract class Contraption {
} }
private void movePulley(Level world, BlockPos pos, Queue<BlockPos> frontier, Set<BlockPos> visited) { private void movePulley(Level world, BlockPos pos, Queue<BlockPos> frontier, Set<BlockPos> visited) {
int limit = AllConfigs.SERVER.kinetics.maxRopeLength.get(); int limit = AllConfigs.server().kinetics.maxRopeLength.get();
BlockPos ropePos = pos; BlockPos ropePos = pos;
while (limit-- >= 0) { while (limit-- >= 0) {
ropePos = ropePos.below(); ropePos = ropePos.below();

View file

@ -354,7 +354,7 @@ public class ContraptionCollider {
entity.fallDistance = 0; entity.fallDistance = 0;
for (Entity rider : entity.getIndirectPassengers()) for (Entity rider : entity.getIndirectPassengers())
if (getPlayerType(rider) == PlayerType.CLIENT) if (getPlayerType(rider) == PlayerType.CLIENT)
AllPackets.channel.sendToServer(new ClientMotionPacket(rider.getDeltaMovement(), true, 0)); AllPackets.getChannel().sendToServer(new ClientMotionPacket(rider.getDeltaMovement(), true, 0));
boolean canWalk = bounce != 0 || slide == 0; boolean canWalk = bounce != 0 || slide == 0;
if (canWalk || !rotation.hasVerticalRotation()) { if (canWalk || !rotation.hasVerticalRotation()) {
if (canWalk) if (canWalk)
@ -378,7 +378,7 @@ public class ContraptionCollider {
float limbSwing = Mth.sqrt((float) (d0 * d0 + d1 * d1)) * 4.0F; float limbSwing = Mth.sqrt((float) (d0 * d0 + d1 * d1)) * 4.0F;
if (limbSwing > 1.0F) if (limbSwing > 1.0F)
limbSwing = 1.0F; limbSwing = 1.0F;
AllPackets.channel.sendToServer(new ClientMotionPacket(entityMotion, true, limbSwing)); AllPackets.getChannel().sendToServer(new ClientMotionPacket(entityMotion, true, limbSwing));
if (entity.isOnGround() && contraption instanceof TranslatingContraption) { if (entity.isOnGround() && contraption instanceof TranslatingContraption) {
safetyLock.setLeft(new WeakReference<>(contraptionEntity)); safetyLock.setLeft(new WeakReference<>(contraptionEntity));
@ -460,7 +460,7 @@ public class ContraptionCollider {
return entityMotion; return entityMotion;
if (cce.nonDamageTicks != 0) if (cce.nonDamageTicks != 0)
return entityMotion; return entityMotion;
if (!AllConfigs.SERVER.trains.trainsCauseDamage.get()) if (!AllConfigs.server().trains.trainsCauseDamage.get())
return entityMotion; return entityMotion;
Vec3 diffMotion = contraptionMotion.subtract(entity.getDeltaMovement()); Vec3 diffMotion = contraptionMotion.subtract(entity.getDeltaMovement());
@ -477,7 +477,7 @@ public class ContraptionCollider {
return entityMotion; return entityMotion;
if (playerType == PlayerType.CLIENT) { if (playerType == PlayerType.CLIENT) {
AllPackets.channel.sendToServer(new TrainCollisionPacket((int) (damage * 16), contraptionEntity.getId())); AllPackets.getChannel().sendToServer(new TrainCollisionPacket((int) (damage * 16), contraptionEntity.getId()));
world.playSound((Player) entity, entity.blockPosition(), SoundEvents.PLAYER_ATTACK_CRIT, world.playSound((Player) entity, entity.blockPosition(), SoundEvents.PLAYER_ATTACK_CRIT,
SoundSource.NEUTRAL, 1, .75f); SoundSource.NEUTRAL, 1, .75f);
} else { } else {

View file

@ -109,7 +109,7 @@ public class ContraptionHandlerClient {
BlockPos pos = rayTraceResult.getBlockPos(); BlockPos pos = rayTraceResult.getBlockPos();
if (contraptionEntity.handlePlayerInteraction(player, pos, face, hand)) { if (contraptionEntity.handlePlayerInteraction(player, pos, face, hand)) {
AllPackets.channel.sendToServer(new ContraptionInteractionPacket(contraptionEntity, hand, pos, face)); AllPackets.getChannel().sendToServer(new ContraptionInteractionPacket(contraptionEntity, hand, pos, face));
} else if (handleSpecialInteractions(contraptionEntity, player, pos, face, hand)) { } else if (handleSpecialInteractions(contraptionEntity, player, pos, face, hand)) {
} else } else
continue; continue;

View file

@ -63,7 +63,7 @@ public class MountedFluidStorage {
packetCooldown--; packetCooldown--;
else if (sendPacket) { else if (sendPacket) {
sendPacket = false; sendPacket = false;
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> entity),
new ContraptionFluidPacket(entity.getId(), pos, tank.getFluid())); new ContraptionFluidPacket(entity.getId(), pos, tank.getFluid()));
packetCooldown = 8; packetCooldown = 8;
} }

View file

@ -52,7 +52,7 @@ public interface MovementBehaviour {
default void dropItem(MovementContext context, ItemStack stack) { default void dropItem(MovementContext context, ItemStack stack) {
ItemStack remainder; ItemStack remainder;
if (AllConfigs.SERVER.kinetics.moveItemsToStorage.get()) if (AllConfigs.server().kinetics.moveItemsToStorage.get())
remainder = ItemHandlerHelper.insertItem(context.contraption.getSharedInventory(), stack, false); remainder = ItemHandlerHelper.insertItem(context.contraption.getSharedInventory(), stack, false);
else else
remainder = stack; remainder = stack;

View file

@ -13,7 +13,7 @@ public class NonStationaryLighter<C extends Contraption> extends ContraptionLigh
@Override @Override
public boolean tickLightListener() { public boolean tickLightListener() {
if (getVolume().volume() > AllConfigs.CLIENT.maxContraptionLightVolume.get()) if (getVolume().volume() > AllConfigs.client().maxContraptionLightVolume.get())
return false; return false;
ImmutableBox contraptionBounds = getContraptionBounds(); ImmutableBox contraptionBounds = getContraptionBounds();

View file

@ -42,7 +42,7 @@ public class BearingContraption extends Contraption {
return false; return false;
startMoving(world); startMoving(world);
expandBoundsAroundAxis(facing.getAxis()); expandBoundsAroundAxis(facing.getAxis());
if (isWindmill && sailBlocks < AllConfigs.SERVER.kinetics.minimumWindmillSails.get()) if (isWindmill && sailBlocks < AllConfigs.server().kinetics.minimumWindmillSails.get())
throw AssemblyException.notEnoughSails(sailBlocks); throw AssemblyException.notEnoughSails(sailBlocks);
if (blocks.isEmpty()) if (blocks.isEmpty())
return false; return false;

View file

@ -6,7 +6,7 @@ import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.BackHalfShaftInstance; import com.simibubi.create.content.contraptions.base.BackHalfShaftInstance;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
@ -30,7 +30,7 @@ public class BearingInstance<B extends KineticBlockEntity & IBearingBlockEntity>
blockOrientation = getBlockStateOrientation(facing); blockOrientation = getBlockStateOrientation(facing);
PartialModel top = PartialModel top =
blockEntity.isWoodenTop() ? AllBlockPartials.BEARING_TOP_WOODEN : AllBlockPartials.BEARING_TOP; blockEntity.isWoodenTop() ? AllPartialModels.BEARING_TOP_WOODEN : AllPartialModels.BEARING_TOP;
topInstance = getOrientedMaterial().getModel(top, blockState).createInstance(); topInstance = getOrientedMaterial().getModel(top, blockState).createInstance();

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
@ -34,7 +34,7 @@ public class BearingRenderer<T extends KineticBlockEntity & IBearingBlockEntity>
final Direction facing = be.getBlockState() final Direction facing = be.getBlockState()
.getValue(BlockStateProperties.FACING); .getValue(BlockStateProperties.FACING);
PartialModel top = PartialModel top =
be.isWoodenTop() ? AllBlockPartials.BEARING_TOP_WOODEN : AllBlockPartials.BEARING_TOP; be.isWoodenTop() ? AllPartialModels.BEARING_TOP_WOODEN : AllPartialModels.BEARING_TOP;
SuperByteBuffer superBuffer = CachedBufferer.partial(top, be.getBlockState()); SuperByteBuffer superBuffer = CachedBufferer.partial(top, be.getBlockState());
float interpolatedAngle = be.getInterpolatedAngle(partialTicks - 1); float interpolatedAngle = be.getInterpolatedAngle(partialTicks - 1);
@ -50,7 +50,7 @@ public class BearingRenderer<T extends KineticBlockEntity & IBearingBlockEntity>
@Override @Override
protected SuperByteBuffer getRotatedModel(KineticBlockEntity be, BlockState state) { protected SuperByteBuffer getRotatedModel(KineticBlockEntity be, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.SHAFT_HALF, state, state return CachedBufferer.partialFacing(AllPartialModels.SHAFT_HALF, state, state
.getValue(BearingBlock.FACING) .getValue(BearingBlock.FACING)
.getOpposite()); .getOpposite());
} }

View file

@ -6,7 +6,7 @@ import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
import com.mojang.math.Vector3f; import com.mojang.math.Vector3f;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData; import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance; import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
@ -38,7 +38,7 @@ public class StabilizedBearingInstance extends ActorInstance {
topInstance = materialManager.defaultSolid() topInstance = materialManager.defaultSolid()
.material(Materials.ORIENTED) .material(Materials.ORIENTED)
.getModel(AllBlockPartials.BEARING_TOP, blockState) .getModel(AllPartialModels.BEARING_TOP, blockState)
.createInstance(); .createInstance();
int blockLight = localBlockLight(); int blockLight = localBlockLight();
@ -48,7 +48,7 @@ public class StabilizedBearingInstance extends ActorInstance {
shaft = materialManager.defaultSolid() shaft = materialManager.defaultSolid()
.material(AllMaterialSpecs.ROTATING) .material(AllMaterialSpecs.ROTATING)
.getModel(AllBlockPartials.SHAFT_HALF, blockState, blockState.getValue(BlockStateProperties.FACING).getOpposite()) .getModel(AllPartialModels.SHAFT_HALF, blockState, blockState.getValue(BlockStateProperties.FACING).getOpposite())
.createInstance(); .createInstance();
// not rotating so no need to set speed, axis, etc. // not rotating so no need to set speed, axis, etc.

View file

@ -6,7 +6,7 @@ import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.math.Quaternion; import com.mojang.math.Quaternion;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.ControlledContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.ControlledContraptionEntity;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
@ -43,7 +43,7 @@ public class StabilizedBearingMovementBehaviour implements MovementBehaviour {
return; return;
Direction facing = context.state.getValue(BlockStateProperties.FACING); Direction facing = context.state.getValue(BlockStateProperties.FACING);
PartialModel top = AllBlockPartials.BEARING_TOP; PartialModel top = AllPartialModels.BEARING_TOP;
SuperByteBuffer superBuffer = CachedBufferer.partial(top, context.state); SuperByteBuffer superBuffer = CachedBufferer.partial(top, context.state);
float renderPartialTicks = AnimationTickHolder.getPartialTicks(); float renderPartialTicks = AnimationTickHolder.getPartialTicks();

View file

@ -67,7 +67,7 @@ public class WindmillBearingBlockEntity extends MechanicalBearingBlockEntity {
if (movedContraption == null) if (movedContraption == null)
return lastGeneratedSpeed; return lastGeneratedSpeed;
int sails = ((BearingContraption) movedContraption.getContraption()).getSailBlocks() int sails = ((BearingContraption) movedContraption.getContraption()).getSailBlocks()
/ AllConfigs.SERVER.kinetics.windmillSailsPerRPM.get(); / AllConfigs.server().kinetics.windmillSailsPerRPM.get();
return Mth.clamp(sails, 1, 16) * getAngleSpeedDirection(); return Mth.clamp(sails, 1, 16) * getAngleSpeedDirection();
} }

View file

@ -40,7 +40,7 @@ public class ChassisBlockEntity extends SmartBlockEntity {
@Override @Override
public void addBehaviours(List<BlockEntityBehaviour> behaviours) { public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
int max = AllConfigs.SERVER.kinetics.maxChassisRange.get(); int max = AllConfigs.server().kinetics.maxChassisRange.get();
range = new BulkScrollValueBehaviour(Lang.translateDirect("generic.range"), this, new CenteredSideValueBoxTransform(), range = new BulkScrollValueBehaviour(Lang.translateDirect("generic.range"), this, new CenteredSideValueBoxTransform(),
be -> ((ChassisBlockEntity) be).collectChassisGroup()); be -> ((ChassisBlockEntity) be).collectChassisGroup());
range.requiresWrench(); range.requiresWrench();

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance; import com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -24,7 +24,7 @@ public class StickerInstance extends BlockEntityInstance<StickerBlockEntity> imp
public StickerInstance(MaterialManager materialManager, StickerBlockEntity blockEntity) { public StickerInstance(MaterialManager materialManager, StickerBlockEntity blockEntity) {
super(materialManager, blockEntity); super(materialManager, blockEntity);
head = getTransformMaterial().getModel(AllBlockPartials.STICKER_HEAD, blockState).createInstance(); head = getTransformMaterial().getModel(AllPartialModels.STICKER_HEAD, blockState).createInstance();
fakeWorld = blockEntity.getLevel() != Minecraft.getInstance().level; fakeWorld = blockEntity.getLevel() != Minecraft.getInstance().level;
facing = blockState.getValue(StickerBlock.FACING); facing = blockState.getValue(StickerBlock.FACING);

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ch
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer; import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -28,7 +28,7 @@ public class StickerRenderer extends SafeBlockEntityRenderer<StickerBlockEntity>
if (Backend.canUseInstancing(be.getLevel())) return; if (Backend.canUseInstancing(be.getLevel())) return;
BlockState state = be.getBlockState(); BlockState state = be.getBlockState();
SuperByteBuffer head = CachedBufferer.partial(AllBlockPartials.STICKER_HEAD, state); SuperByteBuffer head = CachedBufferer.partial(AllPartialModels.STICKER_HEAD, state);
float offset = be.piston.getValue(AnimationTickHolder.getPartialTicks(be.getLevel())); float offset = be.piston.getValue(AnimationTickHolder.getPartialTicks(be.getLevel()));
if (be.getLevel() != Minecraft.getInstance().level && !be.isVirtual()) if (be.getLevel() != Minecraft.getInstance().level && !be.isVirtual())

View file

@ -164,7 +164,7 @@ public class ElevatorContactScreen extends AbstractSimiScreen {
} }
private void confirm() { private void confirm() {
AllPackets.channel.sendToServer(new ElevatorContactEditPacket(pos, shortName, longName)); AllPackets.getChannel().sendToServer(new ElevatorContactEditPacket(pos, shortName, longName));
onClose(); onClose();
} }

View file

@ -71,7 +71,7 @@ public class ElevatorContraption extends PulleyContraption {
namesList = column.compileNamesList(); namesList = column.compileNamesList();
namesListVersion = column.namesListVersion; namesListVersion = column.namesListVersion;
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> entity),
new ElevatorFloorListPacket(entity, namesList)); new ElevatorFloorListPacket(entity, namesList));
} }

View file

@ -92,7 +92,7 @@ public class ElevatorFloorListPacket extends SimplePacketBase {
return; return;
if (!(ace.getContraption()instanceof ElevatorContraption ec)) if (!(ace.getContraption()instanceof ElevatorContraption ec))
return; return;
AllPackets.channel.send(PacketDistributor.PLAYER.with(() -> sender), AllPackets.getChannel().send(PacketDistributor.PLAYER.with(() -> sender),
new ElevatorFloorListPacket(ace, ec.namesList)); new ElevatorFloorListPacket(ace, ec.namesList));
}); });
ctx.setPacketHandled(true); ctx.setPacketHandled(true);

View file

@ -53,7 +53,7 @@ public class ElevatorPulleyBlockEntity extends PulleyBlockEntity {
if (offset >= 0) if (offset >= 0)
resetContraptionToOffset(); resetContraptionToOffset();
if (level.isClientSide) { if (level.isClientSide) {
AllPackets.channel.sendToServer(new ElevatorFloorListPacket.RequestFloorList(contraption)); AllPackets.getChannel().sendToServer(new ElevatorFloorListPacket.RequestFloorList(contraption));
return; return;
} }
@ -233,7 +233,7 @@ public class ElevatorPulleyBlockEntity extends PulleyBlockEntity {
if (getSpeed() == 0) if (getSpeed() == 0)
return; return;
int maxLength = AllConfigs.SERVER.kinetics.maxRopeLength.get(); int maxLength = AllConfigs.server().kinetics.maxRopeLength.get();
int i = 1; int i = 1;
while (i <= maxLength) { while (i <= maxLength) {
BlockPos ropePos = worldPosition.below(i); BlockPos ropePos = worldPosition.below(i);

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.el
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.blaze3d.vertex.VertexConsumer;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.AllSpriteShifts; import com.simibubi.create.AllSpriteShifts;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
@ -50,7 +50,7 @@ public class ElevatorPulleyRenderer extends KineticBlockEntityRenderer<ElevatorP
BlockState blockState = be.getBlockState(); BlockState blockState = be.getBlockState();
BlockPos pos = be.getBlockPos(); BlockPos pos = be.getBlockPos();
SuperByteBuffer magnet = CachedBufferer.partial(AllBlockPartials.ELEVATOR_MAGNET, blockState); SuperByteBuffer magnet = CachedBufferer.partial(AllPartialModels.ELEVATOR_MAGNET, blockState);
if (running || offset == 0) if (running || offset == 0)
AbstractPulleyRenderer.renderAt(world, magnet, offset, pos, ms, vb); AbstractPulleyRenderer.renderAt(world, magnet, offset, pos, ms, vb);
@ -73,8 +73,8 @@ public class ElevatorPulleyRenderer extends KineticBlockEntityRenderer<ElevatorP
.light(light) .light(light)
.renderInto(ms, vb); .renderInto(ms, vb);
SuperByteBuffer halfRope = CachedBufferer.partial(AllBlockPartials.ELEVATOR_BELT_HALF, blockState); SuperByteBuffer halfRope = CachedBufferer.partial(AllPartialModels.ELEVATOR_BELT_HALF, blockState);
SuperByteBuffer rope = CachedBufferer.partial(AllBlockPartials.ELEVATOR_BELT, blockState); SuperByteBuffer rope = CachedBufferer.partial(AllPartialModels.ELEVATOR_BELT, blockState);
float f = offset % 1; float f = offset % 1;
if (f < .25f || f > .75f) { if (f < .25f || f > .75f) {
@ -105,7 +105,7 @@ public class ElevatorPulleyRenderer extends KineticBlockEntityRenderer<ElevatorP
protected SuperByteBuffer getRotatedCoil(KineticBlockEntity be) { protected SuperByteBuffer getRotatedCoil(KineticBlockEntity be) {
BlockState blockState = be.getBlockState(); BlockState blockState = be.getBlockState();
return CachedBufferer.partialFacing(AllBlockPartials.ELEVATOR_COIL, blockState, return CachedBufferer.partialFacing(AllPartialModels.ELEVATOR_COIL, blockState,
blockState.getValue(ElevatorPulleyBlock.HORIZONTAL_FACING)); blockState.getValue(ElevatorPulleyBlock.HORIZONTAL_FACING));
} }

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ga
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.api.instance.DynamicInstance; import com.jozufozu.flywheel.api.instance.DynamicInstance;
import com.jozufozu.flywheel.core.materials.model.ModelData; import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance; import com.simibubi.create.content.contraptions.relays.encased.ShaftInstance;
import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AngleHelper;
@ -29,7 +29,7 @@ public class GantryCarriageInstance extends ShaftInstance<GantryCarriageBlockEnt
super(materialManager, blockEntity); super(materialManager, blockEntity);
gantryCogs = getTransformMaterial() gantryCogs = getTransformMaterial()
.getModel(AllBlockPartials.GANTRY_COGS, blockState) .getModel(AllPartialModels.GANTRY_COGS, blockState)
.createInstance(); .createInstance();
facing = blockState.getValue(GantryCarriageBlock.FACING); facing = blockState.getValue(GantryCarriageBlock.FACING);

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.ga
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity; import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer; import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
@ -54,7 +54,7 @@ public class GantryCarriageRenderer extends KineticBlockEntityRenderer<GantryCar
if (facing == Direction.NORTH || facing == Direction.EAST) if (facing == Direction.NORTH || facing == Direction.EAST)
angleForBE *= -1; angleForBE *= -1;
SuperByteBuffer cogs = CachedBufferer.partial(AllBlockPartials.GANTRY_COGS, state); SuperByteBuffer cogs = CachedBufferer.partial(AllPartialModels.GANTRY_COGS, state);
cogs.centre() cogs.centre()
.rotateY(AngleHelper.horizontalAngle(facing)) .rotateY(AngleHelper.horizontalAngle(facing))
.rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90) .rotateX(facing == Direction.UP ? 0 : facing == Direction.DOWN ? 180 : 90)

View file

@ -192,7 +192,7 @@ public class GantryContraptionEntity extends AbstractContraptionEntity {
} }
public void sendPacket() { public void sendPacket() {
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> this), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> this),
new GantryContraptionUpdatePacket(getId(), getAxisCoord(), axisMotion)); new GantryContraptionUpdatePacket(getId(), getAxisCoord(), axisMotion));
} }

View file

@ -50,7 +50,7 @@ public class SuperGlueHandler {
BlockPos relative = pos.relative(direction); BlockPos relative = pos.relative(direction);
if (SuperGlueEntity.isGlued(world, pos, direction, cached) if (SuperGlueEntity.isGlued(world, pos, direction, cached)
&& BlockMovementChecks.isMovementNecessary(world.getBlockState(relative), entity.level, relative)) && BlockMovementChecks.isMovementNecessary(world.getBlockState(relative), entity.level, relative))
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> entity), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY_AND_SELF.with(() -> entity),
new GlueEffectPacket(pos, direction, true)); new GlueEffectPacket(pos, direction, true));
} }
@ -101,7 +101,7 @@ public class SuperGlueHandler {
if (SuperGlueEntity.isValidFace(world, gluePos, face)) { if (SuperGlueEntity.isValidFace(world, gluePos, face)) {
if (!world.isClientSide) { if (!world.isClientSide) {
world.addFreshEntity(entity); world.addFreshEntity(entity);
AllPackets.channel.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), AllPackets.getChannel().send(PacketDistributor.TRACKING_ENTITY.with(() -> entity),
new GlueEffectPacket(gluePos, face, true)); new GlueEffectPacket(gluePos, face, true));
} }
itemstack.hurtAndBreak(1, placer, SuperGlueItem::onBroken); itemstack.hurtAndBreak(1, placer, SuperGlueItem::onBroken);

View file

@ -193,7 +193,7 @@ public class SuperGlueSelectionHandler {
if (attack) { if (attack) {
if (selected == null) if (selected == null)
return false; return false;
AllPackets.channel.sendToServer(new SuperGlueRemovalPacket(selected.getId(), soundSourceForRemoval)); AllPackets.getChannel().sendToServer(new SuperGlueRemovalPacket(selected.getId(), soundSourceForRemoval));
selected = null; selected = null;
clusterCooldown = 0; clusterCooldown = 0;
return true; return true;
@ -251,7 +251,7 @@ public class SuperGlueSelectionHandler {
public void confirm() { public void confirm() {
LocalPlayer player = Minecraft.getInstance().player; LocalPlayer player = Minecraft.getInstance().player;
AllPackets.channel.sendToServer(new SuperGlueSelectionPacket(firstPos, hoveredPos)); AllPackets.getChannel().sendToServer(new SuperGlueSelectionPacket(firstPos, hoveredPos));
AllSoundEvents.SLIME_ADDED.playAt(player.level, hoveredPos, 0.5F, 0.95F, false); AllSoundEvents.SLIME_ADDED.playAt(player.level, hoveredPos, 0.5F, 0.95F, false);
player.level.playSound(player, hoveredPos, SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 0.75f, 1); player.level.playSound(player, hoveredPos, SoundEvents.ITEM_FRAME_ADD_ITEM, SoundSource.BLOCKS, 0.75f, 1);

View file

@ -49,7 +49,7 @@ public class ControlsHandler {
AbstractContraptionEntity abstractContraptionEntity = entityRef.get(); AbstractContraptionEntity abstractContraptionEntity = entityRef.get();
if (!currentlyPressed.isEmpty() && abstractContraptionEntity != null) if (!currentlyPressed.isEmpty() && abstractContraptionEntity != null)
AllPackets.channel.sendToServer(new ControlsInputPacket(currentlyPressed, false, AllPackets.getChannel().sendToServer(new ControlsInputPacket(currentlyPressed, false,
abstractContraptionEntity.getId(), controlsPos, false)); abstractContraptionEntity.getId(), controlsPos, false));
packetCooldown = 0; packetCooldown = 0;
@ -73,7 +73,7 @@ public class ControlsHandler {
.getWindow(), GLFW.GLFW_KEY_ESCAPE)) { .getWindow(), GLFW.GLFW_KEY_ESCAPE)) {
BlockPos pos = controlsPos; BlockPos pos = controlsPos;
stopControlling(); stopControlling();
AllPackets.channel AllPackets.getChannel()
.sendToServer(new ControlsInputPacket(currentlyPressed, false, entity.getId(), pos, true)); .sendToServer(new ControlsInputPacket(currentlyPressed, false, entity.getId(), pos, true));
return; return;
} }
@ -92,14 +92,14 @@ public class ControlsHandler {
// Released Keys // Released Keys
if (!releasedKeys.isEmpty()) { if (!releasedKeys.isEmpty()) {
AllPackets.channel AllPackets.getChannel()
.sendToServer(new ControlsInputPacket(releasedKeys, false, entity.getId(), controlsPos, false)); .sendToServer(new ControlsInputPacket(releasedKeys, false, entity.getId(), controlsPos, false));
// AllSoundEvents.CONTROLLER_CLICK.playAt(player.level, player.blockPosition(), 1f, .5f, true); // AllSoundEvents.CONTROLLER_CLICK.playAt(player.level, player.blockPosition(), 1f, .5f, true);
} }
// Newly Pressed Keys // Newly Pressed Keys
if (!newKeys.isEmpty()) { if (!newKeys.isEmpty()) {
AllPackets.channel.sendToServer(new ControlsInputPacket(newKeys, true, entity.getId(), controlsPos, false)); AllPackets.getChannel().sendToServer(new ControlsInputPacket(newKeys, true, entity.getId(), controlsPos, false));
packetCooldown = PACKET_RATE; packetCooldown = PACKET_RATE;
// AllSoundEvents.CONTROLLER_CLICK.playAt(player.level, player.blockPosition(), 1f, .75f, true); // AllSoundEvents.CONTROLLER_CLICK.playAt(player.level, player.blockPosition(), 1f, .75f, true);
} }
@ -107,7 +107,7 @@ public class ControlsHandler {
// Keepalive Pressed Keys // Keepalive Pressed Keys
if (packetCooldown == 0) { if (packetCooldown == 0) {
// if (!pressedKeys.isEmpty()) { // if (!pressedKeys.isEmpty()) {
AllPackets.channel AllPackets.getChannel()
.sendToServer(new ControlsInputPacket(pressedKeys, true, entity.getId(), controlsPos, false)); .sendToServer(new ControlsInputPacket(pressedKeys, true, entity.getId(), controlsPos, false));
packetCooldown = PACKET_RATE; packetCooldown = PACKET_RATE;
// } // }

View file

@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.in
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.jozufozu.flywheel.util.transform.TransformStack; import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
@ -25,7 +25,7 @@ public class ControlsRenderer {
BlockState state = context.state; BlockState state = context.state;
Direction facing = state.getValue(ControlsBlock.FACING); Direction facing = state.getValue(ControlsBlock.FACING);
SuperByteBuffer cover = CachedBufferer.partial(AllBlockPartials.TRAIN_CONTROLS_COVER, state); SuperByteBuffer cover = CachedBufferer.partial(AllPartialModels.TRAIN_CONTROLS_COVER, state);
float hAngle = 180 + AngleHelper.horizontalAngle(facing); float hAngle = 180 + AngleHelper.horizontalAngle(facing);
PoseStack ms = matrices.getModel(); PoseStack ms = matrices.getModel();
cover.transform(ms) cover.transform(ms)
@ -39,7 +39,7 @@ public class ControlsRenderer {
for (boolean first : Iterate.trueAndFalse) { for (boolean first : Iterate.trueAndFalse) {
float vAngle = (float) Mth.clamp(first ? firstLever * 70 - 25 : secondLever * 15, -45, 45); float vAngle = (float) Mth.clamp(first ? firstLever * 70 - 25 : secondLever * 15, -45, 45);
SuperByteBuffer lever = CachedBufferer.partial(AllBlockPartials.TRAIN_CONTROLS_LEVER, state); SuperByteBuffer lever = CachedBufferer.partial(AllPartialModels.TRAIN_CONTROLS_LEVER, state);
ms.pushPose(); ms.pushPose();
TransformStack.cast(ms) TransformStack.cast(ms)
.centre() .centre()

View file

@ -54,7 +54,7 @@ public class HonkPacket extends SimplePacketBase {
train.honkTicks = train.honkTicks > 5 ? 6 : 0; train.honkTicks = train.honkTicks > 5 ? 6 : 0;
} else { } else {
AllAdvancements.TRAIN_WHISTLE.awardTo(sender); AllAdvancements.TRAIN_WHISTLE.awardTo(sender);
AllPackets.channel.send(PacketDistributor.ALL.noArg(), new HonkPacket(train, isHonk)); AllPackets.getChannel().send(PacketDistributor.ALL.noArg(), new HonkPacket(train, isHonk));
} }
}); });

View file

@ -60,7 +60,7 @@ public class TrainHUD {
Train train = carriage.train; Train train = carriage.train;
double value = double value =
Math.abs(train.speed) / (train.maxSpeed() * AllConfigs.SERVER.trains.manualTrainSpeedModifier.getF()); Math.abs(train.speed) / (train.maxSpeed() * AllConfigs.server().trains.manualTrainSpeedModifier.getF());
value = Mth.clamp(value + 0.05f, 0, 1); value = Mth.clamp(value + 0.05f, 0, 1);
displayedSpeed.chase((int) (value * 18) / 18f, .5f, Chaser.EXP); displayedSpeed.chase((int) (value * 18) / 18f, .5f, Chaser.EXP);
@ -73,14 +73,14 @@ public class TrainHUD {
if (isSprintKeyPressed && honkPacketCooldown-- <= 0) { if (isSprintKeyPressed && honkPacketCooldown-- <= 0) {
train.determineHonk(mc.level); train.determineHonk(mc.level);
if (train.lowHonk != null) { if (train.lowHonk != null) {
AllPackets.channel.sendToServer(new HonkPacket.Serverbound(train, true)); AllPackets.getChannel().sendToServer(new HonkPacket.Serverbound(train, true));
honkPacketCooldown = 5; honkPacketCooldown = 5;
usedToHonk = true; usedToHonk = true;
} }
} }
if (!isSprintKeyPressed && usedToHonk) { if (!isSprintKeyPressed && usedToHonk) {
AllPackets.channel.sendToServer(new HonkPacket.Serverbound(train, false)); AllPackets.getChannel().sendToServer(new HonkPacket.Serverbound(train, false));
honkPacketCooldown = 0; honkPacketCooldown = 0;
usedToHonk = false; usedToHonk = false;
} }
@ -94,7 +94,7 @@ public class TrainHUD {
} }
if (hudPacketCooldown-- <= 0) { if (hudPacketCooldown-- <= 0) {
AllPackets.channel.sendToServer(new TrainHUDUpdatePacket.Serverbound(train, editedThrottle)); AllPackets.getChannel().sendToServer(new TrainHUDUpdatePacket.Serverbound(train, editedThrottle));
hudPacketCooldown = 5; hudPacketCooldown = 5;
} }
} }

View file

@ -204,7 +204,7 @@ public class MinecartContraptionItem extends Item {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (player == null || entity == null) if (player == null || entity == null)
return; return;
if (!AllConfigs.SERVER.kinetics.survivalContraptionPickup.get() && !player.isCreative()) if (!AllConfigs.server().kinetics.survivalContraptionPickup.get() && !player.isCreative())
return; return;
ItemStack wrench = player.getItemInHand(event.getHand()); ItemStack wrench = player.getItemInHand(event.getHand());

View file

@ -189,7 +189,7 @@ public class MechanicalPistonBlock extends DirectionalAxisKineticBlock implement
} }
public static int maxAllowedPistonPoles() { public static int maxAllowedPistonPoles() {
return AllConfigs.SERVER.kinetics.maxPistonPoles.get(); return AllConfigs.server().kinetics.maxPistonPoles.get();
} }
@Override @Override

View file

@ -160,7 +160,7 @@ public class PistonContraption extends TranslatingContraption {
boolean retracting = direction != orientation; boolean retracting = direction != orientation;
if (retracting && !sticky) if (retracting && !sticky)
return true; return true;
for (int offset = 0; offset <= AllConfigs.SERVER.kinetics.maxChassisRange.get(); offset++) { for (int offset = 0; offset <= AllConfigs.server().kinetics.maxChassisRange.get(); offset++) {
if (offset == 1 && retracting) if (offset == 1 && retracting)
return true; return true;
BlockPos currentPos = pos.relative(orientation, offset + initialExtensionProgress); BlockPos currentPos = pos.relative(orientation, offset + initialExtensionProgress);

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager; import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.core.Materials; import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.oriented.OrientedData; import com.jozufozu.flywheel.core.materials.oriented.OrientedData;
import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.fluids.actors.HosePulleyBlockEntity; import com.simibubi.create.content.contraptions.fluids.actors.HosePulleyBlockEntity;
import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.AnimationTickHolder;
@ -15,27 +15,27 @@ public class HosePulleyInstance extends AbstractPulleyInstance<HosePulleyBlockEn
} }
protected Instancer<OrientedData> getRopeModel() { protected Instancer<OrientedData> getRopeModel() {
return getOrientedMaterial().getModel(AllBlockPartials.HOSE, blockState); return getOrientedMaterial().getModel(AllPartialModels.HOSE, blockState);
} }
protected Instancer<OrientedData> getMagnetModel() { protected Instancer<OrientedData> getMagnetModel() {
return materialManager.defaultCutout() return materialManager.defaultCutout()
.material(Materials.ORIENTED) .material(Materials.ORIENTED)
.getModel(AllBlockPartials.HOSE_MAGNET, blockState); .getModel(AllPartialModels.HOSE_MAGNET, blockState);
} }
protected Instancer<OrientedData> getHalfMagnetModel() { protected Instancer<OrientedData> getHalfMagnetModel() {
return materialManager.defaultCutout() return materialManager.defaultCutout()
.material(Materials.ORIENTED) .material(Materials.ORIENTED)
.getModel(AllBlockPartials.HOSE_HALF_MAGNET, blockState); .getModel(AllPartialModels.HOSE_HALF_MAGNET, blockState);
} }
protected Instancer<OrientedData> getCoilModel() { protected Instancer<OrientedData> getCoilModel() {
return getOrientedMaterial().getModel(AllBlockPartials.HOSE_COIL, blockState, rotatingAbout); return getOrientedMaterial().getModel(AllPartialModels.HOSE_COIL, blockState, rotatingAbout);
} }
protected Instancer<OrientedData> getHalfRopeModel() { protected Instancer<OrientedData> getHalfRopeModel() {
return getOrientedMaterial().getModel(AllBlockPartials.HOSE_HALF, blockState); return getOrientedMaterial().getModel(AllPartialModels.HOSE_HALF, blockState);
} }
protected float getOffset() { protected float getOffset() {

View file

@ -105,7 +105,7 @@ public class PulleyBlockEntity extends LinearActuatorBlockEntity implements Stoc
return; return;
if (speed == 0 && mirrorParent == null) if (speed == 0 && mirrorParent == null)
return; return;
int maxLength = AllConfigs.SERVER.kinetics.maxRopeLength.get(); int maxLength = AllConfigs.server().kinetics.maxRopeLength.get();
int i = 1; int i = 1;
while (i <= maxLength) { while (i <= maxLength) {
BlockPos ropePos = worldPosition.below(i); BlockPos ropePos = worldPosition.below(i);
@ -341,7 +341,7 @@ public class PulleyBlockEntity extends LinearActuatorBlockEntity implements Stoc
@Override @Override
protected int getExtensionRange() { protected int getExtensionRange() {
return Math.max(0, Math.min(AllConfigs.SERVER.kinetics.maxRopeLength.get(), return Math.max(0, Math.min(AllConfigs.server().kinetics.maxRopeLength.get(),
(worldPosition.getY() - 1) - level.getMinBuildHeight())); (worldPosition.getY() - 1) - level.getMinBuildHeight()));
} }

View file

@ -1,8 +1,8 @@
package com.simibubi.create.content.contraptions.components.structureMovement.pulley; package com.simibubi.create.content.contraptions.components.structureMovement.pulley;
import com.jozufozu.flywheel.core.PartialModel; import com.jozufozu.flywheel.core.PartialModel;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllBlocks; import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity;
import com.simibubi.create.foundation.render.CachedBufferer; import com.simibubi.create.foundation.render.CachedBufferer;
import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.render.SuperByteBuffer;
@ -14,7 +14,7 @@ import net.minecraft.util.Mth;
public class PulleyRenderer extends AbstractPulleyRenderer<PulleyBlockEntity> { public class PulleyRenderer extends AbstractPulleyRenderer<PulleyBlockEntity> {
public PulleyRenderer(BlockEntityRendererProvider.Context context) { public PulleyRenderer(BlockEntityRendererProvider.Context context) {
super(context, AllBlockPartials.ROPE_HALF, AllBlockPartials.ROPE_HALF_MAGNET); super(context, AllPartialModels.ROPE_HALF, AllPartialModels.ROPE_HALF_MAGNET);
} }
@Override @Override
@ -25,7 +25,7 @@ public class PulleyRenderer extends AbstractPulleyRenderer<PulleyBlockEntity> {
@Override @Override
protected PartialModel getCoil() { protected PartialModel getCoil() {
return AllBlockPartials.ROPE_COIL; return AllPartialModels.ROPE_COIL;
} }
@Override @Override

Some files were not shown because too many files have changed in this diff Show more