The Magic Formula

- Re-enable the computercraft integration
- Some ponder oddities
- Update pack format
This commit is contained in:
simibubi 2023-07-04 23:14:05 +02:00
parent 2a93caf5c7
commit 193c905f24
8 changed files with 58 additions and 52 deletions

View file

@ -188,8 +188,8 @@ dependencies {
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_minecraft_version}") runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}+${curios_minecraft_version}")
if (cc_tweaked_enable.toBoolean()) { if (cc_tweaked_enable.toBoolean()) {
compileOnly fg.deobf("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge-api:${cc_tweaked_version}:cc-tweaked-${cc_tweaked_minecraft_version}-forge-api-${cc_tweaked_version}") compileOnly fg.deobf("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge-api:${cc_tweaked_version}")
runtimeOnly fg.deobf("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge:${cc_tweaked_version}:cc-tweaked-${cc_tweaked_minecraft_version}-forge-${cc_tweaked_version}") runtimeOnly fg.deobf("cc.tweaked:cc-tweaked-${cc_tweaked_minecraft_version}-forge:${cc_tweaked_version}")
} }
// implementation fg.deobf("curse.maven:druidcraft-340991:3101903") // implementation fg.deobf("curse.maven:druidcraft-340991:3101903")

View file

@ -29,9 +29,9 @@ jei_version = 15.2.0.22
curios_minecraft_version = 1.20.1 curios_minecraft_version = 1.20.1
curios_version = 5.2.0-beta.3 curios_version = 5.2.0-beta.3
cc_tweaked_enable = false cc_tweaked_enable = true
cc_tweaked_minecraft_version = 1.19.3 cc_tweaked_minecraft_version = 1.20.1
cc_tweaked_version = 1.103.1 cc_tweaked_version = 1.105.0
# curseforge information # curseforge information
projectId = 328085 projectId = 328085

View file

