Compare commits

..
25 Commits
Author SHA1 Message Date
Ruling-0 6472f9eede Bump MaterialLib to 0.24.0-mu 2026-10-11 18:25:18 -05:00
Ruling-0 cdde638c16 Bump MaterialLib to 0.21.0-mu 2026-10-09 21:16:29 -05:00
Ruling-0 d665ee4536 Bump MaterialLib to 0.20.0-mu 2026-10-09 19:02:33 -05:00
Ruling-0 5b7b560342 Merge remote-tracking branch 'origin/master' into mu 2026-10-09 18:56:04 -05:00
Ruling-0 66bc8b7137 Bump MaterialLib to 0.19.0-mu 2026-10-06 14:57:27 -05:00
Fib4ikandM R S E d27f30951a Add redstone signal support for item conduit. (#265)
Co-authored-by: M R S E <[email protected]>
2026-10-06 19:19:44 +02:00
Ruling-0 a7e6e97d18 Bump MaterialLib to 0.18.0-mu 2026-10-04 12:34:45 -05:00
Ruling-0 c30cb80084 Bump MaterialLib to 0.17.0-mu 2026-10-04 12:15:46 -05:00
Ruling-0 503fb98712 Bump MaterialLib to 0.16.0-mu 2026-10-04 02:48:16 -05:00
Ruling-0 53f303ce4c Bump MaterialLib to 0.15.0-mu 2026-09-30 13:01:46 -05:00
Ruling-0 378737a39f Bump MaterialLib to 0.14.0-mu 2026-09-30 11:03:26 -05:00
Ruling-0 4c22609b28 Bump MaterialLib to 0.13.0-mu 2026-09-29 16:57:13 -05:00
Ruling-0 e9c07c9d17 Bump MaterialLib to 0.12.0-mu 2026-09-29 07:22:34 -05:00
Ruling-0 59f1475df0 Merge remote-tracking branch 'origin/master' into mu 2026-09-28 07:38:26 -05:00
Mykhailo Balaker 8dcda4e822 Prevent fall-through when clicking on the "Show Range" button in Vacuum Chest GUI (#274) 2026-09-27 18:08:03 +00:00
fehling135 e337597a3c Make specialmobs really availale for soul binder (#270) 2026-09-25 17:46:29 +02:00
Ruling-0 d41c723194 Bump MaterialLib to 0.11.0-mu 2026-09-22 09:54:06 -05:00
Ruling-0 7e4e73bc0f Merge remote-tracking branch 'origin/master' into mu 2026-09-20 11:21:17 -05:00
Nikolay S. a8197e0026 Remove broken NBT-matching logic (#268) 2026-09-20 13:33:30 +02:00
Ruling-0 b96937cb7f Merge remote-tracking branch 'origin/master' into mu 2026-09-09 12:51:58 -05:00
Ruling-0 5450124254 Bump MaterialLib to 0.10.0-mu 2026-08-29 22:33:22 -05:00
Ruling-0 fd7ed181de Merge remote-tracking branch 'origin/master' into mu 2026-08-29 22:19:19 -05:00
Ruling-0 ae2866aa8d Doc and code style pass 2026-08-20 17:54:40 -05:00
Ruling-0 398dc6d786 Resolve MaterialLib item references in recipe config XML 2026-08-17 20:18:04 -05:00
Ruling-0 af707f80c8 Add MaterialLib as a compile only dependency 2026-08-17 20:18:04 -05:00
14 changed files with 132 additions and 59 deletions

No files matched your search

+1
View File
@@ -32,4 +32,5 @@ dependencies {
compileOnlyApi('com.github.GTNewHorizons:Angelica:2.2.10:api') {transitive = false}
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.196:dev")
compileOnly('curse.maven:automagy-222153:2285272')
compileOnly('com.ruling_0:MaterialLib:0.24.0-mu:dev')
}
+1
View File
@@ -1,4 +1,5 @@
// Add any additional repositories for your dependencies here
repositories {
mavenLocal()
}
@@ -133,6 +133,7 @@ import crazypants.enderio.machine.painter.BlockPaintedWall;
import crazypants.enderio.machine.painter.BlockPainter;
import crazypants.enderio.machine.painter.PaintSourceValidator;
import crazypants.enderio.machine.ranged.RangeEntity;
import crazypants.enderio.machine.recipe.RecipeConfigParser;
import crazypants.enderio.machine.reservoir.BlockReservoir;
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
import crazypants.enderio.machine.slicensplice.SliceAndSpliceRecipeManager;
@@ -766,6 +767,7 @@ public class EnderIO {
FarmersRegistry.addFarmers();
SoulBinderRecipeManager.getInstance().addDefaultRecipes();
PaintSourceValidator.instance.loadConfig();
RecipeConfigParser.logMaterialLibSummary();
if (fluidXpJuice == null) { // should have been registered by open blocks
fluidXpJuice = FluidRegistry.getFluid(getXPJuiceName());
@@ -320,7 +320,7 @@ public class ConduitUtil {
}
int signalStrength = getInternalSignalForColor(bundle, col);
if (signalStrength < 15 && DyeColor.RED == col && bundle != null && bundle.getEntity() != null) {
if (signalStrength < 15 && bundle != null && bundle.getEntity() != null) {
TileEntity te = bundle.getEntity();
signalStrength = Math
.max(signalStrength, te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord));
@@ -175,6 +175,7 @@ public class ItemSettings extends BaseSettingsPanel {
private void updateButtons() {
rsB.onGuiInit();
rsB.setMode(itemConduit.getExtractionRedstoneMode(gui.getDir()));
colorB.onGuiInit();
loopB.onGuiInit();
loopB.setSelected(itemConduit.isSelfFeedEnabled(gui.getDir()));
@@ -52,7 +52,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
@Override
public boolean isActive() {
return currentTask == null ? false : currentTask.getProgress() >= 0 && hasPower() && redstoneCheckPassed;
return currentTask != null && currentTask.getProgress() >= 0 && hasPower() && redstoneCheckPassed;
}
@Override
@@ -224,7 +224,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
ItemStack copy = item.copy();
// try to add it to existing stacks first
for (ItemStack outStack : outputStacks) {
if (outStack != null && copy != null) {
if (outStack != null) {
int num = getNumCanMerge(outStack, copy);
outStack.stackSize += num;
copy.stackSize -= num;
@@ -322,7 +322,7 @@ public abstract class AbstractPoweredTaskEntity extends AbstractPowerConsumerEnt
}
protected int getNumCanMerge(ItemStack itemStack, ItemStack result) {
if (!itemStack.isItemEqual(result)) {
if (!itemStack.isItemEqual(result) || !ItemStack.areItemStackTagsEqual(itemStack, result)) {
return 0;
}
return Math.min(itemStack.getMaxStackSize() - itemStack.stackSize, result.stackSize);
@@ -15,7 +15,9 @@ import crazypants.enderio.machine.SlotDefinition;
public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISidedInventory {
// private static final short MAX_POWER_USE_PER_TICK = 6;
private static final int SLOT_INPUT = 0;
private static final int SLOT_PAINT_SOURCE = 1;
private static final int SLOT_OUTPUT = 2;
public TileEntityPainter() {
// 0 = input slot, 1 = paint source, 2 = output slot
@@ -24,7 +26,8 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
@Override
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
return super.canExtractItem(i, itemstack, j) && PainterUtil.isMetadataEquivelent(itemstack, inventory[2]);
return super.canExtractItem(i, itemstack, j)
&& PainterUtil.isMetadataEquivelent(itemstack, inventory[SLOT_OUTPUT]);
}
@Override
@@ -32,49 +35,44 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
return "Auto Painter";
}
@Override
public boolean hasCustomInventoryName() {
return false;
}
@Override
public boolean isMachineItemValidForSlot(int i, ItemStack itemStack) {
if (i > 1) {
return false;
}
if (i == 0) {
if (i == SLOT_INPUT) {
List<IMachineRecipe> recipes = MachineRecipeRegistry.instance
.getRecipesForInput(getMachineName(), MachineRecipeInput.create(i, itemStack));
if (inventory[1] == null) {
if (inventory[SLOT_PAINT_SOURCE] == null) {
return !recipes.isEmpty();
} else {
for (IMachineRecipe rec : recipes) {
if (rec instanceof BasicPainterTemplate) {
BasicPainterTemplate temp = (BasicPainterTemplate) rec;
if (temp.isValidPaintSource(inventory[1])) {
if (rec instanceof BasicPainterTemplate temp) {
if (temp.isValidPaintSource(inventory[SLOT_PAINT_SOURCE])) {
return true;
}
}
}
return false;
}
return false;
}
if (inventory[0] == null) {
Map<String, IMachineRecipe> recipes = MachineRecipeRegistry.instance.getRecipesForMachine(getMachineName());
for (IMachineRecipe rec : recipes.values()) {
if (rec instanceof BasicPainterTemplate) {
BasicPainterTemplate temp = (BasicPainterTemplate) rec;
if (temp.isValidPaintSource(itemStack)) {
return true;
} else if (i == SLOT_PAINT_SOURCE) {
if (inventory[SLOT_INPUT] == null) {
Map<String, IMachineRecipe> recipes = MachineRecipeRegistry.instance
.getRecipesForMachine(getMachineName());
for (IMachineRecipe rec : recipes.values()) {
if (rec instanceof BasicPainterTemplate temp) {
if (temp.isValidPaintSource(itemStack)) {
return true;
}
}
}
return PaintSourceValidator.instance.isValidSourceDefault(itemStack);
} else {
return MachineRecipeRegistry.instance.getRecipeForInputs(
getMachineName(),
targetInput(),
MachineRecipeInput.create(SLOT_PAINT_SOURCE, itemStack)) != null;
}
return PaintSourceValidator.instance.isValidSourceDefault(itemStack);
} else {
return false;
}
return MachineRecipeRegistry.instance.getRecipeForInputs(
getMachineName(),
i == 0 ? MachineRecipeInput.create(0, itemStack) : targetInput(),
i == 1 ? MachineRecipeInput.create(1, itemStack) : paintSource()) != null;
}
@Override
@@ -83,27 +81,10 @@ public class TileEntityPainter extends AbstractPoweredTaskEntity implements ISid
}
private MachineRecipeInput targetInput() {
return MachineRecipeInput.create(0, inventory[0]);
return MachineRecipeInput.create(SLOT_INPUT, inventory[SLOT_INPUT]);
}
private MachineRecipeInput paintSource() {
return MachineRecipeInput.create(1, inventory[1]);
}
@Override
protected int getNumCanMerge(ItemStack itemStack, ItemStack result) {
if (result == null || !result.isItemEqual(inventory[2])) {
// next result is a different item type
return 0;
} else if (result.hasTagCompound() && inventory[2].hasTagCompound()) {
if (inventory[2].getTagCompound().hasKey("Items")) return 0; // presence of internal items
String cookedId = result.getTagCompound().getString(BlockPainter.KEY_SOURCE_BLOCK_ID);
String invId = inventory[2].getTagCompound().getString(BlockPainter.KEY_SOURCE_BLOCK_ID);
if (!cookedId.equals(invId)) {
// next result has a different source item than the current one
return 0;
}
}
return Math.min(itemStack.getMaxStackSize() - itemStack.stackSize, result.stackSize);
return MachineRecipeInput.create(SLOT_PAINT_SOURCE, inventory[SLOT_PAINT_SOURCE]);
}
}
@@ -0,0 +1,17 @@
package crazypants.enderio.machine.recipe;
import net.minecraft.item.ItemStack;
import com.ruling_0.materiallib.api.StackResolver;
/// Resolves the stack a `modID="ml"` config entry names. The only EnderIO class referencing MaterialLib types, so
/// the soft dependency classloads only behind a `Loader.isModLoaded` check.
final class MaterialLibStacks {
private MaterialLibStacks() {}
/// The stack of the named material in the named shape, or null when the pair resolves to nothing.
static ItemStack getStack(String materialName, String shapeToken, int stackSize) {
return StackResolver.getStack(materialName, shapeToken, stackSize);
}
}
@@ -28,6 +28,7 @@ import org.xml.sax.helpers.DefaultHandler;
import com.enderio.core.common.util.OreDictionaryHelper;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Log;
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
@@ -63,6 +64,14 @@ public class RecipeConfigParser extends DefaultHandler {
public static final String AT_EXP = "exp";
public static final String AT_ALLOW_MISSING = "allowMissing";
/// The `modID` under which an `itemName` of the form `<material>:<shape>` names a MaterialLib stack.
private static final String MOD_ID_ML = "ml";
private static final String MATERIAL_LIB_MODID = "materiallib";
private static int materialLibResolved = 0;
private static int materialLibInvalid = 0;
// Log prefix
private static final String LP = "RecipeParser: ";
@@ -423,7 +432,11 @@ public class RecipeConfigParser extends DefaultHandler {
String modId = getStringValue(AT_MOD_ID, attributes, null);
String name = getStringValue(AT_ITEM_NAME, attributes, null);
if (modId != null && name != null) {
if (MOD_ID_ML.equals(modId)) {
res = getMaterialLibStack(name, stackSize);
// A MaterialLib stack carries its material in the metadata, so itemMeta="*" cannot apply.
useMeta = true;
} else if (modId != null && name != null) {
Item i = GameRegistry.findItem(modId, name);
if (i != null) {
@@ -447,6 +460,39 @@ public class RecipeConfigParser extends DefaultHandler {
getIntValue(AT_SLOT, attributes, -1));
}
/// The stack `itemName` names, or null when MaterialLib is absent, the name is malformed, or the pair resolves
/// to nothing.
private static ItemStack getMaterialLibStack(String itemName, int stackSize) {
if (itemName == null || !Loader.isModLoaded(MATERIAL_LIB_MODID)) {
return null;
}
String[] parts = itemName.split(":", -1);
if (parts.length != 2 || parts[0].isEmpty() || parts[1].isEmpty()) {
Log.warn(LP + "Malformed MaterialLib reference \"" + itemName + "\", expected <material>:<shape>");
materialLibInvalid++;
return null;
}
ItemStack res = MaterialLibStacks.getStack(parts[0], parts[1], stackSize);
if (res == null) {
materialLibInvalid++;
} else {
materialLibResolved++;
}
return res;
}
/// Logs how many MaterialLib references the recipe configs named. Call once config loading has finished.
public static void logMaterialLibSummary() {
if (materialLibResolved + materialLibInvalid > 0) {
Log.info(
LP + "Resolved "
+ materialLibResolved
+ " MaterialLib entries ("
+ materialLibInvalid
+ " invalid)");
}
}
public static boolean getBooleanValue(String qName, Attributes attributes, boolean def) {
String val = attributes.getValue(qName);
if (val == null) {
@@ -15,8 +15,14 @@ public class SoulBinderEnderCystalRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderEnderCystalRF,
Config.soulBinderEnderCystalLevels,
"SoulBinderEnderCystalRecipe",
"SpecialMobs.SpecialEnderman",
"Enderman");
"Enderman",
"SpecialMobs.BlindingEnderman",
"SpecialMobs.CursedEnderman",
"SpecialMobs.IcyEnderman",
"SpecialMobs.LightningEnderman",
"SpecialMobs.MiniEnderman",
"SpecialMobs.MirageEnderman",
"SpecialMobs.ThiefEnderman");
}
@Override
@@ -15,8 +15,14 @@ public class SoulBinderPrecientCystalRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderPrecientCystalRF,
Config.soulBinderPrecientCystalLevels,
"SoulBinderPrecientCystalRecipe",
"SpecialMobs.SpecialEnderman",
"Enderman");
"Enderman",
"SpecialMobs.BlindingEnderman",
"SpecialMobs.CursedEnderman",
"SpecialMobs.IcyEnderman",
"SpecialMobs.LightningEnderman",
"SpecialMobs.MiniEnderman",
"SpecialMobs.MirageEnderman",
"SpecialMobs.ThiefEnderman");
}
@Override
@@ -16,7 +16,12 @@ public class SoulBinderReanimationRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderReanimationLevels,
"SoulBinderReanimationRecipe",
"Zombie",
"SpecialMobs.SpecialZombie");
"SpecialMobs.BrutishZombie",
"SpecialMobs.FireZombie",
"SpecialMobs.FishingZombie",
"SpecialMobs.GiantZombie",
"SpecialMobs.HungryZombie",
"SpecialMobs.PlagueZombie");
}
@Override
@@ -16,7 +16,13 @@ public class SoulBinderSentientRecipe extends AbstractSoulBinderRecipe {
Config.soulBinderReanimationLevels,
"SoulBinderSentientRecipe",
"Witch",
"enderzoo.WitherWitch");
"enderzoo.WitherWitch",
"SpecialMobs.DominationWitch",
"SpecialMobs.RageWitch",
"SpecialMobs.ShadowsWitch",
"SpecialMobs.UndeadWitch",
"SpecialMobs.WildsWitch",
"SpecialMobs.WindWitch");
}
@Override
@@ -148,6 +148,7 @@ public class GuiVacuumChest extends GuiContainerBaseEIO {
break;
case RANGE_ID:
te.setShowRange(showRangeB.isSelected());
break;
case ID_WHITELIST:
itemFilter = te.getItemFilter();
if (itemFilter != null) {