mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-27 23:32:57 +00:00
Merge branch 'master' into walrus_potential
This commit is contained in:
10 files changed
+90
-64
No files matched your search
+7
-7
@@ -34,8 +34,8 @@
|
|||||||
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
|
||||||
*/
|
*/
|
||||||
dependencies {
|
dependencies {
|
||||||
api('com.github.GTNewHorizons:NotEnoughItems:2.6.46-GTNH:dev')
|
api('com.github.GTNewHorizons:NotEnoughItems:2.6.51-GTNH:dev')
|
||||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-477-GTNH:dev')
|
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-502-GTNH:dev')
|
||||||
api('curse.maven:cofh-core-69162:2388751')
|
api('curse.maven:cofh-core-69162:2388751')
|
||||||
api('com.github.GTNewHorizons:waila:1.8.2:dev')
|
api('com.github.GTNewHorizons:waila:1.8.2:dev')
|
||||||
|
|
||||||
@@ -43,22 +43,22 @@ dependencies {
|
|||||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.20:dev") { transitive = false }
|
compileOnly("com.github.GTNewHorizons:GTNHLib:0.5.22:dev") { transitive = false }
|
||||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.0.3:dev')
|
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.0.3:dev')
|
||||||
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
|
||||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.19:dev')
|
compileOnly('com.github.GTNewHorizons:ForestryMC:4.9.19:dev')
|
||||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.22:dev')
|
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.22:dev')
|
||||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.50.74:dev') {
|
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.10:dev') {
|
||||||
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
|
||||||
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||||
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
|
||||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.27-GTNH:dev') { transitive = false }
|
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:dev') { transitive = false }
|
||||||
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') { transitive = false }
|
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.6.27-GTNH:dev') { transitive = false }
|
||||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.5.79:dev") { transitive = false }
|
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.2:dev") { transitive = false }
|
||||||
|
|
||||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
|
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
|
||||||
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.5.20:dev")
|
runtimeOnlyNonPublishable("com.github.GTNewHorizons:GTNHLib:0.5.22:dev")
|
||||||
}
|
}
|
||||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.InventoryPlayer;
|
|||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.glodblock.github.FluidCraft;
|
import com.glodblock.github.FluidCraft;
|
||||||
@@ -116,10 +117,11 @@ public abstract class FCGuiEncodeTerminal extends GuiItemMonitor {
|
|||||||
"PatternTerminal.Combine",
|
"PatternTerminal.Combine",
|
||||||
this.combineDisableBtn == btn ? "1" : "0"));
|
this.combineDisableBtn == btn ? "1" : "0"));
|
||||||
} else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
|
} else if (ModAndClassUtil.isDoubleButton && doubleBtn == btn) {
|
||||||
|
final int eventButton = Mouse.getEventButton();
|
||||||
FluidCraft.proxy.netHandler.sendToServer(
|
FluidCraft.proxy.netHandler.sendToServer(
|
||||||
new CPacketFluidPatternTermBtns(
|
new CPacketFluidPatternTermBtns(
|
||||||
"PatternTerminal.Double",
|
"PatternTerminal.Double",
|
||||||
Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0"));
|
(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? "1" : "0") + (eventButton == 1 ? "1" : "0")));
|
||||||
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
|
} else if (ModAndClassUtil.isBeSubstitutionsButton && beSubstitutionsDisabledBtn == btn) {
|
||||||
FluidCraft.proxy.netHandler
|
FluidCraft.proxy.netHandler
|
||||||
.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
|
.sendToServer(new CPacketFluidPatternTermBtns("PatternTerminal.beSubstitute", "1"));
|
||||||
|
|||||||
+2
-2
@@ -153,9 +153,9 @@ public class ContainerFluidPatternTerminal extends FCContainerEncodeTerminal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doubleStacks(boolean isShift) {
|
public void doubleStacks(boolean isShift, boolean divide) {
|
||||||
if (!isCraftingMode()) {
|
if (!isCraftingMode()) {
|
||||||
super.doubleStacks(isShift);
|
super.doubleStacks(isShift, divide);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+70
-45
@@ -537,57 +537,82 @@ public abstract class FCContainerEncodeTerminal extends ContainerItemMonitor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean canDouble(SlotFake[] slots, int mult) {
|
public void doubleStacks(boolean isShift, boolean divide) {
|
||||||
for (Slot s : slots) {
|
|
||||||
ItemStack st = s.getStack();
|
|
||||||
if (st != null) {
|
|
||||||
if (st.getItem() instanceof ItemFluidPacket) {
|
|
||||||
long result = (long) ItemFluidPacket.getFluidAmount(st) * mult;
|
|
||||||
if (result > Integer.MAX_VALUE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
long result = (long) s.getStack().stackSize * mult;
|
|
||||||
if (result > Integer.MAX_VALUE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void doubleStacksInternal(SlotFake[] slots, int mult) {
|
|
||||||
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
|
||||||
for (final Slot s : enabledSlots) {
|
|
||||||
ItemStack st = s.getStack();
|
|
||||||
if (st != null) {
|
|
||||||
if (st.getItem() instanceof ItemFluidPacket) {
|
|
||||||
ItemFluidPacket.setFluidAmount(st, ItemFluidPacket.getFluidAmount(st) * mult);
|
|
||||||
} else {
|
|
||||||
st.stackSize *= mult;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void doubleStacks(boolean isShift) {
|
|
||||||
if (!isCraftingMode()) {
|
if (!isCraftingMode()) {
|
||||||
if (isShift) {
|
final int mult = (isShift ? 8 : 2) * (divide ? -1 : 1);
|
||||||
if (canDouble(this.craftingSlots, 8) && canDouble(this.outputSlots, 8)) {
|
if (canMultiplyOrDivide(this.craftingSlots, mult) && canMultiplyOrDivide(this.outputSlots, mult)) {
|
||||||
doubleStacksInternal(this.craftingSlots, 8);
|
multiplyOrDivideStacksInternal(this.craftingSlots, mult);
|
||||||
doubleStacksInternal(this.outputSlots, 8);
|
multiplyOrDivideStacksInternal(this.outputSlots, mult);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (canDouble(this.craftingSlots, 2) && canDouble(this.outputSlots, 2)) {
|
|
||||||
doubleStacksInternal(this.craftingSlots, 2);
|
|
||||||
doubleStacksInternal(this.outputSlots, 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.detectAndSendChanges();
|
this.detectAndSendChanges();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean canMultiplyOrDivide(SlotFake[] slots, int mult) {
|
||||||
|
if (mult > 0) {
|
||||||
|
for (Slot s : slots) {
|
||||||
|
ItemStack st = s.getStack();
|
||||||
|
if (st == null) continue;
|
||||||
|
final long count;
|
||||||
|
if (st.getItem() instanceof ItemFluidPacket) {
|
||||||
|
count = ItemFluidPacket.getFluidAmount(st);
|
||||||
|
} else {
|
||||||
|
count = s.getStack().stackSize;
|
||||||
|
}
|
||||||
|
long result = count * mult;
|
||||||
|
if (result > Integer.MAX_VALUE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else if (mult < 0) {
|
||||||
|
mult = Math.abs(mult);
|
||||||
|
for (Slot s : slots) {
|
||||||
|
ItemStack st = s.getStack();
|
||||||
|
if (st == null) continue;
|
||||||
|
final int count;
|
||||||
|
if (st.getItem() instanceof ItemFluidPacket) {
|
||||||
|
count = ItemFluidPacket.getFluidAmount(st);
|
||||||
|
} else {
|
||||||
|
count = s.getStack().stackSize;
|
||||||
|
}
|
||||||
|
if (count % mult != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void multiplyOrDivideStacksInternal(SlotFake[] slots, int mult) {
|
||||||
|
List<SlotFake> enabledSlots = Arrays.stream(slots).filter(SlotFake::isEnabled).collect(Collectors.toList());
|
||||||
|
if (mult > 0) {
|
||||||
|
for (final Slot s : enabledSlots) {
|
||||||
|
ItemStack st = s.getStack();
|
||||||
|
if (st != null) {
|
||||||
|
if (st.getItem() instanceof ItemFluidPacket) {
|
||||||
|
ItemFluidPacket.setFluidAmount(st, ItemFluidPacket.getFluidAmount(st) * mult);
|
||||||
|
} else {
|
||||||
|
st.stackSize *= mult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (mult < 0) {
|
||||||
|
mult = Math.abs(mult);
|
||||||
|
for (final Slot s : enabledSlots) {
|
||||||
|
ItemStack st = s.getStack();
|
||||||
|
if (st != null) {
|
||||||
|
if (st.getItem() instanceof ItemFluidPacket) {
|
||||||
|
ItemFluidPacket.setFluidAmount(st, ItemFluidPacket.getFluidAmount(st) / mult);
|
||||||
|
} else {
|
||||||
|
st.stackSize /= mult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void acceptPattern(IAEItemStack[] inputs, IAEItemStack[] outputs) {
|
public void acceptPattern(IAEItemStack[] inputs, IAEItemStack[] outputs) {
|
||||||
if (this.patternTerminal != null) {
|
if (this.patternTerminal != null) {
|
||||||
|
|||||||
@@ -77,23 +77,22 @@ public class CPacketFluidPatternTermBtns implements IMessage {
|
|||||||
case "PatternTerminal.Clear" -> cpt.clear();
|
case "PatternTerminal.Clear" -> cpt.clear();
|
||||||
case "PatternTerminal.Substitute" -> cpt.getPatternTerminal().setSubstitution(Value.equals("1"));
|
case "PatternTerminal.Substitute" -> cpt.getPatternTerminal().setSubstitution(Value.equals("1"));
|
||||||
case "PatternTerminal.Invert" -> cpt.getPatternTerminal().setInverted(Value.equals("1"));
|
case "PatternTerminal.Invert" -> cpt.getPatternTerminal().setInverted(Value.equals("1"));
|
||||||
case "PatternTerminal.Double" -> cpt.doubleStacks(Value.equals("1"));
|
case "PatternTerminal.Double" -> cpt.doubleStacks(Value.charAt(0) == '1', Value.charAt(1) == '1');
|
||||||
case "PatternTerminal.Combine" -> cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
case "PatternTerminal.Combine" -> cpt.getPatternTerminal().setCombineMode(Value.equals("1"));
|
||||||
case "PatternTerminal.beSubstitute" -> cpt.getPatternTerminal().setBeSubstitute(Value.equals("1"));
|
case "PatternTerminal.beSubstitute" -> cpt.getPatternTerminal().setBeSubstitute(Value.equals("1"));
|
||||||
case "PatternTerminal.ActivePage" -> cpt.getPatternTerminal()
|
case "PatternTerminal.ActivePage" ->
|
||||||
.setActivePage(Integer.parseInt(Value));
|
cpt.getPatternTerminal().setActivePage(Integer.parseInt(Value));
|
||||||
case "PatternTerminal.Prioritize" -> {
|
case "PatternTerminal.Prioritize" -> {
|
||||||
switch (Value) {
|
switch (Value) {
|
||||||
case "0", "1" -> cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
case "0", "1" -> cpt.getPatternTerminal().setPrioritization(Value.equals("1"));
|
||||||
case "2" -> cpt.getPatternTerminal().sortCraftingItems();
|
case "2" -> cpt.getPatternTerminal().sortCraftingItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "PatternTerminal.AutoFillerPattern" -> cpt.getPatternTerminal()
|
case "PatternTerminal.AutoFillerPattern" ->
|
||||||
.setAutoFillPattern(Value.equals("1"));
|
cpt.getPatternTerminal().setAutoFillPattern(Value.equals("1"));
|
||||||
}
|
}
|
||||||
cpt.getPatternTerminal().saveSettings();
|
cpt.getPatternTerminal().saveSettings();
|
||||||
} else if (Name.startsWith("StorageBus.") && c instanceof ContainerFluidStorageBus) {
|
} else if (Name.startsWith("StorageBus.") && c instanceof ContainerFluidStorageBus ccw) {
|
||||||
final ContainerFluidStorageBus ccw = (ContainerFluidStorageBus) c;
|
|
||||||
if (Name.equals("StorageBus.Action")) {
|
if (Name.equals("StorageBus.Action")) {
|
||||||
if (Value.equals("Partition")) {
|
if (Value.equals("Partition")) {
|
||||||
ccw.partition();
|
ccw.partition();
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 636 B After Width: | Height: | Size: 1015 B |
Binary file not shown.
|
After Width: | Height: | Size: 636 B |
Reference in new issue
Block a user