@ -3,6 +3,7 @@ package com.simibubi.create.compat.computercraft;
import java.util.function.Function; import java.util.function.Function;
import com.simibubi.create.compat.Mods; import com.simibubi.create.compat.Mods;
import com.simibubi.create.compat.computercraft.implementation.ComputerBehaviour;
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity; import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
public class ComputerCraftProxy { public class ComputerCraftProxy {
@ -14,7 +15,7 @@ public class ComputerCraftProxy {
private static void registerWithDependency() { private static void registerWithDependency() {
/* Comment if computercraft.implementation is not in the source set */ /* Comment if computercraft.implementation is not in the source set */
// computerFactory = ComputerBehaviour::new; computerFactory = ComputerBehaviour::new;
} }
private static Function<SmartBlockEntity, ? extends AbstractComputerBehaviour> fallbackFactory; private static Function<SmartBlockEntity, ? extends AbstractComputerBehaviour> fallbackFactory;

View file

@ -65,6 +65,7 @@ public class PonderWorld extends SchematicWorld {
int overrideLight; int overrideLight;
Selection mask; Selection mask;
boolean currentlyTickingEntities;
public PonderWorld(BlockPos anchor, Level original) { public PonderWorld(BlockPos anchor, Level original) {
super(anchor, original); super(anchor, original);
@ -147,6 +148,8 @@ public class PonderWorld extends SchematicWorld {
public BlockState getBlockState(BlockPos globalPos) { public BlockState getBlockState(BlockPos globalPos) {
if (mask != null && !mask.test(globalPos.subtract(anchor))) if (mask != null && !mask.test(globalPos.subtract(anchor)))
return Blocks.AIR.defaultBlockState(); return Blocks.AIR.defaultBlockState();
if (currentlyTickingEntities && globalPos.getY() < 0)
return Blocks.AIR.defaultBlockState();
return super.getBlockState(globalPos); return super.getBlockState(globalPos);
} }
@ -194,6 +197,8 @@ public class PonderWorld extends SchematicWorld {
} }
public void tick() { public void tick() {
currentlyTickingEntities = true;
particles.tick(); particles.tick();
for (Iterator<Entity> iterator = entities.iterator(); iterator.hasNext();) { for (Iterator<Entity> iterator = entities.iterator(); iterator.hasNext();) {
@ -211,6 +216,8 @@ public class PonderWorld extends SchematicWorld {
if (!entity.isAlive()) if (!entity.isAlive())
iterator.remove(); iterator.remove();
} }
currentlyTickingEntities = false;
} }
@Override @Override

View file

@ -333,10 +333,6 @@ public class WorldSectionElement extends AnimatedSceneElement {
overlayMS = new PoseStack(); overlayMS = new PoseStack();
overlayMS.last().pose().set(ms.last().pose()); overlayMS.last().pose().set(ms.last().pose());
overlayMS.last().normal().set(ms.last().normal()); overlayMS.last().normal().set(ms.last().normal());
float scaleFactor = world.scene.getScaleFactor();
float f = (float) Math.pow(30 * scaleFactor, -1.2);
overlayMS.scale(f, f, f);
} }
VertexConsumer builder = new SheetedDecalTextureGenerator( VertexConsumer builder = new SheetedDecalTextureGenerator(

View file

@ -9,14 +9,12 @@ import org.apache.commons.lang3.mutable.MutableInt;
import org.lwjgl.glfw.GLFW; import org.lwjgl.glfw.GLFW;
import com.mojang.blaze3d.platform.Window; import com.mojang.blaze3d.platform.Window;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.foundation.gui.AbstractSimiScreen; import com.simibubi.create.foundation.gui.AbstractSimiScreen;
import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.foundation.gui.ScreenOpener;
import com.simibubi.create.foundation.gui.Theme; import com.simibubi.create.foundation.gui.Theme;
import com.simibubi.create.foundation.gui.UIRenderHelper; import com.simibubi.create.foundation.gui.UIRenderHelper;
import com.simibubi.create.foundation.ponder.PonderLocalization; import com.simibubi.create.foundation.ponder.PonderLocalization;
import com.simibubi.create.foundation.ponder.PonderTooltipHandler;
import com.simibubi.create.foundation.utility.Color; import com.simibubi.create.foundation.utility.Color;
import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.animation.LerpedFloat; import com.simibubi.create.foundation.utility.animation.LerpedFloat;
@ -136,45 +134,51 @@ public abstract class NavigatableSimiScreen extends AbstractSimiScreen {
PoseStack ms = graphics.pose(); PoseStack ms = graphics.pose();
Screen lastScreen = ScreenOpener.getPreviouslyRenderedScreen(); // Screen lastScreen = ScreenOpener.getPreviouslyRenderedScreen();
float transitionValue = transition.getValue(partialTicks); float transitionValue = transition.getValue(partialTicks);
float scale = 1 + 0.5f * transitionValue; float scale = 1 + 0.5f * transitionValue;
/*
* Looks like this stopped working sometime before 1.18
* Now commented as it does mess with the background alpha since 1.20
*/
// draw last screen into buffer // draw last screen into buffer
if (lastScreen != null && lastScreen != this && !transition.settled()) { // if (lastScreen != null && lastScreen != this && !transition.settled()) {
ms.pushPose(); // ms.pushPose();
UIRenderHelper.framebuffer.clear(Minecraft.ON_OSX); // UIRenderHelper.framebuffer.clear(Minecraft.ON_OSX);
ms.translate(0, 0, -1000); // ms.translate(0, 0, -1000);
UIRenderHelper.framebuffer.bindWrite(true); // UIRenderHelper.framebuffer.bindWrite(true);
PonderTooltipHandler.enable = false; // PonderTooltipHandler.enable = false;
// Using 0,0 for mouse coords to hide tooltips // // Using 0,0 for mouse coords to hide tooltips
lastScreen.render(graphics, 0, 0, partialTicks); // lastScreen.render(graphics, 0, 0, partialTicks);
PonderTooltipHandler.enable = true; // PonderTooltipHandler.enable = true;
//
ms.popPose(); // ms.popPose();
ms.pushPose(); // ms.pushPose();
//
// use the buffer texture // // use the buffer texture
minecraft.getMainRenderTarget() // minecraft.getMainRenderTarget()
.bindWrite(true); // .bindWrite(true);
//
Window window = minecraft.getWindow(); // Window window = minecraft.getWindow();
int dpx = window.getGuiScaledWidth() / 2; // int dpx = window.getGuiScaledWidth() / 2;
int dpy = window.getGuiScaledHeight() / 2; // int dpy = window.getGuiScaledHeight() / 2;
if (lastScreen instanceof NavigatableSimiScreen navigableScreen) { // if (lastScreen instanceof NavigatableSimiScreen navigableScreen) {
dpx = navigableScreen.depthPointX; // dpx = navigableScreen.depthPointX;
dpy = navigableScreen.depthPointY; // dpy = navigableScreen.depthPointY;
} // }
//
ms.translate(dpx, dpy, 0); // ms.translate(dpx, dpy, 0);
ms.scale(scale, scale, 1); // ms.scale(scale, scale, 1);
ms.translate(-dpx, -dpy, 0); // ms.translate(-dpx, -dpy, 0);
RenderSystem.enableBlend(); // RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc(); // RenderSystem.defaultBlendFunc();
UIRenderHelper.drawFramebuffer(1f - Math.abs(transitionValue)); // UIRenderHelper.drawFramebuffer(1f - Math.abs(transitionValue));
RenderSystem.disableBlend(); // RenderSystem.disableBlend();
ms.popPose(); // ms.popPose();
} // }
// modify current screen as well // modify current screen as well
scale = transitionValue > 0 ? 1 - 0.5f * (1 - transitionValue) : 1 + .5f * (1 + transitionValue); scale = transitionValue > 0 ? 1 - 0.5f * (1 - transitionValue) : 1 + .5f * (1 + transitionValue);

View file

@ -1,8 +1,6 @@
{ {
"pack": { "pack": {
"description": "Create resources", "description": "Create resources",
"pack_format": 10, "pack_format": 15
"forge:resource_pack_format": 12,
"forge:data_pack_format": 10
} }
} }

View file

@ -1,6 +1,6 @@
{ {
"pack": { "pack": {
"pack_format": 12, "pack_format": 15,
"description": "Replacement textures for Vanilla Copper" "description": "Replacement textures for Vanilla Copper"
} }
} }