Skip to content

Commit

Permalink
Merge branch 'IO-of-Harmony' of https://github.com/GTNewHorizons/Appl…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sampsa committed Dec 27, 2024
2 parents 6adbba5 + 5e0bd48 commit 5b72bdb
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 7 deletions.
10 changes: 5 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ dependencies {
implementation('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
implementation('curse.maven:cofh-core-69162:2388751')

compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta27:api')
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta28:api')
compileOnly("com.github.GTNewHorizons:GTNHLib:0.6.0:dev") {transitive = false}
compileOnly('com.github.GTNewHorizons:ThaumicTinkerer:2.11.0:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.0:dev') {transitive = false} // required to compile CraftingV2Tests.java now
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.5.0:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.22:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.33:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Jabba:1.5.0:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.7.0:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.1-GTNH:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:waila:1.8.2:dev') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.15:api') {transitive = false}
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.0:api') {transitive = false}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive = false }
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
Expand All @@ -34,14 +34,14 @@ dependencies {
functionalTestImplementation('org.junit.platform:junit-platform-engine')
functionalTestImplementation('org.junit.platform:junit-platform-launcher')
functionalTestImplementation('org.junit.platform:junit-platform-reporting')
functionalTestImplementation('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.22:dev') {
functionalTestImplementation('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.33:dev') {
exclude module: "Applied-Energistics-2-Unofficial"
}

runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
runtimeOnlyNonPublishable('com.github.GTNewHorizons:Baubles:1.0.4:dev')
runtimeOnlyNonPublishable('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
runtimeOnlyNonPublishable('com.github.GTNewHorizons:ThaumicEnergistics:1.7.0-GTNH:dev') { transitive = false }
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.0-gtnh:dev') { transitive = false }
runtimeOnlyNonPublishable('com.github.GTNewHorizons:AE2FluidCraft-Rework:1.4.2-gtnh:dev') { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:BloodMagic:1.6.9") { transitive = false }
}
2 changes: 1 addition & 1 deletion src/functionalTest/java/appeng/test/AppengTestMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class AppengTestMod {
public void preInit(FMLPreInitializationEvent ev) {
// Disable GT5u messing with vanilla recipes for unit tests
GTMod.gregtechproxy.mNerfedWoodPlank = false;
GTMod.gregtechproxy.mNerfedVanillaTools = false;
GTMod.gregtechproxy.mChangeWoodenVanillaTools = false;
}

@EventHandler
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/appeng/core/localization/PlayerMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public enum PlayerMessages {
PriorityInvalidTarget,
PriorityReadout,
PriorityConfigured,
FinishCraftingRemind;
FinishCraftingRemind,
CraftingCantExtract;

public IChatComponent get() {
return new ChatComponentTranslation(this.getName());
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/appeng/crafting/MECraftingInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,23 @@

import javax.annotation.Nonnull;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.StatCollector;

import appeng.api.AEApi;
import appeng.api.config.Actionable;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.PlayerSource;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.core.AELog;
import appeng.core.localization.PlayerMessages;
import appeng.util.IterationCounter;

public class MECraftingInventory implements IMEInventory<IAEItemStack> {
Expand Down Expand Up @@ -260,6 +269,7 @@ public boolean commit(final BaseActionSource src) {

if (result == null || result.getStackSize() != extra.getStackSize()) {
failed = true;
handleCraftExtractFailure(extra, result, src);
break;
}
}
Expand Down Expand Up @@ -296,4 +306,35 @@ public void ignore(final IAEItemStack what) {
list.setStackSize(0);
}
}

private void handleCraftExtractFailure(final IAEItemStack expected, final IAEItemStack extracted,
final BaseActionSource src) {
if (!(src instanceof PlayerSource)) {
return;
}

try {
EntityPlayer player = ((PlayerSource) src).player;
if (player != null) {
if (expected != null && expected.getItem() != null) {
IChatComponent missingDisplayName;
String missingName = expected.getItemStack().getUnlocalizedName();
if (StatCollector.canTranslate(missingName + ".name") && StatCollector
.translateToLocal(missingName + ".name").equals(expected.getItemStack().getDisplayName()))
missingDisplayName = new ChatComponentTranslation(missingName + ".name");
else missingDisplayName = new ChatComponentText(expected.getItemStack().getDisplayName());

player.addChatMessage(
new ChatComponentTranslation(
PlayerMessages.CraftingCantExtract.getName(),
extracted.getStackSize(),
expected.getStackSize(),
missingName).appendText(" (").appendSibling(missingDisplayName).appendText(")"));
}

}
} catch (Exception ex) {
AELog.error(ex, "Could not notify player of crafting failure");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ public void cancel() {
final ImmutableSet<IAEItemStack> items = ImmutableSet.copyOf(this.waitingFor);

this.waitingFor.resetStatus();
this.waitingForMissing.resetStatus();

for (final IAEItemStack is : items) {
this.postCraftingStatusChange(is);
Expand Down Expand Up @@ -947,6 +948,7 @@ public ICraftingLink submitJob(final IGrid g, final ICraftingJob job, final Base

try {
this.waitingFor.resetStatus();
this.waitingForMissing.resetStatus();
job.startCrafting(ci, this, src);

// Clear the follow list by default
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/appeng/parts/automation/PartFormationPlane.java
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ public IAEItemStack injectItems(final IAEItemStack input, final Actionable type,
side.offsetY,
side.offsetZ);
maxStorage -= is.stackSize;
} else {
worked = false;
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ chat.appliedenergistics2.PriorityConfigured=Updated priority to %d
chat.appliedenergistics2.DriveLocked=Digital Singularity cells in drive were locked to the current item on them
chat.appliedenergistics2.ChestLocked=Digital Singularity cell in chest was locked to the current item on it
chat.appliedenergistics2.FinishCraftingRemind=Crafting of %s * %s finished in %s.
chat.appliedenergistics2.CraftingCantExtract=Can't extract required amount of ingredient from storage: %d / %d | %s

# Creative Tabs
itemGroup.appliedenergistics2=Applied Energistics 2
Expand Down

0 comments on commit 5b72bdb

Please sign in to comment.