Compare commits

...
Author SHA1 Message Date
PLASMAchicken 3d3260cd71 fix(blocks): honor mob-spawn config on Waterstone/Lavastone/Sand (#104)
* fix(blocks): honor mob-spawn config on Waterstone/Lavastone

BlockMultiLayer implements ICarvable, so its item tooltip shows "Mobs
cannot Spawn on this Block" whenever canMobsSpawnOnTheChiselBlocks is
disabled, but unlike BlockCarvable it never overrode canCreatureSpawn,
so the setting was never actually enforced on Waterstone (and
Lavastone, which happened to mask the bug via its high light level
blocking hostile spawns).

Fixes GTNewHorizons/GT-New-Horizons-Modpack#26703

* fix(blocks): honor mob-spawn config on carvable Sand

Same root cause as Waterstone/Lavastone: BlockCarvableSand is a full
opaque block (Material.sand) implementing ICarvable, so it shows the
"Mobs cannot Spawn on this Block" tooltip whenever
canMobsSpawnOnTheChiselBlocks is disabled, but never overrode
canCreatureSpawn to actually enforce it.

Verified against the decompiled Forge source in build/rfg: unlike the
carvable Glass/Ice/PackedIce/Beacon blocks (which never reach
canCreatureSpawn at all because they fail the earlier solid-top-surface
check via a translucent material or renderAsNormalBlock=false), Sand
uses an opaque material with no such override, so it passes that check
and defaults canCreatureSpawn to true.
2026-09-09 08:27:21 +02:00
boubou19 ff70c8b2e3 Fix hex plating glow tint pollution from leaked ambient occlusion state (#101) 2026-08-09 16:59:25 +07:00
Jason Mitchell c1ac213eab Maybe more thread safe renderpass (#100) 2026-07-22 15:30:06 -07:00
UltraProdigyandRanzu 54c339e03e cast it up (#99)
Co-authored-by: Ranzu <[email protected]>
2026-07-08 12:14:03 -04:00
George PatonandUltraProdigy d34cd0445a turn road blocks into concrete to apply speed boost (#96)
Co-authored-by: UltraProdigy <[email protected]>
2026-07-08 07:52:44 +00:00
UltraProdigy 8655f8b0a8 Add reminder to review contribution guidelines (#98) 2026-07-04 20:56:31 +02:00
26 changed files with 66 additions and 41 deletions

No files matched your search

+1
View File
@@ -1,5 +1,6 @@
Contributing
============
Before contributing, make sure you're familiar with the [GT:NH Contribution Guidelines](https://github.com/GTNewHorizons/.github/blob/master/CONTRIBUTING.md)
___
Setting up a Development Environment
------------------------------------
@@ -88,6 +88,7 @@ public class BlockNameConversion {
namingConversion.put("blockFft", "fantasyblock");
namingConversion.put("blockCarpetFloor", "carpet");
namingConversion.put("blockLaboratory", "laboratoryblock");
namingConversion.put("wroughtironblock", "castironblock");
}
public static Item findItem(String oldname) {
+19 -26
View File
@@ -4812,33 +4812,25 @@ public enum Features {
Carving.chisel.registerOre("platinumblock", "blockPlatinum");
}
},
WROUGHT_IRON {
CAST_IRON {
@Override
void addBlocks() {
BlockCarvable wrought_iron = (BlockCarvable) new BlockBeaconBase(Material.iron)
BlockCarvable cast_iron = (BlockCarvable) new BlockBeaconBase(Material.iron)
.setStepSound(Block.soundTypeMetal)
.setCreativeTab(ChiselTabs.tabModdedChiselBlocks)
.setHardness(5F)
.setResistance(10F);
wrought_iron.carverHelper
.addVariation("tile.newmetalOre.0.desc", 0, "metals/wrought_iron/wrought_iron_0", 0);
wrought_iron.carverHelper
.addVariation("tile.newmetalOre.1.desc", 1, "metals/wrought_iron/wrought_iron_1", 1);
wrought_iron.carverHelper
.addVariation("tile.newetalOre.2.desc", 2, "metals/wrought_iron/wrought_iron_2", 2);
wrought_iron.carverHelper
.addVariation("tile.newetalOre.3.desc", 3, "metals/wrought_iron/wrought_iron_3", 3);
wrought_iron.carverHelper
.addVariation("tile.newetalOre.4.desc", 4, "metals/wrought_iron/wrought_iron_4", 4);
wrought_iron.carverHelper
.addVariation("tile.newetalOre.5.desc", 5, "metals/wrought_iron/wrought_iron_5", 5);
wrought_iron.carverHelper
.addVariation("tile.newetalOre.6.desc", 6, "metals/wrought_iron/wrought_iron_6", 6);
wrought_iron.carverHelper
.addVariation("tile.newetalOre.7.desc", 7, "metals/wrought_iron/wrought_iron_7", 6);
wrought_iron.carverHelper.registerAll(wrought_iron, "wroughtironblock");
Carving.chisel.registerOre("wroughtironblock", "blockWroughtIron");
cast_iron.carverHelper.addVariation("tile.newmetalOre.0.desc", 0, "metals/cast_iron/cast_iron_0", 0);
cast_iron.carverHelper.addVariation("tile.newmetalOre.1.desc", 1, "metals/cast_iron/cast_iron_1", 1);
cast_iron.carverHelper.addVariation("tile.newetalOre.2.desc", 2, "metals/cast_iron/cast_iron_2", 2);
cast_iron.carverHelper.addVariation("tile.newetalOre.3.desc", 3, "metals/cast_iron/cast_iron_3", 3);
cast_iron.carverHelper.addVariation("tile.newetalOre.4.desc", 4, "metals/cast_iron/cast_iron_4", 4);
cast_iron.carverHelper.addVariation("tile.newetalOre.5.desc", 5, "metals/cast_iron/cast_iron_5", 5);
cast_iron.carverHelper.addVariation("tile.newetalOre.6.desc", 6, "metals/cast_iron/cast_iron_6", 6);
cast_iron.carverHelper.addVariation("tile.newetalOre.7.desc", 7, "metals/cast_iron/cast_iron_7", 6);
cast_iron.carverHelper.registerAll(cast_iron, "castironblock");
Carving.chisel.registerOre("castironblock", "blockCastIron");
}
},
TITANIUM {
@@ -5251,7 +5243,7 @@ public enum Features {
@Override
void addBlocks() {
BlockCarvable road = (BlockCarvable) new BlockCarvable(Material.wood).setStepSound(Block.soundTypeWood)
BlockCarvable road = (BlockCarvable) new BlockConcrete().setStepSound(Block.soundTypeStone)
.setCreativeTab(ChiselTabs.tabModdedChiselBlocks)
.setHardness(5F)
.setResistance(10F);
@@ -5272,7 +5264,7 @@ public enum Features {
road.carverHelper.addVariation("tile.road.14.desc", 14, "road/lined_white");
road.carverHelper.addVariation("tile.road.15.desc", 15, "road/outline_white");
BlockCarvable road2 = (BlockCarvable) new BlockCarvable(Material.wood).setStepSound(Block.soundTypeWood)
BlockCarvable road2 = (BlockCarvable) new BlockConcrete().setStepSound(Block.soundTypeStone)
.setCreativeTab(ChiselTabs.tabModdedChiselBlocks)
.setHardness(5F)
.setResistance(10F);
@@ -5313,6 +5305,7 @@ public enum Features {
}
};
public static final Features[] VALUES = values();
private static final String[] dyeOres = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple",
"dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta",
"dyeOrange", "dyeWhite" };
@@ -5328,7 +5321,7 @@ public enum Features {
private static void loadBlocks() {
Chisel.logger.info("Loading blocks...");
int num = 0;
for (Features f : values()) {
for (Features f : VALUES) {
if (f.enabled()) {
f.addBlocks();
++num;
@@ -5345,7 +5338,7 @@ public enum Features {
private static void loadItems() {
Chisel.logger.info("Loading items...");
int num = 0;
for (Features f : values()) {
for (Features f : VALUES) {
if (f.enabled()) {
f.addItems();
++num;
@@ -5359,7 +5352,7 @@ public enum Features {
private static void loadRecipes() {
Chisel.logger.info("Loading recipes...");
int num = 0;
for (Features f : values()) {
for (Features f : VALUES) {
if (f.enabled()) {
if (f.needsMetaRecipes()) {
for (int i = 0; i < 16; i++) {
@@ -5395,7 +5388,7 @@ public enum Features {
}
public static boolean oneModdedFeatureLoaded() {
for (Features f : values()) {
for (Features f : VALUES) {
if (f.hasRequiredMod()) {
return true;
}
@@ -6,6 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockSand;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@@ -19,6 +20,7 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import team.chisel.Chisel;
import team.chisel.config.Configurations;
public class BlockCarvableSand extends BlockSand implements ICarvable {
@@ -83,6 +85,11 @@ public class BlockCarvableSand extends BlockSand implements ICarvable {
return carverHelper.getVariation(meta);
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return Configurations.canMobsSpawnOnTheChiselBlocks;
}
public static class SoundType extends Block.SoundType {
public final String soundNameStep;
@@ -6,6 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@@ -14,6 +15,8 @@ import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.api.carving.CarvableHelper;
import com.cricketcraft.chisel.api.carving.IVariationInfo;
import team.chisel.config.Configurations;
public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable {
public CarvableHelper carverHelper;
@@ -62,4 +65,9 @@ public class BlockMultiLayer extends BlockMultiLayerBase implements ICarvable {
public IVariationInfo getManager(int meta) {
return carverHelper.getVariation(meta);
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return Configurations.canMobsSpawnOnTheChiselBlocks;
}
}
@@ -4,7 +4,6 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.ForgeHooksClient;
import team.chisel.client.render.RendererMultiLayer;
@@ -43,7 +42,6 @@ public abstract class BlockMultiLayerBase extends Block {
@Override
public boolean canRenderInPass(int pass) {
ForgeHooksClient.setRenderPass(pass);
return pass == 1 || pass == 0;
}
@@ -37,6 +37,8 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
STACK,
REVERSION;
public static final Upgrade[] VALUES = values();
public String getUnlocalizedName() {
if (Features.AUTO_CHISEL_UPGRADES.enabled()) {
return "item.upgrade_" + this.name()
@@ -380,7 +382,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
return itemStack.getItem() instanceof IChiselItem;
default:
return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade
&& Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
&& Upgrade.VALUES[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
}
}
@@ -465,7 +467,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
String unloc = name == null ? null : String.format(base, name);
return StatCollector.translateToLocal(unloc);
} else {
return Upgrade.values()[slotNumber - MIN_UPGRADE].getLocalizedName();
return Upgrade.VALUES[slotNumber - MIN_UPGRADE].getLocalizedName();
}
}
@@ -40,13 +40,28 @@ public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
final Tessellator tessellator = Tessellator.instance;
tessellator.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]);
final boolean prevEnableAO = renderer.enableAO;
final int tint = Configurations.configColors[world.getBlockMetadata(x, y, z)];
tessellator.setColorOpaque_I(tint);
tessellator.setBrightness(0xF000F0);
setFullbrightColor(renderer, tint);
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
renderer.enableAO = prevEnableAO;
renderer.renderStandardBlock(block, x, y, z);
return true;
}
private static void setFullbrightColor(RenderBlocks renderer, int color) {
final float r = (color >> 16 & 255) / 255.0F;
final float g = (color >> 8 & 255) / 255.0F;
final float b = (color & 255) / 255.0F;
renderer.enableAO = true;
renderer.colorRedTopLeft = renderer.colorRedBottomLeft = renderer.colorRedBottomRight = renderer.colorRedTopRight = r;
renderer.colorGreenTopLeft = renderer.colorGreenBottomLeft = renderer.colorGreenBottomRight = renderer.colorGreenTopRight = g;
renderer.colorBlueTopLeft = renderer.colorBlueBottomLeft = renderer.colorBlueBottomRight = renderer.colorBlueTopRight = b;
renderer.brightnessTopLeft = renderer.brightnessBottomLeft = renderer.brightnessTopRight = renderer.brightnessBottomRight = 0xF000F0;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
@@ -14,7 +14,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.client.ForgeHooksClient;
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
@@ -57,7 +57,7 @@ public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
RenderBlocks renderer) {
if (!(blck instanceof BlockMultiLayerBase block)) return false;
if (MinecraftForgeClient.getRenderPass() == 0) {
if (ForgeHooksClient.getWorldRenderPass() == 0) {
if (block.icon != null) {
renderer.overrideBlockTexture = block.icon;
renderer.renderStandardBlock(block, x, y, z);
@@ -303,7 +303,7 @@ public class Configurations {
}
/* features */
for (Features feature : Features.values()) {
for (Features feature : Features.VALUES) {
features.put(
featureName(feature),
config.get("features", featureName(feature), true)
@@ -189,7 +189,7 @@ public final class ChiselBlocks {
public static final BlockCarvable invar = null;
public static final BlockCarvable nickel = null;
public static final BlockCarvable platinum = null;
public static final BlockCarvable wrought_iron = null;
public static final BlockCarvable cast_iron = null;
public static final BlockCarvable stainless_steel = null;
public static final BlockCarvable titanium = null;
public static final BlockCarvable tungstensteel = null;
@@ -202,7 +202,7 @@ public final class ChiselBlocks {
public static final BlockCarvable albumblock2 = null;
public static final BlockCarvable brickCustom2 = null;
public static final BlockCarvable brutalism = null;
public static final BlockCarvable road = null;
public static final BlockConcrete road = null;
public static final BlockCarvable porcelain = null;
public static final BlockCarvable alabaster = null;
@@ -26,12 +26,12 @@ public class ItemUpgrade extends BaseItem {
@Override
public IIcon getIconFromDamage(int meta) {
// using modulo throughout to prevent AIOB
return this.icons[meta % Upgrade.values().length];
return this.icons[meta % Upgrade.VALUES.length];
}
@Override
public void registerIcons(IIconRegister reg) {
Upgrade[] upgrades = Upgrade.values();
Upgrade[] upgrades = Upgrade.VALUES;
for (int i = 0; i < upgrades.length; i++) {
this.icons[i] = reg.registerIcon(
Chisel.MOD_ID + ":upgrade_"
@@ -43,14 +43,14 @@ public class ItemUpgrade extends BaseItem {
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void getSubItems(Item item, CreativeTabs tab, List list) {
for (int i = 0; i < Upgrade.values().length; i++) {
for (int i = 0; i < Upgrade.VALUES.length; i++) {
list.add(new ItemStack(item, 1, i));
}
}
@Override
public String getUnlocalizedName(ItemStack stack) {
Upgrade[] upgrades = Upgrade.values();
Upgrade[] upgrades = Upgrade.VALUES;
return upgrades[stack.getItemDamage() % upgrades.length].getUnlocalizedName();
}
}
@@ -2820,7 +2820,7 @@ tile.chisel.invarblock.name=Block of Invar
tile.chisel.electrumblock.name=Block of Electrum
tile.chisel.nickelblock.name=Block of Nickel
tile.chisel.platinumblock.name=Block of Platinum
tile.chisel.wroughtironblock.name=Block of Wrought Iron
tile.chisel.castironblock.name=Block of Cast Iron
tile.chisel.stainlesssteelblock.name=Block of Stainless Steel
tile.chisel.titaniumblock.name=Block of Titanium
tile.chisel.tungstensteelblock.name=Block of Tungstensteel
File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB