Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package com.ldtteam.blockui.util.color;

import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormatElement;

/**
* Wrapper for having default color for vertex consumer
*/
public class ColouredVertexConsumer implements VertexConsumer
{
protected final VertexConsumer parent;
public IColour defaultColor = null;

public ColouredVertexConsumer(final VertexConsumer parent)
{
this.parent = parent;
}

@Override
public ColouredVertexConsumer addVertex(final float x, final float y, final float z)
{
parent.addVertex(x, y, z);
return this;
}

@Override
public ColouredVertexConsumer setColor(final int r, final int g, final int b, final int a)
{
parent.setColor(r, g, b, a);
return this;
}

/**
* Applies previously set defaultColor, will shamelessly NPE if you forgot to set it
*/
public ColouredVertexConsumer setDefaultColor()
{
defaultColor.writeIntoBuffer(this);
return this;
}

@Override
public ColouredVertexConsumer setUv(final float u, final float v)
{
parent.setUv(u, v);
return this;
}

@Override
public ColouredVertexConsumer setUv1(final int u, final int v)
{
parent.setUv1(u, v);
return this;
}

@Override
public ColouredVertexConsumer setUv2(final int u, final int v)
{
parent.setUv2(u, v);
return this;
}

@Override
public ColouredVertexConsumer setNormal(final float x, final float y, final float z)
{
parent.setNormal(x, y, z);
return this;
}

@Override
public ColouredVertexConsumer misc(final VertexFormatElement element, final int... values)
{
parent.misc(element, values);
return this;
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/ldtteam/blockui/util/color/IColour.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ldtteam.blockui.util.color;

import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.VertexConsumer;

public interface IColour
{
Expand Down Expand Up @@ -67,9 +67,9 @@ default ColourARGB asARGB()
}

/**
* @see BufferBuilder#setColor(int, int, int, int)
* @see VertexConsumer#setColor(int, int, int, int)
*/
default void writeIntoBuffer(final BufferBuilder buffer)
default void writeIntoBuffer(final VertexConsumer buffer)
{
buffer.setColor(red(), green(), blue(), alpha());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public abstract class AbstractConfiguration
{
public static final String DEFAULT_KEY_PREFIX = "structurize.config.default.";
public static final String DEFAULT_KEY_PREFIX = "blockui.config.default.";
public static final String COMMENT_SUFFIX = ".comment";

final List<ConfigWatcher<?>> watchers = new ArrayList<>();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/ldtteam/common/config/Configurations.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import net.neoforged.fml.config.ModConfig.Type;
import net.neoforged.fml.event.config.ModConfigEvent;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
import net.neoforged.neoforge.common.ModConfigSpec;
import net.neoforged.neoforge.common.ModConfigSpec.Builder;
import net.neoforged.neoforge.common.ModConfigSpec.ConfigValue;
Expand Down Expand Up @@ -75,6 +77,7 @@ public Configurations(final ModContainer modContainer,
// register events for watchers
modBus.addListener(ModConfigEvent.Loading.class, event -> onConfigLoad(event.getConfig()));
modBus.addListener(ModConfigEvent.Reloading.class, event -> onConfigReload(event.getConfig()));
modContainer.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
}

private <T extends AbstractConfiguration> Pair<T, ModConfig> createConfig(final Function<Builder, T> factory,
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/ldtteam/common/fakelevel/FakeLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class FakeLevel<SOURCE extends IFakeLevelBlockGetter> extends Level
protected final boolean overrideBeLevel;

protected final FakeChunkSource chunkSource;
protected final FakeLevelLightEngine lightEngine;
protected final ModelDataManager modelDataManager;
protected FakeLevelEntityGetterAdapter levelEntityGetter = FakeLevelEntityGetterAdapter.EMPTY;
// TODO: this is currently manually filled by class user - ideally if not filled yet this should get constructed from levelSource
Expand Down Expand Up @@ -134,6 +135,7 @@ public FakeLevel(final SOURCE levelSource,
this.overrideBeLevel = overrideBeLevel;
this.chunkSource = new FakeChunkSource(this);
this.modelDataManager = new ModelDataManager(this);
this.lightEngine = new FakeLevelLightEngine(this);

setRealLevel(realLevel); // intentionally due to init
}
Expand Down Expand Up @@ -426,6 +428,12 @@ public ModelDataManager getModelDataManager()
return modelDataManager;
}

@Override
public LevelLightEngine getLightEngine()
{
return lightEngine;
}

@Override
public String gatherChunkSourceStats()
{
Expand Down Expand Up @@ -502,14 +510,6 @@ public float getDayTimePerTick()
// ======= NOOP UNSAFE NULL METHODS =======
// ========================================

@Override
public LevelLightEngine getLightEngine()
{
// TODO: noop
throw new UnsupportedOperationException(
"Structurize fake level - if you really need light engine please make issue on our GitHub");
}

@Override
public Explosion explode(@Nullable Entity p_311934_,
@Nullable DamageSource p_312790_,
Expand Down
Loading