Skip to content

Commit

Permalink
Merge pull request #133 from GTNewHorizons/rename
Browse files Browse the repository at this point in the history
bump gt, rename
  • Loading branch information
boubou19 authored Sep 3, 2024
2 parents a8e7b87 + 3496a9c commit 67fb7f5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {

compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-442-GTNH:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:EnderStorage:1.6.0:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.42:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.49.56:dev") {transitive = false }
compile("com.github.GTNewHorizons:ForestryMC:4.9.7:dev") {transitive = false }
compileOnly("com.github.GTNewHorizons:Railcraft:9.15.12:dev") {transitive = false }
compile("com.github.GTNewHorizons:NotEnoughItems:2.6.33-GTNH:dev") {transitive = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import cpw.mods.fml.common.Loader;
import forestry.api.apiculture.IBeeHousing;
import gregtech.api.metatileentity.BaseMetaTileEntity;
import gregtech.api.util.GT_Utility;
import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_IndustrialApiary;
import gregtech.api.util.GTUtility;
import gregtech.common.tileentities.machines.basic.MTEIndustrialApiary;
import li.cil.oc.util.BlockPosition;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -39,13 +39,13 @@ public static IBeeHousing getBeeHousingAt(BlockPosition pos) {
if (!(te instanceof BaseMetaTileEntity))
return null;
BaseMetaTileEntity mte = (BaseMetaTileEntity)te;
if (!(mte.getMetaTileEntity() instanceof GT_MetaTileEntity_IndustrialApiary))
if (!(mte.getMetaTileEntity() instanceof MTEIndustrialApiary))
return null;
return (IBeeHousing)mte.getMetaTileEntity();
}

/** Returns a Tile Entity for Industrial Apiaries at position pos, or null if none exist */
public static GT_MetaTileEntity_IndustrialApiary getGTIApiaryAt(BlockPosition pos) {
public static MTEIndustrialApiary getGTIApiaryAt(BlockPosition pos) {
if (!GT_LOADED || pos.world().isEmpty())
return null;

Expand All @@ -56,9 +56,9 @@ public static GT_MetaTileEntity_IndustrialApiary getGTIApiaryAt(BlockPosition po
if (!(te instanceof BaseMetaTileEntity))
return null;
BaseMetaTileEntity mte = (BaseMetaTileEntity)te;
if (!(mte.getMetaTileEntity() instanceof GT_MetaTileEntity_IndustrialApiary))
if (!(mte.getMetaTileEntity() instanceof MTEIndustrialApiary))
return null;
return (GT_MetaTileEntity_IndustrialApiary)mte.getMetaTileEntity();
return (MTEIndustrialApiary)mte.getMetaTileEntity();
}

public static boolean swapQueen(BlockPosition pos, IInventory hostInv, int slot) {
Expand Down Expand Up @@ -88,11 +88,11 @@ public static boolean swapDrone(BlockPosition pos, IInventory hostInv, int slot)
public static int getMaxIndustrialUpgradeCount() {
if (!GT_LOADED)
return 0;
return GT_MetaTileEntity_IndustrialApiary.getMaxUpgradeCount();
return MTEIndustrialApiary.getMaxUpgradeCount();
}

public static int addIndustrialUpgrade(BlockPosition pos, IInventory hostInv, int slot, int amount) {
GT_MetaTileEntity_IndustrialApiary iapiary = getGTIApiaryAt(pos);
MTEIndustrialApiary iapiary = getGTIApiaryAt(pos);
if (iapiary == null || amount <= 0)
return 0;

Expand All @@ -113,7 +113,7 @@ public static int addIndustrialUpgrade(BlockPosition pos, IInventory hostInv, in
public static ItemStack getIndustrialUpgrade(BlockPosition pos, int index){
if (index < 1 || index > getMaxIndustrialUpgradeCount())
return null;
GT_MetaTileEntity_IndustrialApiary iapiary = getGTIApiaryAt(pos);
MTEIndustrialApiary iapiary = getGTIApiaryAt(pos);
if (iapiary == null)
return null;
return iapiary.getUpgrade(index - 1);
Expand All @@ -122,7 +122,7 @@ public static ItemStack getIndustrialUpgrade(BlockPosition pos, int index){
public static int removeIndustrialUpgrade(BlockPosition pos, IInventory hostInv, int slot, int index, int amount) {
if (index < 1 || index > getMaxIndustrialUpgradeCount() || amount <= 0)
return 0;
GT_MetaTileEntity_IndustrialApiary iapiary = getGTIApiaryAt(pos);
MTEIndustrialApiary iapiary = getGTIApiaryAt(pos);
if (iapiary == null)
return 0;

Expand Down Expand Up @@ -153,7 +153,7 @@ private static int insertIntoHostInv(IInventory hostInv, int slot, ItemStack sta
// Find any stacks to merge with
for (int i = 0; i < hostInv.getSizeInventory(); i++) {
ItemStack stackInSlot = hostInv.getStackInSlot(i);
if (!GT_Utility.areStacksEqual(stack, stackInSlot))
if (!GTUtility.areStacksEqual(stack, stackInSlot))
continue;
insertIntoSlot(hostInv, i, stack);

Expand All @@ -177,7 +177,7 @@ private static void insertIntoSlot(IInventory inv, int slot, ItemStack stack) {
int maxStackSize = Math.min(inv.getInventoryStackLimit(), stack.getMaxStackSize());
if (stackInSlot == null) {
inv.setInventorySlotContents(slot, stack.splitStack(Math.min(maxStackSize, stack.stackSize)));
} else if (GT_Utility.areStacksEqual(stack, stackInSlot)) {
} else if (GTUtility.areStacksEqual(stack, stackInSlot)) {
int toMove = Math.min(stack.stackSize, Math.max(0, maxStackSize - stackInSlot.stackSize));
if (toMove > 0) {
stackInSlot.stackSize += toMove;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package li.cil.oc.integration.gregtech
import cpw.mods.fml.common.eventhandler.SubscribeEvent
import gregtech.api.interfaces.IDamagableItem
import gregtech.api.interfaces.tileentity.IGregTechTileEntity
import gregtech.api.items.GT_MetaGenerated_Tool
import gregtech.api.items.MetaGeneratedTool
import li.cil.oc.api.event.{GeolyzerEvent, RobotUsedToolEvent}
import net.minecraft.item.ItemStack
import net.minecraftforge.common.util.ForgeDirection
Expand All @@ -25,23 +25,23 @@ object EventHandlerGregTech {
def onRobotApplyDamageRate(e: RobotUsedToolEvent.ApplyDamageRate) {
(e.toolBeforeUse.getItem, e.toolAfterUse.getItem) match {
case (itemBefore: IDamagableItem, itemAfter: IDamagableItem) =>
val damage = GT_MetaGenerated_Tool.getToolDamage(e.toolAfterUse) - GT_MetaGenerated_Tool.getToolDamage(e.toolBeforeUse)
val damage = MetaGeneratedTool.getToolDamage(e.toolAfterUse) - MetaGeneratedTool.getToolDamage(e.toolBeforeUse)
if (damage > 0) {
val actualDamage = damage * e.getDamageRate
val repairedDamage =
if (e.agent.player.getRNG.nextDouble() > 0.5)
damage - math.floor(actualDamage).toInt
else
damage - math.ceil(actualDamage).toInt
GT_MetaGenerated_Tool.setToolDamage(e.toolAfterUse, GT_MetaGenerated_Tool.getToolDamage(e.toolAfterUse) - repairedDamage)
MetaGeneratedTool.setToolDamage(e.toolAfterUse, MetaGeneratedTool.getToolDamage(e.toolAfterUse) - repairedDamage)
}
case _ =>
}
}

def getDurability(stack: ItemStack): Double = {
stack.getItem match {
case item: IDamagableItem => 1.0 - GT_MetaGenerated_Tool.getToolDamage(stack).toDouble / GT_MetaGenerated_Tool.getToolMaxDamage(stack).toDouble
case item: IDamagableItem => 1.0 - MetaGeneratedTool.getToolDamage(stack).toDouble / MetaGeneratedTool.getToolMaxDamage(stack).toDouble
case _ => Double.NaN
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/main/scala/li/cil/oc/integration/gregtech/RecipeHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package li.cil.oc.integration.gregtech
import java.util
import com.typesafe.config.Config
import com.typesafe.config.ConfigValue
import gregtech.api.enums.GT_Values
import gregtech.api.enums.GTValues
import gregtech.api.recipe.RecipeMaps
import li.cil.oc.common.recipe.Recipes
import li.cil.oc.common.recipe.Recipes.RecipeException
Expand Down Expand Up @@ -32,12 +32,12 @@ object RecipeHandler {
secondaryInputs match {
case Some(value) =>
for (primaryInput <- primaryInputs; secondaryInput <- value) {
GT_Values.RA.stdBuilder().itemInputs(primaryInput, secondaryInput).itemOutputs(output).duration(duration)
GTValues.RA.stdBuilder().itemInputs(primaryInput, secondaryInput).itemOutputs(output).duration(duration)
.eut(eu).addTo(RecipeMaps.alloySmelterRecipes)
}
case _ =>
for (primaryInput <- primaryInputs) {
GT_Values.RA.stdBuilder().itemInputs(primaryInput).itemOutputs(output).duration(duration)
GTValues.RA.stdBuilder().itemInputs(primaryInput).itemOutputs(output).duration(duration)
.eut(eu).addTo(RecipeMaps.alloySmelterRecipes)
}
}
Expand All @@ -48,7 +48,7 @@ object RecipeHandler {
secondaryInputs match {
case Some(value) =>
for (primaryInput <- primaryInputs; secondaryInput <- value) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput, secondaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput, secondaryInput)
fluidInput match {
case Some(fluidStack) =>
recipe = recipe.fluidInputs(fluidStack)
Expand All @@ -58,7 +58,7 @@ object RecipeHandler {
}
case _ =>
for (primaryInput <- primaryInputs) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput)
fluidInput match {
case Some(fluidStack) =>
recipe = recipe.fluidInputs(fluidStack)
Expand All @@ -72,7 +72,7 @@ object RecipeHandler {
def addGTBenderRecipe(output: ItemStack, recipe: Config) {
val (primaryInputs, _, _, _, _, eu, duration) = parseRecipe(output, recipe)
for (primaryInput <- primaryInputs) {
GT_Values.RA.stdBuilder().itemInputs(primaryInput).itemOutputs(output).duration(duration).eut(eu)
GTValues.RA.stdBuilder().itemInputs(primaryInput).itemOutputs(output).duration(duration).eut(eu)
.addTo(RecipeMaps.benderRecipes)
}
}
Expand All @@ -83,7 +83,7 @@ object RecipeHandler {
secondaryInputs match {
case Some(value) =>
for (primaryInput <- primaryInputs; secondaryInput <- value) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput, secondaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput, secondaryInput)
secondaryOutput match {
case Some(itemStack) =>
recipe = recipe.itemOutputs(output, itemStack)
Expand All @@ -94,7 +94,7 @@ object RecipeHandler {
}
case None =>
for (primaryInput <- primaryInputs) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput)
secondaryOutput match {
case Some(itemStack) =>
recipe = recipe.itemOutputs(output, itemStack)
Expand All @@ -111,7 +111,7 @@ object RecipeHandler {
secondaryInputs match {
case Some(value) =>
for (primaryInput <- primaryInputs; secondaryInput <- value) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput, secondaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput, secondaryInput)
fluidInput match {
case Some(fluidStack) =>
recipe = recipe.fluidInputs(fluidStack)
Expand All @@ -126,7 +126,7 @@ object RecipeHandler {
}
case _ =>
for (primaryInput <- primaryInputs) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput)
fluidInput match {
case Some(fluidStack) =>
recipe = recipe.fluidInputs(fluidStack)
Expand All @@ -146,7 +146,7 @@ object RecipeHandler {
val (primaryInputs, _, fluidInput, _, secondaryOutputs, eu, duration) = parseRecipe(output, recipe)
val secondaryOutput = secondaryOutputs.headOption
for (primaryInput <- primaryInputs) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput)
fluidInput match {
case Some(fluidStack) =>
recipe = recipe.fluidInputs(fluidStack)
Expand All @@ -165,7 +165,7 @@ object RecipeHandler {
def addGTFluidCannerRecipe(output: ItemStack, recipe: Config) {
val (primaryInputs, _, fluidInput, fluidOutput, _, eu, duration) = parseRecipe(output, recipe)
for (primaryInput <- primaryInputs) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput)
fluidInput match {
case Some(fluidStack) =>
recipe = recipe.fluidInputs(fluidStack)
Expand All @@ -185,7 +185,7 @@ object RecipeHandler {
secondaryInputs match {
case Some(value) =>
for (primaryInput <- primaryInputs; secondaryInput <- value) {
GT_Values.RA.stdBuilder().itemInputs(primaryInput, secondaryInput).itemOutputs(output).duration(duration)
GTValues.RA.stdBuilder().itemInputs(primaryInput, secondaryInput).itemOutputs(output).duration(duration)
.eut(eu).addTo(RecipeMaps.formingPressRecipes)
}
//all values required
Expand All @@ -197,7 +197,7 @@ object RecipeHandler {
val (primaryInputs, _, _, _, secondaryOutputs, eu, duration) = parseRecipe(output, recipe)
val secondaryOutput = secondaryOutputs.headOption
for (primaryInput <- primaryInputs) {
var recipe = GT_Values.RA.stdBuilder().itemInputs(primaryInput)
var recipe = GTValues.RA.stdBuilder().itemInputs(primaryInput)
secondaryOutput match {
case Some(itemStack) =>
recipe = recipe.itemOutputs(output, itemStack)
Expand All @@ -213,7 +213,7 @@ object RecipeHandler {
secondaryInputs match {
case Some(value) =>
for (primaryInput <- primaryInputs; secondaryInput <- value) {
GT_Values.RA.stdBuilder().itemInputs(primaryInput, secondaryInput).itemOutputs(output).duration(duration)
GTValues.RA.stdBuilder().itemInputs(primaryInput, secondaryInput).itemOutputs(output).duration(duration)
.eut(eu).addTo(RecipeMaps.laserEngraverRecipes)
}
case _ =>
Expand All @@ -223,7 +223,7 @@ object RecipeHandler {
def addGTWireMillRecipe(output: ItemStack, recipe: Config) {
val (primaryInputs, _, _, _, _, eu, duration) = parseRecipe(output, recipe)
for (primaryInput <- primaryInputs) {
GT_Values.RA.stdBuilder().itemInputs(primaryInput).itemOutputs(output).duration(duration).eut(eu)
GTValues.RA.stdBuilder().itemInputs(primaryInput).itemOutputs(output).duration(duration).eut(eu)
.addTo(RecipeMaps.wiremillRecipes)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/li/cil/oc/server/component/Geolyzer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Geolyzer(val host: EnvironmentHost) extends prefab.ManagedEnvironment with
@Callback(doc = """function():table -- Returns GregTech underground fluids information""")
def scanUndergroundFluids(computer: Context, args: Arguments): Array[AnyRef] = {
val blockPos = BlockPosition(host)
val fluid = gregtech.common.GT_UndergroundOil.undergroundOilReadInformation(new Chunk(host.world, blockPos.x>>4, blockPos.z>>4))
val fluid = gregtech.common.UndergroundOil.undergroundOilReadInformation(new Chunk(host.world, blockPos.x>>4, blockPos.z>>4))
result(Map("type" -> fluid.getLocalizedName, "quantity" -> fluid.amount))
}

Expand Down

0 comments on commit 67fb7f5

Please sign in to comment.