mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-25 14:36:29 +01:00
Update Flywheel
- Fix too many implementations of ProcessingRecipe#canSpecifyDuration returning true
This commit is contained in:
parent
2a1c6e6916
commit
c5e7ad623f
12 changed files with 26 additions and 48 deletions
|
@ -172,7 +172,7 @@ dependencies {
|
|||
jarJar.ranged(it, '[MC1.18.2-1.1.3,)')
|
||||
}
|
||||
jarJar("com.jozufozu.flywheel:flywheel-forge-${flywheel_minecraft_version}:${flywheel_version}") {
|
||||
jarJar.ranged(it, '[0.6.9,0.6.10)')
|
||||
jarJar.ranged(it, '[0.6.10,0.6.11)')
|
||||
}
|
||||
|
||||
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
|
||||
|
|
|
@ -23,7 +23,7 @@ use_parchment = true
|
|||
# dependency versions
|
||||
registrate_version = MC1.18.2-1.1.3
|
||||
flywheel_minecraft_version = 1.18.2
|
||||
flywheel_version = 0.6.9-101
|
||||
flywheel_version = 0.6.10-105
|
||||
jei_minecraft_version = 1.18.2
|
||||
jei_version = 9.7.0.209
|
||||
curios_minecraft_version = 1.18.2
|
||||
|
|
|
@ -1367,7 +1367,7 @@ public abstract class Contraption {
|
|||
return blocks.values();
|
||||
}
|
||||
|
||||
public Collection<BlockEntity> getSpecialRenderedTEs() {
|
||||
public Collection<BlockEntity> getSpecialRenderedBEs() {
|
||||
return specialRenderedBlockEntities;
|
||||
}
|
||||
|
||||
|
|
|
@ -118,9 +118,9 @@ public class ContraptionRenderDispatcher {
|
|||
ContraptionWorld contraptionWorld = c.getContraptionWorld();
|
||||
|
||||
BlockPos origin = c.anchor;
|
||||
int height = contraptionWorld.getHeight();
|
||||
int minBuildHeight = contraptionWorld.getMinBuildHeight();
|
||||
VirtualRenderWorld renderWorld = new VirtualRenderWorld(world, origin, height, minBuildHeight) {
|
||||
int height = contraptionWorld.getHeight();
|
||||
VirtualRenderWorld renderWorld = new VirtualRenderWorld(world, minBuildHeight, height, origin) {
|
||||
@Override
|
||||
public boolean supportsFlywheel() {
|
||||
return canInstance();
|
||||
|
@ -133,13 +133,13 @@ public class ContraptionRenderDispatcher {
|
|||
// Skip individual lighting updates to prevent lag with large contraptions
|
||||
renderWorld.setBlock(info.pos, info.state, Block.UPDATE_SUPPRESS_LIGHT);
|
||||
|
||||
renderWorld.runLightingEngine();
|
||||
renderWorld.runLightEngine();
|
||||
return renderWorld;
|
||||
}
|
||||
|
||||
public static void renderBlockEntities(Level world, VirtualRenderWorld renderWorld, Contraption c,
|
||||
ContraptionMatrices matrices, MultiBufferSource buffer) {
|
||||
BlockEntityRenderHelper.renderBlockEntities(world, renderWorld, c.getSpecialRenderedTEs(),
|
||||
BlockEntityRenderHelper.renderBlockEntities(world, renderWorld, c.getSpecialRenderedBEs(),
|
||||
matrices.getModelViewProjection(), matrices.getLight(), buffer);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,4 +16,9 @@ public abstract class AbstractCrushingRecipe extends ProcessingRecipe<RecipeWrap
|
|||
protected int getMaxInputCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSpecifyDuration() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,11 @@ public class CuttingRecipe extends ProcessingRecipe<RecipeWrapper> implements IA
|
|||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSpecifyDuration() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAssemblyIngredients(List<Ingredient> list) {}
|
||||
|
||||
|
|
|
@ -208,6 +208,11 @@ public class BasinRecipe extends ProcessingRecipe<SmartInventory> {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSpecifyDuration() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(SmartInventory inv, @Nonnull Level worldIn) {
|
||||
return false;
|
||||
|
|
|
@ -71,7 +71,7 @@ public abstract class ProcessingRecipe<T extends Container> implements Recipe<T>
|
|||
}
|
||||
|
||||
protected boolean canSpecifyDuration() {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected int getMaxFluidInputCount() {
|
||||
|
|
|
@ -289,9 +289,9 @@ public class CarriageContraption extends Contraption {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Collection<BlockEntity> getSpecialRenderedTEs() {
|
||||
public Collection<BlockEntity> getSpecialRenderedBEs() {
|
||||
if (notInPortal())
|
||||
return super.getSpecialRenderedTEs();
|
||||
return super.getSpecialRenderedBEs();
|
||||
return specialRenderedBEsOutsidePortal;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
package com.simibubi.create.foundation.mixin.client;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.At.Shift;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
|
||||
@Mixin(PoseStack.class)
|
||||
public class FixNormalScalingMixin {
|
||||
/**
|
||||
* Minecraft negates the normal matrix if all scales are equal and negative, but
|
||||
* does not return afterward. This allows the rest of the method's logic to be
|
||||
* applied, which negates the matrix again, resulting in the matrix being the
|
||||
* same as in the beginning.
|
||||
*/
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lcom/mojang/math/Matrix3f;mul(F)V", shift = Shift.AFTER), method = "scale(FFF)V", cancellable = true)
|
||||
private void create$returnAfterNegate(float x, float y, float z, CallbackInfo ci) {
|
||||
ci.cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Minecraft takes the inverse cube root of the product of all scales to provide a
|
||||
* rough estimate for normalization so that it does not need to be done later. It
|
||||
* does not make sense for this "normalization factor" to be negative though, as
|
||||
* that would invert all normals. Additionally, Minecraft's fastInverseCbrt method
|
||||
* does not work for negative numbers.
|
||||
*/
|
||||
@ModifyArg(at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;fastInvCubeRoot(F)F"), method = "scale(FFF)V")
|
||||
private float create$absInvCbrtInput(float input) {
|
||||
return Math.abs(input);
|
||||
}
|
||||
}
|
|
@ -33,6 +33,6 @@ Technology that empowers the player.'''
|
|||
[[dependencies.create]]
|
||||
modId="flywheel"
|
||||
mandatory=true
|
||||
versionRange="[0.6.9,0.6.10)"
|
||||
versionRange="[0.6.10,0.6.11)"
|
||||
ordering="AFTER"
|
||||
side="CLIENT"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
"client.BlockDestructionProgressMixin",
|
||||
"client.CameraMixin",
|
||||
"client.EntityContraptionInteractionMixin",
|
||||
"client.FixNormalScalingMixin",
|
||||
"client.GameRendererMixin",
|
||||
"client.HeavyBootsOnPlayerMixin",
|
||||
"client.HumanoidArmorLayerMixin",
|
||||
|
|
Loading…
Reference in a new issue