Skip to content

Commit

Permalink
Merge branch '1.21.1' into fix/logsthatburn_charcoal
Browse files Browse the repository at this point in the history
  • Loading branch information
BluSunrize authored Feb 25, 2025
2 parents cb85662 + 738cf3f commit 1a861e6
Show file tree
Hide file tree
Showing 42 changed files with 57 additions and 17 deletions.
38 changes: 28 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ dependencies {
testImplementation("net.neoforged:testframework:${version_neoforge}")
}

def customGradle = rootProject.file('custom.gradle');
if (customGradle.exists()) {
apply from: customGradle;
}

String buildVersionString() {
String ie_output_version = "${version_ie}-${version_buildnumber}"
boolean jenkins_build = System.getenv("ie_add_git_rev") != null
Expand Down Expand Up @@ -211,6 +206,7 @@ abstract class GenerateUpdateJSON extends DefaultTask {
static def RECOMMENDED = "-recommended"
static def LATEST = "-latest"
static def CF_URL = "https://minecraft.curseforge.com/projects/immersive-engineering"

@Incremental
@PathSensitive(PathSensitivity.NAME_ONLY)
@InputFile
Expand Down Expand Up @@ -416,20 +412,36 @@ publishing {
def pngPatterns = ["**/*.png"]
//Minimize any PNGs in the source sets
// Credits: BrainStone
static String getShortenedAssetPath(File file) {
return file.getPath()
.replaceFirst('^.*?resources.(assets.immersiveengineering.)?', '') // remove start
.replaceAll('[/\\\\]+', '_') // replace slashes with underscores
.replaceAll('.png+', '') // trim the ending
}

for (dir in project.sourceSets.main.resources.srcDirs) {
fileTree(dir: dir, includes: pngPatterns).each { file ->
// TODO relative to some reasonable root?
tasks.create(name: "optimizePng_"+file.getPath().replaceAll('[/\\\\:]', '_'), type: Exec) {
// TODO log size reductions? Somehow this is all very brittle right now
def path = getShortenedAssetPath(file);
tasks.register("optimizePng_" + path, Exec) {
executable "optipng"
args "-q", "-o7", "-zm1-9", "-strip", "all", file
args "-q", "-log", "optipng_${path}.log", "-o7", "-zm1-9", "-strip", "all", file
}
}
}
task optimizePng {
for (dir in project.sourceSets.main.resources.srcDirs) {
fileTree(dir: dir, includes: pngPatterns).each { file ->
dependsOn "optimizePng_"+file.getPath().replace('/', '_')
def path = getShortenedAssetPath(file);
dependsOn "optimizePng_${path}"
doLast {
def logfile = new File("optipng_${path}.log")
if (logfile.exists()) {
def decrease = logfile.text.trim().find('[\\d\\.]+% decrease')
if (decrease)
println "${file.name} optimized:\n\t${decrease} in size"
logfile.delete()
}
}
}
}
}
Expand All @@ -439,3 +451,9 @@ tasks.withType(Task) {
it.standardInput = System.in
}
}

// load developer specific gradle config
def customGradle = rootProject.file('custom.gradle');
if (customGradle.exists()) {
apply from: customGradle;
}
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ private void crusher(RecipeOutput out)
.input(IETags.getItemTag(IETags.clayBlock))
.setEnergy(1600)
.build(out, toRL("crusher/clay"));
CrusherRecipeBuilder.builder()
.output(Items.DIRT)
.input(Items.COARSE_DIRT)
.setEnergy(1600)
.build(out, toRL("crusher/coarse_dirt"));
CrusherRecipeBuilder.builder()
.output(Items.AMETHYST_SHARD, 4)
.input(Items.AMETHYST_BLOCK)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public IFluidTank[] getInternalTanks()
@Override
public IItemHandlerModifiable getInventory()
{
return inventory.getRawHandler();
return inventory;
}

public FluidTank getTank()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public AveragingEnergyStorage getEnergy()
@Override
public IItemHandlerModifiable getInventory()
{
return inventory.getRawHandler();
return inventory;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public int getSlots()
@Override
public int getSlotLimit(int slot)
{
return wrapped.getSlotLimit(slot);
return Math.min(64, wrapped.getSlotLimit(slot));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,13 @@ public static ComparatorManager<State> makeElectrodeComparator()
public static class State implements IMultiblockState, ProcessContextInMachine<ArcFurnaceRecipe>
{
private final AveragingEnergyStorage energy = new AveragingEnergyStorage(ENERGY_CAPACITY);
public ItemStackHandler inventory = new ItemStackHandler(NUM_SLOTS);
public ItemStackHandler inventory = new ItemStackHandler(NUM_SLOTS){
@Override
public int getSlotLimit(int slot)
{
return 64;
}
};
private final InMachineProcessor<ArcFurnaceRecipe> processor;

// Utilities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public ItemStack extractItem(int slot, int amount, boolean simulate)
@Override
public int getSlotLimit(int slot)
{
return rawHandler.getSlotLimit(slot);
return Math.min(64, rawHandler.getSlotLimit(slot));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int getSlots()
@Override
public int getSlotLimit(int slot)
{
return wrapped.getSlotLimit(slot);
return Math.min(64, wrapped.getSlotLimit(slot));
}

@Override
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1a861e6

Please sign in to comment.