Skip to content

Commit

Permalink
Fix JABBA-related issues with crafting station slots (#54)
Browse files Browse the repository at this point in the history
* Fix shift-merging tools voiding items

fixes <GTNewHorizons/GT-New-Horizons-Modpack#11392>

* Change 0-sized ItemStacks into null stacks in crafting station attached slots

Fixes <GTNewHorizons/GT-New-Horizons-Modpack#10425>

* Update buildscript

* spotlessApply
  • Loading branch information
eigenraven authored Sep 22, 2022
1 parent 18bfeaf commit 39be06c
Show file tree
Hide file tree
Showing 571 changed files with 26,161 additions and 28,425 deletions.
42 changes: 42 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
* text eol=lf

*.[jJ][aA][rR] binary

*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary

*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary

*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary

*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary

*.[pP][aA][tT][cC][hH] -text

*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf

*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
561 changes: 454 additions & 107 deletions build.gradle

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
}

apply plugin: 'com.diffplug.blowdryerSetup'

blowdryerSetup {
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.5')
//devLocal '.' // Use this when testing config updates locally
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
*/
public class UBAPIHook {
public static final UBAPIHook ubAPIHook = new UBAPIHook();
//public UBDimensionalStrataColumnProvider dimensionalStrataColumnProvider; // set in the main Underground Biomes
// public UBDimensionalStrataColumnProvider dimensionalStrataColumnProvider; // set in the main Underground Biomes
public UBOreTexturizer ubOreTexturizer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,20 @@ public interface UBOreTexturizer {
// that static vars are fully qualified names for all the textures in the UB pack, just pass as is
// the event isn't needed per se, but if this is called anytime else, the blocks will not "stick"
public void setupUBOre(Block oreBlock, String overlayName, FMLPreInitializationEvent event);

public void setupUBOre(Block oreBlock, int metadata, String overlayName, FMLPreInitializationEvent event);
public void setupUBOre(Block oreBlock, int metadata, String overlayName, String blockName, FMLPreInitializationEvent event);

public void setupUBOre(
Block oreBlock, int metadata, String overlayName, String blockName, FMLPreInitializationEvent event);

public void requestUBOreSetup(Block oreBlock, String overlayName) throws BlocksAreAlreadySet;

public void requestUBOreSetup(Block oreBlock, int metadata, String overlayName) throws BlocksAreAlreadySet;
public void requestUBOreSetup(Block oreBlock, int metadata, String overlayName, String blockName) throws BlocksAreAlreadySet;
public void redoOres(int xInBlockCoordinates, int zInBlockCoordinates, World serverSideWorld) ;

public void requestUBOreSetup(Block oreBlock, int metadata, String overlayName, String blockName)
throws BlocksAreAlreadySet;

public void redoOres(int xInBlockCoordinates, int zInBlockCoordinates, World serverSideWorld);

public static String amber_overlay = "undergroundbiomes:amber_overlay";
public static String cinnabar_overlay = "undergroundbiomes:cinnabar_overlay";
Expand All @@ -50,7 +57,7 @@ public class BlocksAreAlreadySet extends RuntimeException {
// this is thrown if UB has already run its pre-initialization step and can no longer register blocks
public final Block oreBlock;
public final String overlayName;

public BlocksAreAlreadySet(Block oreBlock, String overlayName) {
this.oreBlock = oreBlock;
this.overlayName = overlayName;
Expand All @@ -62,9 +69,8 @@ public String toString() {
String overlayDescription = "undefined overlay";
if (oreBlock != null) blockDescription = oreBlock.getUnlocalizedName();
if (overlayName != null) overlayDescription = overlayName;
return "Attempt to create Underground Biomes ore for "+blockDescription+" with "+overlayDescription +
" after blocks have already been defined";
return "Attempt to create Underground Biomes ore for " + blockDescription + " with " + overlayDescription
+ " after blocks have already been defined";
}

}
}
140 changes: 60 additions & 80 deletions src/main/java/tconstruct/TConstruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.relauncher.Side;
import java.util.Map;
import java.util.Random;
import mantle.pulsar.config.ForgeCFG;
import mantle.pulsar.control.PulseManager;
import net.minecraft.world.gen.structure.MapGenStructureIO;
import net.minecraftforge.common.MinecraftForge;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import tconstruct.achievements.AchievementEvents;
import tconstruct.achievements.TAchievements;
import tconstruct.api.TConstructAPI;
Expand All @@ -36,13 +36,13 @@
import tconstruct.mechworks.TinkerMechworks;
import tconstruct.mechworks.landmine.behavior.Behavior;
import tconstruct.mechworks.landmine.behavior.stackCombo.SpecialStackHandler;
import tconstruct.plugins.gears.TinkerGears;
import tconstruct.plugins.TinkerThaumcraft;
import tconstruct.plugins.fmp.TinkerFMP;
import tconstruct.plugins.gears.TinkerGears;
import tconstruct.plugins.ic2.TinkerIC2;
import tconstruct.plugins.imc.TinkerAE2;
import tconstruct.plugins.imc.TinkerBuildCraft;
import tconstruct.plugins.imc.TinkerMystcraft;
import tconstruct.plugins.TinkerThaumcraft;
import tconstruct.plugins.imc.TinkerRfTools;
import tconstruct.plugins.mfr.TinkerMFR;
import tconstruct.plugins.te4.TinkerTE4;
Expand All @@ -61,51 +61,48 @@
import tconstruct.world.gen.SlimeIslandGen;
import tconstruct.world.village.*;

import java.util.Map;
import java.util.Random;

/**
* TConstruct, the tool mod. Craft your tools with style, then modify until the
* original is gone!
*
*
* @author mDiyo
*/

@Mod(modid = TConstruct.modID, name = "TConstruct", version = TConstruct.modVersion,
dependencies = "required-after:Forge@[10.13.3.1384,11.14);" +
"required-after:Mantle@[0.3.2,1.7.10),[1.7.10-0.3.2,);" + //make sure we still have the 0.3.2 requirement, even without the 1.7.10 prefix
"after:MineFactoryReloaded@[1.7.10R2.8.0RC7,);" +
"after:ThermalExpansion@[1.7.10R4.0.0RC2,);" +
"after:ThermalFoundation@[1.7.10R1.0.0RC3,);" +
"after:armourersWorkshop@[1.7.10-0.28.0,);" +
"after:CoFHAPI|energy;" +
"after:CoFHCore;" +
"after:battlegear2;" +
"after:ZeldaItemAPI;" +
"after:DynamicSkillsAPI;" +
"after:NotEnoughItems;" +
"after:Waila;" +
"before:GalacticraftCore;" +
"before:UndergroundBiomes"
)
public class TConstruct
{
@Mod(
modid = TConstruct.modID,
name = "TConstruct",
version = TConstruct.modVersion,
dependencies =
"required-after:Forge@[10.13.3.1384,11.14);" + "required-after:Mantle@[0.3.2,1.7.10),[1.7.10-0.3.2,);"
+ // make sure we still have the 0.3.2 requirement, even without the 1.7.10 prefix
"after:MineFactoryReloaded@[1.7.10R2.8.0RC7,);"
+ "after:ThermalExpansion@[1.7.10R4.0.0RC2,);"
+ "after:ThermalFoundation@[1.7.10R1.0.0RC3,);"
+ "after:armourersWorkshop@[1.7.10-0.28.0,);"
+ "after:CoFHAPI|energy;"
+ "after:CoFHCore;"
+ "after:battlegear2;"
+ "after:ZeldaItemAPI;"
+ "after:DynamicSkillsAPI;"
+ "after:NotEnoughItems;"
+ "after:Waila;"
+ "before:GalacticraftCore;"
+ "before:UndergroundBiomes")
public class TConstruct {
public static final String modVersion = "GRADLETOKEN_VERSION";
/** The value of one ingot in millibuckets */
public static final int ingotLiquidValue = 144;

public static final int oreLiquidValue = ingotLiquidValue * 2;
public static final int blockLiquidValue = ingotLiquidValue * 9;
public static final int chunkLiquidValue = ingotLiquidValue / 2;
public static final int nuggetLiquidValue = ingotLiquidValue / 9;
public static final int stoneLiquidValue = ingotLiquidValue/8;
public static final int stoneLiquidValue = ingotLiquidValue / 8;

public static final int liquidUpdateAmount = 6;
public static final String modID = "TConstruct";
public static final Logger logger = LogManager.getLogger(modID);
public static final PacketPipeline packetPipeline = new PacketPipeline();
public static Random random = new Random();



/* Instance of this mod, used for grabbing prototype fields */
@Instance(modID)
Expand All @@ -115,33 +112,28 @@ public class TConstruct
public static TProxyCommon proxy;

/* Loads modules in a way that doesn't clutter the @Mod list */
public static PulseManager pulsar = new PulseManager(modID, new ForgeCFG("TinkersModules", "Modules: Disabling these will disable a chunk of the mod"));
public static PulseManager pulsar = new PulseManager(
modID, new ForgeCFG("TinkersModules", "Modules: Disabling these will disable a chunk of the mod"));

public TConstruct()
{
if (Loader.isModLoaded("Natura"))
{
public TConstruct() {
if (Loader.isModLoaded("Natura")) {
logger.info("Natura, what are we going to do tomorrow night?");
LogManager.getLogger("Natura").info("TConstruct, we're going to take over the world!");
}
else
{
} else {
logger.info("Preparing to take over the world");
}

EnvironmentChecks.verifyEnvironmentSanity();
}

//Force the client and server to have or not have this mod
// Force the client and server to have or not have this mod
@NetworkCheckHandler()
public boolean matchModVersions (Map<String, String> remoteVersions, Side side)
{
public boolean matchModVersions(Map<String, String> remoteVersions, Side side) {
return remoteVersions.containsKey("TConstruct") && modVersion.equals(remoteVersions.get("TConstruct"));
}

@EventHandler
public void preInit (FMLPreInitializationEvent event)
{
public void preInit(FMLPreInitializationEvent event) {
PHConstruct.initProps(event.getModConfigurationDirectory());

pulsar.registerPulse(new TinkerWorld());
Expand Down Expand Up @@ -179,7 +171,7 @@ public void preInit (FMLPreInitializationEvent event)
basinCasting = new LiquidCasting();
chiselDetailing = new Detailing();

//GameRegistry.registerFuelHandler(content);
// GameRegistry.registerFuelHandler(content);

playerTracker = new TPlayerHandler();
// GameRegistry.registerPlayerTracker(playerTracker);
Expand All @@ -189,22 +181,20 @@ public void preInit (FMLPreInitializationEvent event)

pulsar.preInit(event);

if (PHConstruct.achievementsEnabled)
{
if (PHConstruct.achievementsEnabled) {
TAchievements.addDefaultAchievements();
}

if (PHConstruct.addToVillages)
{
if (PHConstruct.addToVillages) {
// adds to the villager spawner egg
VillagerRegistry.instance().registerVillagerId(78943);
// moved down, not needed if 'addToVillages' is false
if(PHConstruct.allowVillagerTrading)
if (PHConstruct.allowVillagerTrading)
VillagerRegistry.instance().registerVillageTradeHandler(78943, new TVillageTrades());

VillagerRegistry.instance().registerVillageCreationHandler(new VillageToolStationHandler());
MapGenStructureIO.func_143031_a(ComponentToolWorkshop.class, "TConstruct:ToolWorkshopStructure");
if(pulsar.isPulseLoaded("Tinkers' Smeltery")) {
if (pulsar.isPulseLoaded("Tinkers' Smeltery")) {
VillagerRegistry.instance().registerVillageCreationHandler(new VillageSmelteryHandler());
MapGenStructureIO.func_143031_a(ComponentSmeltery.class, "TConstruct:SmelteryStructure");
}
Expand All @@ -214,12 +204,10 @@ public void preInit (FMLPreInitializationEvent event)
}

@EventHandler
public void init (FMLInitializationEvent event)
{
public void init(FMLInitializationEvent event) {
packetPipeline.initalise();
if (event.getSide() == Side.CLIENT)
{
//MinecraftForge.EVENT_BUS.register(new EventCloakRender());
if (event.getSide() == Side.CLIENT) {
// MinecraftForge.EVENT_BUS.register(new EventCloakRender());
}

DimensionBlacklist.getBadBimensions();
Expand All @@ -229,54 +217,47 @@ public void init (FMLInitializationEvent event)
}

@EventHandler
public void postInit (FMLPostInitializationEvent event)
{
public void postInit(FMLPostInitializationEvent event) {
packetPipeline.postInitialise();
Behavior.registerBuiltInBehaviors();
SpecialStackHandler.registerBuiltInStackHandlers();

proxy.initialize();
pulsar.postInit(event);

if (PHConstruct.achievementsEnabled)
{
if (PHConstruct.achievementsEnabled) {
TAchievements.registerAchievementPane();
MinecraftForge.EVENT_BUS.register(new AchievementEvents());
}
}
/** Called on server shutdown to prevent memory leaks */
@EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
TinkerGadgets.log.info("Cleaning up SlimeBounceHandler data.");
SlimeBounceHandler.BOUNCING_ENTITIES.clear();
}

/** Called on server shutdown to prevent memory leaks */
@EventHandler
public void serverStopping(FMLServerStoppingEvent event) {
TinkerGadgets.log.info("Cleaning up SlimeBounceHandler data.");
SlimeBounceHandler.BOUNCING_ENTITIES.clear();
}

/* IMC Mod Support */
@EventHandler
public void handleIMC(FMLInterModComms.IMCEvent e)
{
public void handleIMC(FMLInterModComms.IMCEvent e) {
IMCHandler.processIMC(e.getMessages());
}

@EventHandler
public void loadComplete(FMLLoadCompleteEvent evt)
{
public void loadComplete(FMLLoadCompleteEvent evt) {
IMCHandler.processIMC(FMLInterModComms.fetchRuntimeMessages(this));
}

public static LiquidCasting getTableCasting ()
{
public static LiquidCasting getTableCasting() {
return tableCasting;
}

public static LiquidCasting getBasinCasting ()
{
public static LiquidCasting getBasinCasting() {
return basinCasting;
}

public static Detailing getChiselDetailing ()
{
public static Detailing getChiselDetailing() {
return chiselDetailing;
}

Expand All @@ -288,9 +269,8 @@ public static Detailing getChiselDetailing ()
@Mod.EventHandler
public void missingMapping(FMLMissingMappingsEvent event) {
// this will be called because the air-block got removed
for(FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
if(mapping.name.equals("TConstruct:TankAir"))
mapping.ignore();
for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
if (mapping.name.equals("TConstruct:TankAir")) mapping.ignore();
}
}
}
Loading

0 comments on commit 39be06c

Please sign in to comment.