mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-14 09:14:50 +00:00
Compare commits
14
Commits
master
...
2.6.21-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d19a546ff | ||
|
|
fa41059f0b | ||
|
|
3771cc3f86 | ||
|
|
1fca9d3b1d | ||
|
|
b1a47727d9 | ||
|
|
e9178f3e79 | ||
|
|
28989257fd | ||
|
|
1b0c1bb3f3 | ||
|
|
b497ff57f6 | ||
|
|
c29ac8f8ff | ||
|
|
6c24da5270 | ||
|
|
a52f1b0926 | ||
|
|
2e159f1983 | ||
|
|
dde6c79f9e |
No files matched your search
+4
-4
@@ -1,12 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.7:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.9.13:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.11:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.9.44:dev')
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.63-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.78-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.57:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
@@ -3,10 +3,10 @@ toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb7
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
+1
-1
@@ -17,5 +17,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.19'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return getType(meta).getIcon(MultipassBlockRenderer.getLayer());
|
||||
return TileType.get(meta >>> 16 & 0xFF).icons[MultipassBlockRenderer.getLayer()];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -167,6 +167,9 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderColor(int meta) {
|
||||
if (!MultipassBlockRenderer.isRendering()) {
|
||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
||||
}
|
||||
return colorMultiplier(meta);
|
||||
}
|
||||
|
||||
@@ -177,14 +180,14 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
@Override
|
||||
public int colorMultiplier(int meta) {
|
||||
BlockType type = getType(meta);
|
||||
if (MultipassBlockRenderer.getLayer() == 0) {
|
||||
int layer = MultipassBlockRenderer.getLayer();
|
||||
if (layer == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
if (MultipassBlockRenderer.getLayer() == 1) {
|
||||
return type.color1.getColor(false);
|
||||
if (layer == 1) {
|
||||
return EnumFlowerColor.get(meta & 0xFF).getColor(false);
|
||||
}
|
||||
return type.color2.getColor(false);
|
||||
return EnumFlowerColor.get(meta >>> 8 & 0xFF).getColor(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -208,6 +211,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
|
||||
public static final TileType[] VALUES = values();
|
||||
private final String id;
|
||||
private final String name;
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.config.BCConfig;
|
||||
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
|
||||
import binnie.core.gui.BinnieCoreGUI;
|
||||
import binnie.core.gui.BinnieGUIHandler;
|
||||
@@ -78,7 +79,9 @@ public class BinnieCore extends AbstractMod {
|
||||
}
|
||||
|
||||
addModule(new ModuleCraftGUI());
|
||||
addModule(new ModuleStorage());
|
||||
if (!BCConfig.disableCompartments) {
|
||||
addModule(new ModuleStorage());
|
||||
}
|
||||
addModule(new ModuleItems());
|
||||
if (Loader.isModLoaded("BuildCraft|Silicon")) {
|
||||
addModule(new ModuleTrigger());
|
||||
|
||||
@@ -14,6 +14,7 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static MultipassBlockRenderer instance;
|
||||
private static int layer = 0;
|
||||
private static boolean rendering = false;
|
||||
|
||||
public MultipassBlockRenderer() {
|
||||
MultipassBlockRenderer.instance = this;
|
||||
@@ -23,31 +24,49 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
return MultipassBlockRenderer.layer;
|
||||
}
|
||||
|
||||
public static boolean isRendering() {
|
||||
return MultipassBlockRenderer.rendering;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelID, RenderBlocks renderer) {
|
||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
||||
int passes = multipassBlock.getNumberOfPasses();
|
||||
|
||||
block.setBlockBoundsForItemRender();
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
|
||||
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
renderItem(block, renderer, meta);
|
||||
MultipassBlockRenderer.layer++;
|
||||
MultipassBlockRenderer.rendering = true;
|
||||
try {
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
MultipassBlockRenderer.layer = pass;
|
||||
renderItem(block, multipassBlock, renderer, meta);
|
||||
}
|
||||
} finally {
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
MultipassBlockRenderer.rendering = false;
|
||||
}
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
boolean r = true;
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
while (MultipassBlockRenderer.layer < ((IMultipassBlock) block).getNumberOfPasses()) {
|
||||
r = renderer.renderStandardBlock(block, x, y, z);
|
||||
MultipassBlockRenderer.layer++;
|
||||
IMultipassBlock multipassBlock = (IMultipassBlock) block;
|
||||
int passes = multipassBlock.getNumberOfPasses();
|
||||
boolean rendered = true;
|
||||
|
||||
MultipassBlockRenderer.rendering = true;
|
||||
try {
|
||||
for (int pass = 0; pass < passes; ++pass) {
|
||||
MultipassBlockRenderer.layer = pass;
|
||||
rendered = renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
return rendered;
|
||||
} finally {
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
MultipassBlockRenderer.rendering = false;
|
||||
}
|
||||
MultipassBlockRenderer.layer = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,8 +79,8 @@ public class MultipassBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
return BinnieCore.multipassRenderID;
|
||||
}
|
||||
|
||||
public void renderItem(Block block, RenderBlocks renderer, int meta) {
|
||||
setColor(((IMultipassBlock) block).colorMultiplier(meta));
|
||||
private void renderItem(Block block, IMultipassBlock multipassBlock, RenderBlocks renderer, int meta) {
|
||||
setColor(multipassBlock.colorMultiplier(meta));
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0f, -1.0f, 0.0f);
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package binnie.core.config;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
@Config(modid = BinnieCore.CORE_MODID)
|
||||
public class BCConfig {
|
||||
|
||||
@Config.Comment("If true, disables all compartment storage machines (no blocks/recipes will be registered).")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean disableCompartments;
|
||||
}
|
||||
@@ -9,4 +9,11 @@ public interface IProcess extends IErrorStateSource {
|
||||
boolean isInProgress();
|
||||
|
||||
ProcessInfo getInfo();
|
||||
|
||||
/***
|
||||
* Returns true if the current target got worked on at least once.
|
||||
*/
|
||||
default boolean workedOnTarget() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,10 @@ import forestry.api.genetics.IIndividual;
|
||||
|
||||
public class SplicerComponentLogic extends ComponentProcessSetCost implements IProcess {
|
||||
|
||||
// Needed to keep stack. If user takes out target slot and it gets automatically refilled, this happens in the same
|
||||
// tick
|
||||
private ItemStack workedOnStack = null;
|
||||
|
||||
public int nOfGenes;
|
||||
|
||||
public SplicerComponentLogic(Machine machine) {
|
||||
@@ -50,6 +54,11 @@ public class SplicerComponentLogic extends ComponentProcessSetCost implements IP
|
||||
public void onInventoryUpdate() {
|
||||
super.onInventoryUpdate();
|
||||
nOfGenes = getGenesToUse();
|
||||
ItemStack newTarget = getUtil().getStack(Splicer.SLOT_TARGET);
|
||||
|
||||
if (newTarget == null || !ItemStack.areItemStacksEqual(workedOnStack, newTarget)) {
|
||||
workedOnStack = null;
|
||||
}
|
||||
}
|
||||
|
||||
protected int getGenesToUse() {
|
||||
@@ -190,5 +199,31 @@ public class SplicerComponentLogic extends ComponentProcessSetCost implements IP
|
||||
Splicer.setGene(gene, target, 1);
|
||||
}
|
||||
getUtil().damageItem(Splicer.SLOT_SERUM_VIAL, 1);
|
||||
workedOnStack = getUtil().getStack(Splicer.SLOT_TARGET).copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean workedOnTarget() {
|
||||
return ItemStack.areItemStacksEqual(workedOnStack, getUtil().getStack(Splicer.SLOT_TARGET));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagCompound tagWorkedOnStack = (NBTTagCompound) nbt.getTag("workedOnStack");
|
||||
if (tagWorkedOnStack != null) {
|
||||
workedOnStack = ItemStack.loadItemStackFromNBT(tagWorkedOnStack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
if (workedOnStack != null) {
|
||||
NBTTagCompound tagWorkedOnStack = new NBTTagCompound();
|
||||
workedOnStack.writeToNBT(tagWorkedOnStack);
|
||||
// Need to save, in case inventory is full it might need to get moved out way later.
|
||||
nbt.setTag("workedOnStack", tagWorkedOnStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package binnie.genetics.machine.splicer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
@@ -79,8 +80,20 @@ public class SplicerPackage extends AdvGeneticMachine.PackageAdvGeneticBase impl
|
||||
|
||||
@Override
|
||||
public boolean fufilled(ItemStack stack) {
|
||||
return stack != null && transfer.getMachine().getMachineUtil().getStack(Splicer.SLOT_SERUM_VIAL) != null
|
||||
&& transfer.getMachine().getInterface(SplicerComponentLogic.class).isValidSerum() != null;
|
||||
if (stack == null) {
|
||||
return false;
|
||||
}
|
||||
IMachine machine = transfer.getMachine();
|
||||
boolean hasSerum = machine.getMachineUtil().getStack(Splicer.SLOT_SERUM_VIAL) != null;
|
||||
|
||||
if (hasSerum) {
|
||||
// Move item if it can't be processed anymore with current serum.
|
||||
boolean validSerum = machine.getInterface(SplicerComponentLogic.class).isValidSerum() == null;
|
||||
return !validSerum;
|
||||
} else {
|
||||
// Move item if there is no serum and item got processed already
|
||||
return machine.getMachineUtil().getProcess().workedOnTarget();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user