Skip to content

Commit

Permalink
Switch to GregTech Nomifactory Edition, Improve PA performance (#180)
Browse files Browse the repository at this point in the history
* Fix broken badges and reword some things in README.md
* Switch to relying on GregTech Nomifactory Edition
* Convert PA to take advantage of Notifiable buses
- Massively improves performance.
- Notifiable buses are a breaking change as compared to GTCE, requiring
  this feature to be merged at the same time as switching to GTNE.
  • Loading branch information
Exaxxion authored May 24, 2024
1 parent c805973 commit cd9ee04
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 127 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Shadows-of-Greg
[![Downloads](http://cf.way2muchnoise.eu/full_shadows-of-greg_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/shadows-of-greg) [![MCVersion](http://cf.way2muchnoise.eu/versions/shadows-of-greg.svg)](https://www.curseforge.com/minecraft/mc-mods/shadows-of-greg)
[![Downloads](http://cf.way2muchnoise.eu/full_316751_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/shadows-of-greg) [![MCVersion](http://cf.way2muchnoise.eu/versions/For%20MC_316751_all.svg)](https://www.curseforge.com/minecraft/mc-mods/shadows-of-greg)

[![GitHub issues](https://img.shields.io/github/issues/Shadows-of-Fire/Shadows-of-Greg.svg)](https://github.com/Shadows-of-Fire/Shadows-of-Greg/issues) [![GitHub pull requests](https://img.shields.io/github/issues-pr/Shadows-of-Fire/Shadows-of-Greg.svg)](https://github.com/Shadows-of-Fire/Shadows-of-Greg/pulls) [![license](https://img.shields.io/github/license/Shadows-of-Fire/Shadows-of-Greg.svg)](../master/LICENSE)

----

## About

Shadows-of-Greg is an addon for [GregTech Community Edition](https://github.com/GregTechCE/GregTech), and was originally a fork of [Gregic Addons](https://github.com/TheLimePixel/GregicAdditions) but has been updated to work with modern versions of Gregtecg CE. This mod continues the goal of Gregic Addons by making Gregtech CE much more complicated and realistic through the use of GregTech 5 Unofficial and GregTech 6 features.
Shadows-of-Greg is an addon for [GregTech Nomifactory Edition](https://github.com/Nomifactory/GregTech) (formerly [GregTech Community Edition](https://github.com/GregTechCE/GregTech)), and was originally a fork of [Gregic Addons](https://github.com/TheLimePixel/GregicAdditions), updated to work with current versions of GregTechCE. This mod continues the goal of Gregic Addons by making GregTech much more complicated and realistic through the use of GregTech 5 Unofficial and GregTech 6 features.

Some features implemented specifically in this mod are:
- The Fusion Reactor
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {

compileOnlyApi rfg.deobf("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.689")
compileOnlyApi rfg.deobf("curse.maven:forestry-59751:2918418") // Forestry 5.8.2.422
implementation rfg.deobf("curse.maven:gregtechce-293327:3388082")
implementation rfg.deobf("curse.maven:gregtech-nomifactory-edition-1019238:5365430")
implementation rfg.deobf("curse.maven:codechicken-lib-1-8-242818:2779848")
compileOnlyApi rfg.deobf("curse.maven:mantle-74924:2713386")
compileOnlyApi rfg.deobf("curse.maven:TConstruct-74072:2902483")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ curseForgeProjectId = 316751
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
curseForgeRelations = requiredDependency:gregtechce
curseForgeRelations = requiredDependency:gregtech-nomifactory-edition

# This project's release type on CurseForge and/or Modrinth
# Alternatively this can be set with the 'RELEASE_TYPE' environment variable.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gregicadditions/GregicAdditions.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.registries.IForgeRegistry;

@Mod(modid = Tags.MODID, name = Tags.MODNAME, version = Tags.VERSION, dependencies = "required-after:gregtech@[1.17.0.764,);after:forestry;after:tconstruct;")
@Mod(modid = Tags.MODID, name = Tags.MODNAME, version = Tags.VERSION, dependencies = "required-after:gregtech@[1.18.0,);after:forestry;after:tconstruct;")
public class GregicAdditions {

@SidedProxy(modId = Tags.MODID, clientSide = "gregicadditions.bees.ClientProxy", serverSide = "gregicadditions.bees.CommonProxy")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gregicadditions.machines;

import gregicadditions.GACapabilities;
import gregtech.api.capability.impl.NotifiableItemStackHandler;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.MetaTileEntityHolder;
import gregtech.api.metatileentity.multiblock.IMultiblockAbilityPart;
Expand All @@ -21,7 +22,7 @@ public class MetaTileEntityMachineHolder extends MetaTileEntityItemBus implement

public MetaTileEntityMachineHolder(ResourceLocation metaTileEntityId) {
super(metaTileEntityId, 0, false);
machineItemHandler = new MachineImportItemHandler();
machineItemHandler = new MachineImportItemHandler(this);
initializeInventory();
}

Expand Down Expand Up @@ -55,7 +56,11 @@ protected IItemHandlerModifiable createImportItemHandler() {
return machineItemHandler;
}

private class MachineImportItemHandler extends ItemStackHandler {
private class MachineImportItemHandler extends NotifiableItemStackHandler {

public MachineImportItemHandler(MetaTileEntity entityToNotify) {
super(1, entityToNotify, false);
}

@Nonnull
@Override
Expand Down Expand Up @@ -86,5 +91,11 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) {

return super.extractItem(slot, amount, simulate);
}

@Override
public <T> void addToNotifiedList(MetaTileEntity metaTileEntity, T handler, boolean isExport) {
if(metaTileEntity instanceof TileEntityProcessingArray && metaTileEntity.isValid())
((TileEntityProcessingArray) metaTileEntity).notifyMachineChanged();
}
}
}
Loading

0 comments on commit cd9ee04

Please sign in to comment.